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.
void *(* get_notify_data )(struct ast_sip_subscription *sub)
 Supply data needed to create a NOTIFY body.
int(* new_subscribe )(struct ast_sip_endpoint *endpoint, const char *resource)
 Called when a SUBSCRIBE arrives attempting to establish a new subscription.
int(* subscription_established )(struct ast_sip_subscription *sub)
 Called when an inbound subscription has been accepted.


Detailed Description

Definition at line 232 of file res_pjsip_pubsub.h.


Field Documentation

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

Referenced by subscription_get_generator_from_rdata().

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:
sub The subscription
Returns:
An ao2 object that can be used to create a NOTIFY body.

Referenced by generate_initial_notify().

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:
endpoint The endpoint from which we received the SUBSCRIBE
resource The name of the resource to which the subscription is being made
Returns:
The response code to send to the SUBSCRIBE.

Referenced by build_node_children(), and build_resource_tree().

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:
sub The new subscription
Return values:
0 Success
-1 Failure

Referenced by generate_initial_notify().


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

Generated on Thu Apr 16 06:35:36 2015 for Asterisk - The Open Source Telephony Project by  doxygen 1.5.6