Precisely my line of thought Steve. I'm almost done with a LUA to do the call setup/tare-down and manipulate hangup causes as needed.<br><br>While I'm at it, I think I may as well handle codec prefs ...etc. within the same script.<br>
<br>Will let you and the others how things progress.<br><br>BR,<br><br>Ahmed.<br><br><div class="gmail_quote">2010/1/13 Steven Ayre <span dir="ltr"><<a href="mailto:steveayre@gmail.com">steveayre@gmail.com</a>></span><br>
<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">"I wonder if it's possible to rewrite causes from such bridges by<br>
executing a JS or similar app attached to the bridge. I'll report on<br>
this as and when."<br>
<br>
</div>If you run a LUA (or JS, etc) script where the hangup app currently<br>
is, then you'll be able to check the current hangup cause at that<br>
point within the script and conditionally run the hangup app from your<br>
script with the cause you want to rewrite to.<br>
<br>
-Steve<br>
<br>
2010/1/13 Ahmed Naji <<a href="mailto:a.alalousi@gmail.com">a.alalousi@gmail.com</a>>:<br>
<div><div></div><div class="h5">> Steve/All,<br>
><br>
> Thanks for all your feedback, this thread can be closed.<br>
><br>
> Here is some feedback:<br>
><br>
> Re: Steve's queries:<br>
><br>
> - "pproxy" was a typo on my part, but it should not affect anything. I set<br>
> them both to false in vars.xml, and don't over-ride them anywhere.<br>
> - true re: default values for proxy_media & bypass_media being false. I am<br>
> explicitly setting them here out of 1) paranoia and 2) I like to make sure I<br>
> know my variable values and not leave them to defaults - relics of being a<br>
> developer<br>
> - I was disabling the q850 code as part of my attempts to crack this nut.<br>
><br>
> Re: the solution, I've managed to rewrite some of the codes with a call to<br>
> the hangup app, which is what Steve is also using, and his findings re:<br>
> bridges getting 183 and 180 before 4xx.<br>
><br>
> I wonder if it's possible to rewrite causes from such bridges by executing a<br>
> JS or similar app attached to the bridge. I'll report on this as and when.<br>
><br>
> Regards,<br>
><br>
> Ahmed.<br>
><br>
><br>
><br>
><br>
> 2010/1/12 Steven Ayre <<a href="mailto:steveayre@gmail.com">steveayre@gmail.com</a>><br>
>><br>
>> - prpoxy_media should be proxy_media<br>
>> - bypass_media and proxy_media shouldn't need setting to false -<br>
>> that's their default (unless you're set one of them to true on the sip<br>
>> profile?)<br>
>> - why do you need to disable q850 reason?<br>
>><br>
>> I do something very similar - try this...<br>
>><br>
>> <condition field="destination_number" expression="^(?:5824)(44(1|2)\d+)$"><br>
>> <action application="set" data="continue_on_fail=true"/><br>
>> <action application="set" data="hangup_after_bridge=true"/><br>
>> <action application="set" data="sip_ignore_remote_cause=true"/><br>
>> <action application="bridge" data="sofia/gateway/<a href="http://sip.xx.xx.com/$1" target="_blank">sip.xx.xx.com/$1</a>"/><br>
>> <action application="hangup" data="NORMAL_CIRCUIT_CONGESTION"/><br>
>> </condition><br>
>><br>
>> By the way, you'll be unable to rewrite the hangup cause for a bridge<br>
>> that gets a 180 or 183 packet from the gateway before getting a 4xx,<br>
>> 5xx or 6xx packet (because those bridges don't 'fail') - I've seen<br>
>> this on a SIP provider before who gives 183 Session Progress before a<br>
>> 404 Not Found if the PSTN number dialled doesn't exist.<br>
>><br>
>> Regards,<br>
>> -Steve<br>
>><br>
>><br>
>> 2010/1/12 Ahmed Naji <<a href="mailto:a.alalousi@gmail.com">a.alalousi@gmail.com</a>>:<br>
>> > Here you go:<br>
>> ><br>
>> > <condition field="destination_number"<br>
>> > expression="^(?:5824)(44(1|2)\d+)$"<br>
>> > break="on-true"><br>
>> > <action inline="true" application="set" data="bypass_media=false"/><br>
>> > <action inline="true" application="set" data="prpoxy_media=false"/><br>
>> > <action inline="true" application="set"<br>
>> > data="disable_q850_reason=true"/><br>
>> > <action inline="true" application="set"<br>
>> > data="hangup_after_bridge=false"/><br>
>> > <action inline="true" application="set"<br>
>> > data="sip_ignore_remote_cause=true"/><br>
>> > <action application="bridge" data="sofia/gateway/<a href="http://sip.xx.xx.com/$1" target="_blank">sip.xx.xx.com/$1</a>"/><br>
>> > <action inline="true" application="set"<br>
>> > data="bridge_hangup_cause=NORMAL_CIRCUIT_CONGESTION"/><br>
>> > <action inline="true" application="set"<br>
>> > data="hangup_cause=NORMAL_CIRCUIT_CONGESTION"/><br>
>> > <action application="bridge" data="error/normal_circuit_congestion"/><br>
>> > <action application="hangup" data="NORMAL_CIRCUIT_CONGESTION"/><br>
>> > </condition><br>
>> ><br>
>> > As you can see, I am trying to rewrite the hangup codes in a multitude<br>
>> > of<br>
>> > ways and places, but still exhibit the same behaviour.<br>
>> ><br>
>> > Any help appreciated.<br>
>> ><br>
>> > Regards,<br>
>> ><br>
>> > Ahmed.<br>
>> ><br>
>> > 2010/1/12 Steven Ayre <<a href="mailto:steveayre@gmail.com">steveayre@gmail.com</a>><br>
>> >><br>
>> >> Can you show us the dialplan extension you're trying?<br>
>> >><br>
>> >> Thanks,<br>
>> >> -Steve<br>
>> >><br>
>> >> 2010/1/12 Ahmed Naji <<a href="mailto:a.alalousi@gmail.com">a.alalousi@gmail.com</a>>:<br>
>> >> > Hi Michael,<br>
>> >> ><br>
>> >> > This is exactly what I'm doing, but it's just not happening.<br>
>> >> ><br>
>> >> > Thanks,<br>
>> >> ><br>
>> >> > Ahmed.<br>
>> >> ><br>
>> >> ><br>
>> >> > 2010/1/12 Michael Collins <<a href="mailto:msc@freeswitch.org">msc@freeswitch.org</a>><br>
>> >> >><br>
>> >> >><br>
>> >> >> On Mon, Jan 11, 2010 at 4:18 AM, Ahmed Naji <<a href="mailto:a.alalousi@gmail.com">a.alalousi@gmail.com</a>><br>
>> >> >> wrote:<br>
>> >> >>><br>
>> >> >>> Dear All,<br>
>> >> >>><br>
>> >> >>> I posted a thread re the subject but didn't get any joy, so perhaps<br>
>> >> >>> second time lucky.<br>
>> >> >>><br>
>> >> >>> I need to rewrite a couple of hangup causes to mean<br>
>> >> >>> NORMAL_CONGESTION<br>
>> >> >>> and<br>
>> >> >>> no matter which variables I set, this isn't happening. The idea is<br>
>> >> >>> to<br>
>> >> >>> control what codes are returned to an end point after a successful<br>
>> >> >>> bridge,<br>
>> >> >>> as well as deal with what codes are returned if the bridge is<br>
>> >> >>> unsuccessful<br>
>> >> >>> (e.g. user_busy, originator_cancel ...etc).<br>
>> >> >>><br>
>> >> >>> I've had limited success by setting hangup_after_bridge=false then<br>
>> >> >>> bridging to error/<required_code>. This, however only works when<br>
>> >> >>> the<br>
>> >> >>> B-leg<br>
>> >> >>> terminates the call after a successful answer. Any other codes are<br>
>> >> >>> not<br>
>> >> >>> rewritten.<br>
>> >> >>><br>
>> >> >>> I've also tried playing with the bridge_hangup_code and hangup_code<br>
>> >> >>> variables prior and after bridging, still no joy. I have also set<br>
>> >> >>> sip_ignore_remote_cause=true prior to entering the bridge, as well<br>
>> >> >>> explicitly in vars.xml.<br>
>> >> >>><br>
>> >> >>> By the way, I'm running in proxy-media mode, but I did try it with<br>
>> >> >>> bypass-media as well. Same symptoms, same behaviour.<br>
>> >> >>><br>
>> >> >>> Any help with this would be highly appreciated.<br>
>> >> >>><br>
>> >> >> Well, I do know that when you do a hangup in the dialplan you can<br>
>> >> >> pass<br>
>> >> >> an<br>
>> >> >> optional cause as well:<br>
>> >> >> <action application="hangup" data="USER_BUSY"/><br>
>> >> >> If you are doing the hanging up then you have a fair amount of<br>
>> >> >> control...<br>
>> >> >> -MC<br>
>> >> >><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>
>> >> >><br>
>> >> >><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>
>> >> ><br>
>> >> ><br>
>> >> ><br>
>> >> > --<br>
>> >> > Ahmed Naji<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>
>> >> ><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>
>> >> ><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>
>> >><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>
>> ><br>
>> ><br>
>> > --<br>
>> > Ahmed Naji<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>
>> ><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>
><br>
><br>
> --<br>
> Ahmed Naji<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>
><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>
</div></div></blockquote></div><br><br clear="all"><br>-- <br>Ahmed Naji<br>