Asterisk - The Open Source Telephony Project GIT-master-f36a736
|
SMDI support for Asterisk. More...
#include "asterisk.h"
#include <termios.h>
#include <sys/time.h>
#include <time.h>
#include <ctype.h>
#include "asterisk/module.h"
#include "asterisk/lock.h"
#include "asterisk/utils.h"
#include "asterisk/smdi.h"
#include "asterisk/config.h"
#include "asterisk/io.h"
#include "asterisk/stringfields.h"
#include "asterisk/linkedlists.h"
#include "asterisk/app.h"
#include "asterisk/mwi.h"
#include "asterisk/pbx.h"
#include "asterisk/channel.h"
Go to the source code of this file.
Data Structures | |
struct | ast_smdi_interface |
struct | mailbox_mapping |
A mapping between an SMDI mailbox ID and an Asterisk mailbox. More... | |
struct | smdi_msg_datastore |
Macros | |
#define | AST_API_MODULE |
#define | DEFAULT_POLLING_INTERVAL 10 |
#define | SMDI_MSG_EXPIRY_TIME 30000 /* 30 seconds */ |
#define | SMDI_RETRIEVE_TIMEOUT_DEFAULT 3000 |
Enumerations | |
enum | { OPT_SEARCH_TERMINAL = (1 << 0) , OPT_SEARCH_NUMBER = (1 << 1) } |
enum | smdi_message_type { SMDI_MWI , SMDI_MD } |
Functions | |
static void | __reg_module (void) |
static void | __unreg_module (void) |
static struct ast_smdi_interface * | alloc_smdi_interface (void) |
static | AO2_GLOBAL_OBJ_STATIC (smdi_ifaces) |
static void | append_mailbox_mapping (struct ast_variable *var, struct ast_smdi_interface *iface) |
struct ast_module * | AST_MODULE_SELF_SYM (void) |
struct ast_smdi_interface *AST_OPTIONAL_API_NAME() | ast_smdi_interface_find (const char *iface_name) |
Find an SMDI interface with the specified name. More... | |
struct ast_smdi_md_message *AST_OPTIONAL_API_NAME() | ast_smdi_md_message_pop (struct ast_smdi_interface *iface) |
Get the next SMDI message from the queue. More... | |
static void | ast_smdi_md_message_push (struct ast_smdi_interface *iface, struct ast_smdi_md_message *md_msg) |
struct ast_smdi_md_message *AST_OPTIONAL_API_NAME() | ast_smdi_md_message_wait (struct ast_smdi_interface *iface, int timeout) |
Get the next SMDI message from the queue. More... | |
struct ast_smdi_mwi_message *AST_OPTIONAL_API_NAME() | ast_smdi_mwi_message_pop (struct ast_smdi_interface *iface) |
Get the next SMDI message from the queue. More... | |
static void | ast_smdi_mwi_message_push (struct ast_smdi_interface *iface, struct ast_smdi_mwi_message *mwi_msg) |
struct ast_smdi_mwi_message *AST_OPTIONAL_API_NAME() | ast_smdi_mwi_message_wait (struct ast_smdi_interface *iface, int timeout) |
Get the next SMDI message from the queue. More... | |
struct ast_smdi_mwi_message *AST_OPTIONAL_API_NAME() | ast_smdi_mwi_message_wait_station (struct ast_smdi_interface *iface, int timeout, const char *station) |
int AST_OPTIONAL_API_NAME() | ast_smdi_mwi_set (struct ast_smdi_interface *iface, const char *mailbox) |
Set the MWI indicator for a mailbox. More... | |
int AST_OPTIONAL_API_NAME() | ast_smdi_mwi_unset (struct ast_smdi_interface *iface, const char *mailbox) |
Unset the MWI indicator for a mailbox. More... | |
static void | destroy_all_mailbox_mappings (void) |
static void | destroy_mailbox_mapping (struct mailbox_mapping *mm) |
static int | load_module (void) |
Load the module. More... | |
static int | lock_msg_q (struct ast_smdi_interface *iface, enum smdi_message_type type) |
static struct timeval | msg_timestamp (void *msg, enum smdi_message_type type) |
static void * | mwi_monitor_handler (void *data) |
static void | poll_mailbox (struct mailbox_mapping *mm) |
static void | purge_old_messages (struct ast_smdi_interface *iface, enum smdi_message_type type) |
static int | reload (void) |
static int | smdi_ifaces_cmp_fn (void *obj, void *data, int flags) |
static void | smdi_interface_destroy (void *obj) |
static int | smdi_load (int reload) |
static int | smdi_md_q_cmp_fn (void *obj, void *arg, int flags) |
static void * | smdi_message_wait (struct ast_smdi_interface *iface, int timeout, enum smdi_message_type type, const char *search_key, struct ast_flags options) |
static void | smdi_msg_datastore_destroy (void *data) |
static void * | smdi_msg_find (struct ast_smdi_interface *iface, enum smdi_message_type type, const char *search_key, struct ast_flags options) |
static void * | smdi_msg_pop (struct ast_smdi_interface *iface, enum smdi_message_type type) |
static int | smdi_msg_read (struct ast_channel *chan, const char *cmd, char *data, char *buf, size_t len) |
static int | smdi_msg_retrieve_read (struct ast_channel *chan, const char *cmd, char *data, char *buf, size_t len) |
static int | smdi_mwi_q_cmp_fn (void *obj, void *data, int flags) |
static void * | smdi_read (void *iface_p) |
static int | smdi_toggle_mwi (struct ast_smdi_interface *iface, const char *mailbox, int on) |
static void * | unlink_from_msg_q (struct ast_smdi_interface *iface, enum smdi_message_type type) |
static int | unload_module (void) |
static int | unlock_msg_q (struct ast_smdi_interface *iface, enum smdi_message_type type) |
Variables | |
static struct ast_module_info | __mod_info = { .name = AST_MODULE, .flags = AST_MODFLAG_GLOBAL_SYMBOLS | AST_MODFLAG_LOAD_ORDER , .description = "Simplified Message Desk Interface (SMDI) 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 = AST_BUILDOPT_SUM, .support_level = AST_MODULE_SUPPORT_EXTENDED, .load = load_module, .unload = unload_module, .reload = reload, .load_pri = AST_MODPRI_CHANNEL_DEPEND, } |
static const struct ast_module_info * | ast_module_info = &__mod_info |
static const char | config_file [] = "smdi.conf" |
struct { | |
ast_cond_t cond | |
struct timeval last_poll | |
ast_mutex_t lock | |
struct { | |
struct mailbox_mapping * first | |
struct mailbox_mapping * last | |
} mailbox_mappings | |
unsigned int polling_interval | |
unsigned int stop:1 | |
pthread_t thread | |
} | mwi_monitor |
Data that gets used by the SMDI MWI monitoring thread. More... | |
static const struct ast_datastore_info | smdi_msg_datastore_info |
static struct ast_custom_function | smdi_msg_function |
static int | smdi_msg_id |
static const struct ast_app_option | smdi_msg_ret_options [128] = { [ 't' ] = { .flag = OPT_SEARCH_TERMINAL }, [ 'n' ] = { .flag = OPT_SEARCH_NUMBER }, } |
static struct ast_custom_function | smdi_msg_retrieve_function |
SMDI support for Asterisk.
Here is a useful mailing list post that describes SMDI protocol details: http://lists.digium.com/pipermail/asterisk-dev/2003-June/000884.html
Definition in file res_smdi.c.
#define AST_API_MODULE |
Definition at line 57 of file res_smdi.c.
#define DEFAULT_POLLING_INTERVAL 10 |
10 seconds
Definition at line 204 of file res_smdi.c.
#define SMDI_MSG_EXPIRY_TIME 30000 /* 30 seconds */ |
Definition at line 69 of file res_smdi.c.
#define SMDI_RETRIEVE_TIMEOUT_DEFAULT 3000 |
In milliseconds
Definition at line 1195 of file res_smdi.c.
anonymous enum |
Enumerator | |
---|---|
OPT_SEARCH_TERMINAL | |
OPT_SEARCH_NUMBER |
Definition at line 429 of file res_smdi.c.
enum smdi_message_type |
Enumerator | |
---|---|
SMDI_MWI | |
SMDI_MD |
Definition at line 319 of file res_smdi.c.
|
static |
Definition at line 1452 of file res_smdi.c.
|
static |
Definition at line 1452 of file res_smdi.c.
|
static |
Definition at line 914 of file res_smdi.c.
References ao2_alloc, AO2_ALLOC_OPT_LOCK_NOLOCK, ao2_container_alloc_list, ast_cond_init, ast_mutex_init, ast_smdi_interface::md_q, ast_smdi_interface::md_q_cond, ast_smdi_interface::md_q_lock, ast_smdi_interface::mwi_q, ast_smdi_interface::mwi_q_cond, ast_smdi_interface::mwi_q_lock, NULL, smdi_interface_destroy(), smdi_md_q_cmp_fn(), and smdi_mwi_q_cmp_fn().
Referenced by smdi_load().
|
static |
|
static |
Definition at line 805 of file res_smdi.c.
References ao2_bump, ast_calloc_with_stringfields, AST_LIST_INSERT_TAIL, ast_mutex_lock, ast_mutex_unlock, ast_strdupa, ast_string_field_set, ast_strlen_zero(), voicemailpwcheck::context, mailbox_mapping::iface, voicemailpwcheck::mailbox, mwi_monitor, mailbox_mapping::smdi, strsep(), and var.
Referenced by smdi_load().
struct ast_module * AST_MODULE_SELF_SYM | ( | void | ) |
Definition at line 1452 of file res_smdi.c.
struct ast_smdi_interface *AST_OPTIONAL_API_NAME() ast_smdi_interface_find | ( | const char * | iface_name | ) |
Find an SMDI interface with the specified name.
iface_name | the name/port of the interface to search for. |
Definition at line 563 of file res_smdi.c.
References ao2_find, ao2_global_obj_ref, ao2_ref, c, NULL, and OBJ_SEARCH_KEY.
Referenced by actual_load_config(), mkintf(), and smdi_msg_retrieve_read().
struct ast_smdi_md_message *AST_OPTIONAL_API_NAME() ast_smdi_md_message_pop | ( | struct ast_smdi_interface * | iface | ) |
Get the next SMDI message from the queue.
iface | a pointer to the interface to use. |
This function pulls the first unexpired message from the SMDI message queue on the specified interface. It will purge all expired SMDI messages before returning.
Definition at line 534 of file res_smdi.c.
References SMDI_MD, and smdi_msg_pop().
|
static |
Definition at line 260 of file res_smdi.c.
References ao2_link, ast_cond_broadcast, ast_mutex_lock, ast_mutex_unlock, ast_smdi_interface::md_q, ast_smdi_interface::md_q_cond, and ast_smdi_interface::md_q_lock.
Referenced by purge_old_messages(), and smdi_read().
struct ast_smdi_md_message *AST_OPTIONAL_API_NAME() ast_smdi_md_message_wait | ( | struct ast_smdi_interface * | iface, |
int | timeout | ||
) |
Get the next SMDI message from the queue.
iface | a pointer to the interface to use. |
timeout | the time to wait before returning in milliseconds. |
This function pulls a message from the SMDI message queue on the specified interface. If no message is available this function will wait the specified amount of time before returning.
Definition at line 539 of file res_smdi.c.
References NULL, options, SMDI_MD, and smdi_message_wait().
Referenced by __analog_ss_thread(), and analog_ss_thread().
struct ast_smdi_mwi_message *AST_OPTIONAL_API_NAME() ast_smdi_mwi_message_pop | ( | struct ast_smdi_interface * | iface | ) |
Get the next SMDI message from the queue.
iface | a pointer to the interface to use. |
This function pulls the first unexpired message from the SMDI message queue on the specified interface. It will purge all expired SMDI messages before returning.
Definition at line 545 of file res_smdi.c.
References smdi_msg_pop(), and SMDI_MWI.
|
static |
Definition at line 274 of file res_smdi.c.
References ao2_link, ast_cond_broadcast, ast_mutex_lock, ast_mutex_unlock, ast_smdi_interface::mwi_q, ast_smdi_interface::mwi_q_cond, and ast_smdi_interface::mwi_q_lock.
Referenced by purge_old_messages(), and smdi_read().
struct ast_smdi_mwi_message *AST_OPTIONAL_API_NAME() ast_smdi_mwi_message_wait | ( | struct ast_smdi_interface * | iface, |
int | timeout | ||
) |
Get the next SMDI message from the queue.
iface | a pointer to the interface to use. |
timeout | the time to wait before returning in milliseconds. |
This function pulls a message from the SMDI message queue on the specified interface. If no message is available this function will wait the specified amount of time before returning.
Definition at line 550 of file res_smdi.c.
References NULL, options, smdi_message_wait(), and SMDI_MWI.
struct ast_smdi_mwi_message *AST_OPTIONAL_API_NAME() ast_smdi_mwi_message_wait_station | ( | struct ast_smdi_interface * | iface, |
int | timeout, | ||
const char * | station | ||
) |
Definition at line 556 of file res_smdi.c.
References options, smdi_message_wait(), and SMDI_MWI.
Referenced by run_externnotify().
int AST_OPTIONAL_API_NAME() ast_smdi_mwi_set | ( | struct ast_smdi_interface * | iface, |
const char * | mailbox | ||
) |
Set the MWI indicator for a mailbox.
iface | the interface to use. |
mailbox | the mailbox to use. |
Definition at line 309 of file res_smdi.c.
References voicemailpwcheck::mailbox, and smdi_toggle_mwi().
Referenced by poll_mailbox(), and run_externnotify().
int AST_OPTIONAL_API_NAME() ast_smdi_mwi_unset | ( | struct ast_smdi_interface * | iface, |
const char * | mailbox | ||
) |
Unset the MWI indicator for a mailbox.
iface | the interface to use. |
mailbox | the mailbox to use. |
Definition at line 314 of file res_smdi.c.
References voicemailpwcheck::mailbox, and smdi_toggle_mwi().
Referenced by poll_mailbox(), and run_externnotify().
|
static |
Definition at line 795 of file res_smdi.c.
References AST_LIST_REMOVE_HEAD, ast_mutex_lock, ast_mutex_unlock, destroy_mailbox_mapping(), and mwi_monitor.
Referenced by smdi_load(), and unload_module().
|
static |
Definition at line 788 of file res_smdi.c.
References ao2_ref, ast_free, ast_string_field_free_memory, and mailbox_mapping::iface.
Referenced by destroy_all_mailbox_mappings().
|
static |
Load the module.
Module loading including tests for configuration or dependencies. This function can return AST_MODULE_LOAD_FAILURE, AST_MODULE_LOAD_DECLINE, or AST_MODULE_LOAD_SUCCESS. If a dependency or environment variable fails tests return AST_MODULE_LOAD_FAILURE. If the module can not load the configuration file or other non-critical problem return AST_MODULE_LOAD_DECLINE. On success return AST_MODULE_LOAD_SUCCESS.
Definition at line 1411 of file res_smdi.c.
References ast_cond_init, ast_custom_function_register, ast_log, AST_MODULE_LOAD_DECLINE, AST_MODULE_LOAD_SUCCESS, ast_mutex_init, LOG_NOTICE, mwi_monitor, NULL, smdi_load(), smdi_msg_function, smdi_msg_retrieve_function, and unload_module().
|
inlinestatic |
Definition at line 324 of file res_smdi.c.
References ast_mutex_lock, ast_smdi_interface::md_q_lock, ast_smdi_interface::mwi_q_lock, SMDI_MD, SMDI_MWI, and type.
Referenced by purge_old_messages(), smdi_message_wait(), and smdi_msg_pop().
|
inlinestatic |
Definition at line 360 of file res_smdi.c.
References ast_tv(), SMDI_MD, SMDI_MWI, ast_smdi_mwi_message::timestamp, ast_smdi_md_message::timestamp, and type.
Referenced by purge_old_messages().
|
static |
Definition at line 852 of file res_smdi.c.
References ast_cond_timedwait, AST_LIST_TRAVERSE, ast_mutex_lock, ast_mutex_unlock, ast_tv(), ast_tvadd(), ast_tvnow(), mwi_monitor, NULL, and poll_mailbox().
Referenced by smdi_load().
|
static |
Definition at line 833 of file res_smdi.c.
References ast_app_has_voicemail(), ast_smdi_mwi_set(), ast_smdi_mwi_unset(), buf, mailbox_mapping::context, mailbox_mapping::cur_state, mailbox_mapping::iface, mailbox_mapping::mailbox, NULL, mailbox_mapping::smdi, and state.
Referenced by mwi_monitor_handler().
|
static |
Definition at line 375 of file res_smdi.c.
References ao2_ref, ast_log, ast_smdi_md_message_push(), ast_smdi_mwi_message_push(), ast_tvdiff_ms(), ast_tvnow(), lock_msg_q(), LOG_NOTICE, ast_smdi_interface::msg_expiry, msg_timestamp(), ast_smdi_interface::name, SMDI_MD, SMDI_MWI, type, unlink_from_msg_q(), and unlock_msg_q().
Referenced by smdi_msg_find(), and smdi_msg_pop().
|
static |
Definition at line 1433 of file res_smdi.c.
References ast_log, LOG_WARNING, and smdi_load().
Referenced by smdi_load().
|
static |
Definition at line 934 of file res_smdi.c.
References CMP_MATCH, CMP_STOP, ast_smdi_interface::name, and str.
Referenced by smdi_load().
|
static |
Definition at line 224 of file res_smdi.c.
References ao2_cleanup, ast_cond_destroy, ast_module_unref, ast_mutex_destroy, AST_PTHREADT_NULL, AST_PTHREADT_STOP, ast_smdi_interface::file, ast_smdi_interface::md_q, ast_smdi_interface::md_q_cond, ast_smdi_interface::md_q_lock, ast_smdi_interface::mwi_q, ast_smdi_interface::mwi_q_cond, ast_smdi_interface::mwi_q_lock, NULL, ast_module_info::self, and ast_smdi_interface::thread.
Referenced by alloc_smdi_interface().
|
static |
Definition at line 952 of file res_smdi.c.
References alloc_smdi_interface(), AO2_ALLOC_OPT_LOCK_MUTEX, ao2_cleanup, ao2_container_alloc_list, ao2_container_count(), ao2_find, ao2_global_obj_ref, ao2_global_obj_replace_unref, ao2_link, append_mailbox_mapping(), ast_config_destroy(), ast_config_load, ast_copy_string(), AST_LIST_EMPTY, ast_log, ast_module_ref, ast_pthread_create_background, AST_PTHREADT_NULL, ast_true(), ast_variable_browse(), ast_verb, config_file, CONFIG_FLAG_FILEUNCHANGED, CONFIG_STATUS_FILEINVALID, CONFIG_STATUS_FILEUNCHANGED, DEFAULT_POLLING_INTERVAL, destroy_all_mailbox_mappings(), errno, ast_smdi_interface::fd, ast_smdi_interface::file, ast_variable::lineno, LOG_ERROR, LOG_NOTICE, ast_smdi_interface::mode, ast_smdi_interface::msdstrip, ast_smdi_interface::msg_expiry, mwi_monitor, mwi_monitor_handler(), ast_variable::name, ast_smdi_interface::name, ast_variable::next, NULL, OBJ_SEARCH_KEY, RAII_VAR, reload(), ast_module_info::self, smdi_ifaces_cmp_fn(), SMDI_MSG_EXPIRY_TIME, smdi_read(), ast_smdi_interface::thread, and ast_variable::value.
Referenced by load_module(), and reload().
|
static |
Definition at line 886 of file res_smdi.c.
References ast_strlen_zero(), CMP_MATCH, ast_smdi_md_message::mesg_desk_num, ast_smdi_md_message::mesg_desk_term, ast_smdi_md_message::name, OBJ_SEARCH_KEY, OBJ_SEARCH_MASK, and OBJ_SEARCH_OBJECT.
Referenced by alloc_smdi_interface().
|
static |
Definition at line 478 of file res_smdi.c.
References ast_cond_timedwait, ast_tv(), ast_tvadd(), ast_tvdiff_ms(), ast_tvnow(), cond, lock, lock_msg_q(), ast_smdi_interface::md_q_cond, ast_smdi_interface::md_q_lock, ast_smdi_interface::mwi_q_cond, ast_smdi_interface::mwi_q_lock, NULL, options, SMDI_MD, smdi_msg_find(), SMDI_MWI, type, and unlock_msg_q().
Referenced by ast_smdi_md_message_wait(), ast_smdi_mwi_message_wait(), ast_smdi_mwi_message_wait_station(), and smdi_msg_retrieve_read().
|
static |
Definition at line 1177 of file res_smdi.c.
References ao2_cleanup, ast_free, smdi_msg_datastore::iface, and smdi_msg_datastore::md_msg.
Referenced by smdi_msg_retrieve_read().
|
static |
Definition at line 434 of file res_smdi.c.
References ao2_callback, ao2_find, ast_strlen_zero(), ast_test_flag, ast_smdi_interface::md_q, ast_smdi_md_message::mesg_desk_num, ast_smdi_md_message::mesg_desk_term, ast_smdi_interface::mwi_q, ast_smdi_md_message::name, NULL, OBJ_SEARCH_KEY, OBJ_SEARCH_OBJECT, OPT_SEARCH_NUMBER, OPT_SEARCH_TERMINAL, options, purge_old_messages(), SMDI_MD, SMDI_MESG_DESK_NUM_LEN, SMDI_MESG_DESK_TERM_LEN, SMDI_MWI, and type.
Referenced by smdi_message_wait().
|
static |
Definition at line 416 of file res_smdi.c.
References lock_msg_q(), purge_old_messages(), type, unlink_from_msg_q(), and unlock_msg_q().
Referenced by ast_smdi_md_message_pop(), and ast_smdi_mwi_message_pop().
|
static |
Definition at line 1298 of file res_smdi.c.
References args, AST_APP_ARG, ast_channel_datastore_find(), ast_channel_lock, ast_channel_unlock, ast_copy_string(), AST_DECLARE_APP_ARGS, ast_log, ast_module_user_add, ast_module_user_remove, AST_STANDARD_APP_ARGS, ast_strdupa, ast_strlen_zero(), buf, ast_smdi_md_message::calling_st, ast_datastore::data, ast_smdi_md_message::fwd_st, len(), LOG_ERROR, LOG_WARNING, smdi_msg_datastore::md_msg, ast_smdi_md_message::mesg_desk_num, ast_smdi_md_message::mesg_desk_term, NULL, smdi_msg_datastore_info, and ast_smdi_md_message::type.
|
static |
Definition at line 1202 of file res_smdi.c.
References ao2_bump, ao2_cleanup, args, AST_APP_ARG, ast_app_parse_options(), ast_atomic_fetchadd_int(), ast_autoservice_start(), ast_autoservice_stop(), ast_calloc, ast_channel_datastore_add(), ast_channel_lock, ast_channel_unlock, ast_datastore_alloc, AST_DECLARE_APP_ARGS, ast_log, ast_module_user_add, ast_module_user_remove, ast_smdi_interface_find(), AST_STANDARD_APP_ARGS, ast_strdupa, ast_strlen_zero(), buf, ast_datastore::data, smdi_msg_datastore::id, smdi_msg_datastore::iface, len(), LOG_ERROR, LOG_WARNING, smdi_msg_datastore::md_msg, NULL, options, SMDI_MD, smdi_message_wait(), smdi_msg_datastore_destroy(), smdi_msg_datastore_info, smdi_msg_id, smdi_msg_ret_options, and SMDI_RETRIEVE_TIMEOUT_DEFAULT.
|
static |
Definition at line 879 of file res_smdi.c.
References CMP_MATCH, CMP_STOP, ast_smdi_mwi_message::name, and str.
Referenced by alloc_smdi_interface().
|
static |
Definition at line 586 of file res_smdi.c.
References ao2_alloc, ao2_ref, ast_copy_string(), ast_debug, ast_log, ast_smdi_md_message_push(), ast_smdi_mwi_message_push(), ast_tvnow(), c, ast_smdi_md_message::calling_st, ast_smdi_mwi_message::cause, ast_smdi_interface::file, ast_smdi_mwi_message::fwd_st, ast_smdi_md_message::fwd_st, LOG_ERROR, ast_smdi_md_message::mesg_desk_num, ast_smdi_md_message::mesg_desk_term, ast_smdi_interface::msdstrip, ast_smdi_interface::name, ast_smdi_mwi_message::name, ast_smdi_md_message::name, NULL, ast_smdi_mwi_message::timestamp, ast_smdi_md_message::timestamp, and ast_smdi_md_message::type.
Referenced by smdi_load().
|
static |
Definition at line 282 of file res_smdi.c.
References ao2_unlock, ao2_wrlock, ast_debug, ast_log, errno, make_ari_stubs::file, LOG_ERROR, voicemailpwcheck::mailbox, ast_smdi_interface::msdstrip, and ast_smdi_interface::name.
Referenced by ast_smdi_mwi_set(), and ast_smdi_mwi_unset().
|
inlinestatic |
Definition at line 348 of file res_smdi.c.
References ao2_callback, ast_smdi_interface::md_q, ast_smdi_interface::mwi_q, NULL, OBJ_UNLINK, SMDI_MD, SMDI_MWI, and type.
Referenced by purge_old_messages(), and smdi_msg_pop().
|
static |
Definition at line 1380 of file res_smdi.c.
References ao2_global_obj_release, ast_cond_signal, ast_custom_function_unregister(), ast_mutex_lock, ast_mutex_unlock, AST_PTHREADT_NULL, destroy_all_mailbox_mappings(), mwi_monitor, NULL, smdi_msg_function, and smdi_msg_retrieve_function.
Referenced by load_module().
|
inlinestatic |
Definition at line 336 of file res_smdi.c.
References ast_mutex_unlock, ast_smdi_interface::md_q_lock, ast_smdi_interface::mwi_q_lock, SMDI_MD, SMDI_MWI, and type.
Referenced by purge_old_messages(), smdi_message_wait(), and smdi_msg_pop().
|
static |
Definition at line 1452 of file res_smdi.c.
|
static |
Definition at line 1452 of file res_smdi.c.
ast_cond_t cond |
Definition at line 211 of file res_smdi.c.
Referenced by smdi_message_wait().
|
static |
Definition at line 165 of file res_smdi.c.
Referenced by smdi_load().
struct mailbox_mapping* first |
Definition at line 213 of file res_smdi.c.
struct mailbox_mapping* last |
Definition at line 213 of file res_smdi.c.
struct timeval last_poll |
The time that the last poll began
Definition at line 219 of file res_smdi.c.
ast_mutex_t lock |
Definition at line 210 of file res_smdi.c.
Referenced by smdi_message_wait().
struct { ... } mailbox_mappings |
A list of mailboxes that need to be monitored
struct { ... } mwi_monitor |
Data that gets used by the SMDI MWI monitoring thread.
Referenced by append_mailbox_mapping(), destroy_all_mailbox_mappings(), load_module(), mwi_monitor_handler(), smdi_load(), and unload_module().
unsigned int polling_interval |
Polling Interval for checking mailbox status
Definition at line 215 of file res_smdi.c.
|
static |
Definition at line 1187 of file res_smdi.c.
Referenced by smdi_msg_read(), and smdi_msg_retrieve_read().
|
static |
Definition at line 1375 of file res_smdi.c.
Referenced by load_module(), and unload_module().
|
static |
Definition at line 1192 of file res_smdi.c.
Referenced by smdi_msg_retrieve_read().
|
static |
Definition at line 1200 of file res_smdi.c.
Referenced by smdi_msg_retrieve_read().
|
static |
Definition at line 1370 of file res_smdi.c.
Referenced by load_module(), and unload_module().
unsigned int stop |
Set to 1 to tell the polling thread to stop
Definition at line 217 of file res_smdi.c.
pthread_t thread |
The thread ID
Definition at line 209 of file res_smdi.c.