[SR-Users] Force socket on reply

Daniel-Constantin Mierla miconda at gmail.com
Thu Oct 13 21:41:59 CEST 2011


Hello,

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:

http://git.sip-router.org/cgi-bin/gitweb.cgi/sip-router/?a=commit;h=9dbf735878acc87bab1a0740476f1d106f89412f

Cheers,
Daniel

On 10/13/11 1:00 AM, Jijo wrote:
> Hi All,
>
> Our system has two IP address, one is used for kamailio and 2nd one is 
> used for data.
> 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'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.
> I tired to force the socket using pseudo variable $fs or 
> force_send_socket(), but neither of them worked from reply_route.
> 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.
> Please let me know is there anyother way we could acheive it?
>    }else{
>     buf = build_res_buf_from_sip_res( relayed_msg, &res_len );
>     /* if we build a message from shmem, we need to remove
>        via delete lumps which are now stirred in the shmem-ed
>        structure
>     */
>     if (branch!=relay) {
>      free_via_clen_lump(&relayed_msg->add_rm);
>     }
>     /* update send_flags with possible additions from the
>        reply route */
>     SND_FLAGS_OR(&uas_rb->dst.send_flags, &uas_rb->dst.send_flags,
> &relayed_msg->rpl_send_flags);
>                 /* Make theresponse to use the same IP where it 
> receives the message */
> **
> *uas_rb->dst.send_flags.f |= SND_F_FORCE_SOCKET; *
>   }
> Thanks
> JIjo
>
>
> _______________________________________________
> SIP Express Router (SER) and Kamailio (OpenSER) - sr-users mailing list
> sr-users at lists.sip-router.org
> http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users

-- 
Daniel-Constantin Mierla -- http://www.asipto.com
Kamailio Advanced Training, Dec 5-8, Berlin: http://asipto.com/u/kat
http://linkedin.com/in/miconda -- http://twitter.com/miconda

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.sip-router.org/pipermail/sr-users/attachments/20111013/08eaa30e/attachment.htm>


More information about the sr-users mailing list