<html>
  <head>
    <meta content="text/html; charset=ISO-8859-1"
      http-equiv="Content-Type">
  </head>
  <body bgcolor="#FFFFFF" text="#000000">
    Hello,<br>
    <br>
    I haven't understood exactly what you tried? Was it use of
    force_send_socket(...) in onreply_route and didn't work? If yes,
    what version are you runing, there was a fix for such case some time
    ago:<br>
    <br>
<a class="moz-txt-link-freetext" href="http://git.sip-router.org/cgi-bin/gitweb.cgi/sip-router/?a=commit;h=9dbf735878acc87bab1a0740476f1d106f89412f">http://git.sip-router.org/cgi-bin/gitweb.cgi/sip-router/?a=commit;h=9dbf735878acc87bab1a0740476f1d106f89412f</a><br>
    <br>
    Cheers,<br>
    Daniel<br>
    <br>
    On 10/13/11 1:00 AM, Jijo wrote:
    <blockquote
cite="mid:CAOYmDE8A1dcm906=gJATtHMerW458qOareDWha-0CjmFZKu=7A@mail.gmail.com"
      type="cite">
      <div>Hi All,</div>
      <div><br>
        Our system has two IP address, one is used for kamailio and&nbsp;2nd
        one is used for data. </div>
      <div>The problem is suppose a request came&nbsp;in to kamailio on a&nbsp;TCP
        connection with first IP address and connection is&nbsp;torned down
        before sending the response. Later when the response is send
        out&nbsp; kamialio is using the 2nd IP to create the connection. The
        reason is kamailio doesn't have force socket in in reply, so it
        uses INADDR_ANY for soruce addres .so kernel uses source address
        based on the detaintion IP.</div>
      <div>&nbsp;</div>
      <div>I tired to force the socket using pseudo variable $fs or
        force_send_socket(), but neither of them worked from
        reply_route. </div>
      <div>&nbsp;</div>
      <div>So i modfied the code relay_replay to&nbsp;set the
        SND_F_FORCE_SOCKET which will use the address where request is
        recieved&nbsp; as source address to make the TCP connection&nbsp;&nbsp;The code
        change is shown below. </div>
      <div>&nbsp;</div>
      <div>Please let me know is there anyother way&nbsp;we could acheive it?</div>
      <div>&nbsp;</div>
      <div>&nbsp;</div>
      <div><font face="courier new,monospace">&nbsp;&nbsp;&nbsp;}else{<br>
          &nbsp;&nbsp;&nbsp;&nbsp;buf = build_res_buf_from_sip_res( relayed_msg,
          &amp;res_len );<br>
          &nbsp;&nbsp;&nbsp;&nbsp;/* if we build a message from shmem, we need to remove<br>
          &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; via delete lumps which are now stirred in the shmem-ed<br>
          &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; structure<br>
          &nbsp;&nbsp;&nbsp;&nbsp;*/<font style="BACKGROUND-COLOR: #ffffff"><br>
          </font>&nbsp;&nbsp;&nbsp;&nbsp;if (branch!=relay) {<br>
          &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;free_via_clen_lump(&amp;relayed_msg-&gt;add_rm);<br>
          &nbsp;&nbsp;&nbsp;&nbsp;}<br>
          &nbsp;&nbsp;&nbsp;&nbsp;/* update send_flags with possible additions from the<br>
          &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; reply route */<br>
          &nbsp;&nbsp;&nbsp;&nbsp;SND_FLAGS_OR(&amp;uas_rb-&gt;dst.send_flags,
          &amp;uas_rb-&gt;dst.send_flags,<br>
          &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&amp;relayed_msg-&gt;rpl_send_flags);<br>
          <font style="BACKGROUND-COLOR: #ffffff"><font color="#000000"><font
                style="BACKGROUND-COLOR: #ffffff">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; /*
                Make the</font><font style="BACKGROUND-COLOR: #ffffff">
                response to use the same IP where it receives the
                message */</font></font></font></font><font
          style="BACKGROUND-COLOR: #ffffff" color="#000000"
          face="courier new,monospace">&nbsp;&nbsp;</font></div>
      <div><font face="courier new,monospace">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<strong> </strong></font></div>
      <div><font face="courier new,monospace"><strong>&nbsp;&nbsp;&nbsp;&nbsp; <font
              style="BACKGROUND-COLOR: #ffff66">uas_rb-&gt;dst.send_flags.f
              |= SND_F_FORCE_SOCKET;&nbsp;</font></strong></font></div>
      <div><font face="courier new,monospace">&nbsp; }</font></div>
      <div>&nbsp;</div>
      <div><font face="Courier New">Thanks</font></div>
      <div><font face="Courier New">JIjo</font></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>
Kamailio Advanced Training, Dec 5-8, Berlin: <a class="moz-txt-link-freetext" href="http://asipto.com/u/kat">http://asipto.com/u/kat</a>
<a class="moz-txt-link-freetext" href="http://linkedin.com/in/miconda">http://linkedin.com/in/miconda</a> -- <a class="moz-txt-link-freetext" href="http://twitter.com/miconda">http://twitter.com/miconda</a></pre>
  </body>
</html>