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

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

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

SourceForge.net
Bugs item #2958254, was opened at 2010-02-25 00:42
Message generated for change (Comment added) made by bogdan_iancu
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: trunk
>Status: Closed
>Resolution: Invalid
Priority: 5
Private: No
Submitted By: Roman Shpount (rshpount)
>Assigned to: Bogdan-Andrei Iancu (bogdan_iancu)
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.


----------------------------------------------------------------------

>Comment By: Bogdan-Andrei Iancu (bogdan_iancu)
Date: 2010-03-04 17:50

Message:
Hi Roman,

This is not a bug at all.
According to RFC3261, Allow hdr is a list:
<quote>
20.5 Allow

   The Allow header field lists the set of methods supported by the UA
   generating the message.
</quote>

So, there is a single body, where the body is a list of methods and NOT
multiple header bodies.

Also check the grammar from RFC3261 for Allow hdr:

Allow  =  "Allow" HCOLON [Method *(COMMA Method)]

So, the current behavior is correct. If you want to split the list of
methods from the body, I suggest using the string transformation - see
http://www.opensips.org/Resources/DocsCoreTran16#toc6

Regards,
Bogdan

----------------------------------------------------------------------

You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=1086410&aid=2958254&group_id=232389

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