19 #ifndef _RES_PJSIP_PUBSUB_H
20 #define _RES_PJSIP_PUBSUB_H
37 enum ast_sip_publish_state {
39 AST_SIP_PUBLISH_STATE_INITIALIZED,
41 AST_SIP_PUBLISH_STATE_ACTIVE,
43 AST_SIP_PUBLISH_STATE_TERMINATED,
89 enum ast_sip_publish_state
state);
116 const
char *ast_sip_publication_get_event_configuration(const struct
ast_sip_publication *pub);
166 void ast_sip_publication_remove_datastore(struct
ast_sip_publication *publication, const
char *name);
190 enum ast_sip_subscription_role {
219 #define AST_SIP_MAX_ACCEPT 32
220 enum ast_sip_subscription_notify_reason {
222 AST_SIP_SUBSCRIPTION_NOTIFY_REASON_STARTED,
224 AST_SIP_SUBSCRIPTION_NOTIFY_REASON_RENEWED,
226 AST_SIP_SUBSCRIPTION_NOTIFY_REASON_TERMINATED,
228 AST_SIP_SUBSCRIPTION_NOTIFY_REASON_OTHER
232 #define AST_SIP_EXTEN_STATE_DATA "ast_sip_exten_state_data"
234 #define AST_SIP_MESSAGE_ACCUMULATOR "ast_sip_message_accumulator"
236 #define AST_SIP_DEVICE_FEATURE_SYNC_DATA "ast_sip_device_feature_sync_data"
284 int (*new_subscribe_with_rdata)(
struct ast_sip_endpoint *endpoint,
const char *resource, pjsip_rx_data *rdata);
338 int (*get_resource_display_name)(
struct ast_sip_endpoint *endpoint,
const char *resource,
char *display_name,
int display_name_size);
364 const char *accept[AST_SIP_MAX_ACCEPT];
468 void ast_sip_subscription_get_local_uri(struct
ast_sip_subscription *sub,
char *buf,
size_t size);
479 void ast_sip_subscription_get_remote_uri(struct
ast_sip_subscription *sub,
char *buf,
size_t size);
576 void ast_sip_subscription_remove_datastore(struct
ast_sip_subscription *subscription, const
char *name);
661 void *(*allocate_body)(
void *data);
673 int (*generate_body_content)(
void *body,
void *data);
680 void (*to_string)(
void *body,
struct ast_str **str);
689 void (*destroy_body)(
void *body);
723 int (*supplement_body)(
void *body,
void *data);
743 int ast_sip_pubsub_generate_body_content(const
char *content_type,
757 int ast_sip_pubsub_is_body_generator_registered(const
char *type, const
char *subtype);
771 int ast_sip_pubsub_register_body_generator(struct ast_sip_pubsub_body_generator *generator);
779 void ast_sip_pubsub_unregister_body_generator(struct ast_sip_pubsub_body_generator *generator);
793 int ast_sip_pubsub_register_body_supplement(struct ast_sip_pubsub_body_supplement *supplement);
801 void ast_sip_pubsub_unregister_body_supplement(struct ast_sip_pubsub_body_supplement *supplement);
const char * event_name
The name of the event this handler deals with.
struct ast_sip_subscriber * subscriber
const char * type
Content type In "plain/text", "plain" is the type.
Data used to create bodies for NOTIFY/PUBLISH requests.
struct ast_sip_notifier * notifier
Structure for variables, used for configurations and for channel variables.
int(* new_publication)(struct ast_sip_endpoint *endpoint, const char *resource, const char *event_configuration)
Called when a PUBLISH to establish a new publication arrives.
Structure for a data store type.
const char * type
Content type In "plain/text", "plain" is the type.
Structure for a data store object.
void(* publish_expire)(struct ast_sip_publication *pub)
Called when a publication has reached its expiration.
const char * subtype
Content subtype In "plain/text", "text" is the subtype.
A set of macros to manage forward-linked lists.
An entity with which Asterisk communicates.
const char * subtype
Content subtype In "plain/text", "text" is the subtype.
Structure representing a "virtual" SIP subscription.
int(* publication_state_change)(struct ast_sip_publication *pub, pjsip_msg_body *body, enum ast_sip_publish_state state)
Published resource has changed states.
struct ast_sip_publish_handler * handler
Handler for this publication.
Support for dynamic strings.
Callbacks that publication handlers will define.
#define AST_LIST_ENTRY(type)
Declare a forward link structure inside a list entry.
struct ast_sip_body * body
A ast_taskprocessor structure is a singleton by name.
Abstract JSON element (object, array, string, int, ...).
Structure representing a SIP publication.
const char * default_accept
Default body type defined for the event package this notifier handles.
struct ao2_container * publications
Publications.
struct ast_variable * headers
Data for responses to SUBSCRIBEs and NOTIFIEs.