[Kamailio-Users] HOWTO rewrite to: header

Olle E. Johansson oej at edvina.net
Wed Aug 12 11:25:42 CEST 2009


12 aug 2009 kl. 11.20 skrev Alex Balashov:

> Ernest Mavrel wrote:
>
>> El Miércoles, 4 de Marzo de 2009, Alex Balashov escribió:
>>> / Iñaki Baz Castillo wrote:
>> />/ > El Miércoles, 4 de Marzo de 2009, alexander merkulov escribió:
>> />/ >> is there any way to rewrite   To: field in kamailio
>> />/ >> because now it nto work
>> />/ >
>> />/ > Could I know why you need to rewrite To header?
>> />/ > A proxy MUST NOT do it.
>> />/
>> />/ That was the question I was going to ask.  It violates proxy  
>> behaviour.
>> /
>> Unfortunatelly a typical pathetic reply from a SIP carrier is  
>> "sorry but the To is different than the request URI, so it cannot  
>> work...".
>
> This is not a "pathetic" reply.  This is an RFC-compliant reply.  A  
> user agent reasonably expects the To and From header values to match  
> those in the initial request.

No, there's an update to RFC3261 which actually allows changing the  
From: and To: headers. It's something needed during transfers or other  
cases where you need an caller ID update. Check RFC 4916 for more  
information.

>
> Why do you need to rewrite the To URI?  The RFC says you shouldn't  
> route on it, but on the Request URI.  If you need to rewrite the To  
> URI, chances are you are doing something wrong or there is a better  
> way to accomplish the goal.

In some cases, where you have on registration and 10 DIDs, the To:  
header is the only place where you actually will find the original  
called number on the PSTN side, to separate the different DID's. The  
request URI will always be the contact URI provided in the  
registration. Unless you use the hack they came up with for SIP- 
connect, where you register a contact, but don't use that in the R-URI  
for the calls based on the registration.

Cheers,
/O


More information about the Users mailing list