How to print SIP message text in pjsip_tx_data?

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

 



Hello Pai,

You can implement your own PJSIP module to log any incoming / outgoing request.
Juste create a pjsip_module, register it by calling pjsip_endpt_register_module.

Then, set its priority to PJSIP_MOD_PRIORITY_TRANSPORT_LAYER-1, and set the callbacks you need (for tracing any SIP messages, implements on_rx_request, on rx_response, on_tx_request and on_tx_response).
In those callbacks, you can log anything you want from pjsip_rx_data or pjsip_tx_data passed as parameters.

You have a sample of logger module in pjsua_core.c.

Regards,

Romain



>________________________________
> De?: Pai Peng <sipaipv6 at gmail.com>
>??: pjsip list <pjsip at lists.pjsip.org> 
>Envoy? le : Mardi 5 mars 2013 15h53
>Objet?: Re: [pjsip] How to print SIP message text in pjsip_tx_data?
> 
>
>Hello all again,
>
>
>
>
>the same problem with another question:
>
>
>How can I log SIP tracking message in TEXT without modify pjsip? THere is some call back functions available in pjsua_app?
>
>
>
>
>Thank you
>
>
>Regards,
>
>
>Pai
>
>
>
>On Mon, Mar 4, 2013 at 9:56 PM, Pai Peng <sipaipv6 at gmail.com> wrote:
>
>Hello allo PJSIP experts,
>>
>>
>>
>>
>>I have now a problem with logging SIP messages, which are sent out.
>>
>>
>>
>>
>>I am using the following code to do it at this moment:
>>PJ_LOG(5,(tsx->obj_name, "===>Raw data:\n%s", (tdata && tdata->buf.start)?tdata->buf.start:"NULL"));
>>
>>
>>but sometime it gets "NULL" back, and sometimes it works fine.
>>
>>
>>
>>
>>Must I call "pjsip_tx_data_invalidate_msg" before using the buf?
>>
>>
>>Is there any other way to printf the SIP message out?
>>
>>
>>
>>
>>Thanks a lot
>>
>>
>>Regards,
>>
>>
>>Pai
>>
>>
>>
>>
>
>_______________________________________________
>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
>
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.pjsip.org/pipermail/pjsip_lists.pjsip.org/attachments/20130305/ccc37cfd/attachment-0001.html>


[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