Trigger Sip Messages during Pjsua Call

L
Lele
Fri, Jan 13, 2017 8:28 AM

Hi guys,

Is there a method to trigger Sip Info Message during Pjsua Call and response
with defined status-code?

There is a Callback or I should pre-configure 'pjsip_module' -->
'on_rx_request' because in this case I can't trigger the event.

This the code that I have implemented in my simple application:

static pjsip_module mod_app =

{

NULL, NULL,                 /* prev, next.        */

{ "mod-app ", 7 },     /* Name.        */

-1,                         /* Id           */

PJSIP_MOD_PRIORITY_APPLICATION,   /* Priority             */

NULL,                  /* load()       */

NULL,                  /* start()      */

NULL,                  /* stop()       */

NULL,                  /* unload()           */

&on_rx_request,      /* on_rx_request()    */

NULL,                  /* on_rx_response()   */

NULL,                  /* on_tx_request.     */

NULL,                  /* on_tx_response()   */

NULL,                  /* on_tsx_state()     */

};

static pj_bool_t on_rx_request(pjsip_rx_data *rdata)

{

 pjsip_tx_data *tdata;

 pjsip_status_code status_code;

 pj_status_t status;



 if (pjsip_method_cmp(&rdata->msg_info.msg->line.req.method,

&pjsip_info_method) == 0) {

      status_code = PJSIP_SC_OK; //response 200ok --> but not work

       status = pjsip_endpt_respond_stateless(pjsua_get_pjsip_endpt(),

rdata, status_code, NULL, NULL, NULL);

 }

Thanks in advice

Best Regards

Ll

Hi guys, Is there a method to trigger Sip Info Message during Pjsua Call and response with defined status-code? There is a Callback or I should pre-configure 'pjsip_module' --> 'on_rx_request' because in this case I can't trigger the event. This the code that I have implemented in my simple application: static pjsip_module mod_app = { NULL, NULL, /* prev, next. */ { "mod-app ", 7 }, /* Name. */ -1, /* Id */ PJSIP_MOD_PRIORITY_APPLICATION, /* Priority */ NULL, /* load() */ NULL, /* start() */ NULL, /* stop() */ NULL, /* unload() */ &on_rx_request, /* on_rx_request() */ NULL, /* on_rx_response() */ NULL, /* on_tx_request. */ NULL, /* on_tx_response() */ NULL, /* on_tsx_state() */ }; static pj_bool_t on_rx_request(pjsip_rx_data *rdata) { pjsip_tx_data *tdata; pjsip_status_code status_code; pj_status_t status; if (pjsip_method_cmp(&rdata->msg_info.msg->line.req.method, &pjsip_info_method) == 0) { status_code = PJSIP_SC_OK; //response 200ok --> but not work status = pjsip_endpt_respond_stateless(pjsua_get_pjsip_endpt(), rdata, status_code, NULL, NULL, NULL); } Thanks in advice Best Regards Ll