<br><br><div class="gmail_quote">On Tue, Aug 18, 2009 at 9:23 AM, Woody Dickson <span dir="ltr">&lt;<a href="mailto:woodydickson@gmail.com" target="_blank">woodydickson@gmail.com</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">

Hi,<br><br>I have my dialplan to do some simple routing. What I need to do is when certain hangup code is received, route advance to the next or the route after next based on the hangup code received.<br><br>So, I have:<br>


<br>&lt;condition&gt;<br>   &lt;action application=&quot;set&quot; data=&quot;hangup_after_bridge=true&quot;/&gt;<br>   &lt;action application=&quot;set&quot; data=&quot;continue_on_fail=&quot;false&quot;/&gt;<br>   &lt;action application=&quot;bridge&quot; data=&quot;sofia/internal/<a href="http://aaa@123.3.3./" target="_blank">aaa@123.3.3./</a>&gt;<br>


   &lt;action application=&quot;bridge&quot; data=&quot;sofia/internal/<a href="http://bbb@123.3.3./" target="_blank">bbb@123.3.3./</a>&gt;<br>
   &lt;action application=&quot;bridge&quot; data=&quot;sofia/internal/<a href="http://ccc@123.3.3./" target="_blank">ccc@123.3.3./</a>&gt;<br>
   &lt;action application=&quot;bridge&quot; data=&quot;sofia/internal/<a href="http://ddd@123.3.3./" target="_blank">ddd@123.3.3./</a>&gt;<br>
<br>&lt;/condition&gt;<br><br>What I want to do is that based on the error code received from ( bridge to aaa), it can route to either bbb or ccc depends on the hangup code received from aaa.<br><br>So there anyway to do it in the dialplan without any scripting?</blockquote>

<div><br>Yes, you can use the result of the previous bridge to execute a transfer. You&#39;d need to use the hangup cause as the transfer destination, or part of the destination. For example, you could try something like this:<br>

<br>   &lt;action application=&quot;set&quot; data=&quot;hangup_after_bridge=true&quot;/&gt;<br>   &lt;action application=&quot;set&quot; data=&quot;continue_on_fail=&quot;false&quot;/&gt;<br>   &lt;action application=&quot;bridge&quot; data=&quot;sofia/internal/<a href="http://aaa@123.3.3./" target="_blank">aaa@123.3.3./</a>&gt;<br>

   &lt;action application=&quot;transfer&quot; data=&quot;${hangup_cause}_AAA XML default&quot;/&gt;<br>...<br><br>And then have an extension for each of the various hangup_causes<br>&lt;extension name=&quot;normal clearing&quot;&gt;<br>

  &lt;condition field=&quot;destination_number&quot; expression=&quot;^(normal_clearing_AAA)$&quot;&gt;<br>    &lt;!-- Do whatever you want for &quot;normal clearing&quot; bridged calls --&gt;<br>  &lt;/condition&gt;<br>
&lt;/extension&gt;<br>
<br>&lt;extension name=&quot;user busy&quot;&gt;<br>
  &lt;condition field=&quot;destination_number&quot; expression=&quot;^(user_busy_AAA)$&quot;&gt;<br>
    &lt;!-- Do whatever you want for &quot;user busy&quot; bridged calls --&gt;<br>
  &lt;/condition&gt;<br>
&lt;/extension&gt;<br>
<br>
&lt;extension name=&quot;no answer&quot;&gt;<br>

  &lt;condition field=&quot;destination_number&quot; expression=&quot;^(no_answer_AAA)$&quot;&gt;<br>

    &lt;!-- Do whatever you want for &quot;no answer&quot; bridged calls --&gt;<br>

  &lt;/condition&gt;<br>

