[Freeswitch-users] Asterisk dial status
Gavin Henry
gavin.henry at gmail.com
Mon Jul 25 22:59:40 MSD 2011
Why not bgapi and listen for the CHANNEL_ANSWER event?
On 25 July 2011 19:36, Michael Collins <msc at freeswitch.org> wrote:
>
>
> On Mon, Jul 25, 2011 at 10:56 AM, Sam <lakersman2006 at yahoo.com> wrote:
>
>> What I want to do is play different sound files back to the caller when
>> the call is NO_ANSWER, BUSY, etc. So I don't think your suggestion would
>> work.
>>
> I think maybe you have a case of "Asteriskitis" in all this. :)
>
> FreeSWITCH makes it easy to do this without actually checking the dial
> status. The only thing you need to do is come up with a dialplan extension
> that handles the various failure notifications to the caller. Consider an
> extremely simple case:
>
> <extension name="bridge_with_failover">
> <condition field="destination_number" expression="1?(\d{10})">
> <action application="set" data="hangup_after_bridge=false"/>
> <action application="set"
> data="continue_on_fail=NORMAL_TEMPORARY_FAILURE,USER_BUSY,NO_ANSWER,NO_ROUTE_DESTINATION"/>
> <action application="bridge" data="sofia/gateway/mygw/+1$1">
> <!-- the stuff after the bridge only gets executed on the failure
> conditions listed above -->
> <action application="playback" data="call_failed.wav"/>
> <action application="hangup"/>
> </condition>
> </extension>
>
> In the above case, if the call works then there's no problem. If the call
> fails, dialplan processing continues on and plays to the caller an error. If
> you want to get fancy and have something specific happen then you can either
> create some dialplan extensions that play various sound files, or you can
> launch a dialplan script (like your perl script) and check
> ${bridge_hangup_cause} to see what "really" happened on the bridge attempt.
>
> Enjoy!
> -MC
>
> _______________________________________________
> Join us at ClueCon 2011, Aug 9-11, Chicago
> http://www.cluecon.com 877-7-4ACLUE
>
> 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
>
>
--
http://www.suretecsystems.com/services/openldap/
http://www.surevoip.co.uk
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.freeswitch.org/pipermail/freeswitch-users/attachments/20110725/4e156f9b/attachment.html
More information about the FreeSWITCH-users
mailing list