[Freeswitch-users] Help with ignore_early_media
Leonardo Alves
leoalves at teltec.com.br
Sun Mar 23 10:14:11 PDT 2008
I need some help using the ignore_early_media.
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.
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.
here is my .js file:
----------------------------------------------------------------------------------------------------------------------------------------------------
var languageCode = "en";
var soundDir = "sounds/";
function playFile(fileName, callBack, callBackArgs)
{
new_session.streamFile(soundDir + languageCode + "/" + fileName, callBack, callBackArgs);
}
new_session = new Session();
new_session.setCallerData("caller_id_name", "6130356060");
new_session.originate(session, "{ignore_early_media=true}sofia/gateway/asterisk/9133803764");
new_session.waitForAnswer();
if(new_session.ready()){
playFile("HelloWorld.wav");
}
exit();
------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
Here is the Freeswitch output:
jsrun HelloWorld.js
API CALL [jsrun(HelloWorld.js)] output:
OK
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]
freeswitch at debianfs01> 2008-03-23 10:21:08 [NOTICE] switch_channel.c:1380 switch_channel_perform_mark_pre_answered() Ring-Ready sofia/default/9133803764!
2008-03-23 10:21:08 [NOTICE] sofia_glue.c:1760 sofia_glue_tech_media() Pre-Answer sofia/default/9133803764!
2008-03-23 10:21:19 [NOTICE] sofia.c:1848 sofia_handle_sip_i_state() Channel [sofia/default/9133803764] has been answered
2008-03-23 10:22:02 [NOTICE] sofia.c:1946 sofia_handle_sip_i_state() Hangup sofia/default/9133803764 [CS_HOLD] [NORMAL_CLEARING]
2008-03-23 10:22:02 [ERR] HelloWorld.js:7 mod_spidermonkey() TypeError: callBack is not a function
2008-03-23 10:22:02 [NOTICE] switch_core_session.c:748 switch_core_session_thread() Session 24 (sofia/default/9133803764) Ended
2008-03-23 10:22:02 [NOTICE] switch_core_session.c:750 switch_core_session_thread() Close Channel sofia/default/9133803764 [CS_HANGUP]
The problem is:
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.
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).
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.
I would like to know if I am doing something wrong or this is a bug in the system.
Thanks for the help.
Leonardo Alves
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.freeswitch.org/pipermail/freeswitch-users/attachments/20080323/fe2618e8/attachment-0002.html
More information about the FreeSWITCH-users
mailing list