Re: [reSIProcate-users] tag accessor misbehaving
On 03/16/2012 08:25 AM, Joegen Baclor wrote:
If From or To is constructed without the angle brackets Example:
From: sip:user@10.0.0.1:5060;tag=123 the tag is not accessible via
header(h_From).param(p_tag) accesor. it returns empty. Is this
intentional?
joegen
Correction, I seem to only encounter this in From. To header seems to
treat tags correctly if there are no angle brackets enclosing the URI.
the code looks like this:
ASSERT_COND(msg->exists(h_From));
if (msg->exists(h_From))
{
fromUser = msg->const_header(h_From).uri().user().c_str();
fromTag = msg->const_header(h_From).exists(p_tag) ?
msg->const_header(h_From).param(p_tag).c_str() : std::string();
ASSERT_STR_EQ(fromUser.c_str(), "homertest");
ASSERT_STR_EQ(fromTag.c_str(), "fromtag12345");
}
The from header looks like this: From:
sip:homertest@192.168.1.10:5060;tag=fromtag12345
Tag would be empty in this case. If I put angle brackets, then tag is
parsed correctly.