Hi,<br>
<br>
In my module, I will collect a list of available failover route that I
can use to failover to whenever a particular error is received.
However, these available routes has different condition and the
condition changes every half a minute. Therefore, I need to catch the
hangup cause after bridge, and then figure out the next workable
available route based on the latest condition setting. <br>
<br>
It seems like this is only prossible to be done within a C module. Any suggestion will be greatly appreciated.<br>
<br>
Woody<br><br><div class="gmail_quote">On Thu, Aug 6, 2009 at 8:36 AM, Mathieu Rene <span dir="ltr"><<a href="mailto:mrene_lists@avgs.ca">mrene_lists@avgs.ca</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;">
<div style="">Hi,<div><br></div><div>You can set the "continue_on_fail" variable to true (or to the hangup causes you want it to ignore) and it'll keep executing whats queued. <div>For receive_message, unless you hook the session thats being created as a B-leg, you won't get anything relevant. </div>
<div>Also set hangup_after_bridge=true if you want to stop failing over when it worked.</div><div><br></div><div>Im curious, what are you coding? you can transfer the call in the dialplan without having to do all this manual queuing in C, thats why the routing state and dialplan modules exist. If you need to pull data from somewhere you can fill in channel variables that you can reference in the dialplan.</div>
<div><br></div><div><div>/*!</div><div> \brief Transfer an existing session to another location</div><div> \param session the session to transfer</div><div> \param extension the new extension</div><div> \param dialplan the new dialplan (OPTIONAL, may be NULL)</div>
<div> \param context the new context (OPTIONAL, may be NULL)</div><div>*/</div><div>SWITCH_DECLARE(switch_status_t) switch_ivr_session_transfer(_In_ switch_core_session_t *session, const char *extension, const char *dialplan,</div>
<div><span style="white-space: pre;">                                                                                                                        </span>const char *context);</div><div><br></div></div><div><br></div><div><br></div><div><div><div class="im"><div> <div style=""><div><span style="font-size: 12px;"><div>
Mathieu Rene</div><div>Avant-Garde Solutions Inc</div><div>Office: + 1 (514) 664-1044 x100</div><div>Cell: +1 (514) 664-1044 x200</div><div><a href="mailto:mrene@avgs.ca" target="_blank">mrene@avgs.ca</a></div><div><br></div>
<div><br></div></span></div></div><br> </div><br></div><div><div>Am 5-Aug-09 um 7:20 PM schrieb Woody Dickson:</div><div><div></div><div class="h5"><br><blockquote type="cite"><div>Hi,</div> <div> </div> <div>The problem is that I need freeswitch to continue executing the code after switch_status_t channel_receive_message even when it gets error SIP code from the destination. Is that possible?</div>
<div> </div> <div>I know if I set up another action after my module in the dialplan.xml, I can catch that. </div> <div> </div> <div>But I would like the code to execute within the route that I have. Is that doable?</div>
<div> </div> <div>Woody<br><br></div> <div class="gmail_quote">On Thu, Aug 6, 2009 at 12:34 AM, Mathieu Rene <span dir="ltr"><<a href="mailto:mrene_lists@avgs.ca" target="_blank">mrene_lists@avgs.ca</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0px 0px 0px 0.8ex; padding-left: 1ex;"> <div style="">The hangup cause will be in the originate_disposition channel variable on the A-leg. <div>
<br></div> <div>sip_term_status will contain the sip code and proto_specific_hangup_cause will contain sip:<code>.</div> <div><br></div> <div> <div> <div> <div><br> <div><span style="word-spacing: 0px; font-family: Helvetica; font-style: normal; font-variant: normal; font-weight: normal; font-size: medium; line-height: normal; font-size-adjust: none; font-stretch: normal; text-transform: none; color: rgb(0, 0, 0); text-indent: 0px; white-space: normal; letter-spacing: normal; border-collapse: separate;"> <div style="">
<div><span style="font-size: 12px;"> <div>Mathieu Rene</div> <div>Avant-Garde Solutions Inc</div> <div>Office: + 1 (514) 664-1044 x100</div> <div>Cell: +1 (514) 664-1044 x200</div> <div><a href="mailto:mrene@avgs.ca" target="_blank">mrene@avgs.ca</a></div>
<div><br></div> <div><br></div></span></div></div></span><br></div><br> <div> <div>Am 5-Aug-09 um 11:23 AM schrieb João Mesquita:</div> <div> <div></div> <div><br> <blockquote type="cite">My guess is that you will receive a message here:<br>
<br>switch_status_t channel_receive_message(switch_core_session_t *session, switch_core_session_message_t *msg)<br><br>The problem here is that you don't have the exact SIP code but there is a clear relationship between the codes and the messages you receive on the channel, so I am guessing that is all the same.<br>
<br>Hope this helps.<br><br>jmesquita<br><br> <div class="gmail_quote">On Wed, Aug 5, 2009 at 12:05 PM, Woody Dickson <span dir="ltr"><<a href="mailto:woodydickson@gmail.com" target="_blank">woodydickson@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;"> <div>Hi,</div> <div> </div> <div>I want to implement a module where freeSWITCH would try to bridge to an extension and if the bridging operation fails, my module can use the hangup code to determine the next cause of action. </div>
<div> </div> <div>With switch_caller_extension_add_application(session, extension, "bridge", "sofia/gateway/mygw/1232323);, if there is an error ( 503 received for instance ) in the outgoing INVITE, freeSWITCH would leave my module ( or the module's APP) and go on to the next action. Is there anyway to control it so that freeSWITCH would remain to be within the module's APP funtion and continue executing the code after switch_call_extension_add_application, when let's say a 4XX or 5XX or CANCEL ( from originator) is received? </div>
<div> </div> <div>I have tried it and found that if the bridging is successful, freeSWITCH would continue executing the code after switch_caller_extension_add_application, but if an error is received, then it would just move on to the next action. </div>
<div> </div> <div>Does anyone know how to deal with this problem?</div> <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>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></blockquote></div></div></div><br></div></div></div></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> _______________________________________________<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></blockquote></div></div></div><br></div></div></div></div><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>