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

#include <evsub.h>

Data Fields

void(* on_evsub_state )(pjsip_evsub *sub, pjsip_event *event)
 
void(* on_tsx_state )(pjsip_evsub *sub, pjsip_transaction *tsx, pjsip_event *event)
 
void(* on_rx_refresh )(pjsip_evsub *sub, pjsip_rx_data *rdata, int *p_st_code, pj_str_t **p_st_text, pjsip_hdr *res_hdr, pjsip_msg_body **p_body)
 
void(* on_rx_notify )(pjsip_evsub *sub, pjsip_rx_data *rdata, int *p_st_code, pj_str_t **p_st_text, pjsip_hdr *res_hdr, pjsip_msg_body **p_body)
 
void(* on_client_refresh )(pjsip_evsub *sub)
 
void(* on_server_timeout )(pjsip_evsub *sub)
 

Detailed Description

This structure describes callback that is registered by application or package to receive notifications about subscription events.

See also
pjsip_evsub_user

Field Documentation

◆ on_evsub_state

void(* pjsip_evsub_user::on_evsub_state) (pjsip_evsub *sub, pjsip_event *event)

This callback is called when subscription state has changed. Application MUST be prepared to receive NULL event and events with type other than PJSIP_EVENT_TSX_STATE

This callback is OPTIONAL.

Parameters
subThe subscription instance.
eventThe event that has caused the state to change, which may be NULL or may have type other than PJSIP_EVENT_TSX_STATE.

◆ on_tsx_state

void(* pjsip_evsub_user::on_tsx_state) (pjsip_evsub *sub, pjsip_transaction *tsx, pjsip_event *event)

This callback is called when transaction state has changed.

Parameters
subThe subscription instance.
tsxTransaction.
eventThe event.

◆ on_rx_refresh

void(* pjsip_evsub_user::on_rx_refresh) (pjsip_evsub *sub, pjsip_rx_data *rdata, int *p_st_code, pj_str_t **p_st_text, pjsip_hdr *res_hdr, pjsip_msg_body **p_body)

This callback is called when incoming SUBSCRIBE (or any method that establishes the subscription in the first place) is received. It allows application to specify what response should be sent to remote, along with additional headers and message body to be put in the response.

This callback is only applicable and required for UAS.

Upon receiving this callback, implementation MUST send NOTIFY request. The suggested behavior is to call pjsip_evsub_current_notify(), since this function takes care about unsubscription request and calculates the appropriate expiration interval.

Parameters
subThe subscription instance.
rdataThe received SUBSCRIBE request.
p_st_codeApplication MUST set the value of this argument with final status code (200-699) upon returning from the callback. Only applicable for refresh request. For unsubscription, the library will always reply with 200.
p_st_textCustom status text, if any.
res_hdrUpon return, application can put additional headers to be sent in the response in this list.
p_bodyApplication MAY specify message body to be sent in the response.

◆ on_rx_notify

void(* pjsip_evsub_user::on_rx_notify) (pjsip_evsub *sub, pjsip_rx_data *rdata, int *p_st_code, pj_str_t **p_st_text, pjsip_hdr *res_hdr, pjsip_msg_body **p_body)

This callback is called when client/subscriber received incoming NOTIFY request. It allows the application to specify what response should be sent to remote, along with additional headers and message body to be put in the response.

This callback is OPTIONAL. When it is not implemented, the default behavior is to respond incoming NOTIFY request with 200 (OK).

Parameters
subThe subscription instance.
rdataThe received NOTIFY request.
p_st_codeApplication MUST set the value of this argument with final status code (200-699) upon returning from the callback.
p_st_textCustom status text, if any.
res_hdrUpon return, application can put additional headers to be sent in the response in this list.
p_bodyApplication MAY specify message body to be sent in the response.

◆ on_client_refresh

void(* pjsip_evsub_user::on_client_refresh) (pjsip_evsub *sub)

This callback is called when it is time for the client to refresh the subscription.

This callback is OPTIONAL when PJSIP package such as presence or refer is used; the event package will refresh subscription by sending SUBSCRIBE with the interval set to current/last interval.

Parameters
subThe subscription instance.

◆ on_server_timeout

void(* pjsip_evsub_user::on_server_timeout) (pjsip_evsub *sub)

This callback is called when server doesn't receive subscription refresh after the specified subscription interval.

This callback is OPTIONAL when PJSIP package such as presence or refer is used; the event package send NOTIFY to terminate the subscription.


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.