[OpenSIPS-Users] Wrong socket selected by proxy when forwarding requests

Bogdan-Andrei Iancu bogdan at opensips.org
Mon Aug 22 13:03:04 CEST 2011

Hi Jan,

By default OpenSIPS is preserving the socket interface (the outbound 
interface is the same as inbound interface). A change in the interface 
is done only if explicitly required from script via functions (like 
force_send_socket() or lookup(location)) or because of double 
Record-Routing in the message.

What may happen is an improper usage of mhomed param - usually this is 
used for multi interfaces with different IPs - it cannot make 
distinction between interfaces with same IP but different ports. So, it 
will simply use the first interface that matches the needed IP (in this 
case the 5060 port interface)


On 08/19/2011 08:42 PM, Jan Blom wrote:
> Hi Bogdan,
> Yes!
> Best regards,
> Jan
> -----Original Message-----
> From: Bogdan-Andrei Iancu [mailto:bogdan at opensips.org]
> Sent: den 19 augusti 2011 17:20
> To: OpenSIPS users mailling list
> Cc: Jan Blom
> Subject: Re: [OpenSIPS-Users] Wrong socket selected by proxy when forwarding requests
> Hi Jam,
> So, what you say is that the A sends ACK on 5002 to opensips and opensips sends it to B via 5060 port ?
> Regards,
> Bogdan
> On 08/15/2011 03:56 PM, Jan Blom wrote:
>> Hello,
>> I have noticed a problem when using mhomed=1. The problem was discovered in 1.6.3, but has also been verified in 1.7.0-beta.
>> I have Opensips (only) listening on two ports on the same IP address. Obviously this doesn't require mhomed=1, but that was a leftover from an older setup. And I wasn't expecting it to cause trouble anyway.
>> This is a snippet from the opensips.cfg:
>> 	auto_aliases=no
>> 	mhomed=1
>> 	listen=udp:178.16.xxx.xxx:5060
>> 	listen=udp:178.16.xxx.xxx:5002
>> I have two user agents that register with the proxy, both using port 5002. In the socket field from the subscriber table, I can verify that both are correctly associated with port 5002 (having value udp:178.16.xxx.xxx:5002).
>> User agent A then calls user agent B, again by sending the INVITE to port 5002. The INVITE request is properly forwarded to user agent B, using src port 5002.
>> However, the ACK request sent when B answers and the BYE request when B hangs up will both, incorrectly, be forwarded by the proxy using src port 5060. The wrong socket is selected by the proxy.
>> This will then prevent proper call setup and termination if any NAT is present.
>> If I remove the mhomed=1 setting, the problem will disappear.
>> So this is currently not a problem for me since the workaround exists. However, it might be a problem for others as well, where you potentially do need a multi-homed setup.
>> Best regards,
>> Jan Blom
>> People Interactive
>> _______________________________________________
>> Users mailing list
>> Users at lists.opensips.org
>> http://lists.opensips.org/cgi-bin/mailman/listinfo/users
> --
> Bogdan-Andrei Iancu
> OpenSIPS eBootcamp - 19th of September 2011 OpenSIPS solutions and "know-how"

Bogdan-Andrei Iancu
OpenSIPS eBootcamp - 19th of September 2011
OpenSIPS solutions and "know-how"

More information about the Users mailing list