[Serusers] Re: rewrite the FROM part of SIP INVITE

Greger V. Teigre greger at teigre.com
Sat Sep 9 09:12:25 CEST 2006


Ok, I've written this before, but it's important and worth another try.
First of all some clarifications:
- From and To have nothing to do with routing
- The requirement to not touch From and To has nothing to do with SER 
implementation
- The tags in From and To together with Call-Id form a dialog and is 
important for matching SIP messages in a transaction (ex. an INVITE - OK 
- ACK sequence) and a dialog (ex. later reINVITEs, BYE etc)
http://www.tech-invite.com/Ti-sip-abnf-hf.html#from

Thus, in order to be RFC3261 compliant, you need to:
1. NOT touch the tags in From and To
2. NOT touch the remainder of From and To

If you break #1, you mess up transaction and dialog matching and pretty 
much everything breaks. If you break #2, you violate the requirement to 
be backwards compatible.

That being said, if ALL your UAs and gateways support and use RFC3261, 
changing From and To names/uris (while leaving tags) will probably work, 
but as all subsequent SIP related IETF documents and  implementation try 
to be RFC3261 compliant,  it is assumed that From and To are only 
changed two places:
a. In the UAs
b. In a B2BUA, i.e. a server that terminates a dialog with UA1 and 
creates another one with UA2 and thus is a go-between

New SEMS can be used for b.

So, regardless of using uac module or subst for replacing From/To, you 
will be MUCH better off if you follow the intentions of the RFCs, i.e. 
change the From/To in the UAs through the provisioning systems you use. 
Having lots of non-compliant SER installations is a recipe for trouble 
in the future.

Note that there is an exception to the anonymization of a call. I tried 
to find the reference, but I couldn't find it. Does somebody sit on the 
reference?

I hope that was clarifying.
g-)

Ricardo Carvalho wrote:
> It isn't necessary to restore those from-header fields to maintain the 
> call leg of transactions taking place. As far as I know, by the tests 
> I made, Ser routes SIP messages based on Call-Id and not as well From 
> and To tags of messages.
> Although this is only true if all UAs that you use are 
> RFC3261compliant. If some phones that you use implement the old 
> protocol, uses the full content of From/To for the same purposes, you 
> may get some problems... It's risky manipulate From/To tags...
>
> Regards,
> Ricardo.
>
>
>
>
>
>
>
> G.Jacobsen wrote:
>> Ricardo,
>>
>> Ok, but how do you restore the from-header when you send answers of the
>> downstream party to the upstream party again ?
>>
>> Cheers
>>
>> Gerry
>>
>>
>> ----- Original Message ----- From: "Ricardo Carvalho" 
>> <rcarvalho at iric.up.pt>
>> To: "Alex Fler" <alexfler at yahoo.com>
>> Cc: <serusers at lists.iptel.org>
>> Sent: Friday, September 08, 2006 5:15 PM
>> Subject: Re: [Serusers] Re: rewrite the FROM part of SIP INVITE
>>
>>
>>  
>>> I've used subst() function for substituting From and To URIs and calls
>>> succeed well! I think that this indicates that Ser uses in fact only 
>>> the
>>> Call-Id to keep track of calls and not as well From and To tags of
>>> messages. Although I this may end up biting me later...
>>>
>>> You can do that for example with the following syntax:
>>>
>>>     
>> subst('/^From:(.*)sip:.*@your_domain(.*)/From:\1sip:what_ever_number at what_ev 
>>
>> er_domain\2/');
>>  
>>> Greetings,
>>>
>>> Ricardo.
>>>
>>>
>>>
>>>
>>>
>>>
>>>
>>> Alex Fler wrote:
>>>    
>>>> Hello guys,
>>>>
>>>> Sorry for a stupid question, but how do you actually rewrite the FROM
>>>> part of SIP INVITE ?
>>>>
>>>> Do you use avp ? Could someone give me an example  ?
>>>>
>>>>
>>>>
>>>> Thanks to all
>>>>
>>>>
>>>>
>>>> Alex Fler
>>>>
>>>>
>>>>
>>>> ------------------------------------------------------------------------ 
>>>>
>>>>
>>>> _______________________________________________
>>>> Serusers mailing list
>>>> Serusers at lists.iptel.org
>>>> http://lists.iptel.org/mailman/listinfo/serusers
>>>>
>>>>       
>>> _______________________________________________
>>> Serusers mailing list
>>> Serusers at lists.iptel.org
>>> http://lists.iptel.org/mailman/listinfo/serusers
>>>     
>>
>>
>>        
>> ___________________________________________________________ Try the 
>> all-new Yahoo! Mail. "The New Version is radically easier to use" – 
>> The Wall Street Journal http://uk.docs.yahoo.com/nowyoucan.html
>>
>>   
>
> _______________________________________________
> Serusers mailing list
> Serusers at lists.iptel.org
> http://lists.iptel.org/mailman/listinfo/serusers
>
>



More information about the sr-users mailing list