[Freeswitch-users] how to set different action for different cause code
Woody Dickson
woodydickson at gmail.com
Tue Aug 18 09:23:02 PDT 2009
Hi,
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.
So, I have:
<condition>
<action application="set" data="hangup_after_bridge=true"/>
<action application="set" data="continue_on_fail="false"/>
<action application="bridge" data="sofia/internal/aaa at 123.3.3./>
<action application="bridge" data="sofia/internal/bbb at 123.3.3./>
<action application="bridge" data="sofia/internal/ccc at 123.3.3./>
<action application="bridge" data="sofia/internal/ddd at 123.3.3./>
</condition>
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.
So there anyway to do it in the dialplan without any scripting?
thannks,
woody
On Mon, Aug 17, 2009 at 11:59 PM, Michael Collins <msc at freeswitch.org>wrote:
>
>
> On Sun, Aug 16, 2009 at 4:24 AM, Woody Dickson <woodydickson at gmail.com>wrote:
>
>> Hello,
>>
>> I find hangup_hook, but I would like to define different actions for
>> different hangup codes. Is there anyway to do that?
>>
>>
>
> 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't mind using a scripting
> language then you can make it very clean:
>
> <action application="set" data="api_hangup_hook=luarun chancleanup.lua
> ${hangup_cause}"/>
>
> Then have your Lua script handle all the if-then-else or case stuff.
>
> 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...
>
> -MC
>
>
>> Woody
>>
>> _______________________________________________
>> 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
>>
>>
>
> _______________________________________________
> 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
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.freeswitch.org/pipermail/freeswitch-users/attachments/20090819/afec97fa/attachment-0001.html
More information about the FreeSWITCH-users
mailing list