<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
  <head>
    <meta content="text/html; charset=ISO-8859-1"
      http-equiv="Content-Type">
  </head>
  <body text="#000000" bgcolor="#ffffff">
    <tt>Hello Rik,<br>
      <br>
      So OpenSIPS generates a new INVITE with credentials (as a result
      of the uac_auth() ), but this is also rejected ?<br>
      <br>
      Regards,<br>
    </tt>
    <pre class="moz-signature" cols="72">Bogdan-Andrei Iancu
OpenSIPS Founder and Developer
<a class="moz-txt-link-freetext" href="http://www.opensips-solutions.com">http://www.opensips-solutions.com</a></pre>
    <br>
    On 10/31/2013 11:46 AM, Rik Broers wrote:
    <blockquote
cite="mid:685BED81F9FCC7418ACC487ECF36B7E919FF9D18@W2K8SV00008.MOTTOVOIP.lan"
      type="cite">
      <meta http-equiv="Content-Type" content="text/html;
        charset=ISO-8859-1">
      <meta name="Generator" content="Microsoft Word 15 (filtered
        medium)">
      <!--[if !mso]><style>v\:* {behavior:url(#default#VML);}
o\:* {behavior:url(#default#VML);}
w\:* {behavior:url(#default#VML);}
.shape {behavior:url(#default#VML);}
</style><![endif]-->
      <style><!--
/* Font Definitions */
@font-face
        {font-family:Wingdings;
        panose-1:5 0 0 0 0 0 0 0 0 0;}
@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:"Trebuchet MS";
        panose-1:2 11 6 3 2 2 2 2 2 4;}
@font-face
        {font-family:Verdana;
        panose-1:2 11 6 4 3 5 4 4 2 4;}
@font-face
        {font-family:"Lucida Console";
        panose-1:2 11 6 9 4 5 4 2 2 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
        {margin:0cm;
        margin-bottom:.0001pt;
        font-size:11.0pt;
        font-family:"Calibri","sans-serif";
        mso-fareast-language:EN-US;}
a:link, span.MsoHyperlink
        {mso-style-priority:99;
        color:#0563C1;
        text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
        {mso-style-priority:99;
        color:#954F72;
        text-decoration:underline;}
p.MsoListParagraph, li.MsoListParagraph, div.MsoListParagraph
        {mso-style-priority:34;
        margin-top:0cm;
        margin-right:0cm;
        margin-bottom:0cm;
        margin-left:36.0pt;
        margin-bottom:.0001pt;
        font-size:11.0pt;
        font-family:"Calibri","sans-serif";
        mso-fareast-language:EN-US;}
span.EmailStyle17
        {mso-style-type:personal-compose;
        font-family:"Calibri","sans-serif";
        color:windowtext;}
.MsoChpDefault
        {mso-style-type:export-only;
        font-family:"Calibri","sans-serif";
        mso-fareast-language:EN-US;}
@page WordSection1
        {size:612.0pt 792.0pt;
        margin:70.85pt 70.85pt 70.85pt 70.85pt;}
div.WordSection1
        {page:WordSection1;}
/* List Definitions */
@list l0
        {mso-list-id:551188517;
        mso-list-type:hybrid;
        mso-list-template-ids:253644554 -1009898892 68354051 68354053 68354049 68354051 68354053 68354049 68354051 68354053;}
@list l0:level1
        {mso-level-start-at:0;
        mso-level-number-format:bullet;
        mso-level-text:\F0E8;
        mso-level-tab-stop:none;
        mso-level-number-position:left;
        text-indent:-18.0pt;
        font-family:Wingdings;
        mso-fareast-font-family:Calibri;
        mso-bidi-font-family:"Times New Roman";}
@list l0:level2
        {mso-level-number-format:bullet;
        mso-level-text:o;
        mso-level-tab-stop:none;
        mso-level-number-position:left;
        text-indent:-18.0pt;
        font-family:"Courier New";}
@list l0:level3
        {mso-level-number-format:bullet;
        mso-level-text:\F0A7;
        mso-level-tab-stop:none;
        mso-level-number-position:left;
        text-indent:-18.0pt;
        font-family:Wingdings;}
@list l0:level4
        {mso-level-number-format:bullet;
        mso-level-text:\F0B7;
        mso-level-tab-stop:none;
        mso-level-number-position:left;
        text-indent:-18.0pt;
        font-family:Symbol;}
@list l0:level5
        {mso-level-number-format:bullet;
        mso-level-text:o;
        mso-level-tab-stop:none;
        mso-level-number-position:left;
        text-indent:-18.0pt;
        font-family:"Courier New";}
@list l0:level6
        {mso-level-number-format:bullet;
        mso-level-text:\F0A7;
        mso-level-tab-stop:none;
        mso-level-number-position:left;
        text-indent:-18.0pt;
        font-family:Wingdings;}
@list l0:level7
        {mso-level-number-format:bullet;
        mso-level-text:\F0B7;
        mso-level-tab-stop:none;
        mso-level-number-position:left;
        text-indent:-18.0pt;
        font-family:Symbol;}
@list l0:level8
        {mso-level-number-format:bullet;
        mso-level-text:o;
        mso-level-tab-stop:none;
        mso-level-number-position:left;
        text-indent:-18.0pt;
        font-family:"Courier New";}
@list l0:level9
        {mso-level-number-format:bullet;
        mso-level-text:\F0A7;
        mso-level-tab-stop:none;
        mso-level-number-position:left;
        text-indent:-18.0pt;
        font-family:Wingdings;}
@list l1
        {mso-list-id:1499616662;
        mso-list-type:hybrid;
        mso-list-template-ids:975195468 1177466678 68354051 68354053 68354049 68354051 68354053 68354049 68354051 68354053;}
@list l1:level1
        {mso-level-start-at:0;
        mso-level-number-format:bullet;
        mso-level-text:\F0E8;
        mso-level-tab-stop:none;
        mso-level-number-position:left;
        text-indent:-18.0pt;
        font-family:Wingdings;
        mso-fareast-font-family:Calibri;
        mso-bidi-font-family:"Times New Roman";}
@list l1:level2
        {mso-level-number-format:bullet;
        mso-level-text:o;
        mso-level-tab-stop:none;
        mso-level-number-position:left;
        text-indent:-18.0pt;
        font-family:"Courier New";}
@list l1:level3
        {mso-level-number-format:bullet;
        mso-level-text:\F0A7;
        mso-level-tab-stop:none;
        mso-level-number-position:left;
        text-indent:-18.0pt;
        font-family:Wingdings;}
@list l1:level4
        {mso-level-number-format:bullet;
        mso-level-text:\F0B7;
        mso-level-tab-stop:none;
        mso-level-number-position:left;
        text-indent:-18.0pt;
        font-family:Symbol;}
@list l1:level5
        {mso-level-number-format:bullet;
        mso-level-text:o;
        mso-level-tab-stop:none;
        mso-level-number-position:left;
        text-indent:-18.0pt;
        font-family:"Courier New";}
@list l1:level6
        {mso-level-number-format:bullet;
        mso-level-text:\F0A7;
        mso-level-tab-stop:none;
        mso-level-number-position:left;
        text-indent:-18.0pt;
        font-family:Wingdings;}
@list l1:level7
        {mso-level-number-format:bullet;
        mso-level-text:\F0B7;
        mso-level-tab-stop:none;
        mso-level-number-position:left;
        text-indent:-18.0pt;
        font-family:Symbol;}
@list l1:level8
        {mso-level-number-format:bullet;
        mso-level-text:o;
        mso-level-tab-stop:none;
        mso-level-number-position:left;
        text-indent:-18.0pt;
        font-family:"Courier New";}
@list l1:level9
        {mso-level-number-format:bullet;
        mso-level-text:\F0A7;
        mso-level-tab-stop:none;
        mso-level-number-position:left;
        text-indent:-18.0pt;
        font-family:Wingdings;}
@list l2
        {mso-list-id:1663392702;
        mso-list-type:hybrid;
        mso-list-template-ids:1010889584 1762040758 68354051 68354053 68354049 68354051 68354053 68354049 68354051 68354053;}
@list l2:level1
        {mso-level-start-at:0;
        mso-level-number-format:bullet;
        mso-level-text:\F0E8;
        mso-level-tab-stop:none;
        mso-level-number-position:left;
        text-indent:-18.0pt;
        font-family:Wingdings;
        mso-fareast-font-family:Calibri;
        mso-bidi-font-family:"Times New Roman";}
@list l2:level2
        {mso-level-number-format:bullet;
        mso-level-text:o;
        mso-level-tab-stop:none;
        mso-level-number-position:left;
        text-indent:-18.0pt;
        font-family:"Courier New";}
@list l2:level3
        {mso-level-number-format:bullet;
        mso-level-text:\F0A7;
        mso-level-tab-stop:none;
        mso-level-number-position:left;
        text-indent:-18.0pt;
        font-family:Wingdings;}
@list l2:level4
        {mso-level-number-format:bullet;
        mso-level-text:\F0B7;
        mso-level-tab-stop:none;
        mso-level-number-position:left;
        text-indent:-18.0pt;
        font-family:Symbol;}
@list l2:level5
        {mso-level-number-format:bullet;
        mso-level-text:o;
        mso-level-tab-stop:none;
        mso-level-number-position:left;
        text-indent:-18.0pt;
        font-family:"Courier New";}
@list l2:level6
        {mso-level-number-format:bullet;
        mso-level-text:\F0A7;
        mso-level-tab-stop:none;
        mso-level-number-position:left;
        text-indent:-18.0pt;
        font-family:Wingdings;}
@list l2:level7
        {mso-level-number-format:bullet;
        mso-level-text:\F0B7;
        mso-level-tab-stop:none;
        mso-level-number-position:left;
        text-indent:-18.0pt;
        font-family:Symbol;}
@list l2:level8
        {mso-level-number-format:bullet;
        mso-level-text:o;
        mso-level-tab-stop:none;
        mso-level-number-position:left;
        text-indent:-18.0pt;
        font-family:"Courier New";}
@list l2:level9
        {mso-level-number-format:bullet;
        mso-level-text:\F0A7;
        mso-level-tab-stop:none;
        mso-level-number-position:left;
        text-indent:-18.0pt;
        font-family:Wingdings;}
@list l3
        {mso-list-id:1711494281;
        mso-list-type:hybrid;
        mso-list-template-ids:-674720816 -128843472 68354051 68354053 68354049 68354051 68354053 68354049 68354051 68354053;}
@list l3:level1
        {mso-level-start-at:0;
        mso-level-number-format:bullet;
        mso-level-text:\F0E8;
        mso-level-tab-stop:none;
        mso-level-number-position:left;
        text-indent:-18.0pt;
        font-family:Wingdings;
        mso-fareast-font-family:Calibri;
        mso-bidi-font-family:"Times New Roman";}
@list l3:level2
        {mso-level-number-format:bullet;
        mso-level-text:o;
        mso-level-tab-stop:none;
        mso-level-number-position:left;
        text-indent:-18.0pt;
        font-family:"Courier New";}
@list l3:level3
        {mso-level-number-format:bullet;
        mso-level-text:\F0A7;
        mso-level-tab-stop:none;
        mso-level-number-position:left;
        text-indent:-18.0pt;
        font-family:Wingdings;}
@list l3:level4
        {mso-level-number-format:bullet;
        mso-level-text:\F0B7;
        mso-level-tab-stop:none;
        mso-level-number-position:left;
        text-indent:-18.0pt;
        font-family:Symbol;}
@list l3:level5
        {mso-level-number-format:bullet;
        mso-level-text:o;
        mso-level-tab-stop:none;
        mso-level-number-position:left;
        text-indent:-18.0pt;
        font-family:"Courier New";}
@list l3:level6
        {mso-level-number-format:bullet;
        mso-level-text:\F0A7;
        mso-level-tab-stop:none;
        mso-level-number-position:left;
        text-indent:-18.0pt;
        font-family:Wingdings;}
@list l3:level7
        {mso-level-number-format:bullet;
        mso-level-text:\F0B7;
        mso-level-tab-stop:none;
        mso-level-number-position:left;
        text-indent:-18.0pt;
        font-family:Symbol;}
@list l3:level8
        {mso-level-number-format:bullet;
        mso-level-text:o;
        mso-level-tab-stop:none;
        mso-level-number-position:left;
        text-indent:-18.0pt;
        font-family:"Courier New";}
@list l3:level9
        {mso-level-number-format:bullet;
        mso-level-text:\F0A7;
        mso-level-tab-stop:none;
        mso-level-number-position:left;
        text-indent:-18.0pt;
        font-family:Wingdings;}
ol
        {margin-bottom:0cm;}
ul
        {margin-bottom:0cm;}
--></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]-->
      <div class="WordSection1">
        <p class="MsoNormal">Hi,<o:p></o:p></p>
        <p class="MsoNormal"><o:p>&nbsp;</o:p></p>
        <p class="MsoNormal"><span lang="EN-US">I&#8217;m trying to use the
            uac_auth() function to add Authorization to my invite after
            I received a 401 Unauthorized.
            <o:p></o:p></span></p>
        <p class="MsoNormal"><span lang="EN-US">I call the function in
            the failure route and according to Debug the authorization
            header is inserted. I also see this in a trace.<o:p></o:p></span></p>
        <p class="MsoNormal"><span lang="EN-US">Unfortunately I haven&#8217;t
            been able to authorize successfully, double checked
            everything and also tried with phones to ensure the
            credentials are correct and my asterisk is working.<o:p></o:p></span></p>
        <p class="MsoNormal"><span lang="EN-US">I&#8217;m filling the
            credentials with a modparam not with AVP.<o:p></o:p></span></p>
        <p class="MsoNormal"><span lang="EN-US"><o:p>&nbsp;</o:p></span></p>
        <p class="MsoNormal"><span lang="EN-US">In DBG I see this: </span><span
            style="font-size: 9pt; font-family: &quot;Lucida
            Console&quot;;" lang="EN-US">DBG:uac_auth:build_authorization_hdr:
            hdr is &lt;Authorization: Digest username="**", realm="**",
            nonce="31d5b0d9", uri="***;user=phone",
            response="ea344343187f27c668be8fdc3acf8c5a",
            algorithm=MD5#015#012&gt;<o:p></o:p></span></p>
        <p class="MsoNormal"><span lang="EN-US">So it seems to match
            correctly.<o:p></o:p></span></p>
        <p class="MsoNormal"><span lang="EN-US"><o:p>&nbsp;</o:p></span></p>
        <p class="MsoNormal"><span lang="EN-US">I&#8217;m authenticating
            against Asterisk. And my failure route looks like this:<o:p></o:p></span></p>
        <p class="MsoNormal" style=""><span style="font-size: 9pt;
            font-family: &quot;Lucida Console&quot;;" lang="EN-US">failure_route<span
              style="color: rgb(0, 187, 0);">[FailPBX]</span>{<span
              style="color: black; background: none repeat scroll 0% 0%
              black;"><o:p></o:p></span></span></p>
        <p class="MsoNormal" style=""><span style="font-size: 9pt;
            font-family: &quot;Lucida Console&quot;;" lang="EN-US">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
            xlog("Im in failpbx route")<span style="color: aqua;">;</span><span
              style="color: black; background: none repeat scroll 0% 0%
              black;"><o:p></o:p></span></span></p>
        <p class="MsoNormal" style=""><span style="font-size: 9pt;
            font-family: &quot;Lucida Console&quot;;" lang="EN-US">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
            uac_auth()<span style="color: aqua;">;</span><span
              style="color: black; background: none repeat scroll 0% 0%
              black;"><o:p></o:p></span></span></p>
        <p class="MsoNormal" style=""><span style="font-size: 9pt;
            font-family: &quot;Lucida Console&quot;;" lang="EN-US">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
            t_on_failure("FailPBX")<span style="color: aqua;">;</span><span
              style="color: black; background: none repeat scroll 0% 0%
              black;"><o:p></o:p></span></span></p>
        <p class="MsoNormal" style=""><span style="font-size: 9pt;
            font-family: &quot;Lucida Console&quot;;" lang="EN-US">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
          </span><span style="font-size: 9pt; font-family: &quot;Lucida
            Console&quot;;">t_relay()<span style="color: aqua;">;</span><span
              style="color: black; background: none repeat scroll 0% 0%
              black;"><o:p></o:p></span></span></p>
        <p class="MsoNormal"><span style="font-size: 9pt; font-family:
            &quot;Lucida Console&quot;;">}<o:p></o:p></span></p>
        <p class="MsoNormal"><span style="font-size: 9pt; font-family:
            &quot;Lucida Console&quot;;"><o:p>&nbsp;</o:p></span></p>
        <p class="MsoNormal"><span lang="EN-US">What happens is the
            following<o:p></o:p></span></p>
        <p class="MsoNormal"><span lang="EN-US">-&gt; Invite<o:p></o:p></span></p>
        <p class="MsoNormal"><span lang="EN-US">&lt;- 100 Giving a try<o:p></o:p></span></p>
        <p class="MsoNormal"><span lang="EN-US">&lt;- 401 Unauthorized
            (Unique nonce 1)<o:p></o:p></span></p>
        <p class="MsoNormal"><span lang="EN-US">-&gt; ACK<o:p></o:p></span></p>
        <p class="MsoNormal"><span lang="EN-US">-&gt; invite with
            authorization header (unique Nonce 1)<o:p></o:p></span></p>
        <p class="MsoNormal"><span lang="EN-US">&lt;- 100 Giving a try<o:p></o:p></span></p>
        <p class="MsoNormal"><span lang="EN-US">&lt;- 401 Unauthorized
            (Unique nonce 2)<o:p></o:p></span></p>
        <p class="MsoNormal"><span lang="EN-US">-&gt; invite with
            authorization header (unique Nonce 2)<o:p></o:p></span></p>
        <p class="MsoNormal"><span lang="EN-US">&#8230;.. and so on until </span><span
            style="font-size: 9pt; font-family: &quot;Lucida
            Console&quot;;" lang="EN-US">ERROR:tm:add_uac: maximum
            number of branches exceeded.<o:p></o:p></span></p>
        <p class="MsoNormal"><span lang="EN-US"><o:p>&nbsp;</o:p></span></p>
        <p class="MsoNormal"><span lang="EN-US"><o:p>&nbsp;</o:p></span></p>
        <p class="MsoNormal"><span lang="EN-US">Only thing left for me
            now is to verify that the Digest calculated is correct.
            <b>How can I do this?</b> What functions should I use on
            linux..<o:p></o:p></span></p>
        <p class="MsoNormal"><span lang="EN-US">Below my authorization
            challenge.<o:p></o:p></span></p>
        <p class="MsoNormal"><span style=""><img id="Picture_x0020_5"
              src="cid:part1.09090806.08020704@opensips.org" height="31"
              width="641"></span><span lang="EN-US"><o:p></o:p></span></p>
        <p class="MsoNormal"><span lang="EN-US"><o:p>&nbsp;</o:p></span></p>
        <p class="MsoNormal"><span lang="EN-US">Or are there any other
            things I&#8217;m missing?<o:p></o:p></span></p>
        <p class="MsoNormal"><span lang="EN-US">Im using </span><span
            style="font-size: 9pt; font-family: &quot;Lucida
            Console&quot;;" lang="EN-US">NOTICE:core:main: version:
            opensips 1.10.0-notls (x86_64/linux)</span><span
            lang="EN-US"><o:p></o:p></span></p>
        <p class="MsoNormal"><span lang="EN-US"><o:p>&nbsp;</o:p></span></p>
        <p class="MsoNormal"><span lang="EN-US"><o:p>&nbsp;</o:p></span></p>
        <p class="MsoNormal"><span style="">Met vriendelijke groet,<o:p></o:p></span></p>
        <p class="MsoNormal"><span style="">Regards,</span><o:p></o:p></p>
        <p class="MsoNormal"><o:p>&nbsp;</o:p></p>
        <table class="MsoNormalTable" style="border-collapse: collapse;"
          border="0" cellpadding="0" cellspacing="0">
          <tbody>
            <tr>
              <td style="width: 529.15pt; padding: 0cm;" valign="top"
                width="706">
                <p class="MsoNormal" style="line-height: 105%;"><b><span
                      style="font-size: 10pt; line-height: 105%;
                      font-family: &quot;Trebuchet
                      MS&quot;,&quot;sans-serif&quot;; color: rgb(161,
                      195, 31);" lang="EN-US">Rik Broers<o:p></o:p></span></b></p>
                <p class="MsoNormal" style="line-height: 105%;"><b><i><span
                        style="font-size: 8pt; line-height: 105%;
                        font-family: &quot;Trebuchet
                        MS&quot;,&quot;sans-serif&quot;;" lang="EN-US">Voice
                        Engineer</span></i></b><b><i><span
                        style="font-size: 8pt; line-height: 105%;
                        font-family:
                        &quot;Verdana&quot;,&quot;sans-serif&quot;;"
                        lang="EN-US"><o:p></o:p></span></i></b></p>
              </td>
            </tr>
          </tbody>
        </table>
        <p class="MsoNormal"><span lang="EN-US"><o:p>&nbsp;</o:p></span></p>
      </div>
      <pre wrap="">
<fieldset class="mimeAttachmentHeader"></fieldset>
_______________________________________________
Users mailing list
<a class="moz-txt-link-abbreviated" href="mailto:Users@lists.opensips.org">Users@lists.opensips.org</a>
<a class="moz-txt-link-freetext" href="http://lists.opensips.org/cgi-bin/mailman/listinfo/users">http://lists.opensips.org/cgi-bin/mailman/listinfo/users</a>
</pre>
    </blockquote>
  </body>
</html>