[OpenSIPS-Users] Problem Contact URI

Bogdan-Andrei Iancu bogdan at voice-system.ro
Tue Dec 28 15:21:18 CET 2010


Lionel Sicilia wrote:
>> Use only fix_nated_register() for REGISTER requests. After the change,
>> be sure you discard all bogus records from your user location (stop
>> opensips, purge "location" table, start opensips).
>>
>> Regards,
>> Bogdan
>>
>>
>>     
>>> Regards,
>>>
>>>       
>
>
> Test the setup, but I had no success, although fix_nated_register ()
> seems to work correctly, I see this in the amount of $avp(i:42),
> but in the "contact"table "location " The port is duplicate.
>
> What can be causing this problem?
>
>   
Check that:

1) you are not receiving (in REGISTER) an already bogus contact (with 2 
ports)

2) you are not doing by mistake another fix_nated_contact in other parts 
of the script (not REGISTER related blocks, maybe)


>
> TABLE LOCATION
> --------------
>
> id	username	domain	contact							received	path	expires			q	
> 11	7020			sip:7020 at 190.178.192.68:13262:13262;transport=UDP	
> 			28-dic-2010 11:14:48	-1
>
>
> callid					cseq	last_modified		flags	cflags	user_agent	socket	methods
> 73a077f520f4410999ec7f964d4828fc	18512	28-dic-2010
> 11:09:48	0	0	n/a		udp:192.168.2.21:5060
>   

Something is wrong here. Normally, if using only fix_nated_register(), 
you should have:
    - private contact (as received in REGISTER) in "contact" column
    - public NAT ip (src of REGISTER) in "received" column

I your case you have only a "contact" value which is public :-/.....It 
looks like your fix_nated_register() has no effect, but a 
fix_nated_contact() does (maybe in other parts of the script).

(see below)

> LOG OPENSIPS
> --------------
>
> Dec 28 10:44:14 jerif opensips[1397]: DBG:registrar:build_contact:
> created Contact HF: Contact:
> <sip:7020 at 190.178.192.68:12344:12344;transport=UDP>;expires=181,
> <sip:7020 at 192.168.2.84:11675>;expires=200,
> <sip:7020 at 192.168.2.84:13100>;expires=220,
> <sip:7020 at 192.168.2.84:16838>;expires=263,
> <sip:7020 at 190.178.192.68:12534>;expires=300^M
>
>
> SET opensips.cfg
> ----------------
>
>
> loadmodule "nathelper.so"
> modparam("nathelper", "received_avp", "$avp(i:42)")
>   

Also add here

modparam("registrar", "received_avp", "$avp(i:42)")  





> ..............
> ..............
>
>
> if (is_method("REGISTER"))
> {
> 	fix_nated_register();
>         xlog("...................RESULT FIX_NATED_REGISTER -> $avp(i:42)");
>
>         # authenticate the REGISTER requests (uncomment to enable auth)
>         if (!www_authorize("", "subscriber"))
> 	{
> 		www_challenge("", "0");
>              	exit;
>         }
>
>         if (!db_check_to())
>         {
> 		sl_send_reply("403","Forbidden auth ID");
>                 exit;
>         }
>
> 	if (!save("location"))
> 		sl_reply_error();
>                 exit;
>         }
> }
>
>   

and be 100% sure you do not call any other fix_nated_contact() like 
functions for this REGISTER (maybe in some other scripting block, before 
register processing).

Regards,
Bogdan


-- 
Bogdan-Andrei Iancu
OpenSIPS Event - expo, conf, social, bootcamp
2 - 4 February 2011, ITExpo, Miami,  USA
www.voice-system.ro




More information about the Users mailing list