Asterisk - The Open Source Telephony Project
18.5.0
|
#include "asterisk.h"
#include <pjsip.h>
#include <pjsip_simple.h>
#include <pjlib.h>
#include "asterisk/mwi.h"
#include "asterisk/res_pjsip_pubsub.h"
#include "asterisk/module.h"
#include "asterisk/linkedlists.h"
#include "asterisk/astobj2.h"
#include "asterisk/datastore.h"
#include "asterisk/uuid.h"
#include "asterisk/taskprocessor.h"
#include "asterisk/sched.h"
#include "asterisk/res_pjsip.h"
#include "asterisk/callerid.h"
#include "asterisk/manager.h"
#include "asterisk/cli.h"
#include "asterisk/test.h"
#include "res_pjsip/include/res_pjsip_private.h"
#include "asterisk/res_pjsip_presence_xml.h"
Go to the source code of this file.
Data Structures | |
struct | ast_sip_publication |
Structure representing a SIP publication. More... | |
struct | ast_sip_publication_resource |
Structure representing a publication resource. More... | |
struct | ast_sip_subscription |
Structure representing a "virtual" SIP subscription. More... | |
struct | body_generators |
struct | body_part |
A multipart body part and meta-information. More... | |
struct | body_supplements |
struct | cli_sub_complete_parms |
struct | cli_sub_parms |
struct | initial_notify_data |
struct | persistence_recreate_data |
struct | publish_handlers |
struct | resource_list |
Resource list configuration item. More... | |
struct | resource_tree |
A resource tree. More... | |
struct | simple_message_summary |
struct | sip_subscription_tree |
A tree of SIP subscriptions. More... | |
struct | subscription_handlers |
struct | subscription_persistence |
Structure used for persisting an inbound subscription. More... | |
struct | subscriptions |
struct | tree_node |
A node for a resource tree. More... | |
Macros | |
#define | AMI_SHOW_SUBSCRIPTIONS_INBOUND "PJSIPShowSubscriptionsInbound" |
#define | AMI_SHOW_SUBSCRIPTIONS_OUTBOUND "PJSIPShowSubscriptionsOutbound" |
#define | CLI_LIST_SUB_FORMAT_ENTRY "%-30.30s %-30.30s %6d %s\n" |
#define | CLI_LIST_SUB_FORMAT_HEADER "%-30.30s %-30.30s %6.6s %s\n" |
#define | CLI_SHOW_SUB_FORMAT_ENTRY |
#define | CLI_SHOW_SUB_FORMAT_HEADER |
#define | DATASTORE_BUCKETS 53 |
Number of buckets for subscription datastore. More... | |
#define | DEFAULT_EXPIRES 3600 |
Default expiration for subscriptions. More... | |
#define | DEFAULT_PUBLISH_EXPIRES 3600 |
Default expiration time for PUBLISH if one is not specified. More... | |
#define | MAX_REGEX_ERROR_LEN 128 |
#define | MOD_DATA_MSG "sub_msg" |
#define | MOD_DATA_PERSISTENCE "sub_persistence" |
#define | PUBLICATIONS_BUCKETS 37 |
Number of buckets for publications (on a per handler) More... | |
#define | RESOURCE_LIST_INIT_SIZE 4 |
Typedefs | |
typedef int(* | on_subscription_t) (struct sip_subscription_tree *sub, void *arg) |
Enumerations | |
enum | sip_persistence_update_type { SUBSCRIPTION_PERSISTENCE_SEND_REQUEST = 0, SUBSCRIPTION_PERSISTENCE_CREATED, SUBSCRIPTION_PERSISTENCE_RECREATED, SUBSCRIPTION_PERSISTENCE_REFRESHED } |
enum | sip_publish_type { SIP_PUBLISH_UNKNOWN, SIP_PUBLISH_INITIAL, SIP_PUBLISH_REFRESH, SIP_PUBLISH_MODIFY, SIP_PUBLISH_REMOVE, SIP_PUBLISH_UNKNOWN, SIP_PUBLISH_INITIAL, SIP_PUBLISH_REFRESH, SIP_PUBLISH_MODIFY, SIP_PUBLISH_REMOVE } |
The types of PUBLISH messages defined in RFC 3903. More... | |
enum | sip_subscription_tree_state { SIP_SUB_TREE_NORMAL = 0, SIP_SUB_TREE_TERMINATE_PENDING, SIP_SUB_TREE_TERMINATE_IN_PROGRESS, SIP_SUB_TREE_TERMINATED } |
The state of the subscription tree. More... | |
Functions | |
static void | __reg_module (void) |
static void | __unreg_module (void) |
static void | add_rlmi_resource (pj_pool_t *pool, pj_xml_node *rlmi, const pjsip_generic_string_hdr *cid, const char *resource_name, const pjsip_sip_uri *resource_uri, pjsip_evsub_state state) |
Add a resource XML element to an RLMI body. More... | |
static void | add_subscription (struct sip_subscription_tree *obj) |
static struct body_part * | allocate_body_part (pj_pool_t *pool, const struct ast_sip_subscription *sub) |
Allocate and initialize a body part structure. More... | |
static struct ast_sip_subscription * | allocate_subscription (const struct ast_sip_subscription_handler *handler, const char *resource, struct sip_subscription_tree *tree) |
static struct sip_subscription_tree * | allocate_subscription_tree (struct ast_sip_endpoint *endpoint, pjsip_rx_data *rdata) |
static int | allocate_tdata_buffer (pjsip_tx_data *tdata) |
Pre-allocate a buffer for the transmission. More... | |
static int | ami_show_resource_lists (struct mansession *s, const struct message *m) |
static int | ami_show_subscriptions_inbound (struct mansession *s, const struct message *m) |
static int | ami_show_subscriptions_outbound (struct mansession *s, const struct message *m) |
static int | ami_subscription_detail (struct sip_subscription_tree *sub_tree, struct ast_sip_ami *ami, const char *event) |
static int | ami_subscription_detail_inbound (struct sip_subscription_tree *sub_tree, void *arg) |
static int | ami_subscription_detail_outbound (struct sip_subscription_tree *sub_tree, void *arg) |
static int | apply_list_configuration (struct ast_sorcery *sorcery) |
struct ast_module * | AST_MODULE_SELF_SYM (void) |
struct ast_sip_subscription * | ast_sip_create_subscription (const struct ast_sip_subscription_handler *handler, struct ast_sip_endpoint *endpoint, const char *resource) |
Create a new ast_sip_subscription structure. More... | |
int | ast_sip_publication_add_datastore (struct ast_sip_publication *publication, struct ast_datastore *datastore) |
Add a datastore to a SIP publication. More... | |
struct ast_datastore * | ast_sip_publication_get_datastore (struct ast_sip_publication *publication, const char *name) |
Retrieve a publication datastore. More... | |
struct ao2_container * | ast_sip_publication_get_datastores (const struct ast_sip_publication *publication) |
Get the datastores container for a publication. More... | |
struct ast_sip_endpoint * | ast_sip_publication_get_endpoint (struct ast_sip_publication *pub) |
Given a publication, get the associated endpoint. More... | |
const char * | ast_sip_publication_get_event_configuration (const struct ast_sip_publication *pub) |
Given a publication, get the configuration name for the event type in use. More... | |
const char * | ast_sip_publication_get_resource (const struct ast_sip_publication *pub) |
Given a publication, get the resource the publication is to. More... | |
void | ast_sip_publication_remove_datastore (struct ast_sip_publication *publication, const char *name) |
Remove a publication datastore from the publication. More... | |
int | ast_sip_pubsub_generate_body_content (const char *type, const char *subtype, struct ast_sip_body_data *data, struct ast_str **str) |
Generate body content for a PUBLISH or NOTIFY. More... | |
static int | ast_sip_pubsub_has_eventlist_support (pjsip_rx_data *rdata) |
Check if the rdata has a Supported header containing 'eventlist'. More... | |
int | ast_sip_pubsub_is_body_generator_registered (const char *type, const char *subtype) |
Is a body generator registered for the given type/subtype. More... | |
int | ast_sip_pubsub_register_body_generator (struct ast_sip_pubsub_body_generator *generator) |
Register a body generator with the pubsub core. More... | |
int | ast_sip_pubsub_register_body_supplement (struct ast_sip_pubsub_body_supplement *supplement) |
Register a body generator with the pubsub core. More... | |
void | ast_sip_pubsub_unregister_body_generator (struct ast_sip_pubsub_body_generator *generator) |
Unregister a body generator with the pubsub core. More... | |
void | ast_sip_pubsub_unregister_body_supplement (struct ast_sip_pubsub_body_supplement *supplement) |
Unregister a body generator with the pubsub core. More... | |
int | ast_sip_register_publish_handler (struct ast_sip_publish_handler *handler) |
Register a publish handler. More... | |
int | ast_sip_register_subscription_handler (struct ast_sip_subscription_handler *handler) |
Register a subscription handler. More... | |
int | ast_sip_subscription_add_datastore (struct ast_sip_subscription *subscription, struct ast_datastore *datastore) |
Add a datastore to a SIP subscription. More... | |
struct ast_datastore * | ast_sip_subscription_alloc_datastore (const struct ast_datastore_info *info, const char *uid) |
Alternative for ast_datastore_alloc() More... | |
void | ast_sip_subscription_destroy (struct ast_sip_subscription *sub) |
Alert the pubsub core that the subscription is ready for destruction. More... | |
const char * | ast_sip_subscription_get_body_subtype (struct ast_sip_subscription *sub) |
Get the body subtype used for this subscription. More... | |
const char * | ast_sip_subscription_get_body_type (struct ast_sip_subscription *sub) |
Get the body type used for this subscription. More... | |
struct ast_datastore * | ast_sip_subscription_get_datastore (struct ast_sip_subscription *subscription, const char *name) |
Retrieve a subscription datastore. More... | |
struct ao2_container * | ast_sip_subscription_get_datastores (const struct ast_sip_subscription *subscription) |
Get the datastores container for a subscription. More... | |
pjsip_dialog * | ast_sip_subscription_get_dialog (struct ast_sip_subscription *sub) |
Get the pjsip dialog that is associated with this subscription. More... | |
struct ast_sip_endpoint * | ast_sip_subscription_get_endpoint (struct ast_sip_subscription *sub) |
Get the endpoint that is associated with this subscription. More... | |
void * | ast_sip_subscription_get_header (const struct ast_sip_subscription *sub, const char *header) |
Get a header value for a subscription. More... | |
void | ast_sip_subscription_get_local_uri (struct ast_sip_subscription *sub, char *buf, size_t size) |
Retrieve the local URI for this subscription. More... | |
const struct ast_json * | ast_sip_subscription_get_persistence_data (const struct ast_sip_subscription *subscription) |
Retrieve persistence data for a subscription. More... | |
void | ast_sip_subscription_get_remote_uri (struct ast_sip_subscription *sub, char *buf, size_t size) |
Retrive the remote URI for this subscription. More... | |
const char * | ast_sip_subscription_get_resource_name (struct ast_sip_subscription *sub) |
Get the name of the subscribed resource. More... | |
struct ast_taskprocessor * | ast_sip_subscription_get_serializer (struct ast_sip_subscription *sub) |
Get the serializer for the subscription. More... | |
pjsip_sip_uri * | ast_sip_subscription_get_sip_uri (struct ast_sip_subscription *sub) |
Retrieve the local sip uri for this subscription. More... | |
int | ast_sip_subscription_is_terminated (const struct ast_sip_subscription *sub) |
Get whether the subscription has been terminated or not. More... | |
int | ast_sip_subscription_notify (struct ast_sip_subscription *sub, struct ast_sip_body_data *notify_data, int terminate) |
Notify a SIP subscription of a state change. More... | |
void | ast_sip_subscription_remove_datastore (struct ast_sip_subscription *subscription, const char *name) |
Remove a subscription datastore from the subscription. More... | |
void | ast_sip_subscription_set_persistence_data (struct ast_sip_subscription *subscription, struct ast_json *persistence_data) |
Set persistence data for a subscription. More... | |
void | ast_sip_unregister_publish_handler (struct ast_sip_publish_handler *handler) |
Unregister a publish handler. More... | |
void | ast_sip_unregister_subscription_handler (struct ast_sip_subscription_handler *handler) |
Unregister a subscription handler. More... | |
AST_TEST_DEFINE (resource_tree) | |
AST_TEST_DEFINE (complex_resource_tree) | |
AST_TEST_DEFINE (bad_resource) | |
AST_TEST_DEFINE (bad_branch) | |
AST_TEST_DEFINE (duplicate_resource) | |
AST_TEST_DEFINE (loop) | |
AST_TEST_DEFINE (bad_event) | |
AST_VECTOR (resources, const char *) | |
A vector of strings commonly used throughout this module. More... | |
AST_VECTOR (body_part_list, struct body_part *) | |
Type declaration for container of body part structures. More... | |
static void | build_body_part (pj_pool_t *pool, struct ast_sip_subscription *sub, struct body_part_list *parts, unsigned int use_full_state) |
Create a multipart body part for a subscribed resource. More... | |
static void | build_node_children (struct ast_sip_endpoint *endpoint, const struct ast_sip_subscription_handler *handler, struct resource_list *list, struct tree_node *parent, struct resources *visited) |
Build child nodes for a given parent. More... | |
static int | build_resource_tree (struct ast_sip_endpoint *endpoint, const struct ast_sip_subscription_handler *handler, const char *resource, struct resource_tree *tree, int has_eventlist_support) |
Build a resource tree. More... | |
static pjsip_multipart_part * | build_rlmi_body (pj_pool_t *pool, struct ast_sip_subscription *sub, struct body_part_list *body_parts, unsigned int full_state) |
Create an RLMI body part for a multipart resource list body. More... | |
static int | check_node (struct ast_test *test, struct tree_node *node, const char **resources, size_t num_resources) |
Check the integrity of a tree node against a set of resources. More... | |
static void | cleanup_resource_list (struct resource_list *list) |
RAII callback to destroy a resource list. More... | |
static char * | cli_complete_subscription_callid (struct ast_cli_args *a) |
static int | cli_complete_subscription_common (struct sip_subscription_tree *sub_tree, struct cli_sub_complete_parms *cli) |
static int | cli_complete_subscription_inbound (struct sip_subscription_tree *sub_tree, void *arg) |
static int | cli_complete_subscription_outbound (struct sip_subscription_tree *sub_tree, void *arg) |
static int | cli_list_subscriptions_detail (struct sip_subscription_tree *sub_tree, struct cli_sub_parms *cli) |
static int | cli_list_subscriptions_inbound (struct sip_subscription_tree *sub_tree, void *arg) |
static char * | cli_list_subscriptions_inout (struct ast_cli_entry *e, int cmd, struct ast_cli_args *a) |
static int | cli_list_subscriptions_outbound (struct sip_subscription_tree *sub_tree, void *arg) |
static int | cli_show_subscription_common (struct sip_subscription_tree *sub_tree, struct cli_sub_parms *cli) |
static int | cli_show_subscription_inbound (struct sip_subscription_tree *sub_tree, void *arg) |
static char * | cli_show_subscription_inout (struct ast_cli_entry *e, int cmd, struct ast_cli_args *a) |
static int | cli_show_subscription_outbound (struct sip_subscription_tree *sub_tree, void *arg) |
static int | cli_show_subscriptions_detail (struct sip_subscription_tree *sub_tree, struct cli_sub_parms *cli) |
static int | cli_show_subscriptions_inbound (struct sip_subscription_tree *sub_tree, void *arg) |
static char * | cli_show_subscriptions_inout (struct ast_cli_entry *e, int cmd, struct ast_cli_args *a) |
static int | cli_show_subscriptions_outbound (struct sip_subscription_tree *sub_tree, void *arg) |
static unsigned int | cli_subscription_expiry (struct sip_subscription_tree *sub_tree) |
static pjsip_msg_body * | create_multipart_body (pj_pool_t *pool) |
Create and initialize the PJSIP multipart body structure for a resource list subscription. More... | |
static pjsip_require_hdr * | create_require_eventlist (pj_pool_t *pool) |
Shortcut method to create a Require: eventlist header. More... | |
static struct resource_list * | create_resource_list (struct ast_test *test, const char *list_name, const char *event, const char **resources, size_t num_resources) |
allocate a resource list, store it in sorcery, and set its details More... | |
static struct sip_subscription_tree * | create_subscription_tree (const struct ast_sip_subscription_handler *handler, struct ast_sip_endpoint *endpoint, pjsip_rx_data *rdata, const char *resource, struct ast_sip_pubsub_body_generator *generator, struct resource_tree *tree, pj_status_t *dlg_status, struct subscription_persistence *persistence) |
Create a subscription tree based on a resource tree. More... | |
static struct ast_sip_subscription * | create_virtual_subscriptions (const struct ast_sip_subscription_handler *handler, const char *resource, struct ast_sip_pubsub_body_generator *generator, struct sip_subscription_tree *tree, struct tree_node *current) |
Create a tree of virtual subscriptions based on a resource tree node. More... | |
static void | destroy_subscription (struct ast_sip_subscription *sub) |
static void | destroy_subscriptions (struct ast_sip_subscription *root) |
static enum sip_publish_type | determine_sip_publish_type (pjsip_rx_data *rdata, pjsip_generic_string_hdr *etag_hdr, unsigned int *expires, int *entity_id) |
static int | exceptional_accept (const pj_str_t *accept) |
Is the Accept header from the SUBSCRIBE in the list of exceptions? More... | |
static struct ast_sip_pubsub_body_generator * | find_body_generator (char accept[AST_SIP_MAX_ACCEPT][64], size_t num_accept, const char *body_type) |
static struct ast_sip_pubsub_body_generator * | find_body_generator_accept (const char *accept) |
static struct ast_sip_pubsub_body_generator * | find_body_generator_type_subtype (const char *type, const char *subtype) |
static struct ast_sip_pubsub_body_generator * | find_body_generator_type_subtype_nolock (const char *type, const char *subtype) |
static struct ast_sip_publish_handler * | find_pub_handler (const char *event) |
static struct ast_sip_subscription_handler * | find_sub_handler_for_event_name (const char *event_name) |
static int | for_each_subscription (on_subscription_t on_subscription, void *arg) |
static int | format_ami_resource_lists (void *obj, void *arg, int flags) |
static void | free_body_parts (struct body_part_list *parts) |
Destroy a list of body parts. More... | |
static pjsip_generic_string_hdr * | generate_content_id_hdr (pj_pool_t *pool, const struct ast_sip_subscription *sub) |
Create a Content-ID header. More... | |
static int | generate_initial_notify (struct ast_sip_subscription *sub) |
static pjsip_msg_body * | generate_list_body (pj_pool_t *pool, struct ast_sip_subscription *sub, unsigned int force_full_state) |
Create a resource list body for NOTIFY requests. More... | |
static pjsip_msg_body * | generate_notify_body (pj_pool_t *pool, struct ast_sip_subscription *root, unsigned int force_full_state) |
Create the body for a NOTIFY request. More... | |
static int | have_visited (const char *resource, struct resources *visited) |
Determine if this resource has been visited already. More... | |
static int | ineligible_configuration (void) |
static int | initial_notify_task (void *obj) |
static int | item_in_vector (const struct resource_list *list, const char *item) |
static int | list_item_handler (const struct aco_option *opt, struct ast_variable *var, void *obj) |
static int | list_item_to_str (const void *obj, const intptr_t *args, char **buf) |
static int | load_module (void) |
static int | parse_simple_message_summary (char *body, struct simple_message_summary *summary) |
static int | persistence_endpoint_str2struct (const struct aco_option *opt, struct ast_variable *var, void *obj) |
static int | persistence_endpoint_struct2str (const void *obj, const intptr_t *args, char **buf) |
static int | persistence_expires_str2struct (const struct aco_option *opt, struct ast_variable *var, void *obj) |
static int | persistence_expires_struct2str (const void *obj, const intptr_t *args, char **buf) |
static int | persistence_generator_data_str2struct (const struct aco_option *opt, struct ast_variable *var, void *obj) |
static int | persistence_generator_data_struct2str (const void *obj, const intptr_t *args, char **buf) |
static int | persistence_tag_str2struct (const struct aco_option *opt, struct ast_variable *var, void *obj) |
static int | persistence_tag_struct2str (const void *obj, const intptr_t *args, char **buf) |
static int | populate_list (struct resource_list *list, const char *event, const char **resources, size_t num_resources) |
Set properties on an allocated resource list. More... | |
static int | publication_cmp_fn (void *obj, void *arg, int flags) |
static void | publication_destroy_fn (void *obj) |
Internal destructor for publications. More... | |
static int | publication_hash_fn (const void *obj, const int flags) |
static void * | publication_resource_alloc (const char *name) |
Allocator for publication resource. More... | |
static void | publication_resource_destroy (void *obj) |
Destructor for publication resource. More... | |
static void | publish_add_handler (struct ast_sip_publish_handler *handler) |
static int | publish_expire (const void *data) |
static int | publish_expire_callback (void *data) |
static struct ast_sip_publication * | publish_request_initial (struct ast_sip_endpoint *endpoint, pjsip_rx_data *rdata, struct ast_sip_publish_handler *handler) |
static void | pubsub_on_client_refresh (pjsip_evsub *sub) |
static void | pubsub_on_evsub_state (pjsip_evsub *evsub, pjsip_event *event) |
Callback sequence for subscription terminate: More... | |
static int | pubsub_on_refresh_timeout (void *userdata) |
static pj_bool_t | pubsub_on_rx_mwi_notify_request (pjsip_rx_data *rdata) |
static void | pubsub_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) |
static pj_bool_t | pubsub_on_rx_notify_request (pjsip_rx_data *rdata) |
static pj_bool_t | pubsub_on_rx_publish_request (pjsip_rx_data *rdata) |
static void | pubsub_on_rx_refresh (pjsip_evsub *evsub, pjsip_rx_data *rdata, int *p_st_code, pj_str_t **p_st_text, pjsip_hdr *res_hdr, pjsip_msg_body **p_body) |
Called whenever an in-dialog SUBSCRIBE is received. More... | |
static pj_bool_t | pubsub_on_rx_request (pjsip_rx_data *rdata) |
Opaque structure representing an RFC 3265 SIP subscription. More... | |
static pj_bool_t | pubsub_on_rx_subscribe_request (pjsip_rx_data *rdata) |
static void | pubsub_on_server_timeout (pjsip_evsub *sub) |
static void | remove_subscription (struct sip_subscription_tree *obj) |
static int | resource_endpoint_handler (const struct aco_option *opt, struct ast_variable *var, void *obj) |
static int | resource_event_handler (const struct aco_option *opt, struct ast_variable *var, void *obj) |
static void * | resource_list_alloc (const char *name) |
static int | resource_list_apply_handler (const struct ast_sorcery *sorcery, void *obj) |
static void | resource_list_destructor (void *obj) |
static void | resource_tree_destroy (struct resource_tree *tree) |
Destroy a resource tree. More... | |
static struct resource_list * | retrieve_resource_list (const char *resource, const char *event) |
Helper function for retrieving a resource list for a given event. More... | |
static void * | rlmi_clone_data (pj_pool_t *pool, const void *data, unsigned len) |
static int | rlmi_print_body (struct pjsip_msg_body *msg_body, char *buf, pj_size_t size) |
static int | sched_cb (const void *data) |
static int | schedule_notification (struct sip_subscription_tree *sub_tree) |
static int | send_notify (struct sip_subscription_tree *sub_tree, unsigned int force_full_state) |
Send a NOTIFY request to a subscriber. More... | |
static int | serialized_pubsub_on_client_refresh (void *userdata) |
static int | serialized_pubsub_on_refresh_timeout (void *userdata) |
static int | serialized_send_notify (void *userdata) |
static void | set_state_terminated (struct ast_sip_subscription *sub) |
static void | shutdown_subscriptions (struct ast_sip_subscription *sub) |
static struct ast_sip_publication * | sip_create_publication (struct ast_sip_endpoint *endpoint, pjsip_rx_data *rdata, const char *resource, const char *event_configuration_name) |
static int | sip_publication_respond (struct ast_sip_publication *pub, int status_code, pjsip_rx_data *rdata) |
static int | sip_subscription_accept (struct sip_subscription_tree *sub_tree, pjsip_rx_data *rdata, int response) |
static int | sip_subscription_send_request (struct sip_subscription_tree *sub_tree, pjsip_tx_data *tdata) |
static void | sip_subscription_to_ami (struct sip_subscription_tree *sub_tree, struct ast_str **buf) |
static void | sub_add_handler (struct ast_sip_subscription_handler *handler) |
static int | sub_persistence_recreate (void *obj) |
static int | sub_tree_subscription_terminate_cb (void *data) |
static void | sub_tree_transport_cb (void *data) |
static struct ast_sip_pubsub_body_generator * | subscription_get_generator_from_rdata (pjsip_rx_data *rdata, const struct ast_sip_subscription_handler *handler) |
Retrieve a body generator using the Accept header of an rdata message. More... | |
static struct ast_sip_subscription_handler * | subscription_get_handler_from_rdata (pjsip_rx_data *rdata, const char *endpoint) |
Retrieve a handler using the Event header of an rdata message. More... | |
static void * | subscription_persistence_alloc (const char *name) |
Allocator for subscription persistence. More... | |
static struct subscription_persistence * | subscription_persistence_create (struct sip_subscription_tree *sub_tree) |
Function which creates initial persistence information of a subscription in sorcery. More... | |
static void | subscription_persistence_destroy (void *obj) |
Destructor for subscription persistence. More... | |
static void | subscription_persistence_event_cb (void *data, struct stasis_subscription *sub, struct stasis_message *message) |
Event callback which fires subscription persistence recreation when the system is fully booted. More... | |
static int | subscription_persistence_load (void *data) |
Function which loads and recreates persisted subscriptions upon startup when the system is fully booted. More... | |
static int | subscription_persistence_recreate (void *obj, void *arg, int flags) |
Callback function to perform the actual recreation of a subscription. More... | |
static void | subscription_persistence_remove (struct sip_subscription_tree *sub_tree) |
Function which removes persistence of a subscription from sorcery. More... | |
static void | subscription_persistence_update (struct sip_subscription_tree *sub_tree, pjsip_rx_data *rdata, enum sip_persistence_update_type type) |
Function which updates persistence information of a subscription in sorcery. More... | |
static void | subscription_setup_dialog (struct sip_subscription_tree *sub_tree, pjsip_dialog *dlg) |
static void | subscription_tree_destructor (void *obj) |
static int | subscription_unreference_dialog (void *obj) |
static int | test_new_subscribe (struct ast_sip_endpoint *endpoint, const char *resource) |
new_subscribe callback for unit tests More... | |
static void | test_resource_tree_destroy (struct resource_tree *tree) |
RAII_VAR callback to destroy an allocated resource tree. More... | |
static struct tree_node * | tree_node_alloc (const char *resource, struct resources *visited, unsigned int full_state) |
Allocate a tree node. More... | |
static void | tree_node_destroy (struct tree_node *node) |
Destructor for a tree node. More... | |
static int | unload_module (void) |
Variables | |
static struct ast_module_info | __mod_info = { .name = AST_MODULE, .flags = AST_MODFLAG_GLOBAL_SYMBOLS | AST_MODFLAG_LOAD_ORDER , .description = "PJSIP event resource" , .key = "This paragraph is copyright (c) 2006 by Digium, Inc. \In order for your module to load, it must return this \key via a function called \"key\". Any code which \includes this paragraph must be licensed under the GNU \General Public License version 2 or later (at your \option). In addition to Digium's general reservations \of rights, Digium expressly reserves the right to \allow other parties to license this paragraph under \different terms. Any use of Digium, Inc. trademarks or \logos (including \"Asterisk\" or \"Digium\") without \express written permission of Digium, Inc. is prohibited.\n" , .buildopt_sum = "30ef0c93b36035ec78c9cfd712d36d9b" , .support_level = AST_MODULE_SUPPORT_CORE, .load = load_module, .unload = unload_module, .load_pri = AST_MODPRI_CHANNEL_DEPEND, .requires = "res_pjsip", } |
const char * | accept_exceptions [] |
Accept headers that are exceptions to the rule. More... | |
static const struct ast_module_info * | ast_module_info = &__mod_info |
const char * | bad_resources [] |
"bad" resources More... | |
struct body_generators | body_generators = { .first = NULL, .last = NULL, .lock = { PTHREAD_RWLOCK_INITIALIZER , NULL, {1, 0} } , } |
struct body_supplements | body_supplements = { .first = NULL, .last = NULL, .lock = { PTHREAD_RWLOCK_INITIALIZER , NULL, {1, 0} } , } |
static struct ast_cli_entry | cli_commands [] |
static int | esc_etag_counter |
const pjsip_method | pjsip_publish_method |
Defined method for PUBLISH. More... | |
struct publish_handlers | publish_handlers = { .first = NULL, .last = NULL, .lock = { PTHREAD_RWLOCK_INITIALIZER , NULL, {1, 0} } , } |
static pjsip_evsub_user | pubsub_cb |
static struct pjsip_module | pubsub_module |
static pjsip_media_type | rlmi_media_type |
static struct ast_sched_context * | sched |
Scheduler used for automatically expiring publications. More... | |
static const char * | sip_subscription_roles_map [] |
static const pj_str_t | str_event_name = { "Event", 5 } |
static char * | sub_tree_state_description [] |
struct subscription_handlers | subscription_handlers = { .first = NULL, .last = NULL, .lock = { PTHREAD_RWLOCK_INITIALIZER , NULL, {1, 0} } , } |
struct subscriptions | subscriptions = { .first = NULL, .last = NULL, .lock = { PTHREAD_RWLOCK_INITIALIZER , NULL, {1, 0} } , } |
struct ast_sip_subscription_handler | test_handler |
Subscription handler for unit tests. More... | |
struct ast_sip_notifier | test_notifier |
Subscription notifier for unit tests. More... | |
#define AMI_SHOW_SUBSCRIPTIONS_INBOUND "PJSIPShowSubscriptionsInbound" |
Definition at line 4135 of file res_pjsip_pubsub.c.
Referenced by load_module(), and unload_module().
#define AMI_SHOW_SUBSCRIPTIONS_OUTBOUND "PJSIPShowSubscriptionsOutbound" |
Definition at line 4136 of file res_pjsip_pubsub.c.
Referenced by load_module(), and unload_module().
#define CLI_LIST_SUB_FORMAT_ENTRY "%-30.30s %-30.30s %6d %s\n" |
Definition at line 4522 of file res_pjsip_pubsub.c.
Referenced by cli_list_subscriptions_detail().
#define CLI_LIST_SUB_FORMAT_HEADER "%-30.30s %-30.30s %6.6s %s\n" |
Definition at line 4521 of file res_pjsip_pubsub.c.
Referenced by cli_list_subscriptions_inout().
#define CLI_SHOW_SUB_FORMAT_ENTRY |
Definition at line 4379 of file res_pjsip_pubsub.c.
Referenced by cli_show_subscriptions_detail().
#define CLI_SHOW_SUB_FORMAT_HEADER |
Definition at line 4374 of file res_pjsip_pubsub.c.
Referenced by cli_show_subscriptions_inout().
#define DATASTORE_BUCKETS 53 |
Number of buckets for subscription datastore.
Definition at line 250 of file res_pjsip_pubsub.c.
#define DEFAULT_EXPIRES 3600 |
Default expiration for subscriptions.
Definition at line 253 of file res_pjsip_pubsub.c.
Referenced by ast_sip_register_subscription_handler().
#define DEFAULT_PUBLISH_EXPIRES 3600 |
Default expiration time for PUBLISH if one is not specified.
Definition at line 247 of file res_pjsip_pubsub.c.
Referenced by determine_sip_publish_type(), sip_create_publication(), and subscription_persistence_update().
#define MAX_REGEX_ERROR_LEN 128 |
Definition at line 4138 of file res_pjsip_pubsub.c.
Referenced by cli_list_subscriptions_inout(), and cli_show_subscriptions_inout().
#define MOD_DATA_MSG "sub_msg" |
Definition at line 236 of file res_pjsip_pubsub.c.
Referenced by ast_sip_subscription_get_header(), and create_subscription_tree().
#define MOD_DATA_PERSISTENCE "sub_persistence" |
Definition at line 235 of file res_pjsip_pubsub.c.
Referenced by create_subscription_tree(), sip_subscription_accept(), and sub_persistence_recreate().
#define PUBLICATIONS_BUCKETS 37 |
Number of buckets for publications (on a per handler)
Definition at line 244 of file res_pjsip_pubsub.c.
Referenced by ast_sip_register_publish_handler().
#define RESOURCE_LIST_INIT_SIZE 4 |
Definition at line 4750 of file res_pjsip_pubsub.c.
Referenced by resource_list_alloc().
typedef int(* on_subscription_t) (struct sip_subscription_tree *sub, void *arg) |
Definition at line 1798 of file res_pjsip_pubsub.c.
Definition at line 523 of file res_pjsip_pubsub.c.
enum sip_publish_type |
The types of PUBLISH messages defined in RFC 3903.
Definition at line 265 of file res_pjsip_pubsub.c.
The state of the subscription tree.
Definition at line 404 of file res_pjsip_pubsub.c.
|
static |
Definition at line 5714 of file res_pjsip_pubsub.c.
|
static |
Definition at line 5714 of file res_pjsip_pubsub.c.
|
static |
Add a resource XML element to an RLMI body.
Each resource element represents a subscribed resource in the list. This function currently will unconditionally add an instance element to each created resource element. Instance elements refer to later parts in the multipart body.
pool | PJLIB allocation pool |
cid | Content-ID header of the resource |
resource_name | Name of the resource |
resource_uri | URI of the resource |
state | State of the subscribed resource |
Definition at line 2029 of file res_pjsip_pubsub.c.
References ast_generate_random_string(), ast_sip_presence_xml_create_attr(), ast_sip_presence_xml_create_node(), cid_name, and name.
Referenced by build_rlmi_body().
|
static |
Definition at line 1175 of file res_pjsip_pubsub.c.
References AST_RWLIST_INSERT_TAIL, AST_RWLIST_UNLOCK, and AST_RWLIST_WRLOCK.
Referenced by ast_sip_create_subscription(), and create_subscription_tree().
|
static |
Allocate and initialize a body part structure.
pool | PJLIB allocation pool |
sub | Subscription representing a subscribed resource |
Definition at line 2233 of file res_pjsip_pubsub.c.
References ast_calloc, body_part::cid, generate_content_id_hdr(), NULL, body_part::resource, body_part::state, and body_part::uri.
Referenced by build_body_part().
|
static |
Definition at line 1233 of file res_pjsip_pubsub.c.
References ao2_bump, ast_calloc, ast_datastores_alloc(), ast_json_object_get(), ast_json_ref(), ast_str_create, ast_sip_subscription::datastores, destroy_subscription(), sip_subscription_tree::dlg, subscription_persistence::generator_data, handler(), ast_sip_subscription::handler, NULL, sip_subscription_tree::persistence, sub, and ast_sip_subscription::tree.
Referenced by ast_sip_create_subscription(), and create_virtual_subscriptions().
|
static |
Definition at line 1405 of file res_pjsip_pubsub.c.
References ao2_alloc, ao2_bump, ao2_ref, ast_module_ref, ast_sip_create_serializer(), ast_sip_get_distributor_serializer(), ast_sorcery_object_get_id(), ast_taskprocessor_build_name(), AST_TASKPROCESSOR_MAX_NAME, sip_subscription_tree::endpoint, sip_subscription_tree::notify_sched_id, NULL, ast_module_info::self, sip_subscription_tree::serializer, and subscription_tree_destructor().
Referenced by ast_sip_create_subscription(), and create_subscription_tree().
|
static |
Pre-allocate a buffer for the transmission.
Typically, we let PJSIP do this step for us when we send a request. PJSIP's buffer allocation algorithm is to allocate a buffer of PJSIP_MAX_PKT_LEN bytes and attempt to write the packet to the allocated buffer. If the buffer is too small to hold the packet, then we get told the message is too long to be sent.
When dealing with SIP NOTIFY, especially with RLS, it is possible to exceed PJSIP_MAX_PKT_LEN. Rather than accepting the limitation imposed on us by default, we instead take the strategy of pre-allocating the buffer, testing for ourselves if the message will fit, and resizing the buffer as required.
The limit we impose is double that of the maximum packet length.
tdata | The tdata onto which to allocate a buffer |
0 | Success |
-1 | The message is too large |
Definition at line 1967 of file res_pjsip_pubsub.c.
References buf.
Referenced by sip_subscription_send_request().
|
static |
Definition at line 4112 of file res_pjsip_pubsub.c.
References ao2_callback, ao2_container_count(), AST_RETRIEVE_FLAG_ALL, AST_RETRIEVE_FLAG_MULTIPLE, ast_sip_get_sorcery(), ast_sorcery_retrieve_by_fields(), astman_get_header(), astman_send_error(), astman_send_list_complete_end(), astman_send_list_complete_start(), astman_send_listack(), ast_sip_ami::count, format_ami_resource_lists(), ast_sip_ami::m, NULL, OBJ_NODATA, and ast_sip_ami::s.
Referenced by load_module().
|
static |
Definition at line 4062 of file res_pjsip_pubsub.c.
References ami_subscription_detail_inbound(), astman_get_header(), astman_send_list_complete_end(), astman_send_list_complete_start(), astman_send_listack(), ast_sip_ami::count, for_each_subscription(), ast_sip_ami::m, and ast_sip_ami::s.
Referenced by load_module().
|
static |
Definition at line 4076 of file res_pjsip_pubsub.c.
References ami_subscription_detail_outbound(), astman_get_header(), astman_send_list_complete_end(), astman_send_list_complete_start(), astman_send_listack(), ast_sip_ami::count, for_each_subscription(), ast_sip_ami::m, and ast_sip_ami::s.
Referenced by load_module().
|
static |
Definition at line 4031 of file res_pjsip_pubsub.c.
References ast_free, ast_sip_create_ami_event(), ast_str_buffer(), astman_append(), buf, ast_sip_ami::count, ast_sip_ami::s, and sip_subscription_to_ami().
Referenced by ami_subscription_detail_inbound(), and ami_subscription_detail_outbound().
|
static |
Definition at line 4050 of file res_pjsip_pubsub.c.
References ami_subscription_detail(), AST_SIP_NOTIFIER, and sip_subscription_tree::role.
Referenced by ami_show_subscriptions_inbound().
|
static |
Definition at line 4056 of file res_pjsip_pubsub.c.
References ami_subscription_detail(), AST_SIP_SUBSCRIBER, and sip_subscription_tree::role.
Referenced by ami_show_subscriptions_outbound().
|
static |
Definition at line 4857 of file res_pjsip_pubsub.c.
References ast_sorcery_apply_default, ast_sorcery_object_field_register, ast_sorcery_object_field_register_custom, ast_sorcery_object_register, ast_sorcery_reload_object(), CHARFLDSET, FLDSET, resource_list::full_state, list_item_handler(), list_item_to_str(), resource_list::notification_batch_interval, NULL, OPT_BOOL_T, OPT_CHAR_ARRAY_T, OPT_NOOP_T, OPT_UINT_T, resource_list_alloc(), and resource_list_apply_handler().
Referenced by load_module().
struct ast_module* AST_MODULE_SELF_SYM | ( | void | ) |
Definition at line 5714 of file res_pjsip_pubsub.c.
struct ast_sip_subscription* ast_sip_create_subscription | ( | const struct ast_sip_subscription_handler * | handler, |
struct ast_sip_endpoint * | endpoint, | ||
const char * | resource | ||
) |
Create a new ast_sip_subscription structure.
When a subscriber wishes to create a subscription, it may call this function to allocate resources and to send the initial SUBSCRIBE out.
subscriber | The subscriber that is making the request. |
endpoint | The endpoint to whome the SUBSCRIBE will be sent. |
resource | The resource to place in the SUBSCRIBE's Request-URI. |
Definition at line 1868 of file res_pjsip_pubsub.c.
References add_subscription(), allocate_subscription(), allocate_subscription_tree(), ao2_cleanup, ao2_ref, ast_sip_endpoint::aors, ast_log, ast_sip_create_dialog_uac(), ast_sip_location_retrieve_contact_from_aor_list(), ast_sorcery_object_get_id(), ast_strlen_zero, resource_list::event, ast_sip_subscription_handler::event_name, sip_subscription_tree::evsub, LOG_WARNING, NULL, pubsub_cb, sub, subscription_setup_dialog(), and ast_sip_contact::uri.
int ast_sip_publication_add_datastore | ( | struct ast_sip_publication * | publication, |
struct ast_datastore * | datastore | ||
) |
Add a datastore to a SIP publication.
Note that SIP uses reference counted datastores. The datastore passed into this function must have been allocated using ao2_alloc() or there will be serious problems.
publication | The publication to add the datastore to |
datastore | The datastore to be added to the subscription |
0 | Success |
-1 | Failure |
Definition at line 2649 of file res_pjsip_pubsub.c.
References ast_datastores_add(), and ast_sip_publication::datastores.
struct ast_datastore* ast_sip_publication_get_datastore | ( | struct ast_sip_publication * | publication, |
const char * | name | ||
) |
Retrieve a publication datastore.
The datastore retrieved will have its reference count incremented. When the caller is done with the datastore, the reference counted needs to be decremented using ao2_ref().
publication | The publication from which to retrieve the datastore |
name | The name of the datastore to retrieve |
NULL | Failed to find the specified datastore |
non-NULL | The specified datastore |
Definition at line 2654 of file res_pjsip_pubsub.c.
References ast_datastores_find(), and ast_sip_publication::datastores.
struct ao2_container* ast_sip_publication_get_datastores | ( | const struct ast_sip_publication * | publication | ) |
Get the datastores container for a publication.
publication | The publication to get the datastores container from |
NULL | datastores container not present |
non-NULL | datastores container |
Definition at line 2664 of file res_pjsip_pubsub.c.
References ast_sip_publication::datastores.
struct ast_sip_endpoint* ast_sip_publication_get_endpoint | ( | struct ast_sip_publication * | pub | ) |
Given a publication, get the associated endpoint.
pub | The publication |
NULL | Failure |
non-NULL | The associated endpoint |
Definition at line 3420 of file res_pjsip_pubsub.c.
References ast_sip_publication::endpoint.
const char* ast_sip_publication_get_event_configuration | ( | const struct ast_sip_publication * | pub | ) |
Given a publication, get the configuration name for the event type in use.
pub | The publication |
Definition at line 3430 of file res_pjsip_pubsub.c.
References ast_sip_publication::event_configuration_name.
Referenced by asterisk_publication_devicestate_state_change(), and asterisk_publication_mwi_state_change().
const char* ast_sip_publication_get_resource | ( | const struct ast_sip_publication * | pub | ) |
Given a publication, get the resource the publication is to.
pub | The publication |
Definition at line 3425 of file res_pjsip_pubsub.c.
References ast_sip_publication::resource.
void ast_sip_publication_remove_datastore | ( | struct ast_sip_publication * | publication, |
const char * | name | ||
) |
Remove a publication datastore from the publication.
This operation may cause the datastore's free() callback to be called if the reference count reaches zero.
publication | The publication to remove the datastore from |
name | The name of the datastore to remove |
Definition at line 2659 of file res_pjsip_pubsub.c.
References ast_datastores_remove(), and ast_sip_publication::datastores.
int ast_sip_pubsub_generate_body_content | ( | const char * | content_type, |
const char * | content_subtype, | ||
struct ast_sip_body_data * | data, | ||
struct ast_str ** | str | ||
) |
Generate body content for a PUBLISH or NOTIFY.
content_type | The content type of the body | |
content_subtype | The content subtype of the body | |
data | The data associated with body generation. | |
[out] | str | The string representation of the generated body |
0 | Success |
non-zero | Failure |
Definition at line 3519 of file res_pjsip_pubsub.c.
References ast_sip_pubsub_body_generator::allocate_body, ast_log, AST_RWLIST_RDLOCK, AST_RWLIST_TRAVERSE, AST_RWLIST_UNLOCK, ast_sip_body_data::body_data, ast_sip_body_data::body_type, ast_sip_pubsub_body_generator::body_type, ast_sip_pubsub_body_generator::destroy_body, end, find_body_generator_type_subtype(), ast_sip_pubsub_body_generator::generate_body_content, generator, ast_sip_pubsub_body_generator::list, LOG_WARNING, ast_sip_pubsub_body_generator::subtype, ast_sip_pubsub_body_supplement::subtype, ast_sip_pubsub_body_supplement::supplement_body, ast_sip_pubsub_body_generator::to_string, ast_sip_pubsub_body_generator::type, and ast_sip_pubsub_body_supplement::type.
Referenced by ast_sip_subscription_notify(), exten_state_publisher_cb(), generate_initial_notify(), and send_unsolicited_mwi_notify_to_contact().
|
static |
Check if the rdata has a Supported header containing 'eventlist'.
1 | rdata has an eventlist containing supported header |
0 | rdata doesn't have an eventlist containing supported header |
Definition at line 866 of file res_pjsip_pubsub.c.
References while().
Referenced by pubsub_on_rx_subscribe_request(), and sub_persistence_recreate().
int ast_sip_pubsub_is_body_generator_registered | ( | const char * | type, |
const char * | subtype | ||
) |
Is a body generator registered for the given type/subtype.
type | The content type of the body |
subtype | The content subtype of the body |
non-zero | if a generator is registered. |
Definition at line 3435 of file res_pjsip_pubsub.c.
References find_body_generator_type_subtype().
Referenced by publisher_start().
int ast_sip_pubsub_register_body_generator | ( | struct ast_sip_pubsub_body_generator * | generator | ) |
Register a body generator with the pubsub core.
generator | Body generator to register |
0 | Success |
-1 | Failure |
Definition at line 3440 of file res_pjsip_pubsub.c.
References ast_alloca, AST_LIST_INSERT_HEAD, ast_log, AST_RWLIST_UNLOCK, AST_RWLIST_WRLOCK, ast_sip_get_pjsip_endpoint(), find_body_generator_type_subtype_nolock(), ast_sip_pubsub_body_generator::list, LOG_WARNING, NULL, pubsub_module, ast_sip_pubsub_body_generator::subtype, and ast_sip_pubsub_body_generator::type.
Referenced by load_module().
int ast_sip_pubsub_register_body_supplement | ( | struct ast_sip_pubsub_body_supplement * | supplement | ) |
Register a body generator with the pubsub core.
generator | Body generator to register |
0 | Success |
-1 | Failure |
Definition at line 3485 of file res_pjsip_pubsub.c.
References AST_RWLIST_INSERT_TAIL, AST_RWLIST_UNLOCK, AST_RWLIST_WRLOCK, and ast_sip_pubsub_body_generator::list.
Referenced by load_module().
void ast_sip_pubsub_unregister_body_generator | ( | struct ast_sip_pubsub_body_generator * | generator | ) |
Unregister a body generator with the pubsub core.
generator | Body generator to unregister |
Definition at line 3470 of file res_pjsip_pubsub.c.
References AST_LIST_REMOVE_CURRENT, AST_RWLIST_TRAVERSE_SAFE_BEGIN, AST_RWLIST_TRAVERSE_SAFE_END, AST_RWLIST_UNLOCK, AST_RWLIST_WRLOCK, and ast_sip_pubsub_body_generator::list.
Referenced by unload_module(), and unregister_all().
void ast_sip_pubsub_unregister_body_supplement | ( | struct ast_sip_pubsub_body_supplement * | supplement | ) |
Unregister a body generator with the pubsub core.
generator | Body generator to unregister |
Definition at line 3494 of file res_pjsip_pubsub.c.
References AST_LIST_REMOVE_CURRENT, AST_RWLIST_TRAVERSE_SAFE_BEGIN, AST_RWLIST_TRAVERSE_SAFE_END, AST_RWLIST_UNLOCK, AST_RWLIST_WRLOCK, and ast_sip_pubsub_body_supplement::list.
Referenced by unload_module().
int ast_sip_register_publish_handler | ( | struct ast_sip_publish_handler * | handler | ) |
Register a publish handler.
0 | Handler was registered successfully |
non-zero | Handler was not registered successfully |
Definition at line 2718 of file res_pjsip_pubsub.c.
References AO2_ALLOC_OPT_LOCK_MUTEX, ao2_container_alloc_hash, ast_log, ast_strlen_zero, ast_sip_publish_handler::event_name, LOG_ERROR, NULL, publication_cmp_fn(), publication_hash_fn(), ast_sip_publish_handler::publications, PUBLICATIONS_BUCKETS, and publish_add_handler().
Referenced by load_module().
int ast_sip_register_subscription_handler | ( | struct ast_sip_subscription_handler * | handler | ) |
Register a subscription handler.
0 | Handler was registered successfully |
non-zero | Handler was not registered successfully |
Definition at line 2777 of file res_pjsip_pubsub.c.
References ast_sip_subscription_handler::accept, ast_log, AST_SIP_MAX_ACCEPT, ast_strlen_zero, DEFAULT_EXPIRES, resource_list::event, ast_sip_subscription_handler::event_name, find_sub_handler_for_event_name(), LOG_ERROR, pubsub_module, and sub_add_handler().
Referenced by load_module().
int ast_sip_subscription_add_datastore | ( | struct ast_sip_subscription * | subscription, |
struct ast_datastore * | datastore | ||
) |
Add a datastore to a SIP subscription.
Note that SIP uses reference counted datastores. The datastore passed into this function must have been allocated using ao2_alloc() or there will be serious problems.
subscription | The ssubscription to add the datastore to |
datastore | The datastore to be added to the subscription |
0 | Success |
-1 | Failure |
Definition at line 2629 of file res_pjsip_pubsub.c.
References ast_datastores_add(), and ast_sip_subscription::datastores.
Referenced by add_datastore(), and add_mwi_datastore().
struct ast_datastore* ast_sip_subscription_alloc_datastore | ( | const struct ast_datastore_info * | info, |
const char * | uid | ||
) |
Alternative for ast_datastore_alloc()
There are two major differences between this and ast_datastore_alloc() 1) This allocates a refcounted object 2) This will fill in a uid if one is not provided
DO NOT call ast_datastore_free() on a datastore allocated in this way since that function will attempt to free the datastore rather than play nicely with its refcount.
info | Callbacks for datastore |
uid | Identifier for datastore |
NULL | Failed to allocate datastore |
non-NULL | Newly allocated datastore |
Definition at line 2624 of file res_pjsip_pubsub.c.
References ast_datastores_alloc_datastore().
Referenced by add_datastore(), and add_mwi_datastore().
void ast_sip_subscription_destroy | ( | struct ast_sip_subscription * | sub | ) |
Alert the pubsub core that the subscription is ready for destruction.
sub | The subscription that is complete |
Definition at line 1389 of file res_pjsip_pubsub.c.
References ao2_cleanup, ast_debug, ast_sorcery_object_get_id(), sip_subscription_tree::endpoint, and ast_sip_subscription::tree.
Referenced by exten_state_subscription_destructor(), and mwi_subscription_destructor().
const char* ast_sip_subscription_get_body_subtype | ( | struct ast_sip_subscription * | sub | ) |
Get the body subtype used for this subscription.
Definition at line 3514 of file res_pjsip_pubsub.c.
References ast_sip_subscription::body_generator, and ast_sip_pubsub_body_generator::subtype.
Referenced by ast_sip_subscription_notify(), generate_initial_notify(), and generate_notify_body().
const char* ast_sip_subscription_get_body_type | ( | struct ast_sip_subscription * | sub | ) |
Get the body type used for this subscription.
Definition at line 3509 of file res_pjsip_pubsub.c.
References ast_sip_subscription::body_generator, and ast_sip_pubsub_body_generator::type.
Referenced by ast_sip_subscription_notify(), generate_initial_notify(), and generate_notify_body().
struct ast_datastore* ast_sip_subscription_get_datastore | ( | struct ast_sip_subscription * | subscription, |
const char * | name | ||
) |
Retrieve a subscription datastore.
The datastore retrieved will have its reference count incremented. When the caller is done with the datastore, the reference counted needs to be decremented using ao2_ref().
subscription | The subscription from which to retrieve the datastore |
name | The name of the datastore to retrieve |
NULL | Failed to find the specified datastore |
non-NULL | The specified datastore |
Definition at line 2634 of file res_pjsip_pubsub.c.
References ast_datastores_find(), and ast_sip_subscription::datastores.
Referenced by get_exten_state_sub(), mwi_get_notify_data(), mwi_subscription_shutdown(), and mwi_to_ami().
struct ao2_container* ast_sip_subscription_get_datastores | ( | const struct ast_sip_subscription * | subscription | ) |
Get the datastores container for a subscription.
subscription | The subscription to get the datastores container from |
NULL | datastores container not present |
non-NULL | datastores container |
Definition at line 2644 of file res_pjsip_pubsub.c.
References ast_sip_subscription::datastores.
Referenced by alloc_notify_task_data(), exten_state_data_alloc(), and notify_task().
pjsip_dialog* ast_sip_subscription_get_dialog | ( | struct ast_sip_subscription * | sub | ) |
Get the pjsip dialog that is associated with this subscription.
NULL | Could not get dialog |
non-NULL | The dialog |
Definition at line 1930 of file res_pjsip_pubsub.c.
References ast_assert, sip_subscription_tree::dlg, NULL, and ast_sip_subscription::tree.
Referenced by dialog_info_generate_body_content(), mwi_get_notify_data(), and send_mwi_notify().
struct ast_sip_endpoint* ast_sip_subscription_get_endpoint | ( | struct ast_sip_subscription * | sub | ) |
Get the endpoint that is associated with this subscription.
This function will increase the reference count of the endpoint. Be sure to release the reference to it when you are finished with the endpoint.
NULL | Could not get endpoint |
non-NULL | The endpoint |
Definition at line 1936 of file res_pjsip_pubsub.c.
References ao2_bump, ast_assert, sip_subscription_tree::endpoint, NULL, and ast_sip_subscription::tree.
Referenced by dialog_info_generate_body_content(), mwi_get_notify_data(), mwi_subscription_established(), send_mwi_notify(), and subscription_established().
void* ast_sip_subscription_get_header | ( | const struct ast_sip_subscription * | sub, |
const char * | header | ||
) |
Get a header value for a subscription.
For notifiers, the headers of the inbound SUBSCRIBE that started the dialog are stored on the subscription. This method allows access to the header. The return is the same as pjsip_msg_find_hdr_by_name(), meaning that it is dependent on the header being searched for.
sub | The subscription to search in. |
header | The name of the header to search for. |
Definition at line 1854 of file res_pjsip_pubsub.c.
References ast_sip_mod_data_get, sip_subscription_tree::dlg, MOD_DATA_MSG, name, NULL, pubsub_module, and ast_sip_subscription::tree.
Referenced by get_user_agent().
void ast_sip_subscription_get_local_uri | ( | struct ast_sip_subscription * | sub, |
char * | buf, | ||
size_t | size | ||
) |
Retrieve the local URI for this subscription.
This is the local URI of the subscribed resource.
sub | The subscription | |
[out] | buf | The buffer into which to store the URI. |
size | The size of the buffer. |
Definition at line 2578 of file res_pjsip_pubsub.c.
Referenced by build_rlmi_body(), exten_state_data_alloc(), and notify_task().
const struct ast_json* ast_sip_subscription_get_persistence_data | ( | const struct ast_sip_subscription * | subscription | ) |
Retrieve persistence data for a subscription.
subscription | The subscription to retrieve persistence data from |
Definition at line 2686 of file res_pjsip_pubsub.c.
Referenced by dialog_info_generate_body_content().
void ast_sip_subscription_get_remote_uri | ( | struct ast_sip_subscription * | sub, |
char * | buf, | ||
size_t | size | ||
) |
Retrive the remote URI for this subscription.
This is the remote URI as determined by the underlying SIP dialog.
sub | The subscription | |
[out] | buf | The buffer into which to store the URI. |
size | The size of the buffer. |
Definition at line 2583 of file res_pjsip_pubsub.c.
References sip_subscription_tree::dlg, and ast_sip_subscription::tree.
Referenced by exten_state_data_alloc(), and notify_task().
const char* ast_sip_subscription_get_resource_name | ( | struct ast_sip_subscription * | sub | ) |
Get the name of the subscribed resource.
Definition at line 2596 of file res_pjsip_pubsub.c.
Referenced by build_rlmi_body(), mwi_get_notify_data(), mwi_subscription_established(), remove_subscription(), send_mwi_notify(), and subscription_established().
struct ast_taskprocessor* ast_sip_subscription_get_serializer | ( | struct ast_sip_subscription * | sub | ) |
Get the serializer for the subscription.
Tasks that originate outside of a SIP servant thread should get the serializer and push the task to the serializer.
sub | The subscription |
NULL | Failure |
non-NULL | The subscription's serializer |
Definition at line 1942 of file res_pjsip_pubsub.c.
References ast_assert, NULL, sip_subscription_tree::serializer, and ast_sip_subscription::tree.
Referenced by exten_state_subscription_alloc(), and send_notify().
pjsip_sip_uri* ast_sip_subscription_get_sip_uri | ( | struct ast_sip_subscription * | sub | ) |
Retrieve the local sip uri for this subscription.
This is the local sip URI of the subscribed resource.
sub | The subscription |
NULL | Could not get uri |
non-NULL | The local pjsip_sip_uri |
Definition at line 2573 of file res_pjsip_pubsub.c.
Referenced by mwi_get_notify_data(), and send_mwi_notify().
int ast_sip_subscription_is_terminated | ( | const struct ast_sip_subscription * | sub | ) |
Get whether the subscription has been terminated or not.
sub | The subscription. |
0 | not terminated. |
1 | terminated. |
Definition at line 2601 of file res_pjsip_pubsub.c.
Referenced by notify_task().
int ast_sip_subscription_notify | ( | struct ast_sip_subscription * | sub, |
struct ast_sip_body_data * | notify_data, | ||
int | terminate | ||
) |
Notify a SIP subscription of a state change.
This tells the pubsub core that the state of a subscribed resource has changed. The pubsub core will generate an appropriate NOTIFY request to send to the subscriber.
sub | The subscription on which a state change is occurring. |
notify_data | Event package-specific data used to create the NOTIFY body. |
terminate | True if this NOTIFY is intended to terminate the subscription. |
0 | Success |
non-zero | Failure |
Definition at line 2529 of file res_pjsip_pubsub.c.
References ao2_ref, ast_sip_pubsub_generate_body_content(), ast_sip_subscription_get_body_subtype(), ast_sip_subscription_get_body_type(), ast_test_suite_event_notify, sip_subscription_tree::dlg, sip_subscription_tree::notification_batch_interval, sip_subscription_tree::root, schedule_notification(), send_notify(), SIP_SUB_TREE_NORMAL, SIP_SUB_TREE_TERMINATE_IN_PROGRESS, SIP_SUB_TREE_TERMINATE_PENDING, sip_subscription_tree::state, and ast_sip_subscription::tree.
Referenced by notify_task(), and send_mwi_notify().
void ast_sip_subscription_remove_datastore | ( | struct ast_sip_subscription * | subscription, |
const char * | name | ||
) |
Remove a subscription datastore from the subscription.
This operation may cause the datastore's free() callback to be called if the reference count reaches zero.
subscription | The subscription to remove the datastore from |
name | The name of the datastore to remove |
Definition at line 2639 of file res_pjsip_pubsub.c.
References ast_datastores_remove(), and ast_sip_subscription::datastores.
Referenced by mwi_subscription_established(), mwi_subscription_shutdown(), and subscription_shutdown().
void ast_sip_subscription_set_persistence_data | ( | struct ast_sip_subscription * | subscription, |
struct ast_json * | persistence_data | ||
) |
Set persistence data for a subscription.
subscription | The subscription to set persistence data on |
persistence_data | The persistence data to set |
Definition at line 2669 of file res_pjsip_pubsub.c.
References ast_json_object_create(), ast_json_object_set(), ast_json_ref(), ast_json_unref(), subscription_persistence::generator_data, sip_subscription_tree::persistence, and ast_sip_subscription::tree.
Referenced by dialog_info_generate_body_content().
void ast_sip_unregister_publish_handler | ( | struct ast_sip_publish_handler * | handler | ) |
Unregister a publish handler.
Definition at line 2738 of file res_pjsip_pubsub.c.
References ao2_cleanup, AST_RWLIST_REMOVE_CURRENT, AST_RWLIST_TRAVERSE_SAFE_BEGIN, AST_RWLIST_TRAVERSE_SAFE_END, AST_RWLIST_UNLOCK, AST_RWLIST_WRLOCK, ast_sip_publish_handler::next, and ast_sip_publish_handler::publications.
Referenced by load_module(), and unload_module().
void ast_sip_unregister_subscription_handler | ( | struct ast_sip_subscription_handler * | handler | ) |
Unregister a subscription handler.
Definition at line 2810 of file res_pjsip_pubsub.c.
References AST_RWLIST_REMOVE_CURRENT, AST_RWLIST_TRAVERSE_SAFE_BEGIN, AST_RWLIST_TRAVERSE_SAFE_END, AST_RWLIST_UNLOCK, AST_RWLIST_WRLOCK, and ast_sip_subscription_handler::next.
Referenced by unload_module().
AST_TEST_DEFINE | ( | resource_tree | ) |
Definition at line 5078 of file res_pjsip_pubsub.c.
References ARRAY_LEN, ast_calloc, AST_TEST_FAIL, AST_TEST_NOT_RUN, AST_TEST_PASS, ast_test_status_update, build_resource_tree(), check_node(), cleanup_resource_list(), create_resource_list(), ineligible_configuration(), sip_to_pjsip::info(), NULL, RAII_VAR, TEST_EXECUTE, TEST_INIT, and test_resource_tree_destroy().
AST_TEST_DEFINE | ( | complex_resource_tree | ) |
Definition at line 5131 of file res_pjsip_pubsub.c.
References ARRAY_LEN, ast_calloc, AST_TEST_FAIL, AST_TEST_NOT_RUN, AST_TEST_PASS, ast_test_status_update, AST_VECTOR_GET, build_resource_tree(), check_node(), cleanup_resource_list(), create_resource_list(), ineligible_configuration(), sip_to_pjsip::info(), NULL, RAII_VAR, TEST_EXECUTE, TEST_INIT, and test_resource_tree_destroy().
AST_TEST_DEFINE | ( | bad_resource | ) |
Definition at line 5208 of file res_pjsip_pubsub.c.
References ARRAY_LEN, ast_calloc, AST_TEST_FAIL, AST_TEST_NOT_RUN, AST_TEST_PASS, ast_test_status_update, build_resource_tree(), check_node(), cleanup_resource_list(), create_resource_list(), ineligible_configuration(), sip_to_pjsip::info(), NULL, RAII_VAR, TEST_EXECUTE, TEST_INIT, and test_resource_tree_destroy().
AST_TEST_DEFINE | ( | bad_branch | ) |
Definition at line 5264 of file res_pjsip_pubsub.c.
References ARRAY_LEN, ast_calloc, AST_TEST_FAIL, AST_TEST_NOT_RUN, AST_TEST_PASS, ast_test_status_update, build_resource_tree(), check_node(), cleanup_resource_list(), create_resource_list(), ineligible_configuration(), sip_to_pjsip::info(), NULL, RAII_VAR, TEST_EXECUTE, TEST_INIT, and test_resource_tree_destroy().
AST_TEST_DEFINE | ( | duplicate_resource | ) |
Definition at line 5335 of file res_pjsip_pubsub.c.
References ARRAY_LEN, ast_calloc, AST_TEST_FAIL, AST_TEST_NOT_RUN, AST_TEST_PASS, ast_test_status_update, AST_VECTOR_GET, build_resource_tree(), check_node(), cleanup_resource_list(), create_resource_list(), ineligible_configuration(), sip_to_pjsip::info(), NULL, RAII_VAR, TEST_EXECUTE, TEST_INIT, and test_resource_tree_destroy().
AST_TEST_DEFINE | ( | loop | ) |
Definition at line 5416 of file res_pjsip_pubsub.c.
References ARRAY_LEN, ast_calloc, AST_TEST_FAIL, AST_TEST_NOT_RUN, AST_TEST_PASS, ast_test_status_update, build_resource_tree(), cleanup_resource_list(), create_resource_list(), ineligible_configuration(), sip_to_pjsip::info(), NULL, RAII_VAR, TEST_EXECUTE, TEST_INIT, and test_resource_tree_destroy().
AST_TEST_DEFINE | ( | bad_event | ) |
Definition at line 5467 of file res_pjsip_pubsub.c.
References ARRAY_LEN, ast_calloc, AST_TEST_FAIL, AST_TEST_NOT_RUN, AST_TEST_PASS, ast_test_status_update, build_resource_tree(), cleanup_resource_list(), create_resource_list(), ineligible_configuration(), sip_to_pjsip::info(), NULL, RAII_VAR, TEST_EXECUTE, TEST_INIT, and test_resource_tree_destroy().
AST_VECTOR | ( | resources | , |
const char * | |||
) |
A vector of strings commonly used throughout this module.
AST_VECTOR | ( | body_part_list | , |
struct body_part * | |||
) |
Type declaration for container of body part structures.
|
static |
Create a multipart body part for a subscribed resource.
pool | PJLIB allocation pool |
sub | The subscription representing a subscribed resource |
parts | A vector of parts to append the created part to. |
use_full_state | Unused locally, but may be passed to other functions |
Definition at line 2258 of file res_pjsip_pubsub.c.
References allocate_body_part(), ast_free, AST_VECTOR_APPEND, body_part::cid, generate_notify_body(), and body_part::part.
Referenced by generate_list_body().
|
static |
Build child nodes for a given parent.
This iterates through the items on a resource list and creates tree nodes for each one. The tree nodes created are children of the supplied parent node. If an item in the resource list is itself a list, then this function is called recursively to provide children for the new node.
If an item in a resource list is not a list, then the supplied subscription handler is called into as if a new SUBSCRIBE for the list item were presented. The handler's response is used to determine if the node can be added to the tree or not.
If a parent node ends up having no child nodes added under it, then the parent node is pruned from the tree.
endpoint | The endpoint that sent the inbound SUBSCRIBE. |
handler | The subscription handler for leaf nodes in the tree. |
list | The configured resource list from which the child node is being built. |
parent | The parent node for these children. |
visited | The resources that have already been visited. |
Definition at line 1021 of file res_pjsip_pubsub.c.
References ao2_cleanup, ast_debug, AST_VECTOR_APPEND, AST_VECTOR_GET, AST_VECTOR_SIZE, resource_list::event, resource_list::full_state, have_visited(), resource_list::items, ast_sip_notifier::new_subscribe, ast_sip_subscription_handler::notifier, retrieve_resource_list(), tree_node_alloc(), and tree_node_destroy().
Referenced by build_resource_tree().
|
static |
Build a resource tree.
This function builds a resource tree based on the requested resource in a SUBSCRIBE request.
This function also creates a container that has all resources that have been visited during creation of the tree, whether those resources resulted in a tree node being created or not. Keeping this container of visited resources allows for misconfigurations such as loops in the tree or duplicated resources to be detected.
endpoint | The endpoint that sent the SUBSCRIBE request. |
handler | The subscription handler for leaf nodes in the tree. |
resource | The resource requested in the SUBSCRIBE request. |
tree | The tree that is to be built. |
has_eventlist_support |
200-299 | Successfully subscribed to at least one resource. |
300-699 | Failure to subscribe to requested resource. |
Definition at line 1135 of file res_pjsip_pubsub.c.
References ao2_cleanup, ast_debug, ast_sorcery_object_get_id(), AST_VECTOR_FREE, AST_VECTOR_INIT, AST_VECTOR_SIZE, build_node_children(), ast_sip_subscription_handler::event_name, ast_sip_notifier::new_subscribe, resource_tree::notification_batch_interval, ast_sip_subscription_handler::notifier, NULL, RAII_VAR, retrieve_resource_list(), resource_tree::root, and tree_node_alloc().
Referenced by AST_TEST_DEFINE(), pubsub_on_rx_subscribe_request(), and sub_persistence_recreate().
|
static |
Create an RLMI body part for a multipart resource list body.
RLMI (Resource list meta information) is a special body type that lists the subscribed resources and tells subscribers the number of subscribed resources and what other body parts are in the multipart body. The RLMI body also has a version number that a subscriber can use to ensure that the locally-stored state corresponds to server state.
pool | The allocation pool |
sub | The subscription representing the subscribed resource list |
body_parts | A container of body parts that RLMI will refer to |
full_state | Indicates whether this is a full or partial state notification |
Definition at line 2162 of file res_pjsip_pubsub.c.
References add_rlmi_resource(), ast_sip_presence_xml_create_attr(), ast_sip_presence_xml_create_node(), ast_sip_subscription_get_local_uri(), ast_sip_subscription_get_resource_name(), AST_VECTOR_GET, AST_VECTOR_SIZE, body_part::cid, generate_content_id_hdr(), generate_notify_body(), name, NULL, body_part::part, pool, body_part::resource, rlmi_clone_data(), rlmi_media_type, rlmi_print_body(), body_part::state, and body_part::uri.
Referenced by generate_list_body().
|
static |
Check the integrity of a tree node against a set of resources.
The tree node's resources must be in the same order as the resources in the supplied resources array. Because of this constraint, tests can misrepresent the size of the resources array as being smaller than it really is if resources at the end of the array should not be present in the tree node.
test | The unit test. Used for printing status messages. |
node | The constructed tree node whose integrity is under question. |
resources | Array of expected resource values |
num_resources | The number of resources to check in the array. |
Definition at line 5022 of file res_pjsip_pubsub.c.
References ast_test_status_update, AST_VECTOR_GET, and AST_VECTOR_SIZE.
Referenced by AST_TEST_DEFINE().
|
static |
RAII callback to destroy a resource list.
Definition at line 4962 of file res_pjsip_pubsub.c.
References ao2_cleanup, ast_sip_get_sorcery(), and ast_sorcery_delete().
Referenced by AST_TEST_DEFINE(), and create_resource_list().
|
static |
Definition at line 4193 of file res_pjsip_pubsub.c.
References a, cli_sub_complete_parms::a, ast_cli_args::argv, ast_assert, cli_sub_complete_parms::callid, cli_complete_subscription_inbound(), cli_complete_subscription_outbound(), for_each_subscription(), NULL, ast_cli_args::pos, cli_sub_complete_parms::which, ast_cli_args::word, and cli_sub_complete_parms::wordlen.
Referenced by cli_show_subscription_inout().
|
static |
Definition at line 4160 of file res_pjsip_pubsub.c.
References cli_sub_complete_parms::a, ast_copy_pj_str(), ast_malloc, cli_sub_complete_parms::callid, sip_subscription_tree::dlg, ast_cli_args::n, cli_sub_complete_parms::which, ast_cli_args::word, and cli_sub_complete_parms::wordlen.
Referenced by cli_complete_subscription_inbound(), and cli_complete_subscription_outbound().
|
static |
Definition at line 4181 of file res_pjsip_pubsub.c.
References AST_SIP_NOTIFIER, cli_complete_subscription_common(), and sip_subscription_tree::role.
Referenced by cli_complete_subscription_callid().
|
static |
Definition at line 4187 of file res_pjsip_pubsub.c.
References AST_SIP_SUBSCRIBER, cli_complete_subscription_common(), and sip_subscription_tree::role.
Referenced by cli_complete_subscription_callid().
|
static |
Definition at line 4524 of file res_pjsip_pubsub.c.
References cli_sub_parms::a, ast_cli(), ast_copy_pj_str(), ast_copy_string(), ast_sorcery_object_get_id(), ast_str_buffer(), ast_str_set(), cli_sub_parms::buf, CLI_LIST_SUB_FORMAT_ENTRY, cli_subscription_expiry(), cli_sub_parms::count, sip_subscription_tree::dlg, sip_subscription_tree::endpoint, ast_sip_subscription_handler::event_name, ast_cli_args::fd, ast_sip_subscription::handler, ast_sip_endpoint::id, cli_sub_parms::like, ast_party_id::name, NULL, ast_party_id::number, sip_subscription_tree::root, S_COR, ast_sip_endpoint_id_configuration::self, ast_party_name::str, ast_party_number::str, ast_party_name::valid, and ast_party_number::valid.
Referenced by cli_list_subscriptions_inbound(), and cli_list_subscriptions_outbound().
|
static |
Definition at line 4568 of file res_pjsip_pubsub.c.
References AST_SIP_NOTIFIER, cli_list_subscriptions_detail(), and sip_subscription_tree::role.
Referenced by cli_list_subscriptions_inout().
|
static |
Definition at line 4580 of file res_pjsip_pubsub.c.
References a, cli_sub_parms::a, ast_cli_args::argc, ast_cli_args::argv, ast_alloca, ast_assert, ast_cli(), ast_free, ast_str_create, cli_sub_parms::buf, CLI_FAILURE, CLI_GENERATE, CLI_INIT, CLI_LIST_SUB_FORMAT_HEADER, cli_list_subscriptions_inbound(), cli_list_subscriptions_outbound(), CLI_SHOWUSAGE, CLI_SUCCESS, ast_cli_entry::command, cli_sub_parms::count, cli_sub_parms::e, ast_cli_args::fd, for_each_subscription(), cli_sub_parms::like, MAX_REGEX_ERROR_LEN, NULL, regex(), and ast_cli_entry::usage.
|
static |
Definition at line 4574 of file res_pjsip_pubsub.c.
References AST_SIP_SUBSCRIBER, cli_list_subscriptions_detail(), and sip_subscription_tree::role.
Referenced by cli_list_subscriptions_inout().
|
static |
Definition at line 4235 of file res_pjsip_pubsub.c.
References cli_sub_parms::a, ast_cli(), ast_free, ast_str_append(), ast_str_buffer(), ast_str_create, ast_str_update(), buf, cli_sub_parms::buf, cli_sub_complete_parms::callid, cli_subscription_expiry(), sip_subscription_tree::dlg, ast_sip_subscription_handler::event_name, ast_cli_args::fd, ast_sip_subscription::handler, if(), sip_subscription_tree::root, sip_subscription_to_ami(), and value.
Referenced by cli_show_subscription_inbound(), and cli_show_subscription_outbound().
|
static |
Definition at line 4322 of file res_pjsip_pubsub.c.
References AST_SIP_NOTIFIER, cli_show_subscription_common(), and sip_subscription_tree::role.
Referenced by cli_show_subscription_inout().
|
static |
Definition at line 4334 of file res_pjsip_pubsub.c.
References a, cli_sub_parms::a, ast_cli_args::argc, ast_cli_args::argv, ast_assert, cli_sub_parms::buf, cli_complete_subscription_callid(), CLI_GENERATE, CLI_INIT, cli_show_subscription_inbound(), cli_show_subscription_outbound(), CLI_SHOWUSAGE, CLI_SUCCESS, ast_cli_entry::command, cli_sub_parms::e, for_each_subscription(), NULL, and ast_cli_entry::usage.
|
static |
Definition at line 4328 of file res_pjsip_pubsub.c.
References AST_SIP_SUBSCRIBER, cli_show_subscription_common(), and sip_subscription_tree::role.
Referenced by cli_show_subscription_inout().
|
static |
Definition at line 4384 of file res_pjsip_pubsub.c.
References cli_sub_parms::a, ast_callerid_merge(), ast_cli(), ast_copy_pj_str(), ast_copy_string(), ast_sorcery_object_get_id(), ast_str_buffer(), ast_str_set(), cli_sub_parms::buf, CLI_SHOW_SUB_FORMAT_ENTRY, cli_subscription_expiry(), cli_sub_parms::count, sip_subscription_tree::dlg, sip_subscription_tree::endpoint, ast_sip_subscription_handler::event_name, ast_cli_args::fd, ast_sip_subscription::handler, ast_sip_endpoint::id, cli_sub_parms::like, ast_party_id::name, NULL, ast_party_id::number, sip_subscription_tree::root, S_COR, ast_sip_endpoint_id_configuration::self, ast_party_name::str, ast_party_number::str, ast_party_name::valid, and ast_party_number::valid.
Referenced by cli_show_subscriptions_inbound(), and cli_show_subscriptions_outbound().
|
static |
Definition at line 4421 of file res_pjsip_pubsub.c.