BLOG | DOCUMENTATION | GITHUB

Home --> Documentations --> PJSIP Reference

#include <sip_module.h>

Public Member Functions

 PJ_DECL_LIST_MEMBER (struct pjsip_module)
 

Data Fields

pj_str_t name
 
int id
 
int priority
 
pj_status_t(* load )(pjsip_endpoint *endpt)
 
pj_status_t(* start )(void)
 
pj_status_t(* stop )(void)
 
pj_status_t(* unload )(void)
 
pj_bool_t(* on_rx_request )(pjsip_rx_data *rdata)
 
pj_bool_t(* on_rx_response )(pjsip_rx_data *rdata)
 
pj_status_t(* on_tx_request )(pjsip_tx_data *tdata)
 
pj_status_t(* on_tx_response )(pjsip_tx_data *tdata)
 
void(* on_tsx_state )(pjsip_transaction *tsx, pjsip_event *event)
 

Detailed Description

The declaration for SIP module. This structure would be passed to pjsip_endpt_register_module() to register the module to PJSIP.

Forward declaration for module (sip_module.h).

Member Function Documentation

◆ PJ_DECL_LIST_MEMBER()

pjsip_module::PJ_DECL_LIST_MEMBER ( struct pjsip_module  )

To allow chaining of modules in the endpoint.

Field Documentation

◆ name

pj_str_t pjsip_module::name

Module name to identify the module.

This field MUST be initialized before registering the module.

◆ id

int pjsip_module::id

Module ID. Application must initialize this field with -1 before registering the module to PJSIP. After the module is registered, this field will contain a unique ID to identify the module.

◆ priority

int pjsip_module::priority

Integer number to identify module initialization and start order with regard to other modules. Higher number will make the module gets initialized later.

This field MUST be initialized before registering the module.

◆ load

pj_status_t(* pjsip_module::load) (pjsip_endpoint *endpt)

Optional function to be called to initialize the module. This function will be called by endpoint during module registration. If the value is NULL, then it's equal to returning PJ_SUCCESS.

Parameters
endptThe endpoint instance.
Returns
Module should return PJ_SUCCESS to indicate success.

◆ start

pj_status_t(* pjsip_module::start) (void)

Optional function to be called to start the module. This function will be called by endpoint during module registration. If the value is NULL, then it's equal to returning PJ_SUCCESS.

Returns
Module should return zero to indicate success.

◆ stop

pj_status_t(* pjsip_module::stop) (void)

Optional function to be called to deinitialize the module before it is unloaded. This function will be called by endpoint during module unregistration. If the value is NULL, then it's equal to returning PJ_SUCCESS.

Returns
Module should return PJ_SUCCESS to indicate success.

◆ unload

pj_status_t(* pjsip_module::unload) (void)

Optional function to be called to deinitialize the module before it is unloaded. This function will be called by endpoint during module unregistration. If the value is NULL, then it's equal to returning PJ_SUCCESS.

Parameters
modThe module.
Returns
Module should return PJ_SUCCESS to indicate success.

◆ on_rx_request

pj_bool_t(* pjsip_module::on_rx_request) (pjsip_rx_data *rdata)

Optional function to be called to process incoming request message.

Parameters
rdataThe incoming message.
Returns
Module should return PJ_TRUE if it handles the request, or otherwise it should return PJ_FALSE to allow other modules to handle the request.

◆ on_rx_response

pj_bool_t(* pjsip_module::on_rx_response) (pjsip_rx_data *rdata)

Optional function to be called to process incoming response message.

Parameters
rdataThe incoming message.
Returns
Module should return PJ_TRUE if it handles the response, or otherwise it should return PJ_FALSE to allow other modules to handle the response.

◆ on_tx_request

pj_status_t(* pjsip_module::on_tx_request) (pjsip_tx_data *tdata)

Optional function to be called when transport layer is about to transmit outgoing request message.

Parameters
tdataThe outgoing request message.
Returns
Module should return PJ_SUCCESS in all cases. If non-zero (or PJ_FALSE) is returned, the message will not be sent.

◆ on_tx_response

pj_status_t(* pjsip_module::on_tx_response) (pjsip_tx_data *tdata)

Optional function to be called when transport layer is about to transmit outgoing response message.

Parameters
tdataThe outgoing response message.
Returns
Module should return PJ_SUCCESS in all cases. If non-zero (or PJ_FALSE) is returned, the message will not be sent.

◆ on_tsx_state

void(* pjsip_module::on_tsx_state) (pjsip_transaction *tsx, pjsip_event *event)

Optional function to be called when this module is acting as transaction user for the specified transaction, when the transaction's state has changed.

Parameters
tsxThe transaction.
eventThe event which has caused the transaction state to change.

The documentation for this struct was generated from the following file:

 


PJSIP Open Source, high performance, small footprint, and very very portable SIP stack
Copyright (C) 2006-2008 Teluu Inc.