how to get sip informations from unimrcp

Skip to first unread message


Nov 24, 2022, 9:01:16 AM11/24/22
to UniMRCP

I used unimrcp1.7.0, and i need to know the detail of SIP info.

unimrcp pass the callback to nua_create, like this:

static nua_t* mrcp_sofia_nua_create(void *obj, su_root_t *root)
nua_t *nua;
mrcp_sofia_agent_t *sofia_agent = obj;
mrcp_sofia_server_config_t *sofia_config = sofia_agent->config;

/* Create a user agent instance. The stack will call the 'event_callback()' * callback when events such as succesful registration to network, * an incoming call, etc, occur. */ nua = nua_create(     root, /* Event loop */     mrcp_sofia_event_callback, /* Callback for processing events */     sofia_agent, /* Additional data to pass to callback */     NUTAG_URL(sofia_agent->sip_bind_str), /* Address to bind to */     NUTAG_AUTOANSWER(0),     NUTAG_APPL_METHOD("OPTIONS"),     TAG_IF(sofia_config->sip_t1,NTATAG_SIP_T1(sofia_config->sip_t1)),     TAG_IF(sofia_config->sip_t2,NTATAG_SIP_T2(sofia_config->sip_t2)),     TAG_IF(sofia_config->sip_t4,NTATAG_SIP_T4(sofia_config->sip_t4)),     TAG_IF(sofia_config->sip_t1x64,NTATAG_SIP_T1X64(sofia_config->sip_t1x64)),     SIPTAG_USER_AGENT_STR(sofia_config->user_agent_name),     TAG_IF(sofia_config->tport_log == TRUE,TPTAG_LOG(1)), /* Print out SIP messages to the console */     TAG_IF(sofia_config->tport_dump_file,TPTAG_DUMP(sofia_config->tport_dump_file)), /* Dump SIP messages to the file */     TAG_END()); /* Last tag should always finish the sequence */ return nua;


the callback funtion is defined as:

static void mrcp_sofia_event_callback(
nua_event_t nua_event,
int status,
char const *phrase,
nua_t *nua,
mrcp_sofia_agent_t *sofia_agent,
nua_handle_t *nh,
mrcp_sofia_session_t *sofia_session,
sip_t const *sip,
tagi_t tags[])
i can get sip info when the sofia-sip get INVITE from client, and call the callback, but when sofia-sip response to the client, it made the sip pointer NULL, so I can not get the SIP info.

Arsen Chaloyan

Dec 22, 2022, 8:21:16 PM12/22/22
In the scope of regular SDP offer/answer, the handler mrcp_sofia_event_callback() is invoked multiple times. You may need to reference the sip_t object with nua_r_invite. The object is NULL with nua_i_state and nua_i_active events.

You received this message because you are subscribed to the Google Groups "UniMRCP" group.
To unsubscribe from this group and stop receiving emails from it, send an email to
To view this discussion on the web visit

Arsen Chaloyan
Author of UniMRCP
Reply all
Reply to author
0 new messages