<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=utf-8">
<meta name="Generator" content="Microsoft Word 14 (filtered medium)">
<style><!--
/* Font Definitions */
@font-face
        {font-family:"Cambria Math";
        panose-1:0 0 0 0 0 0 0 0 0 0;}
@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;}
@font-face
        {font-family:Consolas;
        panose-1:2 11 6 9 2 2 4 3 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";}
h4
        {mso-style-priority:9;
        mso-style-link:"Heading 4 Char";
        mso-margin-top-alt:auto;
        margin-right:0in;
        mso-margin-bottom-alt:auto;
        margin-left:0in;
        font-size:12.0pt;
        font-family:"Times New Roman","serif";
        font-weight:bold;}
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;}
p
        {mso-style-priority:99;
        mso-margin-top-alt:auto;
        margin-right:0in;
        mso-margin-bottom-alt:auto;
        margin-left:0in;
        font-size:12.0pt;
        font-family:"Times New Roman","serif";}
pre
        {mso-style-priority:99;
        mso-style-link:"HTML Preformatted Char";
        margin:0in;
        margin-bottom:.0001pt;
        font-size:10.0pt;
        font-family:"Courier New";}
p.MsoAcetate, li.MsoAcetate, div.MsoAcetate
        {mso-style-priority:99;
        mso-style-link:"Balloon Text Char";
        margin:0in;
        margin-bottom:.0001pt;
        font-size:8.0pt;
        font-family:"Tahoma","sans-serif";}
span.Heading4Char
        {mso-style-name:"Heading 4 Char";
        mso-style-priority:9;
        mso-style-link:"Heading 4";
        font-family:"Cambria","serif";
        color:#4F81BD;
        font-weight:bold;
        font-style:italic;}
span.HTMLPreformattedChar
        {mso-style-name:"HTML Preformatted Char";
        mso-style-priority:99;
        mso-style-link:"HTML Preformatted";
        font-family:Consolas;}
