Trust in the wiki<br><br><a href="http://wiki.freeswitch.org/wiki/Lua">http://wiki.freeswitch.org/wiki/Lua</a><br><a href="http://wiki.freeswitch.org/wiki/Lua#session:getVariable">http://wiki.freeswitch.org/wiki/Lua#session:getVariable</a><br>
<a href="http://wiki.freeswitch.org/wiki/Lua#session:transfer">http://wiki.freeswitch.org/wiki/Lua#session:transfer</a><br><br>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!<br>
<br><br><div class="gmail_quote">On Sat, Dec 18, 2010 at 4:33 AM, Sam <span dir="ltr"><<a href="mailto:u2nsam@gmail.com">u2nsam@gmail.com</a>></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;">
Thnx Chris,<br><br><br>I was able to do that via ${<span style="border-collapse: separate; color: rgb(0, 0, 0); font-family: 'Times New Roman'; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; font-size: medium;"><span style="font-family: sans-serif; font-size: 13px; line-height: 19px;">originate_disposition} in XML, how can i do it via lua script ?<br>
<br><br>Regds<br>Sam<br></span></span><br><div class="gmail_quote"><div class="im">On Sat, Dec 18, 2010 at 12:55 PM, Chris Burns [via freeswitch-users] <span dir="ltr"><<a href="mailto:ml-node%2B5847699-1581430113-292429@n2.nabble.com" target="_blank">ml-node+5847699-1581430113-292429@n2.nabble.com</a>></span> wrote:<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 class="im"><div>
        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? :)<br>