&lt;/extension&gt;<br> <br>Etc., etc.<br><br>I don&#39;t claim it&#39;s pretty, but it would let you avoid the use of scripting languages. However, I would caution you to examine just why you want/need to avoid scripting langs. The dp-only method may indeed be best for you, or perhaps using mod_xml_curl would be better. It does depend on your specific needs and your environment.<br>
<br>-MC<br><br></div><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;"><br>
<br>thannks,<br><font color="#888888">woody</font><div><div></div><div><br><br><br><br><br><div class="gmail_quote">On Mon, Aug 17, 2009 at 11:59 PM, Michael Collins <span dir="ltr">&lt;<a href="mailto:msc@freeswitch.org" target="_blank">msc@freeswitch.org</a>&gt;</span> wrote:<br>

<blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
<br><br><div class="gmail_quote"><div>On Sun, Aug 16, 2009 at 4:24 AM, Woody Dickson <span dir="ltr">&lt;<a href="mailto:woodydickson@gmail.com" target="_blank">woodydickson@gmail.com</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">



<div>Hello,</div>
<div> </div>
<div>I find hangup_hook, but I would like to define different actions for different hangup codes.  Is there anyway to do that?</div>
<div> </div></blockquote></div><div><br>I can think of at least two ways you could do this: one that uses only the dialplan and one that uses a script. If you don&#39;t mind using a scripting language then you can make it very clean:<br>



<br>&lt;action application=&quot;set&quot; data=&quot;api_hangup_hook=luarun chancleanup.lua ${hangup_cause}&quot;/&gt;<br><br>Then have your Lua script handle all the if-then-else or case stuff. <br><br>Question: are you trying to transfer the a-leg to some other destination if the b-leg hangup is a specific cause, or are you just doing some external cleanup stuff? Just curious...<br>



<br>-MC<br> <br></div><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;"><div></div><font color="#888888">
<div>Woody</div>
</font><br>_______________________________________________<br>
FreeSWITCH-users mailing list<br>
<a href="mailto:FreeSWITCH-users@lists.freeswitch.org" target="_blank">FreeSWITCH-users@lists.freeswitch.org</a><br>
<a href="http://lists.freeswitch.org/mailman/listinfo/freeswitch-users" target="_blank">http://lists.freeswitch.org/mailman/listinfo/freeswitch-users</a><br>
UNSUBSCRIBE:<a href="http://lists.freeswitch.org/mailman/options/freeswitch-users" target="_blank">http://lists.freeswitch.org/mailman/options/freeswitch-users</a><br>
<a href="http://www.freeswitch.org" target="_blank">http://www.freeswitch.org</a><br>
<br></blockquote></div><br>
<br>_______________________________________________<br>
FreeSWITCH-users mailing list<br>
<a href="mailto:FreeSWITCH-users@lists.freeswitch.org" target="_blank">FreeSWITCH-users@lists.freeswitch.org</a><br>
<a href="http://lists.freeswitch.org/mailman/listinfo/freeswitch-users" target="_blank">http://lists.freeswitch.org/mailman/listinfo/freeswitch-users</a><br>
UNSUBSCRIBE:<a href="http://lists.freeswitch.org/mailman/options/freeswitch-users" target="_blank">http://lists.freeswitch.org/mailman/options/freeswitch-users</a><br>
<a href="http://www.freeswitch.org" target="_blank">http://www.freeswitch.org</a><br>
<br></blockquote></div><br>
</div></div><br>_______________________________________________<br>
FreeSWITCH-users mailing list<br>
<a href="mailto:FreeSWITCH-users@lists.freeswitch.org" target="_blank">FreeSWITCH-users@lists.freeswitch.org</a><br>
<a href="http://lists.freeswitch.org/mailman/listinfo/freeswitch-users" target="_blank">http://lists.freeswitch.org/mailman/listinfo/freeswitch-users</a><br>
UNSUBSCRIBE:<a href="http://lists.freeswitch.org/mailman/options/freeswitch-users" target="_blank">http://lists.freeswitch.org/mailman/options/freeswitch-users</a><br>
<a href="http://www.freeswitch.org" target="_blank">http://www.freeswitch.org</a><br>
<br></blockquote></div><br>