Hi, I am doing failover routing based on 2 dial commands. First route sends back 4xx response and I don't want it to try 2nd route when it is 4xx response. Can we do failover routing based on SIP 5xx response only ? Thanks Deepika -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.digium.com/pipermail/asterisk-users/attachments/20110228/e1d37c6d/attachment.htm>
Look like you should work with channel status variable. If channel not answer then jump on 5xx -- Sent from my iPhone On Feb 28, 2011, at 10:27 AM, "Deepika Nijhawan" <deepika.nijhawan at oxygen8.com > wrote:> Hi, > > > > I am doing failover routing based on 2 dial commands. First route > sends back 4xx response and I don?t want it to try 2nd route when it > is 4xx response. > > Can we do failover routing based on SIP 5xx response only ? > > > > Thanks > > Deepika > > > > -- > _____________________________________________________________________ > -- Bandwidth and Colocation Provided by http://www.api-digital.com -- > New to Asterisk? Join us for a live introductory webinar every Thurs: > http://www.asterisk.org/hello > > asterisk-users mailing list > To UNSUBSCRIBE or update options visit: > http://lists.digium.com/mailman/listinfo/asterisk-users-------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.digium.com/pipermail/asterisk-users/attachments/20110228/c276a7f2/attachment.htm>
Hi, If I use dialstatus variable, it doesn't give exact reasons for failure like for unallocated numbers it sends Congestion. Whereas, for unallocated number I don't want to go to failover routing. But need to go to failover routing for other congestion reasons. So, is there any way to check SIP responses like 4xx or 5xx ? Thanks, Deepika -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.digium.com/pipermail/asterisk-users/attachments/20110301/f365cb9e/attachment.htm>
You can use exten pattern matching for un allocated numbers, say exten=> _X.,1,Goto(somewhere) will match all the numbers on priority 1. But make sure you match full extension numbers first which are allocated. Also this extension is a security risk as well. It is recommended that you use a filter dialplan application/function before matching this extension to make sure you accept numbers only. Cheers On Tue, Mar 1, 2011 at 5:11 PM, Deepika Nijhawan < deepika.nijhawan at oxygen8.com> wrote:> Hi, > > > > If I use dialstatus variable, it doesn?t give exact reasons for failure > like for unallocated numbers it sends Congestion. Whereas, for unallocated > number I don?t want to go to failover routing. But need to go to failover > routing for other congestion reasons. > > So, is there any way to check SIP responses like 4xx or 5xx ? > > > > Thanks, > > Deepika > > > > -- > _____________________________________________________________________ > -- Bandwidth and Colocation Provided by http://www.api-digital.com -- > New to Asterisk? Join us for a live introductory webinar every Thurs: > http://www.asterisk.org/hello > > asterisk-users mailing list > To UNSUBSCRIBE or update options visit: > http://lists.digium.com/mailman/listinfo/asterisk-users >-- Best Ragards Rizwan Qureshi VoIP/Asterisk Engineer Axvoice Inc. V: +92 (0) 3333 6767 26 E: rizwanhasham at gmail.com W: www.axvoice.com -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.digium.com/pipermail/asterisk-users/attachments/20110301/7f884a41/attachment.htm>
On Tue, Mar 1, 2011 at 8:09 AM, Deepika Nijhawan <deepika.nijhawan at oxygen8.com> wrote:> Ya, below is my routing: > Exten => 1234,1,Dial(SIP/abc) > Exten => 1234,n,Dial(SIP/xyz) > > If 1234 is unallocated on SIP/abc it returns 1 in ${HANGUPCAUSE} variable. > For this I don't want it ?to try SIP/xyz. > But overall, if we get SIP 4xx reason then call should hangup like it sends > back 404 not found for this case and if we get SIP 5xx response then should > try SIP/xyz. > Is there any way to check sip responses and do failover routing based on > that? >Have you looked at SIP_HEADER() dialplan function? <https://wiki.asterisk.org/wiki/display/AST/Function_SIP_HEADER> Maybe you can parse Reason header in 4xx or 5xx response? HTH, -Bob