Hi Bogdan, I knew that Nathelper did some rewriting, but the circumstances required that the thing record the private IP and a certain known port instead of the public IP as a contact address (using fix_nated_register() to save the other address). I wound up borrowing the code from the Nathelper module and modifying it to accept a port argument and made it a separate module. This way, it only rewrote the port and not left everything else untouched.
Thanks. Justin Pearce Information Technology/Programming Price Video Productions [EMAIL PROTECTED] 361-572-3810 800-733-3810 Fax: 361-572-3894 www.PriceVideo.com -----Original Message----- From: Bogdan-Andrei Iancu [mailto:[EMAIL PROTECTED] Sent: Monday, August 21, 2006 6:19 AM To: Justin Pearce Cc: Klaus Darilion; [email protected] Subject: Re: [Users] Rewriting Contact HF port Hi Justin, if you need save(location) to save as "received" a custom uri, you just need to set an avp with the uri you need to be saved. See: http://openser.org/docs/modules/1.1.x/registrar.html#AEN211 It's exactly what nathelper does. regards, bogdan Justin Pearce wrote: >Thanks, Klaus > >It looks like I'll have to make something similar to the nathelper >module to do what I need. > >Justin Pearce > >-----Original Message----- >From: Klaus Darilion [mailto:[EMAIL PROTECTED] >Sent: Monday, August 07, 2006 1:43 AM >To: Justin Pearce >Cc: [email protected] >Subject: Re: [Users] Rewriting Contact HF port > >Justin Pearce wrote: > > >>I am wondering if there is a good way to rewrite the port in the >> >> >contact > > >>header in OpenSER 1.0.1 >> >> > >1. Why do you want to rewrite the port to fixed port? NAT problems? > > > >>before it is stored in the location table?(I'm using the MySQL >> >> >database > > >>backend). >> >>Thus far, I am using "subst(/^(Contact.+):[0-9]+(.+)$/\1:5060\2/ig);" >>just before I do >> >>"save("location");", but that does not seem to be working. >> >> > >subst will be applied before the message is forwarded. Thus, save() sees > >the original Contact header. You either loop the modified message to the > >SIP proxy again or you write your own function (similar to the function >in nathelper module) > >regards >klaus > > > >> >> >>Suggestions? >> >> >> >>Justin Pearce >> >>Information Technology/Programming >> >>Price Video Productions >> >>[EMAIL PROTECTED] <mailto:[EMAIL PROTECTED]> >> >>361-572-3810 >> >>800-733-3810 >> >>Fax: 361-572-3894 >> >>www.PriceVideo.com >> >> >> >> >> >> >> >----------------------------------------------------------------------- - > > >>_______________________________________________ >>Users mailing list >>[email protected] >>http://openser.org/cgi-bin/mailman/listinfo/users >> >> > > >_______________________________________________ >Users mailing list >[email protected] >http://openser.org/cgi-bin/mailman/listinfo/users > > > _______________________________________________ Users mailing list [email protected] http://openser.org/cgi-bin/mailman/listinfo/users
