<html>
  <head>
    <meta content="text/html; charset=windows-1252"
      http-equiv="Content-Type">
  </head>
  <body bgcolor="#FFFFFF" text="#000000">
    <p>Hello,</p>
    <p>dlg_bridge is not using the location table at all, because it has
      to use the contact from 200ok of INVITE.</p>
    <p>Have you used set_contact_alias() for natted 200ok received for
      INVITE?</p>
    <p>Cheers,<br>
      Daniel<br>
    </p>
    <br>
    <div class="moz-cite-prefix">On 27/04/16 11:15, huseyin kalyoncu
      wrote:<br>
    </div>
    <blockquote
cite="mid:CAPf+86WUJ_g64KhRgPiwZoXn9C+3v4Tyf3v4KGLKRy7=YCsniQ@mail.gmail.com"
      type="cite">
      <div dir="ltr">Hello Daniel
        <div><br>
        </div>
        <div>This is the sample output from our location table;</div>
        <div><br>
        </div>
        <div>
          <div>kamailio=# select username,contact,received,user_agent
            from location where username='5678*0012';</div>
          <div> username  |             contact             |      
            received        |     user_agent      </div>
          <div>-----------+---------------------------------+-----------------------+---------------------</div>
          <div> 5678*0012 | <a class="moz-txt-link-freetext" href="sip:5678*">sip:5678*</a><a moz-do-not-send="true"
              href="http://0012@192.168.1.21:5090">0012@192.168.1.21:5090</a>
            | <a class="moz-txt-link-freetext" href="sip:DEVICE_PUBLIC_ADDRESS:5090">sip:DEVICE_PUBLIC_ADDRESS:5090</a> | Cisco/SPA504G-7.6.1</div>
          <div>(1 row)</div>
          <div><br>
          </div>
          <div><br>
          </div>
          <div>After calling dlg_bridge Kamailio firing INVITE and rings
            the device.</div>
          <div>After answering on this device Kamailio firing REFER
            message.</div>
          <div>But as you can see from ngrep output below, Kamailio is
            trying to send this message to address in the contact field
            which is a private IP. </div>
          <div><br>
          </div>
          <div>U 2016/04/27 10:58:25.745935 KAMAILIO_PUBLIC_ADDRESS:5090
            -> <a moz-do-not-send="true"
              href="http://192.168.1.21:5090">192.168.1.21:5090</a></div>
          <div>REFER <a class="moz-txt-link-freetext" href="sip:5678*">sip:5678*</a><a moz-do-not-send="true"
              href="http://0012@192.168.1.21:5090">0012@192.168.1.21:5090</a>
            SIP/2.0.</div>
          <div>Via: SIP/2.0/UDP
KAMAILIO_PUBLIC_ADDRESS:5090;branch=z9hG4bK0ab8.1c5e622e4af6b7b6c9ede7ade4a50bf8.0.</div>
          <div>Via: SIP/2.0/UDP
KAMAILIO_PUBLIC_ADDRESS;rport=5060;branch=z9hG4bK0ab8.c8a54413000000000000000000000000.0.</div>
          <div>To:
            <a class="moz-txt-link-rfc2396E" href="sip:5678*0012@KAMAILIO_PUBLIC_ADDRESS"><sip:5678*0012@KAMAILIO_PUBLIC_ADDRESS></a>;tag=199aaa02310a0799i1.</div>
          <div>From:
