modify TO field in the SIP message header

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

modify TO field in the SIP message header

rob1485
Hi,

What module/function in opensip can be used to modify TO field in the SIP message header?

I've tried both "replace" and "subst" from TEXTOPS module. Both functions create a new TO field. They don't overwrite the existing field.

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 in the SIP message header

Brett Nemeroff
I just did this last night using subst. Can you show us what you used? Chances are your regex is off..


On Tue, Nov 11, 2008 at 11:51 AM, Robert R <[hidden email]> wrote:
Hi,

What module/function in opensip can be used to modify TO field in the SIP message header?

I've tried both "replace" and "subst" from TEXTOPS module. Both functions create a new TO field. They don't overwrite the existing field.

Regards,
RR

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



_______________________________________________
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 in the SIP message header

Iñaki Baz Castillo
In reply to this post by rob1485
2008/11/11 Robert R <[hidden email]>:
> Hi,
>
> What module/function in opensip can be used to modify TO field in the SIP
> message header?
>
> I've tried both "replace" and "subst" from TEXTOPS module. Both functions
> create a new TO field. They don't overwrite the existing field.

Why do you want to change the To header? this is anti RFC 3261.

--
Iñaki Baz Castillo
<[hidden email]>
_______________________________________________
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 in the SIP message header

Brett Nemeroff
I'd like to chime in here since I had an issue needing this, by the way, subst changed the header just FINE.. but subsequent message processing was broken (flood of failed 200OK/ACK on connect followed by far end disconnect).

Here's my issue, I have customers that dial to me with a prefix indicating an accountcode (this was necessary because of technical limitations on their hardware.). I have opensips removing the accountcode from the RURI and forwarding onto a provider.

When that provider sees the accountcode in the TO header, I get a 400 Bad Request back from them and they reject the call. If I clean up the TO header and remove the accountcode from the URI (ie: make it look like $rU) then it attempts to complete the call but it fails, as I said above, with the 200 OK/ACK flood.

Sorry, not trying to take over your thread. :) But if anyone has any ideas on how I should handle this, I'd be much appreciative. 
-Brett



On Tue, Nov 11, 2008 at 12:12 PM, Iñaki Baz Castillo <[hidden email]> wrote:
2008/11/11 Robert R <[hidden email]>:
> Hi,
>
> What module/function in opensip can be used to modify TO field in the SIP
> message header?
>
> I've tried both "replace" and "subst" from TEXTOPS module. Both functions
> create a new TO field. They don't overwrite the existing field.

Why do you want to change the To header? this is anti RFC 3261.

--
Iñaki Baz Castillo
<[hidden email]>
_______________________________________________
Users mailing list
[hidden email]
http://lists.opensips.org/cgi-bin/mailman/listinfo/users


_______________________________________________
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 in the SIP message header

Iñaki Baz Castillo
2008/11/11 Brett Nemeroff <[hidden email]>:
> I'd like to chime in here since I had an issue needing this, by the way,
> subst changed the header just FINE.. but subsequent message processing was
> broken (flood of failed 200OK/ACK on connect followed by far end
> disconnect).

> Here's my issue, I have customers that dial to me with a prefix indicating
> an accountcode (this was necessary because of technical limitations on their
> hardware.). I have opensips removing the accountcode from the RURI and
> forwarding onto a provider.

> When that provider sees the accountcode in the TO header, I get a 400 Bad
> Request back from them and they reject the call.

This is an error in your provider, it shouldn't check the To URI.


> If I clean up the TO header
> and remove the accountcode from the URI (ie: make it look like $rU) then it
> attempts to complete the call but it fails, as I said above, with the 200
> OK/ACK flood.

Maybe you could also replace the To in the ACK?


--
Iñaki Baz Castillo
<[hidden email]>
_______________________________________________
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 in the SIP message header

Brett Nemeroff
Hmm.. I'll look into that.. thanks!

On Tue, Nov 11, 2008 at 12:22 PM, Iñaki Baz Castillo <[hidden email]> wrote:
2008/11/11 Brett Nemeroff <[hidden email]>:
> I'd like to chime in here since I had an issue needing this, by the way,
> subst changed the header just FINE.. but subsequent message processing was
> broken (flood of failed 200OK/ACK on connect followed by far end
> disconnect).

> Here's my issue, I have customers that dial to me with a prefix indicating
> an accountcode (this was necessary because of technical limitations on their
> hardware.). I have opensips removing the accountcode from the RURI and
> forwarding onto a provider.

> When that provider sees the accountcode in the TO header, I get a 400 Bad
> Request back from them and they reject the call.

This is an error in your provider, it shouldn't check the To URI.


> If I clean up the TO header
> and remove the accountcode from the URI (ie: make it look like $rU) then it
> attempts to complete the call but it fails, as I said above, with the 200
> OK/ACK flood.

Maybe you could also replace the To in the ACK?


--
Iñaki Baz Castillo
<[hidden email]>
_______________________________________________
Users mailing list
[hidden email]
http://lists.opensips.org/cgi-bin/mailman/listinfo/users


_______________________________________________
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 in the SIP message header

Alex Massover
In reply to this post by Iñaki Baz Castillo
Hi!

Can you please point me, where exactly is it written in RFC?
I'm also in doubts about changing To header.

--
Best Regards,
Alex Massover

-----Original Message-----
From: [hidden email] [mailto:[hidden email]] On Behalf Of Iñaki Baz Castillo
Sent: Tuesday, November 11, 2008 8:12 PM
Cc: opensip
Subject: Re: [OpenSIPS-Users] modify TO field in the SIP message header

