<!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 bgcolor="#ffffff" text="#000000">
    Hello,<br>
    <br>
    On 4/11/11 5:49 PM, Alejandro Rios P. wrote:
    <blockquote
      cite="mid:BANLkTin6Zpp9QDFX5visqvvY_-_O3tR5kQ@mail.gmail.com"
      type="cite">Hi Daniel<br>
      <br>
      You may want to kill me but I'll be honest,</blockquote>
    you should do that from the first place, so we do not lose time for
    nothing, checking source code which is not even used. For this
    combination you are on your own, it is supposed you know what you do
    and have the knowledge to troubleshoot -- the relaying itself is in
    the tm module, uac module just fills some structure and calls tm
    function.<br>
    <br>
    Cheers,<br>
    Daniel<br>
    &nbsp;<br>
    <blockquote
      cite="mid:BANLkTin6Zpp9QDFX5visqvvY_-_O3tR5kQ@mail.gmail.com"
      type="cite"> I'm actually using kamailio's 1.5 UAC module on an
      Opensips 1.6.2 &nbsp; :$&nbsp;&nbsp; so I don't know if the problem could be
      related to that.&nbsp; Anyway, here is the bad register message when
      using only $uac_req(ruri)="sip:<a moz-do-not-send="true"
        href="http://8.14.80.37:5061">8.14.80.37:5061</a>".&nbsp;&nbsp; Note that
      the SIP part itself its correct, but the UDP destination port is
      wrong:<br>
      <br>
      <br>
      Internet Protocol, Src: 8.14.80.16 (8.14.80.16), Dst: 8.14.80.37
      (8.14.80.37)<br>
      User Datagram Protocol, Src Port: sip-tls (5061), Dst Port: sip
      (5060)<br>
      C%E@@PP%<br>
      REGISTER sip:<a moz-do-not-send="true"
        href="http://8.14.80.37:5061">8.14.80.37:5061</a> SIP/2.0<br>
      Via: SIP/2.0/UDP 8.14.80.16:5061;branch=z9hG4bK9b35.3e435b31.0<br>
      To: <a moz-do-not-send="true"
        href="mailto:sip%3ALV-SKRUPPA@8.14.80.37">sip:LV-SKRUPPA@8.14.80.37</a><br>
      From: &lt;<a moz-do-not-send="true"
        href="mailto:sip%3ALV-SKRUPPA@8.14.80.37">sip:LV-SKRUPPA@8.14.80.37</a>&gt;;tag=a649c0188a5a7b7f4a4dfeaea88004c3-b5bd<br>
      CSeq: 10 REGISTER<br>
      Call-ID: <a moz-do-not-send="true"
        href="mailto:52d42e13484b4229-29572@8.14.80.16">52d42e13484b4229-29572@8.14.80.16</a><br>
      Content-Length: 0<br>
      User-Agent: OpenSIPS (1.6.2-notls (x86_64/linux))<br>
      Contact: &lt;<a moz-do-not-send="true"
        href="http://sip:LV-SKRUPPA@8.14.80.16:5061">sip:LV-SKRUPPA@8.14.80.16:5061</a>&gt;<br>
      Expires: 60<br>
      <br>
      <br>
      I hope this can be of any help.<br>
      <br>
      Kind regards,<br>
      <br>
      <br clear="all">
      Alejandro Rios Pe&ntilde;a<br>
      <br>
      <font size="1"><br>
        DISCLAIMER: The opinions expressed are my own, and not
        necessarily those of my employer.</font><br>
      <a moz-do-not-send="true" href="http://www.avatar.com.co"
        target="_blank"><br>
      </a><br>
      <br>
      <br>
      <div class="gmail_quote">2011/4/11 Daniel-Constantin Mierla <span
          dir="ltr">&lt;<a moz-do-not-send="true"
            href="mailto:miconda@gmail.com">miconda@gmail.com</a>&gt;</span><br>
        <blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt
          0.8ex; border-left: 1px solid rgb(204, 204, 204);
          padding-left: 1ex;">
          <div bgcolor="#ffffff" text="#000000"> Hello,
            <div class="im"><br>
              <br>
              On 4/8/11 6:14 PM, Alejandro Rios P. wrote:
              <blockquote type="cite">Hello Daniel<br>
                <br>
                Thanks for pointing out to the SIP traces. I found out
                that it if the request is to be sent to a destination
                using a port other than 5060, it is required to add the
                $uac_req(ouri) parameter too:<br>
                <br>
                $uac_req(ouri)="sip:" + $var(asterisk_ip) + ":" +
                $var(asterisk_port);<br>
                ....<br>
                <br>
                $uac_req(ouri)="sip:" + $var(asterisk2_ip) + ":" +
                $var(asterisk2_port);<br>
              </blockquote>
            </div>
            Interesting, it should work when changing the 'ruri'
            attribute as well. Can you send a sip trace with changed
            r-uri for the two requests that go to wrong destination?<br>
            <br>
            Thanks,<br>
            Daniel<br>
            <blockquote type="cite">
              <div>
                <div class="h5"><br>
                  <br>
                  Thanks!<br>
                  <br clear="all">
                  Alejandro Rios Pe&ntilde;a<br>
                  <br>
                  <font size="1"><br>
                    DISCLAIMER: The opinions expressed are my own, and
                    not necessarily those of my employer.</font><br>
                  <a moz-do-not-send="true"
                    href="http://www.avatar.com.co" target="_blank"><br>
                  </a><br>
                  <br>
                  <br>
                  <div class="gmail_quote">2011/4/8 Daniel-Constantin
                    Mierla <span dir="ltr">&lt;<a
                        moz-do-not-send="true"
                        href="mailto:miconda@gmail.com" target="_blank">miconda@gmail.com</a>&gt;</span><br>
                    <blockquote class="gmail_quote" style="margin: 0pt
                      0pt 0pt 0.8ex; border-left: 1px solid rgb(204,
                      204, 204); padding-left: 1ex;"> Hello,
                      <div>
                        <div><br>
                          <br>
                          On 4/8/11 12:28 AM, Alejandro Rios P. wrote:<br>
                          <blockquote class="gmail_quote" style="margin:
                            0pt 0pt 0pt 0.8ex; border-left: 1px solid
                            rgb(204, 204, 204); padding-left: 1ex;"> <br>
                            Hi all,<br>
                            <br>
                            I am testing the scenario described here: <a
                              moz-do-not-send="true"