span.EmailStyle21
        {mso-style-type:personal-reply;
        font-family:"Calibri","sans-serif";
        color:#1F497D;}
span.BalloonTextChar
        {mso-style-name:"Balloon Text Char";
        mso-style-priority:99;
        mso-style-link:"Balloon Text";
        font-family:"Tahoma","sans-serif";}
.MsoChpDefault
        {mso-style-type:export-only;
        font-family:"Calibri","sans-serif";}
@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">
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D">You got to set event off while connecting to AMI to get rid of AMI responses on each event. There are ways you can suppress the events
<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D"><o:p> </o:p></span></p>
<p class="MsoNormal"><a href="http://www.voip-info.org/wiki/view/Asterisk+manager+API">http://www.voip-info.org/wiki/view/Asterisk+manager+API</a><o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal">Ask your provider to send 180 instead of 183. <o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D"><o:p> </o:p></span></p>
<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>Mordechay Kaganer<br>
<b>Sent:</b> Thursday, August 15, 2013 5:11 AM<br>
<b>To:</b> Asterisk Users Mailing List - Non-Commercial Discussion<br>
<b>Subject:</b> Re: [asterisk-users] SIP trunk and congestion handling<o:p></o:p></span></p>
<p class="MsoNormal"><o:p> </o:p></p>
<div>
<p class="MsoNormal">B.H.<o:p></o:p></p>
<div>
<p class="MsoNormal"><o:p> </o:p></p>
</div>
<div>
<p class="MsoNormal">While dialing out i get a lot of AMI responses like this:<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal"><o:p> </o:p></p>
</div>
<div>
<div>
<p class="MsoNormal">Event: Hangup<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal">Privilege: call,all<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal">Channel: SIP/TRK012-000336b0<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal">Uniqueid: S5-1376567634.218719<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal">CallerIDNum: XXXXXXXXX<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal">CallerIDName: YYYYYYYYYY<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal">ConnectedLineNum: XXXXXXXXX<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal">ConnectedLineName: YYYYYYYYYY<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal"><b><i>Cause: 19</i></b><o:p></o:p></p>
</div>
<div>
<p class="MsoNormal"><b><i>Cause-txt: User alerting, no answer</i></b><o:p></o:p></p>
</div>
<div>
<p class="MsoNormal"><o:p> </o:p></p>
</div>
<div>
<p class="MsoNormal">Event: OriginateResponse<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal">Privilege: call,all<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal">ActionID: 249867518_255525#YD_UFOzWQx30Wm6PM3USxGE<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal">Response: Failure<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal">Channel: SIP/TRK012/YYYYYYYYYY<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal">Context: YemotDialer_Bridge<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal">Exten: s<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal"><b><i>Reason: 8</i></b><o:p></o:p></p>
</div>
<div>
<p class="MsoNormal">Uniqueid: <null><o:p></o:p></p>
</div>
<div>
<p class="MsoNormal">CallerIDNum: XXXXXXXXX<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal">CallerIDName: YYYYYYYYYY<o:p></o:p></p>
</div>
</div>
<div>
<p class="MsoNormal"><o:p> </o:p></p>
</div>
<div>
<p class="MsoNormal">As mentioned in the previous mails, SIP response code is 480. I would expect to get reason 3 not 8. Reason 8 is confusing my dialer software so it wants to redial the number.<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal"><o:p> </o:p></p>
</div>
<div>
<p class="MsoNormal">I use Asterisk 1.8.22. Is this a bug in asterisk or is a problem with my SIP trunk provider?<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal"><o:p> </o:p></p>
</div>
</div>
<div>
<p class="MsoNormal" style="margin-bottom:12.0pt"><o:p> </o:p></p>
<div>
<p class="MsoNormal">On Wed, Aug 14, 2013 at 9:00 AM, Mordechay Kaganer <<a href="mailto:mkaganer@gmail.com" target="_blank">mkaganer@gmail.com</a>> wrote:<o:p></o:p></p>
<p>B.H.<o:p></o:p></p>
<p>But if the final response is 480 doesn't it mean that the call was placed but there was no reply?<o:p></o:p></p>
<div>
<div>
<div>
<p class="MsoNormal">On Aug 13, 2013 10:30 PM, "Shishir Pokharel" <<a href="mailto:Shishir.Pokharel@on24.com" target="_blank">Shishir.Pokharel@on24.com</a>> wrote:<o:p></o:p></p>
<div>
<div>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"><a href="http://tools.ietf.org/html/rfc3261#section-21.1.5" target="_blank"><b><span style="font-family:"Courier New"">21.1.5</span></b></a><b><span style="font-family:"Courier New"">
183 Session Progress</span></b><o:p></o:p></p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"><span style="font-family:"Courier New""> </span><o:p></o:p></p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"><span style="font-family:"Courier New""> </span><o:p></o:p></p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"><span style="font-family:"Courier New""> The 183 (Session Progress) response is used to convey information</span><o:p></o:p></p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"><span style="font-family:"Courier New""> about the progress of the call that is not otherwise classified. The</span><o:p></o:p></p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"><span style="font-family:"Courier New""> Reason-Phrase, header fields, or message body MAY be used to convey</span><o:p></o:p></p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"><span style="font-family:"Courier New""> more details about the call progress.</span><o:p></o:p></p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"><b><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D"> </span></b><o:p></o:p></p>
<h4><a name="1407b69185a068e2_14079286130689b2_sectio"></a><a href="http://tools.ietf.org/html/rfc3261#section-21.1.2" target="_blank"><span style="font-family:"Courier New"">21.1.2</span></a><span style="font-family:"Courier New""> 180 Ringing</span><o:p></o:p></h4>
<pre><span style="font-size:12.0pt"> </span><o:p></o:p></pre>
<pre><span style="font-size:12.0pt"> </span><o:p></o:p></pre>
<pre><span style="font-size:12.0pt"> The UA receiving the INVITE is trying to alert the user. This</span><o:p></o:p></pre>
<pre><span style="font-size:12.0pt"> response MAY be used to initiate local ringback.</span><o:p></o:p></pre>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"><b><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D"> </span></b><o:p></o:p></p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"><a href="http://tools.ietf.org/html/rfc3261#section-21.1.2" target="_blank">http://tools.ietf.org/html/rfc3261#section-21.1.2</a><o:p></o:p></p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D"> </span><o:p></o:p></p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"><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"">
<a href="mailto:asterisk-users-bounces@lists.digium.com" target="_blank">asterisk-users-bounces@lists.digium.com</a> [mailto:<a href="mailto:asterisk-users-bounces@lists.digium.com" target="_blank">asterisk-users-bounces@lists.digium.com</a>]
<b>On Behalf Of </b>Mordechay Kaganer<br>
<b>Sent:</b> Tuesday, August 13, 2013 10:55 AM<br>
<b>To:</b> Asterisk Users Mailing List - Non-Commercial Discussion<br>
<b>Subject:</b> Re: [asterisk-users] SIP trunk and congestion handling</span><o:p></o:p></p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"> <o:p></o:p></p>
<p>B.H.<o:p></o:p></p>
<p>Asterisk 1.8.22<o:p></o:p></p>
<p>Thanks<o:p></o:p></p>
<div>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto">On Aug 12, 2013 8:05 PM, "Shishir Pokharel" <<a href="mailto:Shishir.Pokharel@on24.com" target="_blank">Shishir.Pokharel@on24.com</a>> wrote:<o:p></o:p></p>
<div>
<div>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D">Which version of asterisk are you using ?
</span><o:p></o:p></p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D"> </span><o:p></o:p></p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D"> </span><o:p></o:p></p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"><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"">
<a href="mailto:asterisk-users-bounces@lists.digium.com" target="_blank">asterisk-users-bounces@lists.digium.com</a> [mailto:<a href="mailto:asterisk-users-bounces@lists.digium.com" target="_blank">asterisk-users-bounces@lists.digium.com</a>]
<b>On Behalf Of </b>Mordechay Kaganer<br>
<b>Sent:</b> Sunday, August 11, 2013 8:59 AM<br>
<b>To:</b> Asterisk Users Mailing List - Non-Commercial Discussion<br>
<b>Subject:</b> [asterisk-users] SIP trunk and congestion handling</span><o:p></o:p></p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"> <o:p></o:p></p>
<div>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto">B.H.<o:p></o:p></p>
<div>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"> <o:p></o:p></p>
</div>
<div>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto">Hello, all. We have a dialer software that runs outgoing telephony campaigns. We have been using it successfully with PRI cards, now we're evaluating it's use also with a SIP trunk.
Most of the things run perfectly good without a need to change anything except for dial string, but there's some strange problem with asterisk interpreting SIP result codes. <o:p></o:p></p>
</div>
<div>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"> <o:p></o:p></p>
</div>
<div>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto">Our software is written in Java using asterisk-java library. It is using Asterisk's reason code from OriginateResponseEvent to determine if it should redial the number. Our consideration
is that if Asterisk returns reason code 8 (Congestion) this means that the call has never actually reached the destination number, and it's OK to try to redial again.<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"> <o:p></o:p></p>
</div>
<div>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto">But with SIP trunk, many times i can see a really strange sequence of events:<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"> <o:p></o:p></p>
</div>
<div>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto">After INVITE i get the following responses (example from a real conversation)<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto">[17:01:40] SIP/2.0 100 Trying<o:p></o:p></p>
</div>
<div>
<div>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto">[17:01:40] SIP/2.0 183 Session Progress<o:p></o:p></p>
</div>
</div>
<div>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto">[17:01:51] SIP/2.0 480 Temporarily not available<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"> <o:p></o:p></p>
</div>
<div>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto">As far as i understand, this means that the remote phone was ringing for 10 seconds and then the call failed due to a timeout. As far as i understand, i'm supposed to get reason
code 3, but actually the java application gets OriginateResponseEvent with failure reason code 8.<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"> <o:p></o:p></p>
</div>
<div>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto">This behavior is hard to reproduce. I was trying with my own phone number and then i get the expected reason code 3, but i constantly get this situation running our customer's campaigns.<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"> <o:p></o:p></p>
</div>
<div>
<div>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"> <o:p></o:p></p>
</div>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto">--
<o:p></o:p></p>
<div>
<div>
<p class="MsoNormal" dir="RTL" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;text-align:right;direction:rtl;unicode-bidi:embed">
<span lang="HE" style="color:#666666">משיח </span><span dir="LTR" style="color:#666666">NOW</span><span dir="RTL"></span><span lang="HE" style="color:#666666"><span dir="RTL"></span>!</span><span dir="LTR"><o:p></o:p></span></p>
</div>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"><span style="color:#666666">Moshiach is coming very soon, prepare yourself!</span><span lang="AR-SA" dir="RTL"><o:p></o:p></span></p>
<div>
<p class="MsoNormal" dir="RTL" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;text-align:right;direction:rtl;unicode-bidi:embed">
<span lang="HE" style="color:#666666">יחי אדוננו מורינו ורבינו מלך המשיח לעולם ועד!</span><span dir="LTR"><o:p></o:p></span></p>
</div>
</div>
</div>
</div>
</div>
</div>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"><br>
--<br>
_____________________________________________________________________<br>
-- Bandwidth and Colocation Provided by <a href="http://www.api-digital.com" target="_blank">
http://www.api-digital.com</a> --<br>
New to Asterisk? Join us for a live introductory webinar every Thurs:<br>
<a href="http://www.asterisk.org/hello" target="_blank">http://www.asterisk.org/hello</a><br>
<br>
asterisk-users mailing list<br>
To UNSUBSCRIBE or update options visit:<br>
<a href="http://lists.digium.com/mailman/listinfo/asterisk-users" target="_blank">http://lists.digium.com/mailman/listinfo/asterisk-users</a><span lang="AR-SA" dir="RTL"><o:p></o:p></span></p>
</div>
</div>
</div>
<p class="MsoNormal"><br>
--<br>
_____________________________________________________________________<br>
-- Bandwidth and Colocation Provided by <a href="http://www.api-digital.com" target="_blank">
http://www.api-digital.com</a> --<br>
New to Asterisk? Join us for a live introductory webinar every Thurs:<br>
<a href="http://www.asterisk.org/hello" target="_blank">http://www.asterisk.org/hello</a><br>
<br>
asterisk-users mailing list<br>
To UNSUBSCRIBE or update options visit:<br>
<a href="http://lists.digium.com/mailman/listinfo/asterisk-users" target="_blank">http://lists.digium.com/mailman/listinfo/asterisk-users</a><o:p></o:p></p>
</div>
</div>
</div>
</div>
<p class="MsoNormal"><br>
<br clear="all">
<o:p></o:p></p>
<div>
<p class="MsoNormal"><o:p> </o:p></p>
</div>
<p class="MsoNormal">-- <o:p></o:p></p>
<div>
<div>
<p class="MsoNormal" dir="RTL" style="text-align:right;direction:rtl;unicode-bidi:embed">
<span lang="HE" style="color:#666666">משיח </span><span dir="LTR" style="color:#666666">NOW</span><span dir="RTL"></span><span lang="HE" style="color:#666666"><span dir="RTL"></span>!</span><span dir="LTR"><o:p></o:p></span></p>
</div>
<p class="MsoNormal"><span style="color:#666666">Moshiach is coming very soon, prepare yourself!</span><span lang="AR-SA" dir="RTL"><o:p></o:p></span></p>
<div>
<p class="MsoNormal" dir="RTL" style="text-align:right;direction:rtl;unicode-bidi:embed">
<span lang="HE" style="color:#666666">יחי אדוננו מורינו ורבינו מלך המשיח לעולם ועד!</span><span dir="LTR"><o:p></o:p></span></p>
</div>
</div>
</div>
</div>
</body>
</html>