Asterisk - The Open Source Telephony Project GIT-master-2de1a68
Data Fields
ast_sip_notifier Struct Reference

#include <res_pjsip_pubsub.h>

Data Fields

const char * default_accept
 Default body type defined for the event package this notifier handles. More...
 
void *(* get_notify_data )(struct ast_sip_subscription *sub)
 Supply data needed to create a NOTIFY body. More...
 
int(* get_resource_display_name )(struct ast_sip_endpoint *endpoint, const char *resource, char *display_name, int display_name_size)
 Supply Display Name for resource. More...
 
int(* new_subscribe )(struct ast_sip_endpoint *endpoint, const char *resource)
 Called when a SUBSCRIBE arrives attempting to establish a new subscription. More...
 
int(* new_subscribe_with_rdata )(struct ast_sip_endpoint *endpoint, const char *resource, pjsip_rx_data *rdata)
 Same as new_subscribe, but also pass a handle to the pjsip_rx_data. More...
 
int(* notify_created )(struct ast_sip_subscription *sub, pjsip_tx_data *tdata)
 Optional callback to execute before sending outgoing NOTIFY requests. Because res_pjsip_pubsub creates the tdata internally, this allows modules to access the tdata if needed, e.g. to add custom headers. More...
 
int(* refresh_subscribe )(struct ast_sip_subscription *sub, pjsip_rx_data *rdata)
 Called when a SUBSCRIBE arrives for an already active subscription. More...
 
int(* subscription_established )(struct ast_sip_subscription *sub)
 Called when an inbound subscription has been accepted. More...
 

Detailed Description

Definition at line 248 of file res_pjsip_pubsub.h.

Field Documentation

◆ default_accept

const char* default_accept

Default body type defined for the event package this notifier handles.

Typically, a SUBSCRIBE request will contain one or more Accept headers that tell what format they expect the body of NOTIFY requests to use. However, every event package is required to define a default body format type to be used if a SUBSCRIBE request for the event contains no Accept header.

Definition at line 257 of file res_pjsip_pubsub.h.

◆ get_notify_data

void *(* get_notify_data) (struct ast_sip_subscription *sub)

Supply data needed to create a NOTIFY body.

The returned data must be an ao2 object. The caller of this function will be responsible for decrementing the refcount of the returned object

Parameters
subThe subscription
Returns
An ao2 object that can be used to create a NOTIFY body.

Definition at line 327 of file res_pjsip_pubsub.h.

◆ get_resource_display_name

int(* get_resource_display_name) (struct ast_sip_endpoint *endpoint, const char *resource, char *display_name, int display_name_size)

Supply Display Name for resource.

Parameters
endpointThe endpoint from which we received the SUBSCRIBE
resourceThe name of the resource to which the subscription is being made
display_namebuffer for Display Name
display_name_sizesize of display_name buffer
Return values
0Success
-1Failure

Definition at line 338 of file res_pjsip_pubsub.h.

◆ new_subscribe

int(* new_subscribe) (struct ast_sip_endpoint *endpoint, const char *resource)

Called when a SUBSCRIBE arrives attempting to establish a new subscription.

The notifier is expected to return the response that should be sent to the SUBSCRIBE request.

If a 200-class response is returned, then the notifier's notify_required callback will immediately be called into with a reason of AST_SIP_SUBSCRIPTION_NOTIFY_REASON_STARTED.

Parameters
endpointThe endpoint from which we received the SUBSCRIBE
resourceThe name of the resource to which the subscription is being made
Returns
The response code to send to the SUBSCRIBE.

Definition at line 272 of file res_pjsip_pubsub.h.

◆ new_subscribe_with_rdata

int(* new_subscribe_with_rdata) (struct ast_sip_endpoint *endpoint, const char *resource, pjsip_rx_data *rdata)

Same as new_subscribe, but also pass a handle to the pjsip_rx_data.

Note
If this callback exists, it will be executed, otherwise new_subscribe will be. Only use this if you need the rdata. Otherwise, use new_subscribe.
Parameters
endpointThe endpoint from which we received the SUBSCRIBE
resourceThe name of the resource to which the subscription is being made
rdataThe pjsip_rx_data for incoming subscription
Returns
The response code to send to the SUBSCRIBE.

Definition at line 284 of file res_pjsip_pubsub.h.

◆ notify_created

int(* notify_created) (struct ast_sip_subscription *sub, pjsip_tx_data *tdata)

Optional callback to execute before sending outgoing NOTIFY requests. Because res_pjsip_pubsub creates the tdata internally, this allows modules to access the tdata if needed, e.g. to add custom headers.

Parameters
subThe existing subscription
tdataThe pjsip_tx_data to use for the outgoing NOTIFY
Return values
0Success
-1Failure

Definition at line 317 of file res_pjsip_pubsub.h.

Referenced by send_notify().

◆ refresh_subscribe

int(* refresh_subscribe) (struct ast_sip_subscription *sub, pjsip_rx_data *rdata)

Called when a SUBSCRIBE arrives for an already active subscription.

Parameters
subThe existing subscription
Return values
0Success
-1Failure

Definition at line 306 of file res_pjsip_pubsub.h.

Referenced by pubsub_on_rx_refresh().

◆ subscription_established

int(* subscription_established) (struct ast_sip_subscription *sub)

Called when an inbound subscription has been accepted.

This is a prime opportunity for notifiers to add any notifier-specific data to the subscription (such as datastores) that it needs to.

Note
There is no need to send a NOTIFY request when this callback is called
Parameters
subThe new subscription
Return values
0Success
-1Failure

Definition at line 298 of file res_pjsip_pubsub.h.


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