Hi Khnykin,

2011/1/11 Khnykin Evgeniy <hsil...@gmail.com>:
> I develop SIP-gateway for XMPP protocol. Gateway works on server which works
> under "xen".
> I can't build latest versions of sofia-sip on this server, so i've built
> something like 1.10.x.
> Everything works good, but now i must add P-Asserted-Identity field to
> INVITE query.
> But SIPTAG_P_ASSERTED_IDENTITY macro was added only in 1.12.7 version, so i
> don't have it in my version.
> Can i resolve it trouble? Can i add, for example, my custom field to query?
> Can i parse this field in future?
> How should i change my code:
> nua_handle_t *t_inviteHandle = nua_handle(
>    m_SipThread.getNua(),
>    t_inviteData,
>    SIPTAG_FROM_STR( t_initJid.toArray().data() ),
>    SIPTAG_TO_STR( t_respJid.toArray().data() ),
>    SIPTAG_P_ASSERTED_IDENTITY(t_asserty.data()),
>    TAG_END());

You can pass unparsed header contents with SIPTAG_HEADER_STR(). Something like

#ifndef SIPTAG_P_ASSERTED_IDENTITY
char *p_a_id = su_sprintf(NULL, "P-Asserted-Identity: <" URL_FORMAT_STRING ">",
    URL_FORMAT_ARGS(t_asserty.data().url));
#endif

nua_handle_t *t_inviteHandle = nua_handle(
   m_SipThread.getNua(),
    t_inviteData,
    SIPTAG_FROM_STR( t_initJid.toArray().data() ),
    SIPTAG_TO_STR( t_respJid.toArray().data() ),
#ifdef SIPTAG_P_ASSERTED_IDENTITY
    SIPTAG_P_ASSERTED_IDENTITY(t_asserty.data()),
#else
    SIPTAG_HEADER_STR(p_a_id);
#endif
    TAG_END());

#ifndef SIPTAG_P_ASSERTED_IDENTITY
   su_free(NULL, p_a_id);
#endif

-- 
Pekka.Pessi mail at nokia.com

------------------------------------------------------------------------------
Protect Your Site and Customers from Malware Attacks
Learn about various malware tactics and how to avoid them. Understand 
malware threats, the impact they can have on your business, and how you 
can protect your company and customers by using code signing.
http://p.sf.net/sfu/oracle-sfdevnl
_______________________________________________
Sofia-sip-devel mailing list
Sofia-sip-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/sofia-sip-devel

Reply via email to