Hey Guys,
Can anyone give me a quick answer on this?
I need to rewrite the incoming and outgoing URI's in SER.
For example. On incoming destination URI's, I need to be able to strip all 1's off of the first of the destination phone number. How would I do this?
Also, on some outgoing URI's I would need to add a 1 back onto the front of the destination number. I imagine that this would be done similar to stripping them.
Is there a function in a SER module that would allow me to do this?
Thanks! Darren Nay - dnay@libertyisp.com
Maybe something like this might help:
if (uri=~"^sip:12345@sip_address.com") { ## This assumes that the caller is log("Strip first character from a sip address\n"); ## registered in our realm strip(1); } just replace strip with prefix("1") in this case #1 will be added.
The best way is to distinguish which ones are your incoming and outgoing requests and then create routes in which you will either strip or add a prefix to a url.
On Tuesday, February 10, 2004, at 10:58 AM, Darren Nay wrote:
Hey Guys, Can anyone give me a quick answer on this? I need to rewrite the incoming and outgoing URI's in SER. For example. On incoming destination URI's, I need to be able to strip all 1's off of the first of the destination phone number. How would I do this? Also, on some outgoing URI's I would need to add a 1 back onto the front of the destination number. I imagine that this would be done similar to stripping them. Is there a function in a SER module that would allow me to do this? Thanks! Darren Nay - dnay@libertyisp.com _______________________________________________ Serusers mailing list serusers@lists.iptel.org http://lists.iptel.org/mailman/listinfo/serusers
Srbo Cvetkovic | CityNet, Inc. srbo@city-net.com | Pittsburgh, PA voice: 412.481.5406 | fax: 412.431.1315
http://iptel.org/ser/doc/seruser/seruser.html#URIREWRITING
klaus
Darren Nay wrote:
Hey Guys,
Can anyone give me a quick answer on this?
I need to rewrite the incoming and outgoing URI's in SER.
For example. On incoming destination URI's, I need to be able to strip all 1's off of the first of the destination phone number. How would I do this?
Also, on some outgoing URI's I would need to add a 1 back onto the front of the destination number. I imagine that this would be done similar to stripping them.
Is there a function in a SER module that would allow me to do this?
Thanks! Darren Nay - dnay@libertyisp.com mailto:dnay@libertyisp.com
Serusers mailing list serusers@lists.iptel.org http://lists.iptel.org/mailman/listinfo/serusers
This will rewrite the whole uri, but for pattern replacements you might want to look at textops module.
---greg
Klaus Darilion wrote:
http://iptel.org/ser/doc/seruser/seruser.html#URIREWRITING
klaus
Darren Nay wrote:
Hey Guys,
Can anyone give me a quick answer on this?
I need to rewrite the incoming and outgoing URI's in SER.
For example. On incoming destination URI's, I need to be able to strip all 1's off of the first of the destination phone number. How would I do this?
Also, on some outgoing URI's I would need to add a 1 back onto the front of the destination number. I imagine that this would be done similar to stripping them.
Is there a function in a SER module that would allow me to do this?
Thanks! Darren Nay - dnay@libertyisp.com mailto:dnay@libertyisp.com
Serusers mailing list serusers@lists.iptel.org http://lists.iptel.org/mailman/listinfo/serusers
Serusers mailing list serusers@lists.iptel.org http://lists.iptel.org/mailman/listinfo/serusers
On Feb 10, 2004 at 10:58, Darren Nay dnay@libertyisp.com wrote:
Hey Guys,
Can anyone give me a quick answer on this?
I need to rewrite the incoming and outgoing URI's in SER.
For example. On incoming destination URI's, I need to be able to strip all 1's off of the first of the destination phone number. How would I do this?
If you need to strip all the 1s (e.g. 111123 -> 23) try subst_uri (from the texstops module).
E.g.: subst_uri('/^sip:1+(.*)$/sip:\1/i');
See textops README for more details.
Andrei
Perfect. This is exactly what I needed. Thanks!
Darren Nay
----- Original Message ----- From: "Andrei Pelinescu-Onciul" pelinescu-onciul@fokus.fraunhofer.de To: "Darren Nay" dnay@libertyisp.com Cc: serusers@lists.iptel.org Sent: Tuesday, February 10, 2004 11:45 AM Subject: Re: [Serusers] Rewriting URI's
On Feb 10, 2004 at 10:58, Darren Nay dnay@libertyisp.com wrote:
Hey Guys,
Can anyone give me a quick answer on this?
I need to rewrite the incoming and outgoing URI's in SER.
For example. On incoming destination URI's, I need to be able to strip
all 1's off of the first of the destination phone number. How would I do this?
If you need to strip all the 1s (e.g. 111123 -> 23) try subst_uri (from the texstops module).
E.g.: subst_uri('/^sip:1+(.*)$/sip:\1/i');
See textops README for more details.
Andrei