[Serusers] Rewrite Contact Field

Stephen Miles SMiles at callplus.co.nz
Thu Nov 20 04:22:47 CET 2003


Hi jiri,

What we are trying to do is take a register request, save the location and then forward the register, with the contact re-writen to another SIP server. So I would register with the SER SIP Proxy using my laptops IP address and the SER would then forward my register request onto the other sip server with the contact re-writen to be jo at ser.server not jo at laptop.

Hope that make some sence...

-----Original Message-----
From: Jiri Kuthan [mailto:jiri at iptel.org]
Sent: Thursday, 20 November 2003 16:13 p.m.
To: Stephen Miles; serusers at lists.iptel.org
Subject: Re: [Serusers] Rewrite Contact Field


Stephen,

I hope you excuse if I leave RE definition to you, I am not into
doing this dirty work either ;), especially if we did not see
what RE resulted in the replacement you are talking about.

The command you wish to use to replace with a fixed value is textops/replace.
To replace a string with a new string which includes part of the original
string, you may use textops/subst.

More importantly, it would be good to understand to know why you need
to mangle the requests -- there may be perhaps other ways to achive
what you are trying to do. There is for example a contact mangling
module, called mangler.

-jiri

At 03:45 AM 11/20/2003, Stephen Miles wrote:
>Hi All,
>
>Hoping you regular expression gurus out there can help me out a bit.
>
>I am wanting to rewrite the Contact header field inside a sip message using either the replace or subst from the textops module. I've done my best but complex/long regular expressions are just a bit beyond me.
>
>I want to change Contact "potato" <sip:99196026 at ns.commverge.co.nz:5060>
>to Contact "potato" <sip:99196026 at sipsrv2.tranzpeer.net:5060>.
>
>So far I can change bits of it and almost get it right but I am still seeing the original contact right after the new one i.e: Contact "potato" <sip:99196026 at ns.commverge.co.nz:5060.sip:99196026 at sipsrv2.tranzpeer.net:5060>
>
>HELP
>
>Thanks in advance,
>Stephen
>
>
>-----------------------------------------------------------------------------------------------
>This message and any attachments contain privileged and confidential information. If you are not the intended recipient of this message, you are hereby notified that any use, dissemination, distribution or reproduction of this message is prohibited.  If you have received this message in error please notify the sender immediately via email and then destroy this message and any attachments.
>
>_______________________________________________
>Serusers mailing list
>serusers at lists.iptel.org
>http://lists.iptel.org/mailman/listinfo/serusers

--
Jiri Kuthan            http://iptel.org/~jiri/ 




More information about the sr-users mailing list