[Freeswitch-users] Freeswitch streamFile when the user answers

Darren Schreiber d at d-man.org
Fri Dec 12 05:48:14 PST 2008


How are you originating calls? You probably need to add
{ignore_early_media=true}. This tells FreeSWITCH not to return from
origination when early media (progress/ringing) was received (I think
anyway)...

See http://wiki.freeswitch.org/wiki/Channel_Variables#ignore_early_media

There is a sample of this in use with the originate command here:
http://wiki.freeswitch.org/wiki/Mod_commands#originate (about halfway down)

Setting channel variables before doing the originate 

   originate {ignore_early_media=true}sofia/mydomain.com/18005551212 at 1.2.3.4
15555551212



Since you are making a dialer, you may want to start the originations in the
background and move on to the next call while tweaking the timeout value for
originated calls. From the WIKI again:

"You can originate a call in the background (asynchronously) and playback a
message with a 60 second timeout. 

   bgapi originate
{ignore_early_media=true,originate_timeout=60}sofia/gateway/name/number
&playback(message)"

- Darren

 

-----Original Message-----
From: Alexandru Nedelcu [mailto:alex at sinapticode.ro] 
Sent: Friday, December 12, 2008 3:39 AM
To: freeswitch-users at lists.freeswitch.org
Subject: [Freeswitch-users] Freeswitch streamFile when the user answers

Hi,

I'm working on a simple dialer, and I have the following problem: the audio
file starts playing before the user answeres the phone (while it's ringing).
It only works when I introduce a delay, but that doesn't seem right.

For instance in the asterisk context referred in the call files, I had:

exten => s,4,Answer
exten => s,n,Wait(2)
exten => s,n,Background(${SOUNDFILE})
And indeed it played a soundfile 2 seconds after the called person picked up
the phone

In FS I currently initiate calls like this:

session.waitForAnswer(10000);

if (session.ready()) {
    session.sleep(2000);
    session.streamFile(/*...*/);
}

Is this right?


_______________________________________________
Freeswitch-users mailing list
Freeswitch-users at lists.freeswitch.org
http://lists.freeswitch.org/mailman/listinfo/freeswitch-users
UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-users
http://www.freeswitch.org





More information about the FreeSWITCH-users mailing list