Group PJSUA_UA

group PJSUA_UA

Provides dialog management.

Application MUST initialize the user agent layer module by calling pjsip_ua_init_module() before using any of the dialog API, and link the application with with pjsip-core library.

Functions

pj_status_t pjsip_ua_init_module(pjsip_endpoint *endpt, const pjsip_ua_init_param *prm)

Initialize user agent layer and register it to the specified endpoint.

Parameters
  • endpt – The endpoint where the user agent will be registered.

  • prm – UA initialization parameter.

Returns

PJ_SUCCESS on success.

pjsip_user_agent *pjsip_ua_instance(void)

Get the instance of the user agent.

Returns

The user agent module instance.

pj_uint32_t pjsip_ua_get_dlg_set_count(void)

Retrieve the current number of dialog-set currently registered in the hash table. Note that dialog-set is different than dialog when the request forks. In this case, all dialogs created from the original request will belong to the same dialog set. When no forking occurs, the number of dialog sets will be equal to the number of dialogs.

Returns

Number of dialog sets.

pjsip_dialog *pjsip_ua_find_dialog(const pj_str_t *call_id, const pj_str_t *local_tag, const pj_str_t *remote_tag, pj_bool_t lock_dialog)

Find a dialog with the specified Call-ID and tags properties. This function may optionally lock the matching dialog instance before returning it back to the caller.

Parameters
  • call_id – The call ID to be matched.

  • local_tag – The local tag to be matched.

  • remote_tag – The remote tag to be matched.

  • lock_dialog – If non-zero, instruct the function to lock the matching dialog with pjsip_dlg_inc_lock(). Application is responsible to release the dialog’s lock after it has finished manipulating the dialog, by calling pjsip_dlg_dec_lock().

Returns

The matching dialog instance, or NULL if no matching dialog is found.

pj_status_t pjsip_ua_destroy(void)

Destroy the user agent layer.

Returns

PJ_SUCCESS on success.

void pjsip_ua_dump(pj_bool_t detail)

Dump user agent contents (e.g. all dialogs).

Parameters

detail – If non-zero, list of dialogs will be printed.

pjsip_endpoint *pjsip_ua_get_endpt(pjsip_user_agent *ua)

Get the endpoint instance of a user agent module.

Parameters

ua – The user agent instance.

Returns

The endpoint instance where the user agent is registered.

struct pjsip_ua_init_param
#include <sip_ua_layer.h>

User agent initialization parameter.