[Users] rewrite contact field

Norman Brandinger norm at goes.com
Wed Nov 23 23:27:34 CET 2005


Please do not email me directly.  I will only respond to emails directed 
to the mailing list.

To answer the questions you directed to me privately:

1)  Perhaps if you post your complete .cfg file, someone on the list 
will be able to assist you.  There is a very good discussion of NAT 
registrations at the onsip.org web site.  Are you 100% positive that 
your code snippet is being executed during a REGISTER message ?  You 
might want to put some xlog() statements in your configuration file to 
make sure that the fix_nated_register() is being executed correctly.

2) I use a flag called FLAG_NAT_CALLER so that the rest of the 
configuration file can test the flag to determine if the CALLER is 
behind a NAT and take appropriate actions if that is the case.  In the 
code snippet you sent to me, you are using setflag(7).  I have no idea 
what this is, but I'll bet that it serves a similar purpose to my 

3) Music-on-hold works for us in the situations where it is needed.


Norman Brandinger wrote:
> Perhaps you are using fix_nat_contact() when you should be using 
> fix_nat_register().
> Note that fix_nat_register() should ONLY be called when a REGISTER 
> method has been received.
> The example below uses a couple of M4 defines, but otherwise might 
> work for you.  If you have any questions about the statements below, 
> please review the documentation available online at openser.org, 
> onsip.org or iptel.org
>  #----------------------------------------------------------------------
>  # NAT Detection
>  #----------------------------------------------------------------------
>  if (!search("^Contact:[ ]*\*") && nat_uac_test("19")) {
>    setflag(FLAG_NAT_CALLER);
>    setflag(FLAG_NAT_PING);
>    fix_nated_register();
>    force_rport();
>  };
> Regards,
> Norm
> p.s. In regard to your previous problems with devices registered to 
> Asterisk, I found that it is a much better idea to have all of the SIP 
> devices register with (Open)SER instead of Asterisk.  This solution 
> may not be right for you, but it's the way we prefer to do things.
> harry gaillac wrote:
>> I try to rewrite contact field in sip hf because of
>> fix_nat_contact() fail with this diagram
>> -----ppp0[ ser/nathelper ] eth0----private network
>>             debian 3.1
>> when agents send INVITE or REGISTER to ser which
>> listen on ppp0 the ip address in contact sip hf stay a
>> private ip address, why ?
>> I try siproxd which rewrite it .
>> how can i build a ser.cfg in order to contact in sip
>> hf will be rewritte
>> Harry
>> ___________________________________________________________________________ 
>> Appel audio GRATUIT partout dans le monde avec le nouveau Yahoo! 
>> Messenger Téléchargez cette version sur http://fr.messenger.yahoo.com
>> _______________________________________________
>> Users mailing list
>> Users at openser.org
>> http://openser.org/cgi-bin/mailman/listinfo/users
> _______________________________________________
> Users mailing list
> Users at openser.org
> http://openser.org/cgi-bin/mailman/listinfo/users

More information about the Users mailing list