Asterisk - The Open Source Telephony Project GIT-master-f36a736
|
Provide a directory of extensions. More...
#include "asterisk.h"
#include <ctype.h>
#include "asterisk/paths.h"
#include "asterisk/file.h"
#include "asterisk/pbx.h"
#include "asterisk/module.h"
#include "asterisk/say.h"
#include "asterisk/app.h"
#include "asterisk/utils.h"
#include "asterisk/adsi.h"
Go to the source code of this file.
Data Structures | |
struct | directory_item |
struct | itemlist |
Macros | |
#define | VOICEMAIL_CONFIG "voicemail.conf" |
Enumerations | |
enum | { OPT_LISTBYFIRSTNAME = (1 << 0) , OPT_SAYEXTENSION = (1 << 1) , OPT_FROMVOICEMAIL = (1 << 2) , OPT_SELECTFROMMENU = (1 << 3) , OPT_LISTBYLASTNAME = (1 << 4) , OPT_LISTBYEITHER = OPT_LISTBYFIRSTNAME | OPT_LISTBYLASTNAME , OPT_PAUSE = (1 << 5) , OPT_NOANSWER = (1 << 6) , OPT_ALIAS = (1 << 7) , OPT_CONFIG_FILE = (1 << 8) , OPT_SKIP = (1 << 9) , OPT_ADSI = (1 << 10) } |
enum | { OPT_ARG_FIRSTNAME = 0 , OPT_ARG_LASTNAME = 1 , OPT_ARG_EITHER = 2 , OPT_ARG_PAUSE = 3 , OPT_ARG_FILENAME = 4 , OPT_ARG_ARRAY_SIZE = 5 } |
Functions | |
static void | __init_commonbuf (void) |
static void | __reg_module (void) |
static void | __unreg_module (void) |
static int | adsi_confirm_match (struct ast_channel *chan, int seq, int total, const char *exten, const char *name, int showexten) |
static int | adsi_search_input (struct ast_channel *chan) |
struct ast_module * | AST_MODULE_SELF_SYM (void) |
static int | check_match (struct directory_item **result, const char *item_context, const char *item_fullname, const char *item_ext, const char *pattern_ext, int use_first_name) |
static int | compare (const char *text, const char *template) |
static int | directory_exec (struct ast_channel *chan, const char *data) |
static int | do_directory (struct ast_channel *chan, struct ast_config *vmcfg, struct ast_config *ucfg, char *context, char *dialcontext, char digit, int digits, struct ast_flags *flags, char *opts[]) |
static int | goto_exten (struct ast_channel *chan, const char *dialcontext, char *ext) |
static int | load_module (void) |
static int | play_mailbox_owner (struct ast_channel *chan, const char *context, const char *ext, const char *name, struct ast_flags *flags) |
static struct ast_config * | realtime_directory (char *context, const char *filename) |
static int | search_directory (const char *context, struct ast_config *vmcfg, struct ast_config *ucfg, const char *ext, struct ast_flags flags, itemlist *alist) |
static int | search_directory_sub (const char *context, struct ast_config *vmcfg, struct ast_config *ucfg, const char *ext, struct ast_flags flags, itemlist *alist) |
static int | select_entry (struct ast_channel *chan, const char *dialcontext, const struct directory_item *item, struct ast_flags *flags) |
static int | select_item_menu (struct ast_channel *chan, struct directory_item **items, int count, const char *dialcontext, struct ast_flags *flags, char *opts[]) |
static int | select_item_pause (struct ast_channel *chan, struct ast_flags *flags, char *opts[]) |
static int | select_item_seq (struct ast_channel *chan, struct directory_item **items, int count, const char *dialcontext, struct ast_flags *flags, char *opts[]) |
static void | sort_items (struct directory_item **sorted, int count) |
static int | unload_module (void) |
Variables | |
static struct ast_module_info | __mod_info = { .name = AST_MODULE, .flags = AST_MODFLAG_LOAD_ORDER , .description = "Extension Directory" , .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, .load = load_module, .unload = unload_module, .load_pri = AST_MODPRI_DEFAULT, .support_level = AST_MODULE_SUPPORT_CORE, } |
static const char | app [] = "Directory" |
static const struct ast_module_info * | ast_module_info = &__mod_info |
static struct ast_threadstorage | commonbuf = { .once = PTHREAD_ONCE_INIT , .key_init = __init_commonbuf , .custom_init = NULL , } |
static const struct ast_app_option | directory_app_options [128] = { [ 'f' ] = { .flag = OPT_LISTBYFIRSTNAME , .arg_index = OPT_ARG_FIRSTNAME + 1 }, [ 'l' ] = { .flag = OPT_LISTBYLASTNAME , .arg_index = OPT_ARG_LASTNAME + 1 }, [ 'b' ] = { .flag = OPT_LISTBYEITHER , .arg_index = OPT_ARG_EITHER + 1 }, [ 'p' ] = { .flag = OPT_PAUSE , .arg_index = OPT_ARG_PAUSE + 1 }, [ 'e' ] = { .flag = OPT_SAYEXTENSION }, [ 'v' ] = { .flag = OPT_FROMVOICEMAIL }, [ 'm' ] = { .flag = OPT_SELECTFROMMENU }, [ 'n' ] = { .flag = OPT_NOANSWER }, [ 'a' ] = { .flag = OPT_ALIAS }, [ 'c' ] = { .flag = OPT_CONFIG_FILE , .arg_index = OPT_ARG_FILENAME + 1 }, [ 's' ] = { .flag = OPT_SKIP }, [ 'd' ] = { .flag = OPT_ADSI }, } |
Provide a directory of extensions.
Definition in file app_directory.c.
#define VOICEMAIL_CONFIG "voicemail.conf" |
Definition at line 162 of file app_directory.c.
anonymous enum |
Enumerator | |
---|---|
OPT_LISTBYFIRSTNAME | |
OPT_SAYEXTENSION | |
OPT_FROMVOICEMAIL | |
OPT_SELECTFROMMENU | |
OPT_LISTBYLASTNAME | |
OPT_LISTBYEITHER | |
OPT_PAUSE | |
OPT_NOANSWER | |
OPT_ALIAS | |
OPT_CONFIG_FILE | |
OPT_SKIP | |
OPT_ADSI |
Definition at line 164 of file app_directory.c.
anonymous enum |
Enumerator | |
---|---|
OPT_ARG_FIRSTNAME | |
OPT_ARG_LASTNAME | |
OPT_ARG_EITHER | |
OPT_ARG_PAUSE | |
OPT_ARG_FILENAME | |
OPT_ARG_ARRAY_SIZE |
Definition at line 179 of file app_directory.c.
|
static |
Definition at line 552 of file app_directory.c.
|
static |
Definition at line 1102 of file app_directory.c.
|
static |
Definition at line 1102 of file app_directory.c.
|
static |
Definition at line 235 of file app_directory.c.
References ADSI_INFO_PAGE, ADSI_JUST_CENT, ADSI_KEY_APPS, ADSI_MSG_DISPLAY, ast_adsi_display(), ast_adsi_load_soft_key(), ast_adsi_set_keys(), ast_adsi_set_line(), ast_adsi_transmit_message(), ast_adsi_voice_mode(), ast_debug, buf, name, NULL, seq, and total.
Referenced by select_item_seq().
|
static |
Definition at line 213 of file app_directory.c.
References ADSI_COMM_PAGE, ADSI_DIR_FROM_LEFT, ADSI_JUST_CENT, ADSI_JUST_LEFT, ADSI_KEY_APPS, ADSI_MSG_DISPLAY, ast_adsi_display(), ast_adsi_input_control(), ast_adsi_input_format(), ast_adsi_load_soft_key(), ast_adsi_set_keys(), ast_adsi_set_line(), ast_adsi_transmit_message(), ast_adsi_voice_mode(), ast_channel_name(), ast_debug, and buf.
Referenced by directory_exec().
struct ast_module * AST_MODULE_SELF_SYM | ( | void | ) |
Definition at line 1102 of file app_directory.c.
|
static |
Definition at line 652 of file app_directory.c.
References ast_calloc, ast_copy_string(), ast_debug, ast_strlen_zero(), compare(), item, directory_item::key, aco_type::name, NULL, and result.
Referenced by search_directory_sub().
|
static |
Definition at line 276 of file app_directory.c.
References ast_strlen_zero(), digit, and text.
Referenced by _ast_hashtab_create(), ast_sip_is_content_type(), and check_match().
|
static |
Definition at line 940 of file app_directory.c.
References adsi_search_input(), args, ast_adsi_available(), ast_adsi_load_session(), ast_answer(), AST_APP_ARG, ast_app_parse_options(), ast_channel_name(), ast_check_hangup(), ast_clear_flag, ast_config_destroy(), ast_config_load, AST_DECLARE_APP_ARGS, AST_DIGIT_ANY, ast_log, ast_set_flag, AST_STANDARD_APP_ARGS, AST_STATE_UP, ast_stopstream(), ast_strdupa, ast_stream_and_wait(), ast_strlen_zero(), ast_test_flag, ast_variable_retrieve(), ast_waitfordigit(), ast_waitstream(), CONFIG_STATUS_FILEINVALID, dialcontext, digit, directory_app_options, do_directory(), ast_flags::flags, LOG_ERROR, LOG_WARNING, NULL, OPT_ADSI, OPT_ARG_ARRAY_SIZE, OPT_ARG_EITHER, OPT_ARG_FILENAME, OPT_ARG_FIRSTNAME, OPT_ARG_LASTNAME, OPT_LISTBYFIRSTNAME, OPT_LISTBYLASTNAME, OPT_NOANSWER, options, pbx_builtin_setvar_helper(), realtime_directory(), S_OR, and VOICEMAIL_CONFIG.
Referenced by load_module().
|
static |
Definition at line 861 of file app_directory.c.
References ast_calloc, ast_channel_language(), ast_free, AST_LIST_HEAD_NOLOCK_INIT_VALUE, AST_LIST_REMOVE_HEAD, AST_LIST_TRAVERSE, ast_log, ast_readstring(), ast_streamfile(), ast_test_flag, voicemailpwcheck::context, DEBUG_ATLEAST, dialcontext, digit, ext, directory_item::exten, goto_exten(), item, LOG_DEBUG, name, NULL, OPT_SELECTFROMMENU, pbx_builtin_setvar_helper(), search_directory(), select_item_menu(), select_item_seq(), and sort_items().
Referenced by directory_exec().
|
static |
Definition at line 356 of file app_directory.c.
References ast_channel_context(), ast_goto_if_exists(), ast_log, dialcontext, ext, LOG_WARNING, and S_OR.
Referenced by do_directory(), and select_item_seq().
|
static |
Definition at line 1097 of file app_directory.c.
References app, ast_register_application_xml, and directory_exec().
|
static |
Definition at line 372 of file app_directory.c.
References ast_alloca, ast_app_sayname(), ast_channel_language(), AST_DIGIT_ANY, AST_SAY_CASE_NONE, ast_say_character_str(), ast_stopstream(), ast_stream_and_wait(), ast_strlen_zero(), ast_test_flag, voicemailpwcheck::context, ext, name, OPT_SAYEXTENSION, and S_OR.
Referenced by select_item_menu(), and select_item_seq().
|
static |
Definition at line 554 of file app_directory.c.
References ast_category_append(), ast_category_browse(), ast_category_get(), ast_category_new_dynamic, ast_config_destroy(), ast_config_load, ast_debug, ast_load_realtime_multientry(), ast_log, ast_str_append(), ast_str_buffer(), ast_str_set(), ast_str_thread_get(), ast_strlen_zero(), ast_true(), ast_variable_append(), ast_variable_browse(), ast_variable_new, ast_variable_retrieve(), CONFIG_STATUS_FILEINVALID, voicemailpwcheck::context, LOG_ERROR, LOG_WARNING, voicemailpwcheck::mailbox, ast_variable::name, ast_variable::next, NULL, S_OR, SENTINEL, tmp(), ast_variable::value, and var.
Referenced by directory_exec().
|
static |
Definition at line 810 of file app_directory.c.
References ast_category_browse(), ast_debug, ast_strlen_zero(), ast_true(), ast_variable_retrieve(), voicemailpwcheck::context, ext, NULL, and search_directory_sub().
Referenced by do_directory().
|
static |
Definition at line 699 of file app_directory.c.
References a, ast_category_browse(), ast_config_option(), ast_debug, AST_LIST_INSERT_TAIL, ast_str_buffer(), ast_str_set(), ast_str_thread_get(), ast_strlen_zero(), ast_test_flag, ast_true(), ast_variable_browse(), ast_variable_retrieve(), buf, check_match(), voicemailpwcheck::context, ext, item, name, ast_variable::name, ast_variable::next, NULL, OPT_ALIAS, OPT_LISTBYFIRSTNAME, OPT_LISTBYLASTNAME, options, strcasestr(), strsep(), and ast_variable::value.
Referenced by search_directory().
|
static |
Definition at line 400 of file app_directory.c.
References ast_channel_exten_set(), ast_debug, ast_goto_if_exists(), ast_log, ast_test_flag, dialcontext, item, LOG_WARNING, aco_type::name, OPT_FROMVOICEMAIL, OPT_SKIP, pbx_builtin_setvar_helper(), and S_OR.
Referenced by select_item_menu(), and select_item_seq().
|
static |
Definition at line 488 of file app_directory.c.
References ast_channel_language(), AST_DIGIT_ANY, ast_streamfile(), ast_waitfordigit(), ast_waitstream(), buf, dialcontext, item, aco_type::name, pbx_builtin_setvar_helper(), play_mailbox_owner(), select_entry(), and select_item_pause().
Referenced by do_directory().
|
static |
Definition at line 422 of file app_directory.c.
References ast_strlen_zero(), ast_test_flag, ast_waitfordigit(), OPT_ARG_PAUSE, and OPT_PAUSE.
Referenced by select_item_menu(), and select_item_seq().
|
static |
Definition at line 436 of file app_directory.c.
References adsi_confirm_match(), AST_DIGIT_ANY, ast_stopstream(), ast_stream_and_wait(), ast_test_flag, ast_waitfordigit(), dialcontext, goto_exten(), item, aco_type::name, OPT_ADSI, OPT_SAYEXTENSION, pbx_builtin_setvar_helper(), play_mailbox_owner(), select_entry(), and select_item_pause().
Referenced by do_directory().
|
static |
Definition at line 839 of file app_directory.c.
References directory_item::key, and tmp().
Referenced by do_directory().
|
static |
Definition at line 1090 of file app_directory.c.
References app, and ast_unregister_application().
|
static |
Definition at line 1102 of file app_directory.c.
|
static |
Definition at line 157 of file app_directory.c.
Referenced by load_module(), and unload_module().
|
static |
Definition at line 1102 of file app_directory.c.
|
static |
Definition at line 552 of file app_directory.c.
|
static |
Definition at line 211 of file app_directory.c.
Referenced by directory_exec().