Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>This can be done using the the below pjsip_event_notification.cpp</p> <pre><code>#include "pjsip_event_notification.h" #include &lt;pjsip.h&gt; #include &lt;pjsip_ua.h&gt; #include &lt;pjlib-util.h&gt; #include &lt;pjlib.h&gt; #include &lt;pjlib.h&gt; #include &lt;pjsua.h&gt; #include &lt;pjsua-lib/pjsua_internal.h&gt; static EventCallBack* registeredCallbackObject = NULL; extern "C" { pj_bool_t on_rx_response_wrapper(pjsip_rx_data *rdata){ registeredCallbackObject-&gt;on_rx_response(rdata); return PJ_FALSE; } pj_bool_t on_rx_request_wrapper(pjsip_rx_data *rdata){ registeredCallbackObject-&gt;on_rx_request(rdata); return PJ_FALSE; } /* The module instance. */ static pjsip_module mod_event_handler = { NULL, NULL, /* prev, next. */ { (char*)"mod-reg-event", 12 }, /* Name. */ -1, /* Id */ PJSIP_MOD_PRIORITY_TSX_LAYER - 1, /* Priority */ NULL, /* load() */ NULL, /* start() */ NULL, /* stop() */ NULL, /* unload() */ &amp;on_rx_response_wrapper, /* on_rx_request() */ &amp;on_rx_response_wrapper, /* on_rx_response() */ NULL, /* on_tx_request. */ NULL, /* on_tx_response() */ NULL, /* on_tsx_state() */ }; PJ_DECL(pj_status_t) event_callback_init() { return pjsip_endpt_register_module(pjsua_get_pjsip_endpt(), &amp;mod_event_handler); } void setEventCallbackObject(EventCallBack* eventCallBack){ registeredCallbackObject=eventCallBack; } } </code></pre> <p>the h file for the same pjsip_event_notification.h</p> <pre><code>#include &lt;pj/config_site.h&gt; #include &lt;pjsua-lib/pjsua.h&gt; class EventCallBack { public: virtual ~EventCallBack() {} virtual void on_rx_response(pjsip_rx_data *rdata){ // Target Call Back for Notify message } virtual void on_rx_request(pjsip_rx_data *rdata){ } }; extern "C" { pj_status_t event_callback_init(); void setEventCallbackObject(EventCallBack* eventCallBack); } </code></pre>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload