[OpenSER-Users] OpenSER corrects the "Contact" field only one way.

Iñaki Baz Castillo ibc at in.ilimit.es
Tue May 27 09:57:42 CEST 2008


El Monday 26 May 2008 20:28:05 Höskuldur escribió:
> Hi
>
> I have two user clients behind separate NAT networks. My OpenSER is
> directly connected to the Internet and has it's own external IP address.
>
> Both clients are using STUN to get their external IP address and correct
> port for SIP messages.
>
> They successfully register with Openser, which is using Nathelper module
> and Mediaproxy.
>
> In this case, since the client is behind NAT, it puts the wrong port in the
> Contact field of a SIP message.
>
> As a result, SOME SIP messages from OpenSER are never received by the
> client.
>
> But with the help of Nathelper, OpenSER should correct the port in Contact
> field, by replacing the NAT port with the src port of a SIP message (UDP
> pack).
>
> The problem is, that it looks like OpenSER only corrects the port in
> Contact field for client A (The one who initiates the call) but not Client
> B(The one who's called).


Try this in onreply_route[2]:

	if (status =~ "(180)|(183)|2[0-9][0-9]") {
		if (isbflagset(BFLAG_NAT_CALLED) || nat_uac_test("1")) {
			xlog("L_INFO", "--- NAT detected\n");
			fix_nated_contact();
		}
		use_media_proxy();
	}


Tell me if it works.

-- 
Iñaki Baz Castillo
ibc at in.ilimit.es




More information about the Users mailing list