[Freeswitch-users] Asterisk dial status

Michael Collins msc at freeswitch.org
Mon Jul 25 22:36:27 MSD 2011


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
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.freeswitch.org/pipermail/freeswitch-users/attachments/20110725/f9cf40ed/attachment.html 


More information about the FreeSWITCH-users mailing list