<html xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns:m="http://schemas.microsoft.com/office/2004/12/omml" xmlns="http://www.w3.org/TR/REC-html40">

<head>
<meta http-equiv=Content-Type content="text/html; charset=us-ascii">
<meta name=Generator content="Microsoft Word 12 (filtered medium)">
<style>
<!--
 /* Font Definitions */
 @font-face
        {font-family:"Cambria Math";
        panose-1:2 4 5 3 5 4 6 3 2 4;}
@font-face
        {font-family:Calibri;
        panose-1:2 15 5 2 2 2 4 3 2 4;}
@font-face
        {font-family:Tahoma;
        panose-1:2 11 6 4 3 5 4 4 2 4;}
 /* Style Definitions */
 p.MsoNormal, li.MsoNormal, div.MsoNormal
        {margin:0in;
        margin-bottom:.0001pt;
        font-size:12.0pt;
        font-family:"Times New Roman","serif";}
a:link, span.MsoHyperlink
        {mso-style-priority:99;
        color:blue;
        text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
        {mso-style-priority:99;
        color:purple;
        text-decoration:underline;}
span.EmailStyle17
        {mso-style-type:personal-reply;
        font-family:"Calibri","sans-serif";
        color:#1F497D;}
.MsoChpDefault
        {mso-style-type:export-only;}
@page WordSection1
        {size:8.5in 11.0in;
        margin:1.0in 1.0in 1.0in 1.0in;}
div.WordSection1
        {page:WordSection1;}
-->
</style>
<!--[if gte mso 9]><xml>
 <o:shapedefaults v:ext="edit" spidmax="1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
 <o:shapelayout v:ext="edit">
  <o:idmap v:ext="edit" data="1" />
 </o:shapelayout></xml><![endif]-->
</head>

<body lang=EN-US link=blue vlink=purple>

<div class=WordSection1>

<div style='border:none;border-top:solid #B5C4DF 1.0pt;padding:3.0pt 0in 0in 0in'>

<p class=MsoNormal><b><span style='font-size:10.0pt;font-family:"Tahoma","sans-serif"'>From:</span></b><span
style='font-size:10.0pt;font-family:"Tahoma","sans-serif"'>
asterisk-users-bounces@lists.digium.com
[mailto:asterisk-users-bounces@lists.digium.com] <b>On Behalf Of </b>Warren
Selby<br>
<b>Sent:</b> Wednesday, December 08, 2010 4:11 PM<br>
<b>To:</b> Asterisk Users Mailing List - Non-Commercial Discussion<br>
<b>Subject:</b> Re: [asterisk-users] How to quickly move on to Dahdi channels
when SIP provider fails?<o:p></o:p></span></p>

</div>

<p class=MsoNormal><o:p>&nbsp;</o:p></p>

<div>

<p class=MsoNormal>On Wed, Dec 8, 2010 at 1:50 PM, Tilghman Lesher &lt;<a
href="mailto:tlesher@digium.com">tlesher@digium.com</a>&gt; wrote:<o:p></o:p></p>

<div>

<p class=MsoNormal>On Wednesday 08 December 2010 11:33:10 Bruce B wrote:<br>
&gt; Thanks for the input guys. I really appreciate all the input and I am<br>
&gt; sure they work but I thought there would be a much better way to do<br>
&gt; this. Sounds like patching things to me. Why doesn't Asterisk take<br>
&gt; advantage of the qualify values to make sure if the SIP connection is<br>
&gt; up or not? Shouldn't this become a native feature of the PBX rather<br>
&gt; than trying to do work-around?<br clear=all>
<o:p></o:p></p>

</div>

</div>

<p class=MsoNormal><br>
Enable qualify on your SIP peers.&nbsp; Then configure your outbound dialplan
like this:<br>
<br>
exten =&gt; outboundexten,1,Dial(SIP/...)<br>
exten =&gt; outboundexten,n,Dial(DAHDI/...)<br>
<br>
If the SIP is up, the call goes through on that Dial statement.&nbsp; When the
call is over and the people hangup, it will not continue down to the next
line.&nbsp; If it's down (and the system knows this because of qualify), it
will fail and automatically roll to the next line.&nbsp; I've used this to
setup failover between DAHDI and SIP a few times.<br>
<br>
-- <br>
Thanks,<br>
--Warren Selby, dCAP<br>
<a href="http://www.selbytech.com" target="_blank">http://www.selbytech.com</a><o:p></o:p></p>

<p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";
color:#1F497D'><o:p>&nbsp;</o:p></span></p>

<p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";
color:#1F497D'><o:p>&nbsp;</o:p></span></p>

<p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";
color:#1F497D'>Another thing to check is Congestion, sometimes my Sip Provider
works fine, but for some reason there end peer has failed.<o:p></o:p></span></p>

<p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";
color:#1F497D'><o:p>&nbsp;</o:p></span></p>

<p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";
color:#1F497D'>exten =&gt; s,n,Dial(SIP/XXXXXX@ProviderX)<o:p></o:p></span></p>

<p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";
color:#1F497D'>exten =&gt; s,n,GotoIf($[&quot;${DIALSTATUS}&quot; =
&quot;CONGESTION&quot;]?ProviderXCongestion)<o:p></o:p></span></p>

<p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";
color:#1F497D'>exten =&gt;
s,n,Hangup()&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
<o:p></o:p></span></p>

<p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";
color:#1F497D'>exten =&gt; s,n(ProviderXCongestion),Dial(IAX2/XXXXX/XXXXX)<o:p></o:p></span></p>

<p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";
color:#1F497D'>exten =&gt; s,n,GotoIf($[&quot;${DIALSTATUS}&quot; =
&quot;CONGESTION&quot;]?ProviderYCongestion)<o:p></o:p></span></p>

<p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";
color:#1F497D'>exten =&gt; s,n,Hangup()&nbsp;&nbsp;&nbsp;&nbsp; <o:p></o:p></span></p>

<p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";
color:#1F497D'>exten =&gt; s,n(ProviderYCongestion),Dial(DAHDI/XXX/XXXXXX)<o:p></o:p></span></p>

<p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";
color:#1F497D'>exten =&gt; s,n,Hangup()<o:p></o:p></span></p>

<p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";
color:#1F497D'><o:p>&nbsp;</o:p></span></p>

<p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";
color:#1F497D'><o:p>&nbsp;</o:p></span></p>

</div>

</body>

</html>