2008/11/11 Robert R <[hidden email]>:
> Hi,
>
> What module/function in opensip can be used to modify TO field in the SIP
> message header?
>
> I've tried both "replace" and "subst" from TEXTOPS module. Both functions
> create a new TO field. They don't overwrite the existing field.

Why do you want to change the To header? this is anti RFC 3261.

--
Iñaki Baz Castillo
<[hidden email]>
_______________________________________________
Users mailing list
[hidden email]
http://lists.opensips.org/cgi-bin/mailman/listinfo/users


******************************************************************************
 This footnote confirms that this email message has been scanned by Jajah Inc. Mail system for the presence of malicious code, vandals & computer viruses.
******************************************************************************



******************************************************************************
 This footnote confirms that this email message has been scanned by Jajah Inc. Mail system for the presence of malicious code, vandals & computer viruses.
******************************************************************************

_______________________________________________
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 in the SIP message header

Iñaki Baz Castillo
2008/11/12 Alex Massover <[hidden email]>:
> Hi!
>
> Can you please point me, where exactly is it written in RFC?
> I'm also in doubts about changing To header.

Well, not sure where exactly, but I can sure 300% that To shouldn be
NEVER modified by a proxy or UA (except the UAS who adds the To_tag,
of course).
I suggest you to look for "To" header in RFC3261 until finding it, but
trust me :)




--
Iñaki Baz Castillo
<[hidden email]>
_______________________________________________
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 in the SIP message header

Olle E. Johansson

12 nov 2008 kl. 09.58 skrev Iñaki Baz Castillo:

> 2008/11/12 Alex Massover <[hidden email]>:
>> Hi!
>>
>> Can you please point me, where exactly is it written in RFC?
>> I'm also in doubts about changing To header.
>
> Well, not sure where exactly, but I can sure 300% that To shouldn be
> NEVER modified by a proxy or UA (except the UAS who adds the To_tag,
> of course).
> I suggest you to look for "To" header in RFC3261 until finding it, but
> trust me :)

This was actually mandated by SIP v1.0, so you have to go further back
than 3261. SIP v1.0 used From and To headers as identifiers for a call.
SIP v2.0 kept this for backwards compatibility, but moved to using
tags as identifiers.

There's a recent RFC that changed this again, but I still don't
think the Proxy is allowed to change From/To headers,
only the UA. This is for caller ID updates. The RFC might
allow proxy changes, but that needs to be checked.

/O
_______________________________________________
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 in the SIP message header

Iñaki Baz Castillo
2008/11/12 Johansson Olle E <[hidden email]>:

>> I suggest you to look for "To" header in RFC3261 until finding it, but
>> trust me :)

Well, this info is in:

- 8.1.1.2 To

- 8.2.2.1 To and Request-URI

- Also: 4 Overview of Operation
  "To contains a display name (Bob) and a SIP or SIPS URI
   (sip:[hidden email]) towards which the request was originally
   directed."


> This was actually mandated by SIP v1.0, so you have to go further back
> than 3261. SIP v1.0 used From and To headers as identifiers for a call.
> SIP v2.0 kept this for backwards compatibility, but moved to using
> tags as identifiers.
>
> There's a recent RFC that changed this again, but I still don't
> think the Proxy is allowed to change From/To headers,
> only the UA. This is for caller ID updates. The RFC might
> allow proxy changes, but that needs to be checked.

Yeah, RFC 4916 page 4:

     "Usage of the URI from the To and From fields in the original
      request within subsequent requests is done for backwards
      compatibility with RFC 2543 [6], which used the URI for dialog
      identification.  In this specification, only the tags are used for
      dialog identification.  It is expected that mandatory reflection
      of the original To and From URI in mid-dialog requests will be
      deprecated in a subsequent revision of this specification."

As you say, I think the proxy is not able to change the From/To URI,
just the UA's can do it.

Regards.


--
Iñaki Baz Castillo
<[hidden email]>
_______________________________________________
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 in the SIP message header

Klaus Darilion
In reply to this post by Iñaki Baz Castillo


Iñaki Baz Castillo schrieb:

> 2008/11/12 Alex Massover <[hidden email]>:
>> Hi!
>>
>> Can you please point me, where exactly is it written in RFC?
>> I'm also in doubts about changing To header.
>
> Well, not sure where exactly, but I can sure 300% that To shouldn be
> NEVER modified by a proxy or UA (except the UAS who adds the To_tag,
> of course).
> I suggest you to look for "To" header in RFC3261 until finding it, but
> trust me :)

"Never changing From/To headers" is in RFC 3261 for compatibility with
RFC 2543 which used the whole header for dialog matching. RFC 3261 only
uses the tags - thus changing from/to is possible.

Recently there was an RFC published which explicitly changes the from
and to header (I can not remember the RFC number) with the conclusion
that there shouldn't be any RFC 2543 clients anymore.

Nevertheless, if there is a component which does routing based on To it
is buggy.

regards
klaus

_______________________________________________
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 in the SIP message header

Iñaki Baz Castillo
2008/11/12 Klaus Darilion <[hidden email]>:

> "Never changing From/To headers" is in RFC 3261 for compatibility with RFC
> 2543 which used the whole header for dialog matching. RFC 3261 only uses the
> tags - thus changing from/to is possible.
>
> Recently there was an RFC published which explicitly changes the from and to
> header (I can not remember the RFC number)

RFC 4916 (Connected Identity)


> with the conclusion that there
> shouldn't be any RFC 2543 clients anymore.

But just the UA's should change the From or To URI, not the proxy.



> Nevertheless, if there is a component which does routing based on To it is
> buggy.

It's very sad in fact :(


--
Iñaki Baz Castillo
<[hidden email]>
_______________________________________________
Users mailing list
[hidden email]
http://lists.opensips.org/cgi-bin/mailman/listinfo/users