[reSIProcate] getting from and to from sip message

Mateus Bellomo mateusbellomo at gmail.com
Sat Jun 25 21:42:12 CDT 2016


I just find out how to do it. I will post here in case anyone also need
this:

 const NameAddr& to = message.header(h_To);
 const NameAddr& from = message.header(h_From);

 QString strTo = to.displayName().c_str();
 QString strFrom = from..displayName().c_str();

I'm not sure if displayName() is the right method to get the information.
At [1] we can see the attributes of NameAddr but I don't know if this is
the one that holds user handles (in this specific case).

[1]
https://github.com/resiprocate/resiprocate/blob/master/resip/stack/NameAddr.hxx#L39


2016-06-25 20:38 GMT-03:00 Mateus Bellomo <mateusbellomo at gmail.com>:

> Reading the comments of [1] I found out that I could do this:
>
>    const NameAddr& to = message.header(h_To);
>    const NameAddr& from = message.header(h_From);
>
> But I need to convert this NameAddr to QString now. How can I do that?
>
> [1]
> https://github.com/resiprocate/resiprocate/blob/master/resip/stack/SipMessage.hxx
>
> 2016-06-25 16:03 GMT-03:00 Mateus Bellomo <mateusbellomo at gmail.com>:
>
>> Hello,
>>
>> How can I get the 'from' and 'to' users from a sip message?
>>
>> I'm looking at [1] and I saw a lot of reference to headers. So I searched
>> at resip/stack/Header* and I saw some 'from' and 'to' ([2] and [3]) but I
>> couldn't find a method that return this data.
>>
>>
>> Thanks in advance.
>>
>> [1]
>> https://github.com/resiprocate/resiprocate/blob/master/resip/stack/SipMessage.hxx
>> [2]
>> https://github.com/resiprocate/resiprocate/blob/master/resip/stack/Headers.hxx#L188
>> [3]
>> https://github.com/resiprocate/resiprocate/blob/master/resip/stack/HeaderTypes.hxx#L58
>>
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://list.resiprocate.org/pipermail/resiprocate-devel/attachments/20160625/8cef69c3/attachment.htm>


More information about the resiprocate-devel mailing list