<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META http-equiv=Content-Type content=text/html;charset=iso-8859-1>
<META content="MSHTML 6.00.6000.16609" name=GENERATOR></HEAD>
<BODY 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> </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> </DIV>
<DIV><FONT size=1>
<P><FONT face=Arial
size=2>----------------------------------------------------------------------------------------------------------------------------------------------------</FONT></P>
<P>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>> 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() 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</P></FONT></FONT>
<P><FONT size=1><FONT face=Arial
size=2></FONT> </P></FONT></DIV></BODY></HTML>