<br><br><div class="gmail_quote">On Mon, Jul 25, 2011 at 10:56 AM, Sam <span dir="ltr"><<a href="mailto:lakersman2006@yahoo.com">lakersman2006@yahoo.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
<table cellspacing="0" cellpadding="0" border="0"><tbody><tr><td valign="top" style="font:inherit">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.<br>
</td></tr></tbody></table></blockquote><div>I think maybe you have a case of "Asteriskitis" in all this. :)</div><div><br></div><div>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:</div>
<div><br></div><div><font class="Apple-style-span" face="'courier new', monospace"><extension name="bridge_with_failover"></font></div><div><font class="Apple-style-span" face="'courier new', monospace"> <condition field="destination_number" expression="1?(\d{10})"></font></div>
<div><font class="Apple-style-span" face="'courier new', monospace"> <action application="set" data="hangup_after_bridge=false"/></font></div><div><font class="Apple-style-span" face="'courier new', monospace"> <action application="set" data="continue_on_fail=NORMAL_TEMPORARY_FAILURE,USER_BUSY,NO_ANSWER,NO_ROUTE_DESTINATION"/></font></div>
<div><font class="Apple-style-span" face="'courier new', monospace"> <action application="bridge" data="sofia/gateway/mygw/+1$1"></font></div><div><font class="Apple-style-span" face="'courier new', monospace"> <!-- the stuff after the bridge only gets executed on the failure conditions listed above --></font></div>
<div><font class="Apple-style-span" face="'courier new', monospace"> <action application="playback" data="call_failed.wav"/></font></div><div><font class="Apple-style-span" face="'courier new', monospace"> <action application="hangup"/></font></div>
<div><font class="Apple-style-span" face="'courier new', monospace"> </condition></font></div><div><font class="Apple-style-span" face="'courier new', monospace"></extension></font></div><div>
<br></div><div>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.</div>
<div><br></div><div>Enjoy!</div><div>-MC</div></div>