Asterisk - The Open Source Telephony Project  18.5.0
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(* new_subscribe )(struct ast_sip_endpoint *endpoint, const char *resource)
 Called when a SUBSCRIBE arrives attempting to establish a new subscription. More...
 
int(* subscription_established )(struct ast_sip_subscription *sub)
 Called when an inbound subscription has been accepted. More...
 

Detailed Description

Definition at line 246 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 255 of file res_pjsip_pubsub.h.

Referenced by subscription_get_generator_from_rdata().

◆ 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 294 of file res_pjsip_pubsub.h.

Referenced by generate_initial_notify().

◆ 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 270 of file res_pjsip_pubsub.h.

Referenced by build_node_children(), and build_resource_tree().

◆ 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 284 of file res_pjsip_pubsub.h.

Referenced by generate_initial_notify().


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