[Freeswitch-users] 10 seconds delay on fallback

Sergey Okhapkin sos at sokhapkin.dyndns.org
Wed Jan 13 04:46:47 PST 2010


To implement fallback to backup PSTN routes and do LCR my dialplan executes 
the following commands:

set execute_on_answer=set hangup_after_bridge=true
set some custom channel variables
bridge sofia/gateway1/number
set some custom channel variables
bridge sofia/gateway2/number
....

This generally works fine if gateway1 returns SIP error, dialplan sets channel 
variables to another values and calls gateway2 immediately. But if GW1 
responds with 183 early media and SIP error after that, bad thing happens - 
dialplan continues immediately, sets channel variables, executes bridge 
application, but INVITE to GW2 is sent after 10 seconds delay. Caller gets 10 
extra seconds of post dial delay. I suspect the delay happens because of 
attempt to read audio frame, switch_ivr_originate() has the following lines:

if (switch_channel_media_ready(caller_channel)) {
	tstatus = switch_core_session_read_frame()
      ...

Any advice how to avoid extra delay in this situation?



More information about the FreeSWITCH-users mailing list