[Freeswitch-users] routing via hangup_cause

Chris Burns chris at cloudtel.com
Sat Dec 18 12:50:35 MSK 2010


Trust in the wiki

http://wiki.freeswitch.org/wiki/Lua
http://wiki.freeswitch.org/wiki/Lua#session:getVariable
http://wiki.freeswitch.org/wiki/Lua#session:transfer

Use getVariable to retrieve session variables, and then use transfer to send
them somewhere based on the contents of variables. There are plenty of
examples on the wiki for you to check and figure it out. Good luck!


On Sat, Dec 18, 2010 at 4:33 AM, Sam <u2nsam at gmail.com> wrote:

> Thnx Chris,
>
>
> I was able to do that via ${originate_disposition} in XML, how can i do it
> via lua script ?
>
>
> Regds
> Sam
>
> On Sat, Dec 18, 2010 at 12:55 PM, Chris Burns [via freeswitch-users] <
> ml-node+5847699-1581430113-292429 at n2.nabble.com<ml-node%2B5847699-1581430113-292429 at n2.nabble.com>
> > wrote:
>
>> First of all, your log output is different than your dialplan example.
>> Second, you show only a tiny log snip taken after everything interesting
>> occurred. All it shows is that you are having the issue you describe. Third,
>> it seems like you are making multiple posts to the list for the same issue,
>> and multiple emails within those requests. Slow down, take your time, try to
>> learn as best you can (using the wiki), and give the list a reasonable
>> amount of time to answer your questions. If you cant get a hangup cause in
>> your XML dialplan, you dont need to start a seperate thread for how you cant
>> do it in LUA either ... you see my point? :)
>>
>> The other end has to answer the call in order to hang up on you, as far as
>> I know. If the originate fails you don't get a hangup cause into the
>> bridge_hangup_cause channel variable. For instance, the other end never
>> answers the call and originate fails with NO_USER_RESPONSE .... you will not
>> have any value in bridge_hangup_cause because nothing ever bridged. Check
>> the variable originate_disposition:
>> http://wiki.freeswitch.org/wiki/Variable_originate_disposition
>>
>> Try out this extension using the "info" app to debug variables after your
>> bridge:
>> <extension name="funwithvariables">
>>   <condition field="destination_number" expression="^1234$">
>>      <action application="set" data="hangup_after_bridge=false"/>
>>     <action application="set" data="continue_on_fail=true"/>
>>     <action application="bridge" data="[hidden email]<http://user/SendEmail.jtp?type=node&node=5847699&i=0>
>> "/>
>>
>>     <action application="info"/>
>>   </condition>
>> </extension>
>>
>>
>> On Fri, Dec 17, 2010 at 11:12 PM, Sam <[hidden email]<http://user/SendEmail.jtp?type=node&node=5847699&i=1>
>> > wrote:
>>
>>> Yes Bleg hangs up first but i am not able to fetch the hangupcause here,
>>>
>>>
>>> hangup cause: ${bridge_hangup_cause}
>>>
>>> in logs i get as :-
>>>
>>> EXECUTE sofia/internal/[hidden email]<http://user/SendEmail.jtp?type=node&node=5847699&i=2>log(1 B-leg hangup Q850 cause: )
>>> 2010-12-18 09:37:08.342225 [DEBUG] switch_core_state_machine.c:449
>>> (sofia/external/[hidden email]<http://user/SendEmail.jtp?type=node&node=5847699&i=3>)
>>> Callstate Change HANGUP -> DOWN
>>>
>>> 2010-12-18 09:37:08.342225 [ALERT] mod_dptools.c:1152 B-leg hangup Q850
>>> cause:
>>> 2010-12-18 09:37:08.342225 [DEBUG] switch_core_state_machine.c:452
>>> (sofia/external/[hidden email]<http://user/SendEmail.jtp?type=node&node=5847699&i=4>)
>>> Running State Change CS_DESTROY
>>>
>>>
>>> Regds
>>> Sam
>>>
>>>
>>>
>>>
>>> On Sat, Dec 18, 2010 at 3:21 AM, Michael Collins <[hidden email]<http://user/SendEmail.jtp?type=node&node=5847699&i=5>
>>> > wrote:
>>>
>>>> You're almost there. First off, you can delete this line:
>>>> <action application="set" data="hangup_after_bridge=false"/>
>>>> That's the default behavior and you have to set it prior to the bridge
>>>> anyway.
>>>>
>>>> Move this line before the bridge:
>>>> <action application="set" data="continue_on_fail=true"/>
>>>> Otherwise it won't have any effect.
>>>>
>>>> The other stuff should work if the b-leg hangs up first, but not if the
>>>> a-leg does.
>>>>
>>>> -MC
>>>>
>>>>
>>>>  On Thu, Dec 16, 2010 at 2:28 AM, Sam <[hidden email]<http://user/SendEmail.jtp?type=node&node=5847699&i=6>
>>>> > wrote:
>>>>
>>>>>
>>>>> I am not able to fetch the hangup cause in the dial-plan by using log
>>>>> function .
>>>>> I would like to use that hangup cause variable for further routing so
>>>>> that
>>>>> the routing would be conditional to hangup cause.
>>>>>
>>>>> Regards
>>>>> Sam
>>>>>
>>>>> On Wed, Dec 15, 2010 at 9:48 AM, samir <[hidden email]<http://user/SendEmail.jtp?type=node&node=5847699&i=7>
>>>>> > wrote:
>>>>>
>>>>>>
>>>>>> Hello friends,
>>>>>>
>>>>>> was trying to create a routing rule to to route calls by accounting to
>>>>>> the
>>>>>> hangup causes,
>>>>>>
>>>>>> I have written below syntax but it fails to give the cause code to the
>>>>>> varriable for routing.
>>>>>>
>>>>>> <extension name="refer">
>>>>>>               <condition field="destination_number"
>>>>>> expression="^1234$">
>>>>>>
>>>>>>
>>>>>>       <action application="bridge" data="[hidden email]<http://user/SendEmail.jtp?type=node&node=5847699&i=8>
>>>>>> "/>
>>>>>>
>>>>>>       <action application="set" data="hangup_after_bridge=false"/>
>>>>>>       <action application="set" data="continue_on_fail=true"/>
>>>>>>       <action application="log" data="1 B-leg hangup cause:
>>>>>> ${bridge_hangup_cause}"/>
>>>>>>       <action application="transfer" data="${bridge_hangup_cause} XML
>>>>>> conbridge"/>
>>>>>>
>>>>>>               </condition>
>>>>>>
>>>>>>
>>>>>>   </extension>
>>>>>>
>>>>>>       <extension name="no user">
>>>>>>               <condition field="destination_number"
>>>>>> expression="^(NO_USER_RESPONSE)$">
>>>>>>               <action application="bridge"
>>>>>> data="[hidden email]<http://user/SendEmail.jtp?type=node&node=5847699&i=9>
>>>>>> "/>
>>>>>>
>>>>>>
>>>>>>               </condition>
>>>>>>       </extension>
>>>>>>
>>>>>>
>>>>>> here the ${bridge_hangup_cause} is not getting executed. Am I doing it
>>>>>> right
>>>>>> or is there any other way to do it.
>>>>>>
>>>>>> Regards
>>>>>> Sam
>>>>>> --
>>>>>> View this message in context:
>>>>>> http://freeswitch-users.2379917.n2.nabble.com/routing-via-hangup-cause-tp5837136p5837136.html<http://freeswitch-users.2379917.n2.nabble.com/routing-via-hangup-cause-tp5837136p5837136.html?by-user=t>
>>>>>> Sent from the freeswitch-users mailing list archive at Nabble.com.
>>>>>>
>>>>>> _______________________________________________
>>>>>> FreeSWITCH-users mailing list
>>>>>> [hidden email]<http://user/SendEmail.jtp?type=node&node=5847699&i=10>
>>>>>>
>>>>>> 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
>>>>> [hidden email] <http://user/SendEmail.jtp?type=node&node=5847699&i=11>
>>>>>
>>>>> 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
>>>> [hidden email] <http://user/SendEmail.jtp?type=node&node=5847699&i=12>
>>>>
>>>> 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
>>> [hidden email] <http://user/SendEmail.jtp?type=node&node=5847699&i=13>
>>>
>>> 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
>> [hidden email] <http://user/SendEmail.jtp?type=node&node=5847699&i=14>
>> http://lists.freeswitch.org/mailman/listinfo/freeswitch-users
>> UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-users
>> http://www.freeswitch.org
>>
>>
>> ------------------------------
>>  View message @
>> http://freeswitch-users.2379917.n2.nabble.com/routing-via-hangup-cause-tp5837136p5847699.html
>>
>> To unsubscribe from routing via hangup_cause, click here<http://freeswitch-users.2379917.n2.nabble.com/template/NamlServlet.jtp?macro=unsubscribe_by_code&node=5837136&code=dTJuc2FtQGdtYWlsLmNvbXw1ODM3MTM2fC0xMTk1MzYwMDk5>.
>>
>>
>
>
> _______________________________________________
> 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/20101218/e65df0f7/attachment.html 


More information about the FreeSWITCH-users mailing list