WARNING: The online documentation has moved to https://docs.pjsip.org.

Visit the new documentation at https://docs.pjsip.org:

BLOG | DOCUMENTATION | GITHUB

Home --> Documentations --> PJSIP Reference

SIP Session Timers support (RFC 4028 - Session Timers in SIP)

SIP Session Timers support (RFC 4028 - Session Timers in SIP) More...

Data Structures

struct  pjsip_timer_setting
 
struct  pjsip_sess_expires_hdr
 
struct  pjsip_min_se_hdr
 

Typedefs

typedef struct pjsip_timer pjsip_timer
 

Functions

pj_status_t pjsip_timer_init_module (pjsip_endpoint *endpt)
 
pj_status_t pjsip_timer_setting_default (pjsip_timer_setting *setting)
 
pj_status_t pjsip_timer_init_session (pjsip_inv_session *inv, const pjsip_timer_setting *setting)
 
pjsip_sess_expires_hdrpjsip_sess_expires_hdr_create (pj_pool_t *pool)
 
pjsip_min_se_hdrpjsip_min_se_hdr_create (pj_pool_t *pool)
 
pj_status_t pjsip_timer_update_req (pjsip_inv_session *inv, pjsip_tx_data *tdata)
 
pj_status_t pjsip_timer_process_resp (pjsip_inv_session *inv, const pjsip_rx_data *rdata, pjsip_status_code *st_code)
 
pj_status_t pjsip_timer_handle_refresh_error (pjsip_inv_session *inv, pjsip_event *event)
 
pj_status_t pjsip_timer_process_req (pjsip_inv_session *inv, const pjsip_rx_data *rdata, pjsip_status_code *st_code)
 
pj_status_t pjsip_timer_update_resp (pjsip_inv_session *inv, pjsip_tx_data *tdata)
 
pj_status_t pjsip_timer_end_session (pjsip_inv_session *inv)
 

Detailed Description

References

References:

Typedef Documentation

◆ pjsip_timer

typedef struct pjsip_timer pjsip_timer

Opaque declaration of Session Timers.

Function Documentation

◆ pjsip_timer_init_module()

pj_status_t pjsip_timer_init_module ( pjsip_endpoint endpt)

Initialize Session Timers module. This function must be called once during application initialization, to register this module to SIP endpoint.

Parameters
endptThe SIP endpoint instance.
Returns
PJ_SUCCESS if module is successfully initialized.

◆ pjsip_timer_setting_default()

pj_status_t pjsip_timer_setting_default ( pjsip_timer_setting setting)

Initialize Session Timers setting with default values.

Parameters
settingSession Timers setting to be initialized.
Returns
PJ_SUCCESS on successful.

◆ pjsip_timer_init_session()

pj_status_t pjsip_timer_init_session ( pjsip_inv_session inv,
const pjsip_timer_setting setting 
)

Initialize Session Timers for an invite session. This function should be called by application to apply Session Timers setting, otherwise invite session will apply default setting to the Session Timers.

Parameters
invThe invite session.
settingSession Timers setting, see pjsip_timer_setting. If setting is NULL, default setting will be applied.
Returns
PJ_SUCCESS on successful.

◆ pjsip_sess_expires_hdr_create()

pjsip_sess_expires_hdr * pjsip_sess_expires_hdr_create ( pj_pool_t pool)

Create Session-Expires header.

Parameters
poolPool to allocate the header instance from.
Returns
An empty Session-Expires header instance.

◆ pjsip_min_se_hdr_create()

pjsip_min_se_hdr * pjsip_min_se_hdr_create ( pj_pool_t pool)

Create Min-SE header.

Parameters
poolPool to allocate the header instance from.
Returns
An empty Min-SE header instance.

◆ pjsip_timer_update_req()

pj_status_t pjsip_timer_update_req ( pjsip_inv_session inv,
pjsip_tx_data tdata 
)

Update outgoing request to insert Session Timers headers and also signal Session Timers capability in Supported and/or Require headers.

This function will be called internally by the invite session if it detects that the session needs Session Timers support.

Parameters
invThe invite session.
tdataOutgoing INVITE or UPDATE request.
Returns
PJ_SUCCESS on successful.

◆ pjsip_timer_process_resp()

pj_status_t pjsip_timer_process_resp ( pjsip_inv_session inv,
const pjsip_rx_data rdata,
pjsip_status_code st_code 
)

Process Session Timers headers in incoming response, this function will only process incoming response with status code 422 (Session Interval Too Small) or 2xx (final response).

This function will be called internally by the invite session if it detects that the session needs Session Timers support.

Parameters
invThe invite session.
rdataIncoming response data.
st_codeOutput buffer to store corresponding SIP status code when function returning non-PJ_SUCCESS.
Returns
PJ_SUCCESS on successful.

◆ pjsip_timer_handle_refresh_error()

pj_status_t pjsip_timer_handle_refresh_error ( pjsip_inv_session inv,
pjsip_event event 
)

Process Session Timers refresh error, this function will process error from refresh request. The error will be handle according the error code, i.e : BYE will be sent after error 503 (Transport Error).

Parameters
invThe invite session.
eventThe event that trigger the error.
Returns
PJ_SUCCESS on successful.

◆ pjsip_timer_process_req()

pj_status_t pjsip_timer_process_req ( pjsip_inv_session inv,
const pjsip_rx_data rdata,
pjsip_status_code st_code 
)

Process Session Timers headers in incoming request, this function will only process incoming INVITE and UPDATE request.

This function will be called internally by the invite session if it detects that the session needs Session Timers support.

Parameters
invThe invite session.
rdataIncoming INVITE or UPDATE request.
st_codeOutput buffer to store corresponding SIP status code when function returning non-PJ_SUCCESS.
Returns
PJ_SUCCESS on successful.

◆ pjsip_timer_update_resp()

pj_status_t pjsip_timer_update_resp ( pjsip_inv_session inv,
pjsip_tx_data tdata 
)

Update outgoing response to insert Session Timers headers and also signal Session Timers capability in Supported and/or Require headers. This function will only update outgoing response with status code 422 (Session Interval Too Small) or 2xx (final response).

This function will be called internally by the invite session if it detects that the session needs Session Timers support.

Parameters
invThe invite session.
tdataOutgoing 422/2xx response.
Returns
PJ_SUCCESS on successful.

◆ pjsip_timer_end_session()

pj_status_t pjsip_timer_end_session ( pjsip_inv_session inv)

End Session Timers in an invite session.

This function will be called internally by the invite session if it detects that the session needs Session Timers support.

Parameters
invThe invite session.
Returns
PJ_SUCCESS on successful.

References PJ_END_DECL.

 


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