[OpenSIPS-Devel] [ opensips-Bugs-2958254 ] Comma separated headers are not parsed by $hdr

Richard Revels rrevels at bandwidth.com
Thu Feb 25 02:46:40 CET 2010


I'm kind of under the impression that $(hdr(name)[N]) will return the body of the Nth instance of the header.  At least that's what the documentation states.

3.82 SIP Headers
$(hdr(name)[N]) - represents the body of the N-th header identified by 'name'. If [N] is omitted then the body of the first header is printed. The first header is got when N=0, for the second N=1, a.s.o. To print the last header of that type, use -1, no other negative values are supported now. No white spaces are allowed inside the specifier (before }, before or after {, [, ] symbols). When N='*', all headers of that type are printed.

 
On Feb 24, 2010, at 5:42 PM, SourceForge.net wrote:

> Bugs item #2958254, was opened at 2010-02-24 17:42
> Message generated for change (Tracker Item Submitted) made by rshpount
> You can respond by visiting: 
> https://sourceforge.net/tracker/?func=detail&atid=1086410&aid=2958254&group_id=232389
> 
> Please note that this message will contain a full copy of the comment thread,
> including the initial issue submission, for this request,
> not just the latest update.
> Category: core
> Group: None
> Status: Open
> Resolution: None
> Priority: 5
> Private: No
> Submitted By: Roman Shpount (rshpount)
> Assigned to: Nobody/Anonymous (nobody)
> Summary: Comma separated headers are not parsed by $hdr
> 
> Initial Comment:
> When comma separated headers, such as "Allow: INVITE, ACK, CANCEL, BYE" are accessed using $hdr script variable, they are presented as a single header. In other words, $hdr(Allow) returns "INVITE, ACK, CANCEL, BYE" and $(hdr(Allow)[1]) returns <null>. Expected behavior is to return "INVITE" and "ACK" respectively.
> 
> To reproduce, see the output of
> 
> xlog("L_INFO", "TRACE:TEST: $hdr(Allow)\n");
> xlog("L_INFO", "TRACE:TEST: $(hdr(Allow)[1])\n");
> 
> while processing almost any Register message.
> 
> 
> ----------------------------------------------------------------------
> 
> You can respond by visiting: 
> https://sourceforge.net/tracker/?func=detail&atid=1086410&aid=2958254&group_id=232389
> 
> _______________________________________________
> Devel mailing list
> Devel at lists.opensips.org
> http://lists.opensips.org/cgi-bin/mailman/listinfo/devel

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.opensips.org/pipermail/devel/attachments/20100224/f616b21d/attachment-0001.htm 


More information about the Devel mailing list