<html><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><div><span class="Apple-style-span" style="font-family: Arial; font-size: 10px; ">2008-03-23 10:22:02 [ERR] HelloWorld.js:7 mod_spidermonkey()&nbsp; TypeError: callBack is not a function</span></div><div><font class="Apple-style-span" face="Arial" size="2"><span class="Apple-style-span" style="font-size: 10px;"><br class="webkit-block-placeholder"></span></font></div><div><font class="Apple-style-span" face="Arial" size="2"><span class="Apple-style-span" style="font-size: 10px;">You have an error in your script, so the call is aborting.</span></font></div><div><font class="Apple-style-span" face="Arial" size="2"><span class="Apple-style-span" style="font-size: 10px;"><br class="webkit-block-placeholder"></span></font></div><div><font class="Apple-style-span" face="Arial" size="2"><span class="Apple-style-span" style="font-size: 10px;">Mike</span></font></div><div><br class="webkit-block-placeholder"></div><div><br></div><div><div>On Mar 23, 2008, at 1:14 PM, Leonardo Alves wrote:</div><br class="Apple-interchange-newline"><blockquote type="cite"> <div id="MailContainerBody" style="PADDING-RIGHT: 10px; PADDING-LEFT: 10px; PADDING-TOP: 15px" bgcolor="#ffffff" leftmargin="0" topmargin="0" canvastabstop="true" name="Compose message area"> <div><font face="Arial" size="2">I need some help using the ignore_early_media.</font></div> <div><font face="Arial" size="2"></font>&nbsp;</div> <div><font face="Arial" size="2">I am using a javascript file to dial a number from a asterisk server and play a file to the person who answers the phone.</font></div> <div><font face="Arial" size="2">The problem I am having is relatated to the early_media. I think I am doing something wrong. But I cannot discover what it is.</font></div> <div><font face="Arial" size="2">here is my .js file:</font></div> <div><font face="Arial" size="2"></font>&nbsp;</div> <div><font size="1"><p><font face="Arial" size="2">----------------------------------------------------------------------------------------------------------------------------------------------------</font></p> </font><p><font size="1">var languageCode = "en";<br>var soundDir = "sound</font><font face="Courier New" size="1">s</font><font size="1">/";<br>function playFile(fileName, callBack, callBackArgs)<br>{<br></font><font face="Courier New" size="1">new_session.</font><font size="1">streamFile(soundDir + languageCode + "/" + fileName, callBack, callBackArgs);<br>}<br></font><font face="Courier New" size="1">new_session = new Session();<br>new_session.setCallerData("caller_id_name", "6130356060");<br>new_session.originate(session, "{ignore_early_media=true}sofia/gateway/asterisk/9133803764");<br>new_session.waitForAnswer();<br>if(new_session.ready()){<br>playFile("HelloWorld.wav");<br>}<br></font><font size="1">exit();</font></p><p><font size="1">------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------</font></p><p><font size="1"><font face="Arial" size="2">Here is the Freeswitch output:</font></font></p><p><font size="1"><font face="Arial" size="2">jsrun HelloWorld.js<br>API CALL [jsrun(HelloWorld.js)] output:<br>OK</font></font></p><p><font size="1"><font face="Arial" size="2">2008-03-23 10:21:08 [NOTICE] switch_channel.c:531 switch_channel_set_name() New Channel sofia/default/9133803764 [ff67046e-f8db-11dc-ad03-7f3820494c31]<br><a title="mailto:freeswitch@debianfs01
CTRL + Clique para seguir o link" href="mailto:freeswitch@debianfs01">freeswitch@debianfs01</a>&gt; 2008-03-23 10:21:08 [NOTICE] switch_channel.c:1380 switch_channel_perform_mark_pre_answered() Ring-Ready sofia/default/9133803764!<br>2008-03-23 10:21:08 [NOTICE] sofia_glue.c:1760 sofia_glue_tech_media() Pre-Answer sofia/default/9133803764!<br>2008-03-23 10:21:19 [NOTICE] sofia.c:1848 sofia_handle_sip_i_state() Channel [sofia/default/9133803764] has been answered<br>2008-03-23 10:22:02 [NOTICE] sofia.c:1946 sofia_handle_sip_i_state() Hangup sofia/default/9133803764 [CS_HOLD] [NORMAL_CLEARING]<br>2008-03-23 10:22:02 [ERR] HelloWorld.js:7 mod_spidermonkey()&nbsp; TypeError: callBack is not a function<br>2008-03-23 10:22:02 [NOTICE] switch_core_session.c:748 switch_core_session_thread() Session 24 (sofia/default/9133803764) Ended<br>2008-03-23 10:22:02 [NOTICE] switch_core_session.c:750 switch_core_session_thread() Close Channel sofia/default/9133803764 [CS_HANGUP]<br></font></font></p><p><font size="1"><font face="Arial" size="2">The problem is:</font></font></p><p><font size="1"><font face="Arial" size="2">If in the originate command I use the {ignore_early_media=true} option. The script to play the file is executed when the call is answered. But the person who answers the phone cannot hear the .wav file. </font></font></p><p><font size="1"><font face="Arial" size="2">If I do not use the {ignore_early_media=true} option. The script to play the file starts when the call is preAnswered. And when the person in the phone answer the call, can hear the sound of the .wav file, but the audio has already started (when the preanswer is executed). </font></font></p><p><font face="Arial" size="2">ps: the computer that is making the call is a asterisk server, connected with the FS by sip, and the call is made by zaptel whe pri isdn signalling.</font></p><p><font size="1"><font face="Arial" size="2">I would like to know if I am doing something wrong or this is a bug in the system.</font></font></p><p><font size="1"><font face="Arial" size="2">Thanks for the help.</font></font></p><p><font size="1"><font face="Arial" size="2">Leonardo Alves</font></font></p><font size="1"><font face="Arial" size="2"></font></font><div><font size="1"><font face="Arial" size="2"></font>&nbsp;</font><br class="webkit-block-placeholder"></div><font size="1"></font></div></div> _______________________________________________<br>Freeswitch-users mailing list<br><a href="mailto:Freeswitch-users@lists.freeswitch.org">Freeswitch-users@lists.freeswitch.org</a><br>http://lists.freeswitch.org/mailman/listinfo/freeswitch-users<br>UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-users<br>http://www.freeswitch.org<br></blockquote></div><br></body></html>