Hello,<br><br>Please find the diff. t_reply_A.c is the orginal and t_reply_B.c is the modified file.<br><br>--- t_reply_A.c 2011-10-14 10:05:45.093352500 -0400<br>+++ t_reply_B.c 2011-10-16 01:10:53.179916800 -0400<br>@@ -1726,6 +1726,8 @@<br>
                                   reply route */<br>                                SND_FLAGS_OR(&amp;uas_rb-&gt;dst.send_flags, &amp;uas_rb-&gt;dst.send_flags,<br>                                                                &amp;relayed_msg-&gt;rpl_send_flags);<br>
+                                /* Make the response to use the same IP where it receives the message */<br>+                                uas_rb-&gt;dst.send_flags.f |= SND_F_FORCE_SOCKET;<br>                        }<br>
                }<br>                update_reply_stats( relayed_code );<br><br><br>Thanks<br>JIjo<br><br><div class="gmail_quote">On Fri, Oct 14, 2011 at 9:56 AM, Daniel-Constantin Mierla <span dir="ltr">&lt;<a href="mailto:miconda@gmail.com">miconda@gmail.com</a>&gt;</span> wrote:<br>
<blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
  
    
  
  <div bgcolor="#FFFFFF" text="#000000">
    Hello,<br>
    <br>
    can you send the patch with &#39;git diff&#39; or &#39;diff -u&#39; -- it will be
    easier to apply and analyze it. Once I get it, I will look over the
    case you reported in more details.<br>
    <br>
    Thanks,<br><font color="#888888">
    Daniel</font><div><div></div><div class="h5"><br>
    <br>
    On 10/13/11 10:23 PM, Jijo wrote:
    <blockquote type="cite">Hi Daniel..<br>
      <br>
      I&#39;m using version 3.1.0. I looked at the change but its done only
      for forward_reply.. How about relay_reply()?<br>
      <br>
      Thanks<br>
      Jijo<br>
      <br>
      <div class="gmail_quote">On Thu, Oct 13, 2011 at 3:41 PM,
        Daniel-Constantin Mierla <span dir="ltr">&lt;<a href="mailto:miconda@gmail.com" target="_blank">miconda@gmail.com</a>&gt;</span>
        wrote:<br>
        <blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
          <div bgcolor="#FFFFFF" text="#000000"> Hello,<br>
            <br>
            I haven&#39;t understood exactly what you tried? Was it use of
            force_send_socket(...) in onreply_route and didn&#39;t work? If
            yes, what version are you runing, there was a fix for such
            case some time ago:<br>
            <br>
            <a href="http://git.sip-router.org/cgi-bin/gitweb.cgi/sip-router/?a=commit;h=9dbf735878acc87bab1a0740476f1d106f89412f" target="_blank">http://git.sip-router.org/cgi-bin/gitweb.cgi/sip-router/?a=commit;h=9dbf735878acc87bab1a0740476f1d106f89412f</a><br>

            <br>
            Cheers,<br>
            Daniel
            <div>
              <div><br>
                <br>
                On 10/13/11 1:00 AM, Jijo wrote: </div>
            </div>
            <blockquote type="cite">
              <div>
                <div>
                  <div>Hi All,</div>
                  <div><br>
                    Our system has two IP address, one is used for
                    kamailio and 2nd one is used for data. </div>
                  <div>The problem is suppose a request came in to
                    kamailio on a TCP connection with first IP address
                    and connection is torned down before sending the
                    response. Later when the response is send out 
                    kamialio is using the 2nd IP to create the
                    connection. The reason is kamailio doesn&#39;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> </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> </div>
                  <div>So i modfied the code relay_replay to set the
                    SND_F_FORCE_SOCKET which will use the address where
                    request is recieved  as source address to make the
                    TCP connection  The code change is shown below. </div>
                  <div> </div>
                  <div>Please let me know is there anyother way we could
                    acheive it?</div>
                  <div> </div>
                  <div> </div>
                  <div><font face="courier new,monospace">   }else{<br>
                          buf = build_res_buf_from_sip_res( relayed_msg,
                      &amp;res_len );<br>
                          /* if we build a message from shmem, we need
                      to remove<br>
                             via delete lumps which are now stirred in
                      the shmem-ed<br>
                             structure<br>
                          */<font style="background-color: rgb(255, 255, 255);"><br>
                      </font>    if (branch!=relay) {<br>
     free_via_clen_lump(&amp;relayed_msg-&gt;add_rm);<br>
                          }<br>
                          /* update send_flags with possible additions
                      from the<br>
                             reply route */<br>
                          SND_FLAGS_OR(&amp;uas_rb-&gt;dst.send_flags,
                      &amp;uas_rb-&gt;dst.send_flags,<br>
                              &amp;relayed_msg-&gt;rpl_send_flags);<br>
                      <font style="background-color: rgb(255, 255, 255);"><font color="#000000"><font style="background-color: rgb(255, 255, 255);">                /* Make the</font><font style="background-color: rgb(255, 255, 255);"> response to use the same IP where it
                            receives the message */</font></font></font></font><font style="background-color: rgb(255, 255, 255);" color="#000000" face="courier new,monospace">  </font></div>
                  <div><font face="courier new,monospace">           <b>
                      </b></font></div>
                  <div><font face="courier new,monospace"><b>     <font style="background-color: rgb(255, 255, 102);">uas_rb-&gt;dst.send_flags.f

                          |= SND_F_FORCE_SOCKET; </font></b></font></div>
                  <div><font face="courier new,monospace">  }</font></div>
                  <div> </div>
                  <div><font face="Courier New">Thanks</font></div>
                  <div><font face="Courier New">JIjo</font></div>
                  <br>
                  <fieldset></fieldset>
                  <br>
                </div>
              </div>
              <pre>_______________________________________________
SIP Express Router (SER) and Kamailio (OpenSER) - sr-users mailing list
<a href="mailto:sr-users@lists.sip-router.org" target="_blank">sr-users@lists.sip-router.org</a>
<a 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>
            <font color="#888888"> <br>
              <pre cols="72">-- 
Daniel-Constantin Mierla -- <a href="http://www.asipto.com" target="_blank">http://www.asipto.com</a>
Kamailio Advanced Training, Dec 5-8, Berlin: <a href="http://asipto.com/u/kat" target="_blank">http://asipto.com/u/kat</a>
<a href="http://linkedin.com/in/miconda" target="_blank">http://linkedin.com/in/miconda</a> -- <a href="http://twitter.com/miconda" target="_blank">http://twitter.com/miconda</a></pre>
            </font></div>
        </blockquote>
      </div>
      <br>
    </blockquote>
    <br>
    <pre cols="72">-- 
Daniel-Constantin Mierla -- <a href="http://www.asipto.com" target="_blank">http://www.asipto.com</a>
Kamailio Advanced Training, Dec 5-8, Berlin: <a href="http://asipto.com/u/kat" target="_blank">http://asipto.com/u/kat</a>
<a href="http://linkedin.com/in/miconda" target="_blank">http://linkedin.com/in/miconda</a> -- <a href="http://twitter.com/miconda" target="_blank">http://twitter.com/miconda</a></pre>
  </div></div></div>

</blockquote></div><br>