href="http://kb.asipto.com/asterisk:realtime:kamailio-3.1.x-asterisk-1.6.2-astdb"
                              target="_blank">http://kb.asipto.com/asterisk:realtime:kamailio-3.1.x-asterisk-1.6.2-astdb</a><br>
                            <br>
                            It works great with one instance of
                            Asterisk, but now that I'm testing with two
                            Asterisk instances to load balance, and I
                            see a problem regarding the registration
                            forwarding to the second Asterisk.<br>
                            <br>
                            I tried adding a second "uac_req_send()"
                            bellow the first one, but Kamailio only
                            sends the first request and the REGISTER
                            never gets to the second Asterisk:<br>
                            <br>
                            # Forward REGISTER to Asterisk<br>
                            route[REGFWD] &nbsp;{<br>
                            &nbsp; &nbsp; &nbsp; &nbsp;if(!is_method("REGISTER"))<br>
                            &nbsp; &nbsp; &nbsp; &nbsp;{<br>
                            &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;return;<br>
                            &nbsp; &nbsp; &nbsp; &nbsp;}<br>
                            &nbsp; &nbsp; &nbsp; &nbsp;$var(rip) &nbsp;=
                            &nbsp;$sel(cfg_get.asterisk.bindip);<br>
                            &nbsp; &nbsp; &nbsp; &nbsp;$uac_req(method)="REGISTER";<br>
                            &nbsp; &nbsp; &nbsp; &nbsp;$uac_req(ruri)="sip:" &nbsp;+ &nbsp;$var(rip)
                            &nbsp;+ &nbsp;":" &nbsp;+ &nbsp;$sel(cfg_get.asterisk.bindport);<br>
                            &nbsp; &nbsp; &nbsp; &nbsp;$uac_req(furi)="sip:" &nbsp;+ &nbsp;$au+ &nbsp;"@"
                            &nbsp;+ &nbsp;$var(rip);<br>
                            &nbsp; &nbsp; &nbsp; &nbsp;$uac_req(turi)="sip:" &nbsp;+ &nbsp;$au+ &nbsp;"@"
                            &nbsp;+ &nbsp;$var(rip);<br>
                            &nbsp; &nbsp; &nbsp; &nbsp;$uac_req(hdrs)="Contact:&lt;sip:" &nbsp;+
                            &nbsp;$au+ &nbsp;"@"<br>
                            &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;+
                            &nbsp;$sel(cfg_get.kamailio.bindip)<br>
                            &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;+ &nbsp;":" &nbsp;+
                            &nbsp;$sel(cfg_get.kamailio.bindport) &nbsp;+
                            &nbsp;"&gt;\r\n";<br>
                            &nbsp; &nbsp; &nbsp; &nbsp;if($sel(contact.expires) &nbsp;!= &nbsp;$null)<br>
                            &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;$uac_req(hdrs)=
                            &nbsp;$uac_req(hdrs) &nbsp;+ &nbsp;"Expires:" &nbsp;+
                            &nbsp;$sel(contact.expires) &nbsp;+ &nbsp;"\r\n";<br>
                            &nbsp; &nbsp; &nbsp; &nbsp;else<br>
                            &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;$uac_req(hdrs)=
                            &nbsp;$uac_req(hdrs) &nbsp;+ &nbsp;"Expires:" &nbsp;+
                            &nbsp;$hdr(Expires) &nbsp;+ &nbsp;"\r\n";<br>
                            &nbsp; &nbsp; &nbsp; &nbsp;uac_req_send();<br>
                            <br>
                            &nbsp; &nbsp; &nbsp; &nbsp; $uac_req(all) = null;<br>
                            <br>
                            &nbsp; &nbsp; &nbsp; &nbsp;$var(rip2) &nbsp;=
                            &nbsp;$sel(cfg_get.asterisk2.bindip);<br>
                            &nbsp; &nbsp; &nbsp; &nbsp;$uac_req(method)="REGISTER";<br>
                            &nbsp; &nbsp; &nbsp; &nbsp;$uac_req(ruri)="sip:" &nbsp;+ &nbsp;$var(rip2)
                            &nbsp;+ &nbsp;":" &nbsp;+
                            &nbsp;$sel(cfg_get.asterisk2.bindport);<br>
                            &nbsp; &nbsp; &nbsp; &nbsp;$uac_req(furi)="sip:" &nbsp;+ &nbsp;$au+ &nbsp;"@"
                            &nbsp;+ &nbsp;$var(rip2);<br>
                            &nbsp; &nbsp; &nbsp; &nbsp;$uac_req(turi)="sip:" &nbsp;+ &nbsp;$au+ &nbsp;"@"
                            &nbsp;+ &nbsp;$var(rip2);<br>
                            &nbsp; &nbsp; &nbsp; &nbsp;$uac_req(hdrs)="Contact:&lt;sip:" &nbsp;+
                            &nbsp;$au+ &nbsp;"@"<br>
                            &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;+
                            &nbsp;$sel(cfg_get.kamailio.bindip)<br>
                            &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;+ &nbsp;":" &nbsp;+
                            &nbsp;$sel(cfg_get.kamailio.bindport) &nbsp;+
                            &nbsp;"&gt;\r\n";<br>
                            &nbsp; &nbsp; &nbsp; &nbsp;if($sel(contact.expires) &nbsp;!= &nbsp;$null)<br>
                            &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;$uac_req(hdrs)=
                            &nbsp;$uac_req(hdrs) &nbsp;+ &nbsp;"Expires:" &nbsp;+
                            &nbsp;$sel(contact.expires) &nbsp;+ &nbsp;"\r\n";<br>
                            &nbsp; &nbsp; &nbsp; &nbsp;else<br>
                            &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;$uac_req(hdrs)=
                            &nbsp;$uac_req(hdrs) &nbsp;+ &nbsp;"Expires:" &nbsp;+
                            &nbsp;$hdr(Expires) &nbsp;+ &nbsp;"\r\n";<br>
                            &nbsp; &nbsp; &nbsp; &nbsp;uac_req_send();<br>
                            <br>
                            }<br>
                            <br>
                            I also tried appending another branch and
                            sending the second &nbsp;uac_req_send() from
                            there, but it is not being sent.<br>
                            <br>
                            How can I use uac_req_send() several times
                            for the same request or in parallel?<br>
                          </blockquote>
                        </div>
                      </div>
                      it should work one after the other.
                      append_branch() does not affect uac_req_send() at
                      all, this is a separate request built from
                      scratch.<br>
                      <br>
                      Do you get any error message in the syslog? Can
                      you watch the traffic on all interfaces 'ngrep -d
                      any -qt -W byline port 5060' ?<br>
                      <br>
                      I see you assign '$uac_req(all) = null;', it
                      should be '$uac_req(all) = $null;' - but I guess
                      it was a copy&amp;paste thing.<br>
                      <br>
                      Cheers,<br>
                      Daniel<br>
                      <font color="#888888"> <br>
                        -- <br>
                        Daniel-Constantin Mierla<br>
                        <a moz-do-not-send="true"
                          href="http://www.asipto.com" target="_blank">http://www.asipto.com</a><br>
                        <br>
                      </font></blockquote>
                  </div>
                  <br>
                </div>
              </div>
              <pre><fieldset></fieldset>
_______________________________________________
SIP Express Router (SER) and Kamailio (OpenSER) - sr-users mailing list
<a moz-do-not-send="true" href="mailto:sr-users@lists.sip-router.org" target="_blank">sr-users@lists.sip-router.org</a>
<a moz-do-not-send="true" href="http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users" target="_blank">http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users</a>
</pre>
            </blockquote>
            <div class="im"> <br>
              <pre cols="72">-- 
Daniel-Constantin Mierla
<a moz-do-not-send="true" href="http://www.asipto.com" target="_blank">http://www.asipto.com</a></pre>
            </div>
          </div>
        </blockquote>
      </div>
      <br>
    </blockquote>
    <br>
    <pre class="moz-signature" cols="72">-- 
Daniel-Constantin Mierla
<a class="moz-txt-link-freetext" href="http://www.asipto.com">http://www.asipto.com</a></pre>
  </body>
</html>