User-agent parsing in 200 OK response message after Register

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Buona sera Davide,

On 12-Jan-12 20:27, Barbieri Davide wrote:
> I need to parse the User-Agent in the 200 OK response message after sending a Register to the SIP server. I think that's possible in the "on-reg_state" callback using pjsip_parse_hdr(...) function. The problem is that I need to the get the entire response message to use that function (in practice the buffer for received messages).
> 
> How can I get the message header in this callback? Or should I use another callback to obtain it?
> 

at that state the message is already decoded.
You therefor just need a callback that will give you access to the
pjsip_msg data structure.

*on_reg_state2* is the one to be used since through its
*pjsua_reg_info* parameter you can access the underlaying
*pjsip_msg* data structure.
You can then use *pjsip_msg_find_hdr* or better
*pjsip_msg_find_hdr_by_names* to retrieve the User-Agent Header
(generic string) and its value if provided by the UAS ;o)

Ciao,
Alain




> 
> 
> Davide Barbieri
> 
> [Concept Reply]Concept Reply
> P: +39 011 29100
> E: d.barbieri at reply.it<mailto:d.barbieri at reply.it>
> W: www.reply.it<http://www.reply.it>
> 
> ________________________________
> 
> --
> The information transmitted is intended for the person or entity to which it is addressed and may contain confidential and/or privileged material. Any review, retransmission, dissemination or other use of, or taking of any action in reliance upon, this information by persons or entities other than the intended recipient is prohibited. If you received this in error, please contact the sender and delete the material from any computer.
> 
> 
> 
> 
> _______________________________________________
> Visit our blog: http://blog.pjsip.org
> 
> pjsip mailing list
> pjsip at lists.pjsip.org
> http://lists.pjsip.org/mailman/listinfo/pjsip_lists.pjsip.org

-- 
                            ""
                          (o)(o)
                _____o00o__(__)__o00o_____
3072D/146D10DE 2011-09-29    Alain Totouom  <totouom at gmx.de>
PGP Fingerprint 39A4F092 FFA7C746 CC305CB0 69091911 146D10DE



[Index of Archives]     [Asterisk Users]     [Asterisk App Development]     [Linux ARM Kernel]     [Linux ARM]     [Linux Omap]     [Fedora ARM]     [IETF Annouce]     [Security]     [Bugtraq]     [Linux]     [Linux OMAP]     [Linux MIPS]     [Linux API]
  Powered by Linux