Home --> Documentations --> PJSIP Reference
#include <evsub.h>
|
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) |
|
This structure describes callback that is registered by application or package to receive notifications about subscription events.
- See also
- pjsip_evsub_user
◆ on_evsub_state
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
-
sub | The subscription instance. |
event | The 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
This callback is called when transaction state has changed.
- Parameters
-
sub | The subscription instance. |
tsx | Transaction. |
event | The event. |
◆ on_rx_refresh
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
-
sub | The subscription instance. |
rdata | The received SUBSCRIBE request. |
p_st_code | Application 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_text | Custom status text, if any. |
res_hdr | Upon return, application can put additional headers to be sent in the response in this list. |
p_body | Application MAY specify message body to be sent in the response. |
◆ on_rx_notify
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
-
sub | The subscription instance. |
rdata | The received NOTIFY request. |
p_st_code | Application MUST set the value of this argument with final status code (200-699) upon returning from the callback. |
p_st_text | Custom status text, if any. |
res_hdr | Upon return, application can put additional headers to be sent in the response in this list. |
p_body | Application 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
-
sub | The 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.
|