You can never reliably depend on the tones, particularly with international traffic. This is never going to work reliably unless you get useful sip signaling. I would be demanding the carrier change settings back.
On Jan 3, 2015, at 7:46 AM, Bunea Lucian <lucibunea@gmail.com> wrote:
Hello,
My SIP provider (Vodafone) decided to make me a Christmas present: they change the configuration of their SIP server.
Using the old configuration they were sending SIP codes for decline, busy and unavailable. Now they are sending early media with tones (for decline and busy) and a one minute message for unavailable. Each status is followed by a SIP/480.
Since I need to be able to distinguish between different statuses, I have determined the following: - if I don't receive a ring tone within 7 second, the called number is unavailable; - if I receive a busy tone within 4 seconds the called number is busy; - if I receive a busy tone after 4 second the call number has declined the call;
This is how I tried to implement it: - after receiving early media (SIP/180 or SIP/183) a timer is started for call hangup (sched_hangup) - if I receive a ring tone within 7 seconds the timer is canceled (sched_cancel); - if I receive a busy tone a lua script is called;
<action application="set" data="sip_ignore_remote_cause=true"/> <action application="set" data="execute_on_media=sched_hangup +7 SUBSCRIBER_ABSENT"/>
<action application="tone_detect" data="busy 425 w +60000 lua 'busy_detected.lua ${uuid} ${created_time}' 2"/> <action application="tone_detect" data="ring 450 w +7000 sched_cancel"/>
<action application="bridge" data="sofia/external/${destination_number}@XXX.XXX.XXX.XXX"/>
But, for some reason, the tones are detected, but the applications are never called.
If I add one of the following lines to the dialplan the corresponding application is called:
<action application="set" data="execute_on_tone_detect=sched_cancel"/>
or
<action application="set" data="execute_on_tone_detect=lua busy_detected.lua ${uuid} ${created_time}"/>
but I can't tell which tone was detected...
What am I missing?
PS: Tested with FreeSWITCH Version 1.4.14-1~64bit.
Regards, Lucian