modify TO field

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

modify TO field

rob1485
Hi,

What module/function can be used to modify TO field in a SIP request header?
I've tried both "replace" and "subst" from TEXTOPS module. Both
functions works fine for INVITE message. However, it creates a new TO
field in ACK message i.e, it does not overwrite on the existing To
field. Thus, I end up with two TO fields in ACK message.

Please advice.

Regards,
RR

_______________________________________________
Users mailing list
[hidden email]
http://lists.opensips.org/cgi-bin/mailman/listinfo/users
Reply | Threaded
Open this post in threaded view
|

Re: modify TO field

Brett Nemeroff
Make sure your regex allows for a to_tag,.
------Original Message------
From: Robert R
Sender:
To: opensip
Sent: Nov 19, 2008 8:04 AM
Subject: [OpenSIPS-Users] modify TO field

Hi,

What module/function can be used to modify TO field in a SIP request header?
I've tried both "replace" and "subst" from TEXTOPS module. Both
functions works fine for INVITE message. However, it creates a new TO
field in ACK message i.e, it does not overwrite on the existing To
field. Thus, I end up with two TO fields in ACK message.

Please advice.

Regards,
RR

_______________________________________________
Users mailing list
[hidden email]
http://lists.opensips.org/cgi-bin/mailman/listinfo/users


Sent from my Verizon Wireless BlackBerry

_______________________________________________
Users mailing list
[hidden email]
http://lists.opensips.org/cgi-bin/mailman/listinfo/users
Reply | Threaded
Open this post in threaded view
|

Re: modify TO field

rob1485
My goal is to change the domain in TO filed from "1.1.1.1" to a new
value "2.2.2.2".

TO field in ACK before using "subst"
To: <sip:14078789913@1.1.1.1;user=phone>;tag=3b6d3327


TO field in ACK after using "subst"
To: <sip:14078789913@1.1.1.1;user=phone>;tag=3b6d3327 t:
<sip:+14078789913@2.2.2.2:5060;transport=udp;user=phone>;tag=3b6d3327

command used in route[1] block:
if ( subst('/^To:(.*)sip:[^@]*@[a-zA-Z0-9.]+(.*)$/t:\1\u\2/ig') ) {};


Is this a bug?

Regards,
AR



On Wed, Nov 19, 2008 at 9:11 AM,  <[hidden email]> wrote:

> Make sure your regex allows for a to_tag,.
> ------Original Message------
> From: Robert R
> Sender:
> To: opensip
> Sent: Nov 19, 2008 8:04 AM
> Subject: [OpenSIPS-Users] modify TO field
>
> Hi,
>
> What module/function can be used to modify TO field in a SIP request header?
> I've tried both "replace" and "subst" from TEXTOPS module. Both
> functions works fine for INVITE message. However, it creates a new TO
> field in ACK message i.e, it does not overwrite on the existing To
> field. Thus, I end up with two TO fields in ACK message.
>
> Please advice.
>
> Regards,
> RR
>
> _______________________________________________
> Users mailing list
> [hidden email]
> http://lists.opensips.org/cgi-bin/mailman/listinfo/users
>
>
> Sent from my Verizon Wireless BlackBerry
>

_______________________________________________
Users mailing list
[hidden email]
http://lists.opensips.org/cgi-bin/mailman/listinfo/users