[ previous ] [ next ] [ threads ]
 To :  Yate mailing list <yate@v...>
 From :  Paul Chitescu <paulc@v...>
 Subject :  Re: [yate] Re: Extra SIP Headers
 Date :  Sat, 8 Dec 2007 18:18:53 +0200 (EET)

Please see my answers inline.


On Fri, 7 Dec 2007, Anand Kumria wrote:
> Hi Paul,
> On Wed, 05 Dec 2007 17:51:23 +0200, Paul Chitescu wrote:
>> Hi there!
>> Unknown (and a few of the known) SIP headers are placed in the routing
>> In outgoing SIP call legs any osip_HeaderName parameter is turned to a
>> SIP HeaderName. Case is preserved.
> Why is that? I was under the impression that SIP headers fields are like
> SMTP headers, where case is not relevant for processing.
> Does Yate just preserver the header and not care about the case of the
> header, or does it care as well?

Yate does lower case conversion of incoming headers. This allows Yate 
modules to match the message parameters without the extra overhead of case 
insensitive comparations.

>> Example for regexroute.conf:
>> ; copy My-Header from incoming to outgoing call leg only if set
>> ${sip_my-header}.=;osip_My-Header=${sip_My-Header}
> This regex seems odd, shouldn't it be:
> ${sip_my-header}(.*)=;osip_My-Header=

This can become:

"When sip_my-header matches any characters (but at least one) capture the 
expression (basic regexps need a backslash in front of parantheses and 
plus sign) and set osip_My-Header to the captured value."


Since the entire match is to be used no subexpression capture is required.

> I do not understand how your version works.

"If sip_my-header has at least one character set osip_My-Header to the 
value of sip_my-header."

Note that I used . and not .* since .* would match an empty string too. 
Same for .\+ vs .*

> Thanks,
> Anand