Asterisk - The Open Source Telephony Project
18.5.0
|
#include "asterisk.h"
#include <pjsip.h>
#include <pjsip_simple.h>
#include <pjlib.h>
#include "asterisk/res_pjsip.h"
#include "asterisk/res_pjsip_pubsub.h"
#include "asterisk/res_pjsip_body_generator_types.h"
#include "asterisk/module.h"
#include "asterisk/logger.h"
#include "asterisk/astobj2.h"
#include "asterisk/taskprocessor.h"
#include "asterisk/serializer.h"
#include "asterisk/sorcery.h"
#include "asterisk/stasis.h"
#include "asterisk/mwi.h"
Go to the source code of this file.
Data Structures | |
struct | mwi_stasis_subscription |
Wrapper for stasis subscription. More... | |
struct | mwi_subscription |
A subscription for MWI. More... | |
struct | unsolicited_mwi_data |
Macros | |
#define | MAX_UNLOAD_TIMEOUT_TIME 10 /* Seconds */ |
#define | MWI_BUCKETS 53 |
#define | MWI_DATASTORE "MWI datastore" |
#define | MWI_SERIALIZER_POOL_SIZE 8 |
#define | MWI_SUBTYPE "simple-message-summary" |
#define | MWI_TYPE "application" |
#define | STASIS_BUCKETS 13 |
Functions | |
static void | __reg_module (void) |
static void | __unreg_module (void) |
static int | add_mwi_datastore (struct mwi_subscription *sub) |
static int | allow_and_or_replace_unsolicited (struct ast_sip_endpoint *endpoint, const char *mailbox, struct ao2_container *unsolicited_mwi) |
AO2_GLOBAL_OBJ_STATIC (mwi_unsolicited) | |
AO2_GLOBAL_OBJ_STATIC (mwi_solicited) | |
struct ast_module * | AST_MODULE_SELF_SYM (void) |
static void | create_mwi_subscriptions (void) |
static int | create_mwi_subscriptions_for_endpoint (void *obj, void *arg, void *data, int flags) |
static int | create_unsolicited_mwi_subscriptions (struct ast_sip_endpoint *endpoint, int recreate, int send_now, struct ao2_container *unsolicited_mwi, struct ao2_container *solicited_mwi) |
static struct ast_sip_aor * | find_aor_for_resource (struct ast_sip_endpoint *endpoint, const char *resource) |
static int | get_message_count (void *obj, void *arg, int flags) |
static void | global_loaded (const char *object_type) |
static int | has_mwi_subscription (struct ao2_container *container, struct ast_sip_endpoint *endpoint, const char *mailbox, struct mwi_subscription **mwi_sub, struct mwi_stasis_subscription **mwi_stasis) |
static int | is_unsolicited_allowed (struct ast_sip_endpoint *endpoint, const char *mailbox, struct ao2_container *unsolicited_mwi, struct ao2_container *solicited_mwi) |
static int | load_module (void) |
static void | mwi_contact_added (const void *object) |
Function called when a contact is added. More... | |
static void | mwi_contact_changed (const struct ast_sip_contact *contact) |
Create mwi subscriptions and notify. More... | |
static void | mwi_contact_deleted (const void *object) |
Function called when a contact is deleted. More... | |
static void | mwi_contact_updated (const void *object) |
Function called when a contact is updated. More... | |
static struct mwi_subscription * | mwi_create_subscription (struct ast_sip_endpoint *endpoint, struct ast_sip_subscription *sip_sub) |
static void | mwi_ds_destroy (void *data) |
static void * | mwi_get_notify_data (struct ast_sip_subscription *sub) |
static int | mwi_new_subscribe (struct ast_sip_endpoint *endpoint, const char *resource) |
static int | mwi_on_aor (void *obj, void *arg, int flags) |
static void | mwi_startup_event_cb (void *data, struct stasis_subscription *sub, struct stasis_message *message) |
Event callback which fires initial unsolicited MWI NOTIFY messages when we're fully booted. More... | |
static void | mwi_stasis_cb (void *userdata, struct stasis_subscription *sub, struct stasis_message *msg) |
static struct mwi_stasis_subscription * | mwi_stasis_subscription_alloc (const char *mailbox, struct mwi_subscription *mwi_sub) |
static int | mwi_sub_cmp (void *obj, void *arg, int flags) |
static int | mwi_sub_hash (const void *obj, const int flags) |
static struct mwi_subscription * | mwi_subscribe_all (struct ast_sip_endpoint *endpoint, struct ast_sip_subscription *sip_sub) |
static struct mwi_subscription * | mwi_subscribe_single (struct ast_sip_endpoint *endpoint, struct ast_sip_subscription *sip_sub, const char *name) |
static struct mwi_subscription * | mwi_subscription_alloc (struct ast_sip_endpoint *endpoint, unsigned int is_solicited, struct ast_sip_subscription *sip_sub) |
static void | mwi_subscription_destructor (void *obj) |
static int | mwi_subscription_established (struct ast_sip_subscription *sub) |
static void | mwi_subscription_mailboxes_str (struct ao2_container *stasis_subs, struct ast_str **str) |
static void | mwi_subscription_shutdown (struct ast_sip_subscription *sub) |
static void | mwi_to_ami (struct ast_sip_subscription *sub, struct ast_str **buf) |
static int | mwi_validate_for_aor (void *obj, void *arg, int flags) |
Determine if an endpoint is a candidate to be able to subscribe for MWI. More... | |
static int | reload (void) |
static int | send_contact_notify (void *obj, void *arg, int flags) |
Function called to send MWI NOTIFY on any unsolicited mailboxes relating to this AOR. More... | |
static int | send_initial_notify_all (void *obj) |
Task invoked to send initial MWI NOTIFY for unsolicited. More... | |
static void | send_mwi_notify (struct mwi_subscription *sub) |
static int | send_notify (void *obj, void *arg, int flags) |
static void | send_unsolicited_mwi_notify (struct mwi_subscription *sub, struct ast_sip_message_accumulator *counter) |
static int | send_unsolicited_mwi_notify_to_contact (void *obj, void *arg, int flags) |
static int | serialized_cleanup (void *userdata) |
static int | serialized_notify (void *userdata) |
static void | set_voicemail_extension (pj_pool_t *pool, pjsip_sip_uri *local_uri, struct ast_sip_message_accumulator *counter, const char *voicemail_extension) |
static int | stasis_sub_cmp (void *obj, void *arg, int flags) |
static int | stasis_sub_hash (const void *obj, const int flags) |
static int | unload_module (void) |
static int | unsubscribe (void *obj, void *arg, int flags) |
static int | unsubscribe_stasis (void *obj, void *arg, int flags) |
Variables | |
static struct ast_module_info | __mod_info = { .name = AST_MODULE, .flags = AST_MODFLAG_LOAD_ORDER , .description = "PJSIP MWI 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, .reload = reload, .load_pri = AST_MODPRI_CHANNEL_DEPEND + 5, .requires = "res_pjsip,res_pjsip_pubsub", } |
static const struct ast_module_info * | ast_module_info = &__mod_info |
static char * | default_voicemail_extension |
static struct ast_sorcery_observer | global_observer |
static const struct ast_sorcery_observer | mwi_contact_observer |
Observer for contacts so unsolicited MWI is sent when a contact changes. More... | |
static struct ast_datastore_info | mwi_ds_info |
static struct ast_sip_subscription_handler | mwi_handler |
static struct ast_sip_notifier | mwi_notifier |
static struct ast_serializer_pool * | mwi_serializer_pool |
#define MAX_UNLOAD_TIMEOUT_TIME 10 /* Seconds */ |
Max timeout for all threads to join during an unload.
Definition at line 63 of file res_pjsip_mwi.c.
Referenced by load_module().
#define MWI_BUCKETS 53 |
Definition at line 52 of file res_pjsip_mwi.c.
Referenced by load_module().
#define MWI_DATASTORE "MWI datastore" |
Definition at line 57 of file res_pjsip_mwi.c.
Referenced by add_mwi_datastore(), mwi_get_notify_data(), mwi_subscription_established(), mwi_subscription_shutdown(), and mwi_to_ami().
#define MWI_SERIALIZER_POOL_SIZE 8 |
Number of serializers in pool if one not supplied.
Definition at line 60 of file res_pjsip_mwi.c.
Referenced by load_module().
#define MWI_SUBTYPE "simple-message-summary" |
Definition at line 55 of file res_pjsip_mwi.c.
Referenced by send_unsolicited_mwi_notify_to_contact().
#define MWI_TYPE "application" |
Definition at line 54 of file res_pjsip_mwi.c.
Referenced by send_unsolicited_mwi_notify_to_contact().
#define STASIS_BUCKETS 13 |
Definition at line 51 of file res_pjsip_mwi.c.
Referenced by mwi_subscription_alloc().
|
static |
Definition at line 1622 of file res_pjsip_mwi.c.
|
static |
Definition at line 1622 of file res_pjsip_mwi.c.
|
static |
Definition at line 640 of file res_pjsip_mwi.c.
References ao2_ref, ast_sip_subscription_add_datastore(), ast_sip_subscription_alloc_datastore(), ast_datastore::data, MWI_DATASTORE, mwi_subscription::sip_sub, and sub.
Referenced by mwi_create_subscription().
|
static |
Definition at line 729 of file res_pjsip_mwi.c.
References ast_sip_mwi_configuration::aggregate, ao2_ref, ao2_unlink, ast_debug, ast_sorcery_object_get_id(), has_mwi_subscription(), ast_sip_endpoint_subscription_configuration::mwi, mwi_sub, NULL, send_notify(), mwi_subscription::stasis_subs, ast_sip_mwi_configuration::subscribe_replaces_unsolicited, ast_sip_endpoint::subscription, and unsubscribe_stasis().
Referenced by mwi_validate_for_aor().
AO2_GLOBAL_OBJ_STATIC | ( | mwi_unsolicited | ) |
AO2_GLOBAL_OBJ_STATIC | ( | mwi_solicited | ) |
struct ast_module* AST_MODULE_SELF_SYM | ( | void | ) |
Definition at line 1622 of file res_pjsip_mwi.c.
|
static |
Definition at line 1301 of file res_pjsip_mwi.c.
References ao2_callback, ao2_callback_data, ao2_cleanup, ao2_global_obj_ref, ao2_lock, ao2_ref, ao2_unlock, AST_RETRIEVE_FLAG_MULTIPLE, ast_sip_get_sorcery(), ast_sorcery_retrieve_by_fields(), ast_variable_new, ast_variables_destroy(), create_mwi_subscriptions_for_endpoint(), endpoints, NULL, OBJ_MULTIPLE, OBJ_NODATA, OBJ_NOLOCK, OBJ_UNLINK, unsubscribe(), and var.
Referenced by load_module(), and reload().
|
static |
Definition at line 1287 of file res_pjsip_mwi.c.
References create_unsolicited_mwi_subscriptions().
Referenced by create_mwi_subscriptions().
|
static |
Definition at line 1188 of file res_pjsip_mwi.c.
References ast_sip_mwi_configuration::aggregate, ao2_cleanup, ao2_container_count(), ao2_find, ao2_link, ao2_link_flags, ao2_lock, ao2_ref, ao2_unlock, ast_sorcery_object_get_id(), ast_strdupa, ast_strip(), ast_strlen_zero, is_unsolicited_allowed(), mwi_stasis_subscription::mailbox, mailboxes, ast_sip_mwi_configuration::mailboxes, ast_sip_endpoint_subscription_configuration::mwi, mwi_stasis_subscription_alloc(), mwi_subscription_alloc(), NULL, OBJ_NOLOCK, OBJ_SEARCH_KEY, RAII_VAR, send_notify(), mwi_subscription::stasis_subs, strsep(), sub, and ast_sip_endpoint::subscription.
Referenced by create_mwi_subscriptions_for_endpoint(), mwi_contact_changed(), mwi_subscription_shutdown(), and unsubscribe_stasis().
|
static |
Definition at line 450 of file res_pjsip_mwi.c.
References ao2_ref, ast_sip_endpoint::aors, ast_debug, ast_sip_location_retrieve_aor(), ast_strdupa, ast_strip(), ast_strlen_zero, NULL, strsep(), and ast_sip_aor::voicemail_extension.
Referenced by mwi_get_notify_data(), mwi_new_subscribe(), mwi_subscribe_single(), and send_mwi_notify().
|
static |
Definition at line 326 of file res_pjsip_mwi.c.
References ao2_ref, ast_mwi_subscriber_data(), mwi_stasis_subscription::mwi_subscriber, ast_sip_message_accumulator::new_msgs, ast_mwi_state::new_msgs, ast_sip_message_accumulator::old_msgs, and ast_mwi_state::old_msgs.
Referenced by mwi_get_notify_data(), and send_mwi_notify().
|
static |
Definition at line 1505 of file res_pjsip_mwi.c.
References ast_free, ast_serializer_pool_set_alerts(), ast_sip_get_default_voicemail_extension(), ast_sip_get_mwi_tps_queue_high(), ast_sip_get_mwi_tps_queue_low(), and default_voicemail_extension.
|
static |
Definition at line 682 of file res_pjsip_mwi.c.
References ao2_find, ao2_iterator_destroy(), ao2_iterator_next, ao2_ref, ast_sorcery_object_get_id(), NULL, OBJ_MULTIPLE, OBJ_NOLOCK, and OBJ_SEARCH_KEY.
Referenced by allow_and_or_replace_unsolicited(), and is_unsolicited_allowed().
|
static |
Definition at line 783 of file res_pjsip_mwi.c.
References ao2_ref, ast_strlen_zero, has_mwi_subscription(), ast_sip_endpoint_subscription_configuration::mwi, mwi_sub, NULL, send_notify(), ast_sip_mwi_configuration::subscribe_replaces_unsolicited, ast_sip_endpoint::subscription, and mwi_subscription::terminate.
Referenced by create_unsolicited_mwi_subscriptions().
|
static |
Definition at line 1553 of file res_pjsip_mwi.c.
References AO2_ALLOC_OPT_LOCK_MUTEX, ao2_container_alloc_hash, ao2_global_obj_replace_unref, ao2_ref, ast_log, AST_LOG_WARNING, ast_manager_get_generic_type(), ast_manager_get_topic(), AST_MODFLAG_LOAD_ORDER, AST_MODPRI_CHANNEL_DEPEND, AST_MODULE_INFO(), AST_MODULE_LOAD_DECLINE, AST_MODULE_LOAD_SUCCESS, ast_module_shutdown_ref, AST_MODULE_SUPPORT_CORE, AST_OPT_FLAG_FULLY_BOOTED, ast_options, ast_serializer_pool_create(), ast_serializer_pool_get(), ast_sip_get_mwi_disable_initial_unsolicited(), ast_sip_get_sorcery(), ast_sip_push_task(), ast_sip_register_subscription_handler(), ast_sip_threadpool(), ast_sorcery_observer_add(), ast_sorcery_reload_object(), ast_test_flag, ASTERISK_GPL_KEY, create_mwi_subscriptions(), MAX_UNLOAD_TIMEOUT_TIME, MWI_BUCKETS, MWI_SERIALIZER_POOL_SIZE, mwi_startup_event_cb(), mwi_sub_cmp(), mwi_sub_hash(), NULL, reload(), ast_module_info::self, send_initial_notify_all(), stasis_subscribe_pool, stasis_subscription_accept_message_type(), STASIS_SUBSCRIPTION_FILTER_SELECTIVE, stasis_subscription_set_filter(), sub, and unload_module().
|
static |
Function called when a contact is added.
Definition at line 1408 of file res_pjsip_mwi.c.
References mwi_contact_changed().
|
static |
Create mwi subscriptions and notify.
Definition at line 1361 of file res_pjsip_mwi.c.
References ao2_bump, ao2_callback, ao2_cleanup, ao2_global_obj_ref, ao2_lock, ao2_ref, ao2_unlock, ast_sip_get_sorcery(), ast_sorcery_object_get_id(), ast_sorcery_retrieve_by_id(), ast_strdupa, ast_strlen_zero, create_unsolicited_mwi_subscriptions(), ast_sip_contact::endpoint, ast_sip_contact::endpoint_name, ast_sip_mwi_configuration::mailboxes, ast_sip_endpoint_subscription_configuration::mwi, NULL, OBJ_NODATA, send_contact_notify(), strsep(), and ast_sip_endpoint::subscription.
Referenced by mwi_contact_added(), and mwi_contact_updated().
|
static |
Function called when a contact is deleted.
Definition at line 1414 of file res_pjsip_mwi.c.
References ao2_bump, ao2_cleanup, ao2_find, ao2_global_obj_ref, ao2_iterator_destroy(), ao2_iterator_next, ao2_lock, ao2_ref, ao2_unlock, ast_sip_endpoint::aors, ast_sip_get_sorcery(), ast_sip_location_retrieve_contact_from_aor_list(), ast_sorcery_retrieve_by_id(), ast_strlen_zero, ast_sip_contact::endpoint, ast_sip_contact::endpoint_name, ast_sip_mwi_configuration::mailboxes, ast_sip_endpoint_subscription_configuration::mwi, mwi_sub, NULL, OBJ_MULTIPLE, OBJ_NOLOCK, OBJ_SEARCH_KEY, OBJ_UNLINK, ast_sip_endpoint::subscription, and unsubscribe().
|
static |
Function called when a contact is updated.
Definition at line 1402 of file res_pjsip_mwi.c.
References mwi_contact_changed().
|
static |
Definition at line 920 of file res_pjsip_mwi.c.
References add_mwi_datastore(), ao2_ref, ast_log, mwi_subscription::id, LOG_WARNING, mwi_subscription_alloc(), NULL, and sub.
Referenced by mwi_subscribe_all(), and mwi_subscribe_single().
|
static |
Definition at line 629 of file res_pjsip_mwi.c.
|
static |
Definition at line 1042 of file res_pjsip_mwi.c.
References ao2_alloc, ao2_callback, ao2_cleanup, ao2_ref, ast_sip_subscription_get_datastore(), ast_sip_subscription_get_dialog(), ast_sip_subscription_get_endpoint(), ast_sip_subscription_get_resource_name(), ast_sip_subscription_get_sip_uri(), ast_datastore::data, find_aor_for_resource(), get_message_count(), MWI_DATASTORE, mwi_sub, NULL, OBJ_NODATA, set_voicemail_extension(), mwi_subscription::stasis_subs, and ast_sip_aor::voicemail_extension.
|
static |
Definition at line 974 of file res_pjsip_mwi.c.
References ao2_cleanup, ast_sip_endpoint::aors, ast_debug, ast_sip_for_each_aor(), ast_strlen_zero, find_aor_for_resource(), mwi_validate_for_aor(), NULL, and RAII_VAR.
|
static |
Definition at line 889 of file res_pjsip_mwi.c.
References ao2_link, ao2_ref, ast_strdupa, ast_strip(), ast_strlen_zero, mwi_stasis_subscription::mailbox, mailboxes, ast_sip_aor::mailboxes, mwi_stasis_subscription_alloc(), mwi_subscription::stasis_subs, strsep(), and sub.
Referenced by mwi_subscribe_all(), and mwi_subscribe_single().
|
static |
Event callback which fires initial unsolicited MWI NOTIFY messages when we're fully booted.
Definition at line 1483 of file res_pjsip_mwi.c.
References ast_json_object_get(), ast_json_string_get(), ast_manager_get_generic_type(), ast_serializer_pool_get(), ast_sip_push_task(), ast_json_payload::json, NULL, send_initial_notify_all(), stasis_message_data(), stasis_message_type(), stasis_unsubscribe(), and type.
Referenced by load_module().
|
static |
Definition at line 1156 of file res_pjsip_mwi.c.
References ao2_bump, ao2_ref, ast_mwi_state_type(), ast_serializer_pool_get(), ast_sip_push_task(), mwi_sub, NULL, send_notify(), serialized_cleanup(), stasis_message_type(), and stasis_subscription_final_message().
Referenced by mwi_stasis_subscription_alloc().
|
static |
Definition at line 140 of file res_pjsip_mwi.c.
References ao2_alloc, ao2_ref, ast_mwi_subscribe_pool(), ast_mwi_subscriber_subscription(), mwi_stasis_subscription::mailbox, mwi_stasis_cb(), mwi_stasis_subscription::mwi_subscriber, NULL, stasis_subscription_accept_message_type(), and stasis_subscription_change_type().
Referenced by create_unsolicited_mwi_subscriptions(), and mwi_on_aor().
|
static |
Definition at line 299 of file res_pjsip_mwi.c.
References CMP_MATCH, mwi_subscription::id, OBJ_SEARCH_KEY, OBJ_SEARCH_MASK, OBJ_SEARCH_OBJECT, and OBJ_SEARCH_PARTIAL_KEY.
Referenced by load_module().
|
static |
Definition at line 279 of file res_pjsip_mwi.c.
References ast_assert, ast_str_hash(), OBJ_SEARCH_KEY, OBJ_SEARCH_MASK, and OBJ_SEARCH_OBJECT.
Referenced by load_module().
|
static |
Definition at line 960 of file res_pjsip_mwi.c.
References ast_sip_endpoint::aors, ast_sip_for_each_aor(), mwi_create_subscription(), mwi_on_aor(), NULL, and sub.
Referenced by mwi_subscription_established().
|
static |
Definition at line 939 of file res_pjsip_mwi.c.
References ao2_ref, ast_log, find_aor_for_resource(), LOG_WARNING, mwi_create_subscription(), mwi_on_aor(), NULL, and sub.
Referenced by mwi_subscription_established().
|
static |
Definition at line 231 of file res_pjsip_mwi.c.
References ao2_alloc, AO2_ALLOC_OPT_LOCK_MUTEX, ao2_cleanup, ao2_container_alloc_hash, ao2_ref, mwi_subscription::aors, ast_sip_endpoint::aors, ast_debug, ast_sorcery_object_get_id(), ast_strdup, ast_strlen_zero, mwi_subscription::id, mwi_subscription::is_solicited, mwi_subscription_destructor(), NULL, mwi_subscription::sip_sub, STASIS_BUCKETS, stasis_sub_cmp(), stasis_sub_hash(), mwi_subscription::stasis_subs, and sub.
Referenced by create_unsolicited_mwi_subscriptions(), and mwi_create_subscription().
|
static |
Definition at line 219 of file res_pjsip_mwi.c.
References ao2_cleanup, mwi_subscription::aors, ast_debug, ast_free, ast_sip_subscription_destroy(), mwi_subscription::id, mwi_subscription::is_solicited, mwi_subscription::sip_sub, mwi_subscription::stasis_subs, and sub.
Referenced by mwi_subscription_alloc().
|
static |
Definition at line 1005 of file res_pjsip_mwi.c.
References ao2_cleanup, ao2_container_count(), ao2_global_obj_ref, ao2_link, ao2_ref, ast_sip_subscription_get_endpoint(), ast_sip_subscription_get_resource_name(), ast_sip_subscription_remove_datastore(), ast_strlen_zero, MWI_DATASTORE, mwi_subscribe_all(), mwi_subscribe_single(), mwi_subscription::stasis_subs, and sub.
|
static |
Definition at line 1078 of file res_pjsip_mwi.c.
References ao2_iterator_destroy(), ao2_iterator_init(), ao2_iterator_next, ao2_ref, ast_str_append(), and mwi_stasis_subscription::mailbox.
Referenced by mwi_to_ami().
|
static |
Definition at line 587 of file res_pjsip_mwi.c.
References ao2_callback, ao2_cleanup, ao2_global_obj_ref, ao2_lock, ao2_ref, ao2_unlink, ao2_unlock, ast_sip_get_sorcery(), ast_sip_subscription_get_datastore(), ast_sip_subscription_remove_datastore(), ast_sorcery_retrieve_by_id(), create_unsolicited_mwi_subscriptions(), ast_datastore::data, mwi_subscription::id, MWI_DATASTORE, mwi_sub, NULL, OBJ_MULTIPLE, OBJ_NODATA, OBJ_UNLINK, mwi_subscription::stasis_subs, and unsubscribe_stasis().
|
static |
Definition at line 1097 of file res_pjsip_mwi.c.
References ao2_ref, ast_sip_subscription_get_datastore(), ast_str_append(), ast_datastore::data, MWI_DATASTORE, mwi_sub, mwi_subscription_mailboxes_str(), and mwi_subscription::stasis_subs.
|
static |
Determine if an endpoint is a candidate to be able to subscribe for MWI.
Currently, this just makes sure that the endpoint is not already receiving unsolicted MWI for any of an AOR's configured mailboxes.
obj | The AOR to which the endpoint is subscribing. |
arg | The endpoint that is attempting to subscribe. |
flags | Unused. |
0 | Endpoint is a candidate to subscribe to MWI on the AOR. |
-1 | The endpoint cannot subscribe to MWI on the AOR. |
Definition at line 844 of file res_pjsip_mwi.c.
References allow_and_or_replace_unsolicited(), ao2_global_obj_ref, ao2_lock, ao2_ref, ao2_unlock, ast_debug, ast_sorcery_object_get_id(), ast_strdupa, ast_strip(), ast_strlen_zero, mwi_stasis_subscription::mailbox, mailboxes, ast_sip_aor::mailboxes, and strsep().
Referenced by mwi_new_subscribe().
|
static |
Definition at line 1517 of file res_pjsip_mwi.c.
References ast_sip_get_mwi_disable_initial_unsolicited(), and create_mwi_subscriptions().
Referenced by load_module().
|
static |
Function called to send MWI NOTIFY on any unsolicited mailboxes relating to this AOR.
Definition at line 1343 of file res_pjsip_mwi.c.
References ao2_bump, ao2_ref, mwi_subscription::aors, ast_serializer_pool_get(), ast_sip_push_task(), mwi_sub, and serialized_notify().
Referenced by mwi_contact_changed().
|
static |
Task invoked to send initial MWI NOTIFY for unsolicited.
Definition at line 1470 of file res_pjsip_mwi.c.
References ao2_callback, ao2_global_obj_ref, ao2_ref, NULL, OBJ_NODATA, and send_notify().
Referenced by load_module(), and mwi_startup_event_cb().
|
static |
Definition at line 538 of file res_pjsip_mwi.c.
References ao2_callback, ao2_cleanup, AST_SIP_MESSAGE_ACCUMULATOR, ast_sip_subscription_get_dialog(), ast_sip_subscription_get_endpoint(), ast_sip_subscription_get_resource_name(), ast_sip_subscription_get_sip_uri(), ast_sip_subscription_notify(), ast_sip_body_data::body_type, find_aor_for_resource(), get_message_count(), mwi_subscription::is_solicited, OBJ_NODATA, ast_sip_message_accumulator::old_msgs, send_unsolicited_mwi_notify(), set_voicemail_extension(), mwi_subscription::sip_sub, mwi_subscription::stasis_subs, mwi_subscription::terminate, and ast_sip_aor::voicemail_extension.
Referenced by serialized_notify().
|
static |
Definition at line 1142 of file res_pjsip_mwi.c.
References ao2_bump, ao2_ref, ast_serializer_pool_get(), ast_sip_push_task(), ast_sip_subscription_get_serializer(), mwi_subscription::is_solicited, mwi_sub, serialized_notify(), and mwi_subscription::sip_sub.
Referenced by allow_and_or_replace_unsolicited(), create_unsolicited_mwi_subscriptions(), is_unsolicited_allowed(), mwi_stasis_cb(), and send_initial_notify_all().
|
static |
Definition at line 490 of file res_pjsip_mwi.c.
References ao2_callback, ao2_cleanup, ao2_container_count(), ast_debug, ast_log, ast_sip_get_sorcery(), ast_sip_location_retrieve_aor(), ast_sip_location_retrieve_aor_contacts(), ast_sorcery_retrieve_by_id(), ast_strdupa, ast_strip(), ast_strlen_zero, unsolicited_mwi_data::counter, unsolicited_mwi_data::endpoint, mwi_subscription::id, LOG_WARNING, ast_sip_message_accumulator::new_msgs, NULL, OBJ_NODATA, ast_sip_message_accumulator::old_msgs, RAII_VAR, send_unsolicited_mwi_notify_to_contact(), strsep(), sub, and unsolicited_mwi_data::sub.
Referenced by send_mwi_notify().
|
static |
Definition at line 371 of file res_pjsip_mwi.c.
References ast_free, ast_log, ast_sip_add_body(), ast_sip_create_request(), AST_SIP_MESSAGE_ACCUMULATOR, ast_sip_pubsub_generate_body_content(), ast_sip_send_request(), ast_str_buffer(), ast_str_create, ast_strlen_zero, ast_sip_body::body_text, ast_sip_body_data::body_type, unsolicited_mwi_data::counter, unsolicited_mwi_data::endpoint, ast_sip_mwi_configuration::fromuser, mwi_subscription::id, LOG_WARNING, ast_sip_endpoint_subscription_configuration::mwi, MWI_SUBTYPE, MWI_TYPE, NULL, set_voicemail_extension(), unsolicited_mwi_data::state, sub, unsolicited_mwi_data::sub, ast_sip_endpoint::subscription, ast_sip_body::subtype, ast_sip_body::type, ast_sip_contact::uri, and ast_sip_mwi_configuration::voicemail_extension.
Referenced by send_unsolicited_mwi_notify().
|
static |
Definition at line 1127 of file res_pjsip_mwi.c.
References ao2_cleanup, and mwi_sub.
Referenced by mwi_stasis_cb().
|
static |
Definition at line 1118 of file res_pjsip_mwi.c.
References ao2_ref, mwi_sub, and send_mwi_notify().
Referenced by send_contact_notify(), and send_notify().
|
static |
Definition at line 345 of file res_pjsip_mwi.c.
References ast_strlen_zero, default_voicemail_extension, and ast_sip_message_accumulator::message_account.
Referenced by mwi_get_notify_data(), send_mwi_notify(), and send_unsolicited_mwi_notify_to_contact().
|
static |
Definition at line 192 of file res_pjsip_mwi.c.
References CMP_MATCH, mwi_stasis_subscription::mailbox, OBJ_SEARCH_KEY, OBJ_SEARCH_MASK, OBJ_SEARCH_OBJECT, and OBJ_SEARCH_PARTIAL_KEY.
Referenced by mwi_subscription_alloc().
|
static |
Definition at line 172 of file res_pjsip_mwi.c.
References ast_assert, ast_str_hash(), OBJ_SEARCH_KEY, OBJ_SEARCH_MASK, and OBJ_SEARCH_OBJECT.
Referenced by mwi_subscription_alloc().
|
static |
Definition at line 1525 of file res_pjsip_mwi.c.
References ao2_callback, ao2_global_obj_release, ao2_global_obj_replace, ao2_ref, ast_free, ast_log, ast_serializer_pool_destroy(), ast_sip_get_sorcery(), ast_sip_unregister_subscription_handler(), ast_sorcery_observer_remove(), default_voicemail_extension, LOG_WARNING, NULL, OBJ_MULTIPLE, OBJ_NODATA, OBJ_UNLINK, and unsubscribe().
Referenced by load_module().
|
static |
Definition at line 1292 of file res_pjsip_mwi.c.
References ao2_callback, CMP_MATCH, mwi_sub, NULL, OBJ_MULTIPLE, OBJ_NODATA, OBJ_UNLINK, mwi_subscription::stasis_subs, and unsubscribe_stasis().
Referenced by create_mwi_subscriptions(), mwi_contact_deleted(), unload_module(), and xmpp_pubsub_unsubscribe().
|
static |
Definition at line 573 of file res_pjsip_mwi.c.
References ast_debug, ast_mwi_unsubscribe_and_join(), CMP_MATCH, create_unsolicited_mwi_subscriptions(), mwi_stasis_subscription::mailbox, and mwi_stasis_subscription::mwi_subscriber.
Referenced by allow_and_or_replace_unsolicited(), mwi_subscription_shutdown(), and unsubscribe().
|
static |
Definition at line 1622 of file res_pjsip_mwi.c.
|
static |
Definition at line 1622 of file res_pjsip_mwi.c.
|
static |
Definition at line 49 of file res_pjsip_mwi.c.
Referenced by global_loaded(), set_voicemail_extension(), and unload_module().
|
static |
Definition at line 1513 of file res_pjsip_mwi.c.
|
static |
Observer for contacts so unsolicited MWI is sent when a contact changes.
Definition at line 1463 of file res_pjsip_mwi.c.
|
static |
Definition at line 636 of file res_pjsip_mwi.c.
|
static |
Definition at line 82 of file res_pjsip_mwi.c.
|
static |
Definition at line 75 of file res_pjsip_mwi.c.
|
static |
Pool of serializers to use if not supplied.
Definition at line 66 of file res_pjsip_mwi.c.