<br>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: <a href="http://wiki.freeswitch.org/wiki/Variable_originate_disposition" rel="nofollow" link="external" target="_blank">http://wiki.freeswitch.org/wiki/Variable_originate_disposition</a><br>
<br>Try out this extension using the "info" app to debug variables after your bridge:<br><extension name="funwithvariables"><br></div><div> <condition field="destination_number" expression="^1234$"><br>
</div><div>
<action application="set" data="hangup_after_bridge=false"/><br> <action application="set" data="continue_on_fail=true"/><br></div></div> <action application="bridge" data="<a href="http://user/SendEmail.jtp?type=node&node=5847699&i=0" rel="nofollow" target="_blank">[hidden email]</a>"/><div class="im">
<div>
<br>
<action application="info"/><br> </condition><br></extension><br><br><br></div></div><div class="gmail_quote"><div class="im"><div>On Fri, Dec 17, 2010 at 11:12 PM, Sam <span dir="ltr"><<a href="http://user/SendEmail.jtp?type=node&node=5847699&i=1" rel="nofollow" target="_blank">[hidden email]</a>></span> wrote:<br>
</div></div><blockquote class="gmail_quote" style="border-left: 2px solid rgb(204, 204, 204); padding: 0pt 1em;"><div class="im"><div>Yes Bleg hangs up first but i am not able to fetch the hangupcause here,<div><br>
<br>hangup cause:
${bridge_hangup_cause}<br><br></div>in logs i get as :-<br><br></div></div><span style="background-color: rgb(255, 255, 204);">EXECUTE sofia/internal/<a href="http://user/SendEmail.jtp?type=node&node=5847699&i=2" rel="nofollow" target="_blank">[hidden email]</a> log(1 B-leg hangup Q850 cause: )</span><br>
2010-12-18 09:37:08.342225 [DEBUG] switch_core_state_machine.c:449 (sofia/external/<a href="http://user/SendEmail.jtp?type=node&node=5847699&i=3" rel="nofollow" target="_blank">[hidden email]</a>) Callstate Change HANGUP -> DOWN<div class="im">
<div>
<br><span style="background-color: rgb(255, 255, 204);">2010-12-18 09:37:08.342225 [ALERT] mod_dptools.c:1152 B-leg hangup Q850 cause:</span><br></div></div>
2010-12-18 09:37:08.342225 [DEBUG] switch_core_state_machine.c:452 (sofia/external/<a href="http://user/SendEmail.jtp?type=node&node=5847699&i=4" rel="nofollow" target="_blank">[hidden email]</a>) Running State Change CS_DESTROY<br>
<br><span><span style="background-color: rgb(255, 255, 204);"></span></span><br>
Regds<br>Sam<div><div></div><div><br><br><br><br><div class="gmail_quote"><div class="im"><div>On Sat, Dec 18, 2010 at 3:21 AM, Michael Collins <span dir="ltr"><<a href="http://user/SendEmail.jtp?type=node&node=5847699&i=5" rel="nofollow" target="_blank">[hidden email]</a>></span> wrote:<br>
</div></div><blockquote class="gmail_quote" style="border-left: 2px solid rgb(204, 204, 204); padding: 0pt 1em;"><div class="im"><div>
You're almost there. First off, you can delete this line:<div><div><action application="set" data="hangup_after_bridge=false"/></div></div><div>That's the default behavior and you have to set it prior to the bridge anyway.</div>
<div><br></div><div>Move this line before the bridge:</div><div><div><action application="set" data="continue_on_fail=true"/></div></div><div>Otherwise it won't have any effect.</div>
<div><br></div><div>The other stuff should work if the b-leg hangs up first, but not if the a-leg does. </div><div><br></div><font color="#888888"><div>-MC</div></font></div></div><div><div></div><div><div><br><br><div class="gmail_quote">
<div class="im">
<div>
On Thu, Dec 16, 2010 at 2:28 AM, Sam <span dir="ltr"><<a href="http://user/SendEmail.jtp?type=node&node=5847699&i=6" rel="nofollow" target="_blank">[hidden email]</a>></span> wrote:<br>
</div></div><blockquote class="gmail_quote" style="border-left: 2px solid rgb(204, 204, 204); padding: 0pt 1em;"><div class="im"><div><br>I am not able to fetch the hangup cause in the dial-plan by using log function .<br>
I would like to use that hangup cause variable for further routing so that<br>
the routing would be conditional to hangup cause. <br><br>
Regards<br>Sam<br><br></div></div><div class="gmail_quote"><div class="im"><div>On Wed, Dec 15, 2010 at 9:48 AM, samir <span dir="ltr"><<a href="http://user/SendEmail.jtp?type=node&node=5847699&i=7" rel="nofollow" target="_blank">[hidden email]</a>></span> wrote:<br>
</div></div><blockquote class="gmail_quote" style="border-left: 2px solid rgb(204, 204, 204); padding: 0pt 1em;"><div class="im"><div>
<br>
Hello friends,<br>
<br>
was trying to create a routing rule to to route calls by accounting to the<br>
hangup causes,<br>
<br>
I have written below syntax but it fails to give the cause code to the<br>
varriable for routing.<br>
<br>
<extension name="refer"><br>
<condition field="destination_number" expression="^1234$"><br>
<br>
<br></div></div>
<action application="bridge" data="<a href="http://user/SendEmail.jtp?type=node&node=5847699&i=8" rel="nofollow" target="_blank">[hidden email]</a>"/><div class="im"><div><br>
<action application="set" data="hangup_after_bridge=false"/><br>
<action application="set" data="continue_on_fail=true"/><br>
<action application="log" data="1 B-leg hangup cause:<br>
${bridge_hangup_cause}"/><br>
<action application="transfer" data="${bridge_hangup_cause} XML<br>
conbridge"/><br>
<br>
</condition><br>
<br>
<br>
</extension><br>
<br>
<extension name="no user"><br>
<condition field="destination_number"<br>
expression="^(NO_USER_RESPONSE)$"><br>
<action application="bridge"<br></div></div>
data="<a href="http://user/SendEmail.jtp?type=node&node=5847699&i=9" rel="nofollow" target="_blank">[hidden email]</a>"/><div class="im"><div><br>
<br>
</condition><br>
</extension><br>
<br>
<br>
here the ${bridge_hangup_cause} is not getting executed. Am I doing it right<br>
or is there any other way to do it.<br>
<br>
Regards<br>
Sam<br>
--<br>
View this message in context: <a href="http://freeswitch-users.2379917.n2.nabble.com/routing-via-hangup-cause-tp5837136p5837136.html?by-user=t" rel="nofollow" link="external" target="_blank">http://freeswitch-users.2379917.n2.nabble.com/routing-via-hangup-cause-tp5837136p5837136.html</a><br>
Sent from the freeswitch-users mailing list archive at Nabble.com.<br>
<br>
_______________________________________________<br>
FreeSWITCH-users mailing list<br>
</div></div><a href="http://user/SendEmail.jtp?type=node&node=5847699&i=10" rel="nofollow" target="_blank">[hidden email]</a><div class="im"><div><br>
<a href="http://lists.freeswitch.org/mailman/listinfo/freeswitch-users" rel="nofollow" link="external" target="_blank">http://lists.freeswitch.org/mailman/listinfo/freeswitch-users</a><br>
UNSUBSCRIBE:<a href="http://lists.freeswitch.org/mailman/options/freeswitch-users" rel="nofollow" link="external" target="_blank">http://lists.freeswitch.org/mailman/options/freeswitch-users</a><br>
<a href="http://www.freeswitch.org" rel="nofollow" link="external" target="_blank">http://www.freeswitch.org</a><br>
</div></div></blockquote></div><br>
<br>_______________________________________________<br>
FreeSWITCH-users mailing list<br>
<a href="http://user/SendEmail.jtp?type=node&node=5847699&i=11" rel="nofollow" target="_blank">[hidden email]</a><div class="im"><div><br>
<a href="http://lists.freeswitch.org/mailman/listinfo/freeswitch-users" rel="nofollow" link="external" target="_blank">http://lists.freeswitch.org/mailman/listinfo/freeswitch-users</a><br>
UNSUBSCRIBE:<a href="http://lists.freeswitch.org/mailman/options/freeswitch-users" rel="nofollow" link="external" target="_blank">http://lists.freeswitch.org/mailman/options/freeswitch-users</a><br>
<a href="http://www.freeswitch.org" rel="nofollow" link="external" target="_blank">http://www.freeswitch.org</a><br>
<br></div></div></blockquote></div><br></div>
</div></div><br>_______________________________________________<br>
FreeSWITCH-users mailing list<br>
<a href="http://user/SendEmail.jtp?type=node&node=5847699&i=12" rel="nofollow" target="_blank">[hidden email]</a><div class="im"><div><br>
<a href="http://lists.freeswitch.org/mailman/listinfo/freeswitch-users" rel="nofollow" link="external" target="_blank">http://lists.freeswitch.org/mailman/listinfo/freeswitch-users</a><br>
UNSUBSCRIBE:<a href="http://lists.freeswitch.org/mailman/options/freeswitch-users" rel="nofollow" link="external" target="_blank">http://lists.freeswitch.org/mailman/options/freeswitch-users</a><br>
<a href="http://www.freeswitch.org" rel="nofollow" link="external" target="_blank">http://www.freeswitch.org</a><br>
<br></div></div></blockquote></div><br>
</div></div><br>_______________________________________________<br>
FreeSWITCH-users mailing list<br>
<a href="http://user/SendEmail.jtp?type=node&node=5847699&i=13" rel="nofollow" target="_blank">[hidden email]</a><div class="im"><div><br>
<a href="http://lists.freeswitch.org/mailman/listinfo/freeswitch-users" rel="nofollow" link="external" target="_blank">http://lists.freeswitch.org/mailman/listinfo/freeswitch-users</a><br>
UNSUBSCRIBE:<a href="http://lists.freeswitch.org/mailman/options/freeswitch-users" rel="nofollow" link="external" target="_blank">http://lists.freeswitch.org/mailman/options/freeswitch-users</a><br>
<a href="http://www.freeswitch.org" rel="nofollow" link="external" target="_blank">http://www.freeswitch.org</a><br>
<br></div></div></blockquote></div><br>
<br>_______________________________________________
<br>FreeSWITCH-users mailing list
<br><a href="http://user/SendEmail.jtp?type=node&node=5847699&i=14" rel="nofollow" target="_blank">[hidden email]</a>
<br><div class="im"><div><a href="http://lists.freeswitch.org/mailman/listinfo/freeswitch-users" rel="nofollow" link="external" target="_blank">http://lists.freeswitch.org/mailman/listinfo/freeswitch-users</a><br>UNSUBSCRIBE:<a href="http://lists.freeswitch.org/mailman/options/freeswitch-users" rel="nofollow" link="external" target="_blank">http://lists.freeswitch.org/mailman/options/freeswitch-users</a><br>
<a href="http://www.freeswitch.org" rel="nofollow" link="external" target="_blank">http://www.freeswitch.org</a><br>
        
        <br>
        <br>
        <hr color="#cccccc" size="1" noshade>
        </div></div><div style="color: rgb(102, 102, 102); font-family: tahoma,geneva,helvetica,arial,sans-serif; font-style: normal; font-variant: normal; font-weight: normal; font-size: 11px; line-height: normal; font-size-adjust: none; font-stretch: normal;">
                View message @ <a href="http://freeswitch-users.2379917.n2.nabble.com/routing-via-hangup-cause-tp5837136p5847699.html" target="_blank">http://freeswitch-users.2379917.n2.nabble.com/routing-via-hangup-cause-tp5837136p5847699.html</a><div class="im">
<div>
<br>
                
                To unsubscribe from routing via hangup_cause, <a href="http://freeswitch-users.2379917.n2.nabble.com/template/NamlServlet.jtp?macro=unsubscribe_by_code&node=5837136&code=dTJuc2FtQGdtYWlsLmNvbXw1ODM3MTM2fC0xMTk1MzYwMDk5" target="_blank">click here</a>.
        </div></div></div></blockquote></div><br>
<br>_______________________________________________<br>
FreeSWITCH-users mailing list<br>
<a href="mailto:FreeSWITCH-users@lists.freeswitch.org">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>