<a class="moz-txt-link-rfc2396E" href="sip:click2call@KAMAILIO_PUBLIC_ADDRESS"><sip:click2call@KAMAILIO_PUBLIC_ADDRESS></a>;tag=0d71401ca91009b00be5953e2813d7e4-7471.</div>
          <div>CSeq: 11 REFER.</div>
          <div>Call-ID: 63dc8c8a5ea88a30-868@KAMAILIO_PUBLIC_ADDRESS.</div>
          <div>Max-Forwards: 69.</div>
          <div>Content-Length: 0.</div>
          <div>User-Agent: Kamailio.</div>
          <div>Referred-By: <a class="moz-txt-link-freetext" href="sip:click2call@KAMAILIO_PUBLIC_ADDRESS">sip:click2call@KAMAILIO_PUBLIC_ADDRESS</a>.</div>
          <div>Refer-To: <a class="moz-txt-link-freetext" href="sip:5678*0002@KAMAILIO_PUBLIC_ADDRESS">sip:5678*0002@KAMAILIO_PUBLIC_ADDRESS</a>.</div>
          <div>Contact:
            <a class="moz-txt-link-rfc2396E" href="sip:click2call@KAMAILIO_PUBLIC_ADDRESS:5060"><sip:click2call@KAMAILIO_PUBLIC_ADDRESS:5060></a>.</div>
        </div>
        <div><br>
        </div>
        <div><br>
        </div>
      </div>
      <div class="gmail_extra"><br>
        <div class="gmail_quote">On Wed, Apr 27, 2016 at 10:47 AM,
          Daniel-Constantin Mierla <span dir="ltr"><<a
              moz-do-not-send="true" href="mailto:miconda@gmail.com"
              target="_blank"><a class="moz-txt-link-abbreviated" href="mailto:miconda@gmail.com">miconda@gmail.com</a></a>></span> wrote:<br>
          <blockquote class="gmail_quote" style="margin:0 0 0
            .8ex;border-left:1px #ccc solid;padding-left:1ex">
            <div bgcolor="#FFFFFF" text="#000000">
              <p>Hello,</p>
              <p>can you send the ngrep trace for such case? I would
                like to look at the headers to understand properly what
                do you mean.</p>
              <p>Cheers,</p>
              <p>Daniel<br>
              </p>
              <div>
                <div class="h5"> <br>
                  <div>On 26/04/16 15:23, huseyin kalyoncu wrote:<br>
                  </div>
                </div>
              </div>
              <blockquote type="cite">
                <div>
                  <div class="h5">
                    <div dir="ltr">Hello
                      <div><br>
                      </div>
                      <div>I am trying to implement click 2 call
                        functionality on Kamailio with dlg_bridge.</div>
                      <div>But It seems that Kamailio routes REFER
                        messages to devices according to Contact field
                        of location table instead of Received field. </div>
                      <div>But if the the IP in the Contact field is
                        private REFER messages are failing so </div>
                      <div>does the dlg_bridge.</div>
                      <div><br>
                      </div>
                      <div><br>
                      </div>
                      <div>I called dlg_bridge in the config like this:</div>
                      <div><br>
                      </div>
                      <div>dlg_bridge(<a moz-do-not-send="true">"sip:$param1"</a>,
                        <a moz-do-not-send="true">"sip:$param2"</a>, <a
                          moz-do-not-send="true"><a class="moz-txt-link-rfc2396E" href="sip:IP_ADDRESS_OF_KAMAILIO:5060">"sip:IP_ADDRESS_OF_KAMAILIO:5060"</a></a>);<br>
                      </div>
                      <div><br>
                      </div>
                      <div>It rings the device in $param1 but after
                        answering on that device</div>
                      <div>Kamailio fails to send REFER if the Contact
                        field for that device is Private IP.</div>
                      <div>So it fails to initiate a call.</div>
                      <div><br>
                      </div>
                      <div>How can I force Kamailio to use Received
                        field for REFER messages instead of Contact
                        field?<br>
                      </div>
                      <div><br>
                      </div>
                      <div>Thanks</div>
                      <div>Huseyin</div>
                      <div><br>
                      </div>
                      <div> </div>
                    </div>
                    <br>
                    <fieldset></fieldset>
                    <br>
                  </div>
                </div>
                <pre>_______________________________________________
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><span class="HOEnZb"><font color="#888888">
</font></span></pre>
                <span class="HOEnZb"><font color="#888888"> </font></span></blockquote>
              <span class="HOEnZb"><font color="#888888"> <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>
<a moz-do-not-send="true" href="http://twitter.com/#%21/miconda" target="_blank">http://twitter.com/#!/miconda</a> - <a moz-do-not-send="true" href="http://www.linkedin.com/in/miconda" target="_blank">http://www.linkedin.com/in/miconda</a>
Kamailio World Conference, Berlin, May 18-20, 2016 - <a moz-do-not-send="true" href="http://www.kamailioworld.com" target="_blank">http://www.kamailioworld.com</a></pre>
                </font></span></div>
            <br>
            _______________________________________________<br>
            SIP Express Router (SER) and Kamailio (OpenSER) - sr-users
            mailing list<br>
            <a moz-do-not-send="true"
              href="mailto:sr-users@lists.sip-router.org">sr-users@lists.sip-router.org</a><br>
            <a moz-do-not-send="true"
              href="http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users"
              rel="noreferrer" target="_blank">http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users</a><br>
            <br>
          </blockquote>
        </div>
        <br>
      </div>
      <br>
      <fieldset class="mimeAttachmentHeader"></fieldset>
      <br>
      <pre wrap="">_______________________________________________
SIP Express Router (SER) and Kamailio (OpenSER) - sr-users mailing list
<a class="moz-txt-link-abbreviated" href="mailto:sr-users@lists.sip-router.org">sr-users@lists.sip-router.org</a>
<a class="moz-txt-link-freetext" href="http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users">http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users</a>
</pre>
    </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>
<a class="moz-txt-link-freetext" href="http://twitter.com/#!/miconda">http://twitter.com/#!/miconda</a> - <a class="moz-txt-link-freetext" href="http://www.linkedin.com/in/miconda">http://www.linkedin.com/in/miconda</a>
Kamailio World Conference, Berlin, May 18-20, 2016 - <a class="moz-txt-link-freetext" href="http://www.kamailioworld.com">http://www.kamailioworld.com</a></pre>
  </body>
</html>