Asterisk - The Open Source Telephony Project
18.5.0
|
Comedian Mail - Voicemail System. More...
#include "asterisk.h"
#include "asterisk/paths.h"
#include <sys/time.h>
#include <sys/stat.h>
#include <sys/mman.h>
#include <time.h>
#include <dirent.h>
#include "asterisk/logger.h"
#include "asterisk/lock.h"
#include "asterisk/file.h"
#include "asterisk/channel.h"
#include "asterisk/pbx.h"
#include "asterisk/config.h"
#include "asterisk/say.h"
#include "asterisk/module.h"
#include "asterisk/adsi.h"
#include "asterisk/app.h"
#include "asterisk/mwi.h"
#include "asterisk/manager.h"
#include "asterisk/dsp.h"
#include "asterisk/localtime.h"
#include "asterisk/cli.h"
#include "asterisk/utils.h"
#include "asterisk/stringfields.h"
#include "asterisk/strings.h"
#include "asterisk/smdi.h"
#include "asterisk/astobj2.h"
#include "asterisk/taskprocessor.h"
#include "asterisk/test.h"
#include "asterisk/format_cache.h"
Go to the source code of this file.
Data Structures | |
struct | alias_mailbox_mapping |
struct | ast_vm_user |
struct | baseio |
struct | inprocess |
struct | leave_vm_options |
Options for leaving voicemail with the voicemail() application. More... | |
struct | mailbox_alias_mapping |
struct | test_files |
struct | users |
list of users found in the config file More... | |
struct | vm_state |
struct | vm_zone |
struct | zones |
Macros | |
#define | ALIASES_OUTPUT_FORMAT "%-32s %-32s\n" |
#define | ASTERISK_USERNAME "asterisk" |
#define | BASELINELEN 72 |
#define | BASEMAXINLINE 256 |
#define | CHECK(u, attr, value) |
#define | CHUNKSIZE 65536 |
#define | COMMAND_TIMEOUT 5000 |
#define | COPY(a, b, c, d, e, f, g, h) (copy_plain_file(g,h)); |
#define | DEFAULT_LISTEN_CONTROL_FORWARD_KEY "#" |
#define | DEFAULT_LISTEN_CONTROL_PAUSE_KEY "0" |
#define | DEFAULT_LISTEN_CONTROL_RESTART_KEY "2" |
#define | DEFAULT_LISTEN_CONTROL_REVERSE_KEY "*" |
#define | DEFAULT_LISTEN_CONTROL_STOP_KEY "13456789" |
#define | DEFAULT_POLL_FREQ 30 |
#define | DELETE(a, b, c, d) (vm_delete(c)) |
#define | DISPOSE(a, b) |
#define | ENDL "\n" |
#define | ERROR_LOCK_PATH -100 |
#define | ERROR_MAX_MSGS -101 |
#define | EXISTS(a, b, c, d) (ast_fileexists(c,NULL,d) > 0) |
#define | HVSU_OUTPUT_FORMAT "%-10s %-5s %-25s %-10s %6s\n" |
#define | HVSZ_OUTPUT_FORMAT "%-15s %-20s %-45s\n" |
#define | INTRO "vm-intro" |
#define | MAPPING_BUCKETS 511 |
#define | MAX_DATETIME_FORMAT 512 |
#define | MAX_MAIL_BODY_CONTENT_SIZE 134217728L |
#define | MAX_NUM_CID_CONTEXTS 10 |
#define | MAX_VM_CONTEXT_LEN (AST_MAX_CONTEXT) |
#define | MAX_VM_MAILBOX_LEN (MAX_VM_MBOX_ID_LEN + MAX_VM_CONTEXT_LEN) |
#define | MAX_VM_MBOX_ID_LEN (AST_MAX_EXTENSION) |
#define | MAXMSG 100 |
#define | MAXMSGLIMIT 9999 |
#define | MINPASSWORD 0 |
#define | MSG_ID_LEN 256 |
#define | OPERATOR_EXIT 300 |
#define | PWDCHANGE_EXTERNAL (1 << 2) |
#define | PWDCHANGE_INTERNAL (1 << 1) |
#define | RENAME(a, b, c, d, e, f, g, h) (rename_file(g,h)); |
#define | RETRIEVE(a, b, c, d) |
#define | SENDMAIL "/usr/sbin/sendmail -t" |
#define | SMDI_MWI_WAIT_TIMEOUT 1000 /* 1 second */ |
#define | STORE(a, b, c, d, e, f, g, h, i, j, k) |
#define | tdesc "Comedian Mail (Voicemail System)" |
#define | UPDATE_MSG_ID(a, b, c, d, e, f) |
#define | VALID_DTMF "1234567890*#" /* Yes ABCD are valid dtmf but what phones have those? */ |
#define | VM_ALLOCED (1 << 13) |
#define | VM_ATTACH (1 << 11) |
#define | VM_DELETE (1 << 12) |
#define | VM_DIRECFORWARD (1 << 10) |
#define | VM_ENVELOPE (1 << 4) |
#define | VM_FORCEGREET (1 << 8) |
#define | VM_FORCENAME (1 << 7) |
#define | VM_FWDURGAUTO (1 << 18) |
#define | VM_MESSAGEWRAP (1 << 17) |
#define | VM_MOVEHEARD (1 << 16) |
#define | VM_OPERATOR (1 << 1) |
#define | VM_PBXSKIP (1 << 9) |
#define | VM_REVIEW (1 << 0) |
#define | VM_SAYCID (1 << 2) |
#define | VM_SAYDURATION (1 << 5) |
#define | VM_SEARCH (1 << 14) |
#define | VM_SKIPAFTERCMD (1 << 6) |
#define | VM_SVMAIL (1 << 3) |
#define | VM_TEMPGREETWARN (1 << 15) |
#define | VMSTATE_MAX_MSG_ARRAY 256 |
#define | VOICEMAIL_CONFIG "voicemail.conf" |
#define | VOICEMAIL_DIR_MODE 0777 |
#define | VOICEMAIL_FILE_MODE 0666 |
Enumerations | |
enum | vm_box { NEW_FOLDER = 0, OLD_FOLDER = 1, WORK_FOLDER = 2, FAMILY_FOLDER = 3, FRIENDS_FOLDER = 4, GREETINGS_FOLDER = -1 } |
enum | vm_option_args { OPT_ARG_RECORDGAIN = 0, OPT_ARG_PLAYFOLDER = 1, OPT_ARG_DTMFEXIT = 2, OPT_ARG_BEEP_TONE = 3, OPT_ARG_ARRAY_SIZE = 4 } |
enum | vm_option_flags { OPT_SILENT = (1 << 0), OPT_BUSY_GREETING = (1 << 1), OPT_UNAVAIL_GREETING = (1 << 2), OPT_RECORDGAIN = (1 << 3), OPT_PREPEND_MAILBOX = (1 << 4), OPT_AUTOPLAY = (1 << 6), OPT_DTMFEXIT = (1 << 7), OPT_MESSAGE_Urgent = (1 << 8), OPT_MESSAGE_PRIORITY = (1 << 9), OPT_EARLYM_GREETING = (1 << 10), OPT_BEEP = (1 << 11) } |
enum | vm_passwordlocation { OPT_PWLOC_VOICEMAILCONF = 0, OPT_PWLOC_SPOOLDIR = 1, OPT_PWLOC_USERSCONF = 2 } |
Functions | |
static int | __has_voicemail (const char *context, const char *mailbox, const char *folder, int shortcircuit) |
static void | __reg_module (void) |
static void | __unreg_module (void) |
static int | acf_vm_info (struct ast_channel *chan, const char *cmd, char *args, char *buf, size_t len) |
static int | actual_load_config (int reload, struct ast_config *cfg, struct ast_config *ucfg) |
static int | add_email_attachment (FILE *p, struct ast_vm_user *vmu, char *format, char *attach, char *greeting_attachment, char *mailbox, char *bound, char *filename, int last, int msgnum) |
static int | add_message_id (struct ast_config *msg_cfg, char *dir, int msg, char *filename, char *id, size_t id_size, struct ast_vm_user *vmu, int folder) |
static void | adsi_begin (struct ast_channel *chan, int *useadsi) |
static void | adsi_delete (struct ast_channel *chan, struct vm_state *vms) |
static void | adsi_folders (struct ast_channel *chan, int start, char *label) |
static void | adsi_goodbye (struct ast_channel *chan) |
static int | adsi_load_vmail (struct ast_channel *chan, int *useadsi) |
static void | adsi_login (struct ast_channel *chan) |
static int | adsi_logo (unsigned char *buf) |
static void | adsi_message (struct ast_channel *chan, struct vm_state *vms) |
static void | adsi_password (struct ast_channel *chan) |
static void | adsi_status (struct ast_channel *chan, struct vm_state *vms) |
static void | adsi_status2 (struct ast_channel *chan, struct vm_state *vms) |
static int | advanced_options (struct ast_channel *chan, struct ast_vm_user *vmu, struct vm_state *vms, int msg, int option, signed char record_gain) |
The advanced options within a message. More... | |
static struct alias_mailbox_mapping * | alias_mailbox_mapping_create (const char *alias, const char *mailbox) |
AO2_STRING_FIELD_CMP_FN (alias_mailbox_mapping, alias) | |
AO2_STRING_FIELD_CMP_FN (mailbox_alias_mapping, mailbox) | |
AO2_STRING_FIELD_HASH_FN (alias_mailbox_mapping, alias) | |
AO2_STRING_FIELD_HASH_FN (mailbox_alias_mapping, mailbox) | |
static int | append_mailbox (const char *context, const char *box, const char *data) |
static int | append_vmu_info_astman (struct mansession *s, struct ast_vm_user *vmu, const char *event_name, const char *actionid) |
Append vmu info string into given astman with event_name. More... | |
static void | apply_option (struct ast_vm_user *vmu, const char *var, const char *value) |
Sets a specific property value. More... | |
static void | apply_options (struct ast_vm_user *vmu, const char *options) |
Destructively Parse options and apply. More... | |
static void | apply_options_full (struct ast_vm_user *retval, struct ast_variable *var) |
Loads the options specific to a voicemail user. More... | |
struct ast_module * | AST_MODULE_SELF_SYM (void) |
static const char * | ast_str_encode_mime (struct ast_str **end, ssize_t maxlen, const char *start, size_t preamble, size_t postamble) |
Encode a string according to the MIME rules for encoding strings that are not 7-bit clean or contain control characters. More... | |
static const char * | ast_str_quote (struct ast_str **buf, ssize_t maxlen, const char *from) |
Wraps a character sequence in double quotes, escaping occurences of quotes within the string. More... | |
AST_TEST_DEFINE (test_voicemail_vmuser) | |
AST_TEST_DEFINE (test_voicemail_vmsayname) | |
AST_TEST_DEFINE (test_voicemail_msgcount) | |
AST_TEST_DEFINE (test_voicemail_notify_endl) | |
AST_TEST_DEFINE (test_voicemail_load_config) | |
AST_TEST_DEFINE (test_voicemail_vm_info) | |
static int | base_encode (char *filename, FILE *so) |
Performs a base 64 encode algorithm on the contents of a File. More... | |
static int | change_password_realtime (struct ast_vm_user *vmu, const char *password) |
Performs a change of the voicemail passowrd in the realtime engine. More... | |
static int | check_mime (const char *str) |
Check if the string would need encoding within the MIME standard, to avoid confusing certain mail software that expects messages to be 7-bit clean. More... | |
static int | check_password (struct ast_vm_user *vmu, char *password) |
Check that password meets minimum required length. More... | |
static int | close_mailbox (struct vm_state *vms, struct ast_vm_user *vmu) |
static char * | complete_voicemail_show_users (const char *line, const char *word, int pos, int state) |
static int | copy (char *infile, char *outfile) |
Utility function to copy a file. More... | |
static int | copy_message (struct ast_channel *chan, struct ast_vm_user *vmu, int imbox, int msgnum, long duration, struct ast_vm_user *recip, char *fmt, char *dir, const char *flag, const char *dest_folder) |
Copies a message from one mailbox to another. More... | |
static void | copy_plain_file (char *frompath, char *topath) |
Copies a voicemail information (envelope) file. More... | |
static int | count_messages (struct ast_vm_user *vmu, char *dir) |
Find all .txt files - even if they are not in sequence from 0000. More... | |
static int | create_dirpath (char *dest, int len, const char *context, const char *ext, const char *folder) |
basically mkdir -p $dest/$context/$ext/$folder More... | |
static int | dialout (struct ast_channel *chan, struct ast_vm_user *vmu, char *num, char *outgoing_context) |
static struct ast_frame * | fake_read (struct ast_channel *ast) |
static int | fake_write (struct ast_channel *ast, struct ast_frame *frame) |
static struct ast_vm_user * | find_or_create (const char *context, const char *box) |
static struct ast_vm_user * | find_user (struct ast_vm_user *ivm, const char *context, const char *mailbox) |
Finds a voicemail user from the users file or the realtime engine. More... | |
static struct ast_vm_user * | find_user_realtime (struct ast_vm_user *ivm, const char *context, const char *mailbox) |
Finds a voicemail user from the realtime engine. More... | |
static int | forward_message (struct ast_channel *chan, char *context, struct vm_state *vms, struct ast_vm_user *sender, char *fmt, int is_new_message, signed char record_gain, int urgent) |
Sends a voicemail message to a mailbox recipient. More... | |
static void | free_user (struct ast_vm_user *vmu) |
static void | free_user_final (struct ast_vm_user *vmu) |
static void | free_vm_users (void) |
Free the users structure. More... | |
static void | free_vm_zones (void) |
Free the zones structure. More... | |
static void | free_zone (struct vm_zone *z) |
static void | generate_msg_id (char *dst) |
Sets the destination string to a uniquely identifying msg_id string. More... | |
static int | get_date (char *s, int len) |
Gets the current date and time, as formatted string. More... | |
static int | get_folder (struct ast_channel *chan, int start) |
get_folder: Folder menu Plays "press 1 for INBOX messages" etc. Should possibly be internationalized More... | |
static int | get_folder2 (struct ast_channel *chan, char *fn, int start) |
plays a prompt and waits for a keypress. More... | |
static int | get_folder_by_name (const char *name) |
static int | get_folder_ja (struct ast_channel *chan, int start) |
static char * | handle_voicemail_reload (struct ast_cli_entry *e, int cmd, struct ast_cli_args *a) |
Reload voicemail configuration from the CLI. More... | |
static char * | handle_voicemail_show_aliases (struct ast_cli_entry *e, int cmd, struct ast_cli_args *a) |
Show a list of voicemail zones in the CLI. More... | |
static char * | handle_voicemail_show_users (struct ast_cli_entry *e, int cmd, struct ast_cli_args *a) |
Show a list of voicemail users in the CLI. More... | |
static char * | handle_voicemail_show_zones (struct ast_cli_entry *e, int cmd, struct ast_cli_args *a) |
Show a list of voicemail zones in the CLI. More... | |
static int | has_voicemail (const char *mailbox, const char *folder) |
Determines if the given folder has messages. More... | |
static int | inboxcount (const char *mailbox, int *newmsgs, int *oldmsgs) |
static int | inboxcount2 (const char *mailbox, int *urgentmsgs, int *newmsgs, int *oldmsgs) |
Check the given mailbox's message count. More... | |
static int | inbuf (struct baseio *bio, FILE *fi) |
utility used by inchar(), for base_encode() More... | |
static int | inchar (struct baseio *bio, FILE *fi) |
utility used by base_encode() More... | |
static int | inprocess_cmp_fn (void *obj, void *arg, int flags) |
static int | inprocess_count (const char *context, const char *mailbox, int delta) |
static int | inprocess_hash_fn (const void *obj, const int flags) |
static int | invent_message (struct ast_channel *chan, char *context, char *ext, int busy, char *ecodes) |
static int | is_valid_dtmf (const char *key) |
Determines if a DTMF key entered is valid. More... | |
static int | last_message_index (struct ast_vm_user *vmu, char *dir) |
Determines the highest message number in use for a given user and mailbox folder. More... | |
static int | leave_voicemail (struct ast_channel *chan, char *ext, struct leave_vm_options *options) |
Prompts the user and records a voicemail to a mailbox. More... | |
static void | load_aliases (struct ast_config *cfg) |
static int | load_config (int reload) |
static int | load_config_from_memory (int reload, struct ast_config *cfg, struct ast_config *ucfg) |
static int | load_module (void) |
Load the module. More... | |
static void | load_users (struct ast_config *cfg) |
static void | load_zonemessages (struct ast_config *cfg) |
static int | make_dir (char *dest, int len, const char *context, const char *ext, const char *folder) |
Creates a file system path expression for a folder within the voicemail data folder and the appropriate context. More... | |
static void | make_email_file (FILE *p, char *srcemail, struct ast_vm_user *vmu, int msgnum, char *context, char *mailbox, const char *fromfolder, char *cidnum, char *cidname, char *attach, char *attach2, char *format, int duration, int attach_user_voicemail, struct ast_channel *chan, const char *category, int imap, const char *flag, const char *msg_id) |
Creates the email file to be sent to indicate a new voicemail exists for a user. More... | |
static int | make_file (char *dest, const int len, const char *dir, const int num) |
Creates a file system path expression for a folder within the voicemail data folder and the appropriate context. More... | |
static int | manager_list_voicemail_users (struct mansession *s, const struct message *m) |
Manager list voicemail users command. More... | |
static int | manager_match_mailbox (struct ast_mwi_state *mwi_state, void *data) |
static int | manager_status_voicemail_user (struct mansession *s, const struct message *m) |
static int | manager_voicemail_refresh (struct mansession *s, const struct message *m) |
static void * | mb_poll_thread (void *data) |
static const char * | mbox (struct ast_vm_user *vmu, int id) |
static int | message_range_and_existence_check (struct vm_state *vms, const char *msg_ids [], size_t num_msgs, int *msg_nums, struct ast_vm_user *vmu) |
common bounds checking and existence check for Voicemail API functions. More... | |
static int | messagecount (const char *mailbox_id, const char *folder) |
static int | msg_create_from_file (struct ast_vm_recording_data *recdata) |
static void | mwi_handle_subscribe (const char *id, struct ast_mwi_subscriber *sub) |
static int | mwi_handle_subscribe2 (void *data) |
static void | mwi_handle_unsubscribe (const char *id, struct ast_mwi_subscriber *sub) |
static int | mwi_handle_unsubscribe2 (void *data) |
static int | notify_new_message (struct ast_channel *chan, struct ast_vm_user *vmu, struct vm_state *vms, int msgnum, long duration, char *fmt, char *cidnum, char *cidname, const char *flag) |
Sends email notification that a user has a new voicemail waiting for them. More... | |
static void | notify_new_state (struct ast_vm_user *vmu) |
static int | ochar (struct baseio *bio, int c, FILE *so) |
utility used by base_encode() More... | |
static int | open_mailbox (struct vm_state *vms, struct ast_vm_user *vmu, int box) |
static int | play_message (struct ast_channel *chan, struct ast_vm_user *vmu, struct vm_state *vms) |
static int | play_message_by_id (struct ast_channel *chan, const char *mailbox, const char *context, const char *msg_id) |
Finds a message in a specific mailbox by msg_id and plays it to the channel. More... | |
static int | play_message_by_id_helper (struct ast_channel *chan, struct ast_vm_user *vmu, struct vm_state *vms, const char *msg_id) |
static int | play_message_callerid (struct ast_channel *chan, struct vm_state *vms, char *cid, const char *context, int callback, int saycidnumber) |
static int | play_message_category (struct ast_channel *chan, const char *category) |
static int | play_message_datetime (struct ast_channel *chan, struct ast_vm_user *vmu, const char *origtime, const char *filename) |
static int | play_message_duration (struct ast_channel *chan, struct vm_state *vms, const char *duration, int minduration) |
static int | play_record_review (struct ast_channel *chan, char *playfile, char *recordfile, int maxtime, char *fmt, int outsidecaller, struct ast_vm_user *vmu, int *duration, int *sound_duration, const char *unlockdir, signed char record_gain, struct vm_state *vms, char *flag, const char *msg_id, int forwardintro) |
static int | poll_subscribed_mailbox (struct ast_mwi_state *mwi_state, void *data) |
static void | populate_defaults (struct ast_vm_user *vmu) |
Sets default voicemail system options to a voicemail user. More... | |
static void | prep_email_sub_vars (struct ast_channel *ast, struct ast_vm_user *vmu, int msgnum, char *context, char *mailbox, const char *fromfolder, char *cidnum, char *cidname, char *dur, char *date, const char *category, const char *flag) |
static void | print_mappings (void *v_obj, void *where, ao2_prnt_fn *prnt) |
static void | queue_mwi_event (const char *channel_id, const char *box, int urgent, int new, int old) |
static void | read_password_from_file (const char *secretfn, char *password, int passwordlen) |
static int | reload (void) |
static void | rename_file (char *sfn, char *dfn) |
Renames a message in a mailbox folder. More... | |
static int | resequence_mailbox (struct ast_vm_user *vmu, char *dir, int stopcount) |
static int | reset_user_pw (const char *context, const char *mailbox, const char *newpass) |
Resets a user password to a specified password. More... | |
static void | run_externnotify (const char *context, const char *extension, const char *flag) |
static int | save_to_folder (struct ast_vm_user *vmu, struct vm_state *vms, int msg, int box, int *newmsg, int move) |
static int | say_and_wait (struct ast_channel *chan, int num, const char *language) |
static int | sayname (struct ast_channel *chan, const char *mailbox, const char *context) |
static int | sendmail (char *srcemail, struct ast_vm_user *vmu, int msgnum, char *context, char *mailbox, const char *fromfolder, char *cidnum, char *cidname, char *attach, char *attach2, char *format, int duration, int attach_user_voicemail, struct ast_channel *chan, const char *category, const char *flag, const char *msg_id) |
static int | sendpage (char *srcemail, char *pager, int msgnum, char *context, char *mailbox, const char *fromfolder, char *cidnum, char *cidname, int duration, struct ast_vm_user *vmu, const char *category, const char *flag) |
static int | separate_mailbox (char *mailbox_id, char **mailbox, char **context) |
static char * | show_users_realtime (int fd, const char *context) |
static void | start_poll_thread (void) |
static void | stop_poll_thread (void) |
static char * | strip_control_and_high (const char *input, char *buf, size_t buflen) |
Strips control and non 7-bit clean characters from input string. More... | |
static const char * | substitute_escapes (const char *value) |
static int | unload_module (void) |
static int | valid_config (const struct ast_config *cfg) |
Check if configuration file is valid. More... | |
static int | vm_allocate_dh (struct vm_state *vms, struct ast_vm_user *vmu, int count_msg) |
static int | vm_authenticate (struct ast_channel *chan, char *mailbox, int mailbox_size, struct ast_vm_user *res_vmu, const char *context, const char *prefix, int skipuser, int max_logins, int silent) |
static int | vm_browse_messages (struct ast_channel *chan, struct vm_state *vms, struct ast_vm_user *vmu) |
Top level method to invoke the language variant vm_browse_messages_XX function. More... | |
static int | vm_browse_messages_en (struct ast_channel *chan, struct vm_state *vms, struct ast_vm_user *vmu) |
Default English syntax for 'You have N messages' greeting. More... | |
static int | vm_browse_messages_es (struct ast_channel *chan, struct vm_state *vms, struct ast_vm_user *vmu) |
Spanish syntax for 'You have N messages' greeting. More... | |
static int | vm_browse_messages_gr (struct ast_channel *chan, struct vm_state *vms, struct ast_vm_user *vmu) |
Greek syntax for 'You have N messages' greeting. More... | |
static int | vm_browse_messages_he (struct ast_channel *chan, struct vm_state *vms, struct ast_vm_user *vmu) |
static int | vm_browse_messages_it (struct ast_channel *chan, struct vm_state *vms, struct ast_vm_user *vmu) |
Italian syntax for 'You have N messages' greeting. More... | |
static int | vm_browse_messages_ja (struct ast_channel *chan, struct vm_state *vms, struct ast_vm_user *vmu) |
Japanese syntax for 'You have N messages' greeting. More... | |
static int | vm_browse_messages_pt (struct ast_channel *chan, struct vm_state *vms, struct ast_vm_user *vmu) |
Portuguese syntax for 'You have N messages' greeting. More... | |
static int | vm_browse_messages_vi (struct ast_channel *chan, struct vm_state *vms, struct ast_vm_user *vmu) |
Vietnamese syntax for 'You have N messages' greeting. More... | |
static int | vm_browse_messages_zh (struct ast_channel *chan, struct vm_state *vms, struct ast_vm_user *vmu) |
Chinese (Taiwan)syntax for 'You have N messages' greeting. More... | |
static void | vm_change_password (struct ast_vm_user *vmu, const char *newpassword) |
The handler for the change password option. More... | |
static void | vm_change_password_shell (struct ast_vm_user *vmu, char *newpassword) |
static char * | vm_check_password_shell (char *command, char *buf, size_t len) |
static int | vm_delete (char *file) |
Removes the voicemail sound and information file. More... | |
static int | vm_exec (struct ast_channel *chan, const char *data) |
static int | vm_execmain (struct ast_channel *chan, const char *data) |
static int | vm_forwardoptions (struct ast_channel *chan, struct ast_vm_user *vmu, char *curdir, int curmsg, char *vm_fmts, char *context, signed char record_gain, long *duration, struct vm_state *vms, char *flag) |
presents the option to prepend to an existing message when forwarding it. More... | |
static const char * | vm_index_to_foldername (int id) |
static int | vm_instructions (struct ast_channel *chan, struct ast_vm_user *vmu, struct vm_state *vms, int skipadvanced, int in_urgent) |
static int | vm_instructions_en (struct ast_channel *chan, struct ast_vm_user *vmu, struct vm_state *vms, int skipadvanced, int in_urgent) |
static int | vm_instructions_ja (struct ast_channel *chan, struct ast_vm_user *vmu, struct vm_state *vms, int skipadvanced, int in_urgent) |
static int | vm_instructions_zh (struct ast_channel *chan, struct ast_vm_user *vmu, struct vm_state *vms, int skipadvanced, int in_urgent) |
static int | vm_intro (struct ast_channel *chan, struct ast_vm_user *vmu, struct vm_state *vms) |
static int | vm_intro_cs (struct ast_channel *chan, struct vm_state *vms) |
static int | vm_intro_de (struct ast_channel *chan, struct vm_state *vms) |
static int | vm_intro_en (struct ast_channel *chan, struct vm_state *vms) |
static int | vm_intro_es (struct ast_channel *chan, struct vm_state *vms) |
static int | vm_intro_fr (struct ast_channel *chan, struct vm_state *vms) |
static int | vm_intro_gr (struct ast_channel *chan, struct vm_state *vms) |
static int | vm_intro_he (struct ast_channel *chan, struct vm_state *vms) |
static int | vm_intro_is (struct ast_channel *chan, struct vm_state *vms) |
static int | vm_intro_it (struct ast_channel *chan, struct vm_state *vms) |
static int | vm_intro_ja (struct ast_channel *chan, struct vm_state *vms) |
static int | vm_intro_multilang (struct ast_channel *chan, struct vm_state *vms, const char message_gender[]) |
static int | vm_intro_nl (struct ast_channel *chan, struct vm_state *vms) |
static int | vm_intro_no (struct ast_channel *chan, struct vm_state *vms) |
static int | vm_intro_pl (struct ast_channel *chan, struct vm_state *vms) |
static int | vm_intro_pt (struct ast_channel *chan, struct vm_state *vms) |
static int | vm_intro_pt_BR (struct ast_channel *chan, struct vm_state *vms) |
static int | vm_intro_se (struct ast_channel *chan, struct vm_state *vms) |
static int | vm_intro_vi (struct ast_channel *chan, struct vm_state *vms) |
static int | vm_intro_zh (struct ast_channel *chan, struct vm_state *vms) |
static int | vm_lock_path (const char *path) |
Lock file path only return failure if ast_lock_path returns 'timeout', not if the path does not exist or any other reason. More... | |
static struct ast_vm_mailbox_snapshot * | vm_mailbox_snapshot_create (const char *mailbox, const char *context, const char *folder, int descending, enum ast_vm_snapshot_sort_val sort_val, int combine_INBOX_and_OLD) |
static struct ast_vm_mailbox_snapshot * | vm_mailbox_snapshot_destroy (struct ast_vm_mailbox_snapshot *mailbox_snapshot) |
static FILE * | vm_mkftemp (char *template) |
static int | vm_msg_forward (const char *from_mailbox, const char *from_context, const char *from_folder, const char *to_mailbox, const char *to_context, const char *to_folder, size_t num_msgs, const char *msg_ids[], int delete_old) |
static int | vm_msg_move (const char *mailbox, const char *context, size_t num_msgs, const char *oldfolder, const char *old_msg_ids[], const char *newfolder) |
static int | vm_msg_play (struct ast_channel *chan, const char *mailbox, const char *context, const char *folder, const char *msg_num, ast_vm_msg_play_cb cb) |
static int | vm_msg_remove (const char *mailbox, const char *context, size_t num_msgs, const char *folder, const char *msgs[]) |
static struct ast_vm_msg_snapshot * | vm_msg_snapshot_alloc (void) |
static int | vm_msg_snapshot_create (struct ast_vm_user *vmu, struct vm_state *vms, struct ast_vm_mailbox_snapshot *mailbox_snapshot, int snapshot_index, int mailbox_index, int descending, enum ast_vm_snapshot_sort_val sort_val) |
Create and store off all the msgs in an open mailbox. More... | |
static struct ast_vm_msg_snapshot * | vm_msg_snapshot_destroy (struct ast_vm_msg_snapshot *msg_snapshot) |
static int | vm_newuser_setup (struct ast_channel *chan, struct ast_vm_user *vmu, struct vm_state *vms, char *fmtc, signed char record_gain) |
static int | vm_options (struct ast_channel *chan, struct ast_vm_user *vmu, struct vm_state *vms, char *fmtc, signed char record_gain) |
static int | vm_play_folder_name (struct ast_channel *chan, char *mbox) |
static int | vm_play_folder_name_gr (struct ast_channel *chan, char *box) |
static int | vm_play_folder_name_ja (struct ast_channel *chan, char *box) |
static int | vm_play_folder_name_pl (struct ast_channel *chan, char *box) |
static int | vm_play_folder_name_ua (struct ast_channel *chan, char *box) |
static int | vm_playmsgexec (struct ast_channel *chan, const char *data) |
static int | vm_sayname (struct ast_channel *chan, const char *mailbox_id) |
static int | vm_tempgreeting (struct ast_channel *chan, struct ast_vm_user *vmu, struct vm_state *vms, char *fmtc, signed char record_gain) |
The handler for 'record a temporary greeting'. More... | |
static int | vm_test_create_user (const char *context, const char *mailbox) |
static int | vm_test_destroy_user (const char *context, const char *mailbox) |
static int | vmauthenticate (struct ast_channel *chan, const char *data) |
static int | vmsayname_exec (struct ast_channel *chan, const char *data) |
static const struct ast_tm * | vmu_tm (const struct ast_vm_user *vmu, struct ast_tm *tm) |
fill in *tm for current time according to the proper timezone, if any. More... | |
static int | wait_file (struct ast_channel *chan, struct vm_state *vms, char *file) |
static int | wait_file2 (struct ast_channel *chan, struct vm_state *vms, char *file) |
static int | write_password_to_file (const char *secretfn, const char *password) |
Variables | |
static struct ast_module_info | __mod_info = { .name = AST_MODULE, .flags = AST_MODFLAG_DEFAULT , .description = "Comedian Mail (Voicemail System)" , .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, .optional_modules = "res_adsi,res_smdi", } |
static char * | addesc = "Comedian Mail" |
static unsigned char | adsifdn [4] = "\x00\x00\x00\x0F" |
static unsigned char | adsisec [4] = "\x9B\xDB\xF7\xAC" |
static int | adsiver = 1 |
static struct ao2_container * | alias_mailbox_mappings |
static char | aliasescontext [MAX_VM_CONTEXT_LEN] |
static const struct ast_module_info * | ast_module_info = &__mod_info |
static char | callcontext [AST_MAX_CONTEXT] = "" |
static char | charset [32] = "ISO-8859-1" |
static char | cidinternalcontexts [MAX_NUM_CID_CONTEXTS][64] |
static struct ast_cli_entry | cli_voicemail [] |
static char | dialcontext [AST_MAX_CONTEXT] = "" |
static char * | emailbody |
static char | emaildateformat [32] = "%A, %B %d, %Y at %r" |
static char * | emailsubject |
static char | exitcontext [AST_MAX_CONTEXT] = "" |
static char | ext_pass_check_cmd [128] |
static char | ext_pass_cmd [128] |
static char | externnotify [160] |
static char | fromstring [100] |
static struct ast_flags | globalflags = {0} |
struct ao2_container * | inprocess_container |
static char | listen_control_forward_key [12] |
static char | listen_control_pause_key [12] |
static char | listen_control_restart_key [12] |
static char | listen_control_reverse_key [12] |
static char | listen_control_stop_key [12] |
static char | locale [20] |
static struct ao2_container * | mailbox_alias_mappings |
static const char *const | mailbox_folders [] |
static char | mailcmd [160] = SENDMAIL |
static int | maxdeletedmsg |
static int | maxgreet |
static int | maxlogins = 3 |
static int | maxmsg = MAXMSG |
static int | maxsilence |
static int | minpassword = MINPASSWORD |
static int | msg_id_incrementor |
struct ast_mwi_observer | mwi_observer |
static struct ast_taskprocessor * | mwi_subscription_tps |
static int | my_umask |
static char * | pagerbody |
static char | pagerdateformat [32] = "%A, %B %d, %Y at %r" |
static char | pagerfromstring [100] |
static char * | pagersubject |
static int | passwordlocation |
static char * | playmsg_app = "VoiceMailPlayMsg" |
static ast_cond_t | poll_cond = PTHREAD_COND_INITIALIZER |
static unsigned int | poll_freq = DEFAULT_POLL_FREQ |
static ast_mutex_t | poll_lock = { PTHREAD_RECURSIVE_MUTEX_INITIALIZER_NP , NULL, {1, 0} } |
static unsigned int | poll_mailboxes |
static pthread_t | poll_thread = AST_PTHREADT_NULL |
static unsigned char | poll_thread_run |
static int | pwdchange = PWDCHANGE_INTERNAL |
static int | saydurationminfo = 2 |
static char * | sayname_app = "VMSayName" |
static char | serveremail [80] = ASTERISK_USERNAME |
static int | silencethreshold = 128 |
static int | skipms = 3000 |
static struct ast_smdi_interface * | smdi_iface = NULL |
static struct users | users = { .first = NULL, .last = NULL, .lock = { PTHREAD_RECURSIVE_MUTEX_INITIALIZER_NP , NULL, {1, 0} } , } |
static char | userscontext [AST_MAX_EXTENSION] = "default" |
static const struct ast_app_option | vm_app_options [128] = { [ 's' ] = { .flag = OPT_SILENT }, [ 'b' ] = { .flag = OPT_BUSY_GREETING }, [ 'u' ] = { .flag = OPT_UNAVAIL_GREETING }, [ 'g' ] = { .flag = OPT_RECORDGAIN , .arg_index = OPT_ARG_RECORDGAIN + 1 }, [ 'd' ] = { .flag = OPT_DTMFEXIT , .arg_index = OPT_ARG_DTMFEXIT + 1 }, [ 'p' ] = { .flag = OPT_PREPEND_MAILBOX }, [ 'a' ] = { .flag = OPT_AUTOPLAY , .arg_index = OPT_ARG_PLAYFOLDER + 1 }, [ 'U' ] = { .flag = OPT_MESSAGE_Urgent }, [ 'P' ] = { .flag = OPT_MESSAGE_PRIORITY }, [ 'e' ] = { .flag = OPT_EARLYM_GREETING }, [ 't' ] = { .flag = OPT_BEEP , .arg_index = OPT_ARG_BEEP_TONE + 1 } } |
static const struct ast_vm_greeter_functions | vm_greeter_table |
static struct ast_custom_function | vm_info_acf |
static char | vm_invalid_password [80] = "vm-invalid-password" |
static char | vm_login [80] = "vm-login" |
static char | vm_mismatch [80] = "vm-mismatch" |
static char | vm_newpassword [80] = "vm-newpassword" |
static char | vm_newuser [80] = "vm-newuser" |
static char | vm_passchanged [80] = "vm-passchanged" |
static char | vm_password [80] = "vm-password" |
static char | vm_pls_try_again [80] = "vm-pls-try-again" |
static char | vm_prepend_timeout [80] = "vm-then-pound" |
static char | vm_reenterpassword [80] = "vm-reenterpassword" |
static char | VM_SPOOL_DIR [PATH_MAX] |
static const struct ast_vm_functions | vm_table |
static char * | vmauthenticate_app = "VMAuthenticate" |
static char | vmfmts [80] = "wav" |
static int | vmmaxsecs |
static int | vmminsecs |
static char * | voicemail_app = "VoiceMail" |
static char * | voicemailmain_app = "VoiceMailMain" |
static double | volgain |
static struct zones | zones = { .first = NULL, .last = NULL, .lock = { PTHREAD_RECURSIVE_MUTEX_INITIALIZER_NP , NULL, {1, 0} } , } |
static char | zonetag [80] |
Comedian Mail - Voicemail System.
Definition in file app_voicemail.c.
#define ALIASES_OUTPUT_FORMAT "%-32s %-32s\n" |
Referenced by handle_voicemail_show_aliases().
#define ASTERISK_USERNAME "asterisk" |
Definition at line 512 of file app_voicemail.c.
Referenced by actual_load_config().
#define BASELINELEN 72 |
Definition at line 537 of file app_voicemail.c.
Referenced by ochar().
#define BASEMAXINLINE 256 |
Definition at line 538 of file app_voicemail.c.
Referenced by base_encode(), and inbuf().
#define CHECK | ( | u, | |
attr, | |||
value | |||
) |
Referenced by AST_TEST_DEFINE().
#define CHUNKSIZE 65536 |
Definition at line 509 of file app_voicemail.c.
#define COMMAND_TIMEOUT 5000 |
Definition at line 505 of file app_voicemail.c.
#define COPY | ( | a, | |
b, | |||
c, | |||
d, | |||
e, | |||
f, | |||
g, | |||
h | |||
) | (copy_plain_file(g,h)); |
Definition at line 872 of file app_voicemail.c.
Referenced by copy_message(), and save_to_folder().
#define DEFAULT_LISTEN_CONTROL_FORWARD_KEY "#" |
Definition at line 517 of file app_voicemail.c.
Referenced by actual_load_config().
#define DEFAULT_LISTEN_CONTROL_PAUSE_KEY "0" |
Definition at line 519 of file app_voicemail.c.
Referenced by actual_load_config().
#define DEFAULT_LISTEN_CONTROL_RESTART_KEY "2" |
Definition at line 520 of file app_voicemail.c.
Referenced by actual_load_config().
#define DEFAULT_LISTEN_CONTROL_REVERSE_KEY "*" |
Definition at line 518 of file app_voicemail.c.
Referenced by actual_load_config().
#define DEFAULT_LISTEN_CONTROL_STOP_KEY "13456789" |
Definition at line 521 of file app_voicemail.c.
Referenced by actual_load_config().
#define DEFAULT_POLL_FREQ 30 |
By default, poll every 30 seconds
Definition at line 943 of file app_voicemail.c.
Referenced by actual_load_config().
Definition at line 873 of file app_voicemail.c.
Referenced by AST_TEST_DEFINE(), close_mailbox(), notify_new_message(), play_record_review(), and vm_tempgreeting().
Definition at line 868 of file app_voicemail.c.
Referenced by advanced_options(), AST_TEST_DEFINE(), forward_message(), invent_message(), leave_voicemail(), message_range_and_existence_check(), notify_new_message(), play_message(), play_message_by_id_helper(), play_record_review(), sayname(), vm_intro(), vm_msg_forward(), vm_msg_play(), vm_msg_snapshot_create(), vm_options(), and vm_tempgreeting().
#define ENDL "\n" |
Definition at line 542 of file app_voicemail.c.
Referenced by add_email_attachment(), base_encode(), make_email_file(), ochar(), and sendpage().
#define ERROR_LOCK_PATH -100 |
Definition at line 567 of file app_voicemail.c.
Referenced by close_mailbox(), copy_message(), count_messages(), open_mailbox(), play_message_by_id(), resequence_mailbox(), save_to_folder(), vm_exec(), vm_execmain(), vm_mailbox_snapshot_create(), vm_msg_forward(), vm_msg_move(), and vm_msg_remove().
#define ERROR_MAX_MSGS -101 |
Definition at line 568 of file app_voicemail.c.
Referenced by close_mailbox(), and save_to_folder().
Definition at line 870 of file app_voicemail.c.
Referenced by close_mailbox(), copy_message(), resequence_mailbox(), and save_to_folder().
#define HVSU_OUTPUT_FORMAT "%-10s %-5s %-25s %-10s %6s\n" |
Referenced by handle_voicemail_show_users().
#define HVSZ_OUTPUT_FORMAT "%-15s %-20s %-45s\n" |
Referenced by handle_voicemail_show_zones().
#define INTRO "vm-intro" |
Definition at line 528 of file app_voicemail.c.
Referenced by leave_voicemail(), and play_record_review().
#define MAPPING_BUCKETS 511 |
Definition at line 966 of file app_voicemail.c.
Referenced by load_module().
#define MAX_DATETIME_FORMAT 512 |
Definition at line 545 of file app_voicemail.c.
#define MAX_MAIL_BODY_CONTENT_SIZE 134217728L |
Definition at line 530 of file app_voicemail.c.
Referenced by vm_allocate_dh().
#define MAX_NUM_CID_CONTEXTS 10 |
Definition at line 546 of file app_voicemail.c.
Referenced by actual_load_config(), and play_message_callerid().
#define MAX_VM_CONTEXT_LEN (AST_MAX_CONTEXT) |
Definition at line 749 of file app_voicemail.c.
#define MAX_VM_MAILBOX_LEN (MAX_VM_MBOX_ID_LEN + MAX_VM_CONTEXT_LEN) |
Definition at line 751 of file app_voicemail.c.
Referenced by __has_voicemail(), append_mailbox(), and find_user().
#define MAX_VM_MBOX_ID_LEN (AST_MAX_EXTENSION) |
Definition at line 748 of file app_voicemail.c.
#define MAXMSG 100 |
Definition at line 532 of file app_voicemail.c.
Referenced by actual_load_config(), and apply_option().
#define MAXMSGLIMIT 9999 |
Definition at line 533 of file app_voicemail.c.
Referenced by actual_load_config(), apply_option(), and last_message_index().
#define MINPASSWORD 0 |
Default minimum mailbox password length
Definition at line 535 of file app_voicemail.c.
Referenced by actual_load_config().
#define MSG_ID_LEN 256 |
Definition at line 3739 of file app_voicemail.c.
Referenced by generate_msg_id(), leave_voicemail(), msg_create_from_file(), and vm_msg_snapshot_create().
#define OPERATOR_EXIT 300 |
Definition at line 569 of file app_voicemail.c.
Referenced by leave_voicemail(), vm_exec(), and vm_execmain().
#define PWDCHANGE_EXTERNAL (1 << 2) |
Definition at line 886 of file app_voicemail.c.
Referenced by actual_load_config(), vm_newuser_setup(), and vm_options().
#define PWDCHANGE_INTERNAL (1 << 1) |
Definition at line 885 of file app_voicemail.c.
Referenced by actual_load_config(), vm_newuser_setup(), and vm_options().
#define RENAME | ( | a, | |
b, | |||
c, | |||
d, | |||
e, | |||
f, | |||
g, | |||
h | |||
) | (rename_file(g,h)); |
Definition at line 871 of file app_voicemail.c.
Referenced by close_mailbox(), resequence_mailbox(), and save_to_folder().
Definition at line 867 of file app_voicemail.c.
Referenced by advanced_options(), forward_message(), invent_message(), leave_voicemail(), message_range_and_existence_check(), notify_new_message(), play_message(), play_message_by_id_helper(), sayname(), vm_intro(), vm_msg_forward(), vm_msg_play(), vm_msg_snapshot_create(), vm_options(), and vm_tempgreeting().
#define SENDMAIL "/usr/sbin/sendmail -t" |
Definition at line 526 of file app_voicemail.c.
Referenced by actual_load_config().
#define SMDI_MWI_WAIT_TIMEOUT 1000 /* 1 second */ |
Definition at line 503 of file app_voicemail.c.
Referenced by run_externnotify().
Definition at line 869 of file app_voicemail.c.
Referenced by AST_TEST_DEFINE(), copy_message(), forward_message(), leave_voicemail(), msg_create_from_file(), and play_record_review().
#define tdesc "Comedian Mail (Voicemail System)" |
Definition at line 895 of file app_voicemail.c.
Referenced by vm_msg_play().
Definition at line 874 of file app_voicemail.c.
Referenced by add_message_id().
#define VALID_DTMF "1234567890*#" /* Yes ABCD are valid dtmf but what phones have those? */ |
Definition at line 522 of file app_voicemail.c.
Referenced by is_valid_dtmf().
#define VM_ALLOCED (1 << 13) |
Structure was malloc'ed, instead of placed in a return (usually static) buffer
Definition at line 561 of file app_voicemail.c.
Referenced by AST_TEST_DEFINE(), find_user(), find_user_realtime(), free_user(), free_vm_users(), and vm_allocate_dh().
#define VM_ATTACH (1 << 11) |
Attach message to voicemail notifications?
Definition at line 559 of file app_voicemail.c.
Referenced by actual_load_config(), append_vmu_info_astman(), apply_option(), AST_TEST_DEFINE(), forward_message(), notify_new_message(), and sendmail().
#define VM_DELETE (1 << 12) |
Delete message after sending notification
Definition at line 560 of file app_voicemail.c.
Referenced by append_vmu_info_astman(), apply_option(), AST_TEST_DEFINE(), and notify_new_message().
#define VM_DIRECFORWARD (1 << 10) |
Permit caller to use the Directory app for selecting to which mailbox to forward a VM
Definition at line 558 of file app_voicemail.c.
Referenced by actual_load_config(), and forward_message().
#define VM_ENVELOPE (1 << 4) |
Play the envelope information (who-from, time received, etc.)
Definition at line 552 of file app_voicemail.c.
Referenced by actual_load_config(), append_vmu_info_astman(), apply_option(), AST_TEST_DEFINE(), and play_message().
#define VM_FORCEGREET (1 << 8) |
Have new users record their greetings
Definition at line 556 of file app_voicemail.c.
Referenced by actual_load_config(), apply_option(), AST_TEST_DEFINE(), vm_execmain(), and vm_newuser_setup().
#define VM_FORCENAME (1 << 7) |
Have new users record their name
Definition at line 555 of file app_voicemail.c.
Referenced by actual_load_config(), apply_option(), AST_TEST_DEFINE(), vm_execmain(), and vm_newuser_setup().
#define VM_FWDURGAUTO (1 << 18) |
Autoset of Urgent flag on forwarded Urgent messages set globally
Definition at line 566 of file app_voicemail.c.
Referenced by actual_load_config(), and forward_message().
#define VM_MESSAGEWRAP (1 << 17) |
Wrap around from the last message to the first, and vice-versa
Definition at line 565 of file app_voicemail.c.
Referenced by actual_load_config(), apply_option(), AST_TEST_DEFINE(), vm_execmain(), vm_instructions_en(), and vm_instructions_ja().
#define VM_MOVEHEARD (1 << 16) |
Move a "heard" message to Old after listening to it
Definition at line 564 of file app_voicemail.c.
Referenced by actual_load_config(), apply_option(), AST_TEST_DEFINE(), and close_mailbox().
#define VM_OPERATOR (1 << 1) |
Allow 0 to be pressed to go to 'o' extension
Definition at line 549 of file app_voicemail.c.
Referenced by actual_load_config(), append_vmu_info_astman(), apply_option(), AST_TEST_DEFINE(), leave_voicemail(), and play_record_review().
#define VM_PBXSKIP (1 << 9) |
Skip the [PBX] preamble in the Subject line of emails
Definition at line 557 of file app_voicemail.c.
Referenced by actual_load_config(), and make_email_file().
#define VM_REVIEW (1 << 0) |
After recording, permit the caller to review the recording before saving
Definition at line 548 of file app_voicemail.c.
Referenced by actual_load_config(), append_vmu_info_astman(), apply_option(), AST_TEST_DEFINE(), and play_record_review().
#define VM_SAYCID (1 << 2) |
Repeat the CallerID info during envelope playback
Definition at line 550 of file app_voicemail.c.
Referenced by actual_load_config(), append_vmu_info_astman(), apply_option(), AST_TEST_DEFINE(), and play_message().
#define VM_SAYDURATION (1 << 5) |
Play the length of the message during envelope playback
Definition at line 553 of file app_voicemail.c.
Referenced by actual_load_config(), apply_option(), AST_TEST_DEFINE(), and play_message().
#define VM_SEARCH (1 << 14) |
Search all contexts for a matching mailbox
Definition at line 562 of file app_voicemail.c.
Referenced by actual_load_config(), find_or_create(), find_user(), and find_user_realtime().
#define VM_SKIPAFTERCMD (1 << 6) |
After deletion, assume caller wants to go to the next message
Definition at line 554 of file app_voicemail.c.
Referenced by actual_load_config(), apply_option(), AST_TEST_DEFINE(), and vm_execmain().
#define VM_SVMAIL (1 << 3) |
Allow the user to compose a new VM from within VoicemailMain
Definition at line 551 of file app_voicemail.c.
Referenced by actual_load_config(), apply_option(), AST_TEST_DEFINE(), and vm_execmain().
#define VM_TEMPGREETWARN (1 << 15) |
Remind user tempgreeting is set
Definition at line 563 of file app_voicemail.c.
Referenced by actual_load_config(), apply_option(), AST_TEST_DEFINE(), and vm_intro().
#define VMSTATE_MAX_MSG_ARRAY 256 |
Definition at line 803 of file app_voicemail.c.
Referenced by vm_allocate_dh().
#define VOICEMAIL_CONFIG "voicemail.conf" |
Definition at line 511 of file app_voicemail.c.
Referenced by load_config(), and vm_change_password().
#define VOICEMAIL_DIR_MODE 0777 |
Definition at line 507 of file app_voicemail.c.
Referenced by create_dirpath(), leave_voicemail(), and msg_create_from_file().
#define VOICEMAIL_FILE_MODE 0666 |
Definition at line 508 of file app_voicemail.c.
Referenced by copy(), leave_voicemail(), msg_create_from_file(), and vm_mkftemp().
enum vm_box |
Enumerator | |
---|---|
NEW_FOLDER | |
OLD_FOLDER | |
WORK_FOLDER | |
FAMILY_FOLDER | |
FRIENDS_FOLDER | |
GREETINGS_FOLDER |
Definition at line 571 of file app_voicemail.c.
enum vm_option_args |
Enumerator | |
---|---|
OPT_ARG_RECORDGAIN | |
OPT_ARG_PLAYFOLDER | |
OPT_ARG_DTMFEXIT | |
OPT_ARG_BEEP_TONE | |
OPT_ARG_ARRAY_SIZE |
Definition at line 594 of file app_voicemail.c.
enum vm_option_flags |
Enumerator | |
---|---|
OPT_SILENT | |
OPT_BUSY_GREETING | |
OPT_UNAVAIL_GREETING | |
OPT_RECORDGAIN | |
OPT_PREPEND_MAILBOX | |
OPT_AUTOPLAY | |
OPT_DTMFEXIT | |
OPT_MESSAGE_Urgent | |
OPT_MESSAGE_PRIORITY | |
OPT_EARLYM_GREETING | |
OPT_BEEP |
Definition at line 580 of file app_voicemail.c.
enum vm_passwordlocation |
Enumerator | |
---|---|
OPT_PWLOC_VOICEMAILCONF | |
OPT_PWLOC_SPOOLDIR | |
OPT_PWLOC_USERSCONF |
Definition at line 603 of file app_voicemail.c.
|
static |
Definition at line 6061 of file app_voicemail.c.
References ao2_find, ao2_ref, ast_strdupa, ast_strlen_zero, c, alias_mailbox_mapping::mailbox, MAX_VM_MAILBOX_LEN, OBJ_SEARCH_KEY, and separate_mailbox().
Referenced by has_voicemail(), inboxcount2(), inprocess_count(), and messagecount().
|
static |
Definition at line 16611 of file app_voicemail.c.
|
static |
Definition at line 16611 of file app_voicemail.c.
|
static |
Definition at line 12679 of file app_voicemail.c.
References ast_alloca, AST_APP_ARG, ast_channel_language(), ast_copy_string(), AST_DECLARE_APP_ARGS, ast_log, AST_STANDARD_APP_ARGS, ast_strdupa, ast_strlen_zero, context, ast_vm_user::email, find_user(), free_user(), ast_vm_user::fullname, ast_vm_user::language, ast_vm_user::locale, LOG_ERROR, mailbox, messagecount(), NULL, ast_vm_user::pager, parse(), ast_vm_user::password, S_OR, separate_mailbox(), and ast_vm_user::zonetag.
Referenced by AST_TEST_DEFINE().
|
static |
Definition at line 13680 of file app_voicemail.c.
References ao2_callback, apply_options_full(), ast_category_browse(), ast_config_option(), ast_copy_string(), ast_debug, ast_dsp_get_threshold_from_settings(), ast_false(), ast_format_str_reduce(), ast_free, AST_LIST_LOCK, AST_LIST_UNLOCK, ast_log, AST_LOG_ERROR, AST_LOG_WARNING, ast_mwi_state_callback_all(), AST_PTHREADT_NULL, ast_set2_flag, ast_smdi_interface_find(), ast_strdup, ast_strdupa, ast_strlen_zero, ast_taskprocessor_alert_set_levels(), AST_TASKPROCESSOR_HIGH_WATER_LEVEL, ast_true(), ast_variable_browse(), ast_variable_retrieve(), ASTERISK_USERNAME, ast_vm_user::context, DEFAULT_LISTEN_CONTROL_FORWARD_KEY, DEFAULT_LISTEN_CONTROL_PAUSE_KEY, DEFAULT_LISTEN_CONTROL_RESTART_KEY, DEFAULT_LISTEN_CONTROL_REVERSE_KEY, DEFAULT_LISTEN_CONTROL_STOP_KEY, DEFAULT_POLL_FREQ, find_or_create(), free_vm_users(), free_vm_zones(), is_valid_dtmf(), load_aliases(), load_users(), load_zonemessages(), LOG_ERROR, ast_vm_user::mailbox, MAX_NUM_CID_CONTEXTS, MAXMSG, MAXMSGLIMIT, MINPASSWORD, NULL, OBJ_MULTIPLE, OBJ_NODATA, OBJ_UNLINK, OPT_PWLOC_SPOOLDIR, OPT_PWLOC_USERSCONF, OPT_PWLOC_VOICEMAILCONF, ast_vm_user::password, ast_vm_user::passwordlocation, PATH_MAX, populate_defaults(), PWDCHANGE_EXTERNAL, PWDCHANGE_INTERNAL, read_password_from_file(), S_OR, SENDMAIL, start_poll_thread(), stop_poll_thread(), strsep(), substitute_escapes(), THRESHOLD_SILENCE, tmp(), VM_ATTACH, VM_DIRECFORWARD, VM_ENVELOPE, VM_FORCEGREET, VM_FORCENAME, VM_FWDURGAUTO, VM_MESSAGEWRAP, VM_MOVEHEARD, VM_OPERATOR, VM_PBXSKIP, VM_REVIEW, VM_SAYCID, VM_SAYDURATION, VM_SEARCH, VM_SKIPAFTERCMD, VM_SVMAIL, and VM_TEMPGREETWARN.
Referenced by load_config(), and load_config_from_memory().
|
static |
Definition at line 5384 of file app_voicemail.c.
References ast_copy_string(), ast_debug, ast_file_is_readable(), ast_log, AST_LOG_WARNING, ast_safe_system(), base_encode(), ast_vm_user::context, create_dirpath(), ENDL, errno, LOG_ERROR, LOG_WARNING, ast_vm_user::mailbox, mkdtemp(), NULL, PATH_MAX, and ast_vm_user::volgain.
Referenced by make_email_file().
|
static |
Definition at line 12356 of file app_voicemail.c.
References ast_category_get(), ast_config_text_file_save(), ast_log, ast_variable_append(), ast_variable_new, ast_variables_destroy(), generate_msg_id(), LOG_ERROR, LOG_WARNING, NULL, UPDATE_MSG_ID, and var.
Referenced by vm_msg_snapshot_create().
|
static |
Definition at line 7448 of file app_voicemail.c.
References adsi_load_vmail(), ast_adsi_available(), ast_adsi_load_session(), ast_log, and AST_LOG_WARNING.
Referenced by vm_authenticate(), and vm_execmain().
|
static |
Definition at line 7644 of file app_voicemail.c.
References ADSI_KEY_APPS, ADSI_KEY_SKT, ADSI_MSG_DISPLAY, ast_adsi_available(), ast_adsi_set_keys(), ast_adsi_transmit_message(), ast_adsi_voice_mode(), ast_mutex_lock, ast_mutex_unlock, vm_state::curmsg, vm_state::deleted, and vm_state::lastmsg.
Referenced by vm_execmain().
|
static |
Definition at line 7513 of file app_voicemail.c.
References ADSI_COMM_PAGE, ADSI_JUST_CENT, ADSI_KEY_APPS, ADSI_KEY_SKT, ADSI_MSG_DISPLAY, ast_adsi_available(), ast_adsi_display(), ast_adsi_set_keys(), ast_adsi_set_line(), ast_adsi_transmit_message(), and ast_adsi_voice_mode().
Referenced by vm_execmain().
|
static |
Definition at line 7799 of file app_voicemail.c.
References ADSI_COMM_PAGE, ADSI_JUST_CENT, ADSI_JUST_LEFT, adsi_logo(), ADSI_MSG_DISPLAY, ast_adsi_available(), ast_adsi_display(), ast_adsi_set_line(), ast_adsi_transmit_message(), and ast_adsi_voice_mode().
Referenced by vm_execmain().
|
static |
Definition at line 7319 of file app_voicemail.c.
References ADSI_COMM_PAGE, ADSI_JUST_CENT, ADSI_JUST_LEFT, ADSI_KEY_APPS, adsi_logo(), ADSI_MSG_DISPLAY, ADSI_MSG_DOWNLOAD, ast_adsi_begin_download(), ast_adsi_data_mode(), ast_adsi_display(), ast_adsi_download_disconnect(), ast_adsi_end_download(), ast_adsi_load_session(), ast_adsi_load_soft_key(), ast_adsi_set_line(), ast_adsi_transmit_message(), ast_adsi_voice_mode(), ast_debug, mbox(), and NULL.
Referenced by adsi_begin().
|
static |
Definition at line 7465 of file app_voicemail.c.
References ADSI_COMM_PAGE, ADSI_DIR_FROM_LEFT, ADSI_JUST_CENT, ADSI_JUST_LEFT, ADSI_KEY_APPS, adsi_logo(), ADSI_MSG_DISPLAY, ast_adsi_available(), 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(), and ast_adsi_voice_mode().
Referenced by vm_authenticate().
|
static |
Definition at line 7311 of file app_voicemail.c.
References ADSI_COMM_PAGE, ADSI_JUST_CENT, and ast_adsi_display().
Referenced by adsi_goodbye(), adsi_load_vmail(), adsi_login(), vm_newuser_setup(), vm_options(), and vm_tempgreeting().
|
static |
Definition at line 7542 of file app_voicemail.c.
References ADSI_COMM_PAGE, ADSI_JUST_LEFT, ADSI_KEY_APPS, ADSI_KEY_SKT, ADSI_MSG_DISPLAY, ast_adsi_available(), ast_adsi_display(), ast_adsi_set_keys(), ast_adsi_set_line(), ast_adsi_transmit_message(), ast_adsi_voice_mode(), ast_callerid_parse(), ast_copy_string(), ast_mutex_lock, ast_mutex_unlock, ast_strlen_zero, buf1, buf2, vm_state::curbox, vm_state::curmsg, vm_state::deleted, vm_state::fn, vm_state::lastmsg, name, NULL, PATH_MAX, and strsep().
Referenced by play_message(), and vm_execmain().
|
static |
Definition at line 7491 of file app_voicemail.c.
References ADSI_COMM_PAGE, ADSI_DIR_FROM_LEFT, ADSI_JUST_LEFT, ADSI_KEY_APPS, ADSI_MSG_DISPLAY, ast_adsi_available(), ast_adsi_input_control(), ast_adsi_input_format(), ast_adsi_set_keys(), ast_adsi_set_line(), ast_adsi_transmit_message(), and ast_adsi_voice_mode().
Referenced by vm_authenticate().
|
static |
Definition at line 7696 of file app_voicemail.c.
References ADSI_COMM_PAGE, ADSI_JUST_LEFT, ADSI_KEY_APPS, ADSI_KEY_SKT, ADSI_MSG_DISPLAY, ast_adsi_available(), ast_adsi_display(), ast_adsi_set_keys(), ast_adsi_set_line(), ast_adsi_transmit_message(), ast_adsi_voice_mode(), buf1, buf2, vm_state::lastmsg, vm_state::newmessages, and vm_state::oldmessages.
Referenced by vm_execmain().
|
static |
Definition at line 7743 of file app_voicemail.c.
References ADSI_COMM_PAGE, ADSI_JUST_LEFT, ADSI_KEY_APPS, ADSI_KEY_SKT, ADSI_MSG_DISPLAY, ast_adsi_available(), ast_adsi_display(), ast_adsi_set_keys(), ast_adsi_set_line(), ast_adsi_transmit_message(), ast_adsi_voice_mode(), buf1, buf2, vm_state::curbox, and vm_state::lastmsg.
Referenced by vm_execmain().
|
static |
The advanced options within a message.
chan | |
vmu | |
vms | |
msg | |
option | |
record_gain | Provides handling for the play message envelope, call the person back, or reply to message. |
Definition at line 15305 of file app_voicemail.c.
References ast_callerid_parse(), ast_config_destroy(), ast_config_load, ast_log, AST_LOG_WARNING, AST_MAX_EXTENSION, ast_play_and_wait(), ast_strdupa, ast_strlen_zero, ast_test_suite_event_notify, ast_variable_retrieve(), ast_verb, ast_waitfordigit(), leave_vm_options::beeptone, ast_vm_user::callback, CONFIG_FLAG_NOCACHE, context, ast_vm_user::context, vm_state::curdir, vm_state::curmsg, ast_vm_user::dialout, dialout(), DISPOSE, find_user(), vm_state::fn, free_user(), vm_state::heard, leave_voicemail(), ast_vm_user::mailbox, make_file(), name, NULL, PATH_MAX, play_message_callerid(), play_message_datetime(), leave_vm_options::record_gain, RETRIEVE, vm_state::starting, valid_config(), and wait_file().
Referenced by vm_execmain().
|
static |
Definition at line 13588 of file app_voicemail.c.
References alias_mailbox_mapping::alias, ao2_alloc, ast_copy_string(), alias_mailbox_mapping::buf, alias_mailbox_mapping::mailbox, and NULL.
Referenced by load_aliases().
AO2_STRING_FIELD_CMP_FN | ( | alias_mailbox_mapping | , |
alias | |||
) |
AO2_STRING_FIELD_CMP_FN | ( | mailbox_alias_mapping | , |
mailbox | |||
) |
AO2_STRING_FIELD_HASH_FN | ( | alias_mailbox_mapping | , |
alias | |||
) |
AO2_STRING_FIELD_HASH_FN | ( | mailbox_alias_mapping | , |
mailbox | |||
) |
|
static |
Definition at line 12425 of file app_voicemail.c.
References apply_options(), ast_copy_string(), ast_log, ast_strdup, ast_strdupa, ast_strlen_zero, ast_vm_user::context, ast_vm_user::email, find_or_create(), ast_vm_user::fullname, inboxcount2(), LOG_WARNING, ast_vm_user::mailbox, MAX_VM_MAILBOX_LEN, NULL, OPT_PWLOC_SPOOLDIR, ast_vm_user::pager, ast_vm_user::password, ast_vm_user::passwordlocation, PATH_MAX, populate_defaults(), queue_mwi_event(), read_password_from_file(), strsep(), and tmp().
Referenced by load_users().
|
static |
Append vmu info string into given astman with event_name.
Definition at line 13227 of file app_voicemail.c.
References ast_asprintf, ast_free, ast_log, ast_strlen_zero, ast_test_flag, astman_append(), ast_vm_user::attachfmt, ast_vm_user::callback, ast_vm_user::context, ast_vm_user::dialout, ast_vm_user::email, errno, ast_vm_user::exit, ast_vm_user::fromstring, ast_vm_user::fullname, inboxcount(), ast_vm_user::language, LOG_ERROR, mailbox, ast_vm_user::mailbox, ast_vm_user::maxmsg, ast_vm_user::maxsecs, NULL, ast_vm_user::pager, ast_vm_user::saydurationm, ast_vm_user::serveremail, ast_vm_user::uniqueid, VM_ATTACH, VM_DELETE, VM_ENVELOPE, VM_OPERATOR, VM_REVIEW, VM_SAYCID, ast_vm_user::volgain, and ast_vm_user::zonetag.
Referenced by manager_list_voicemail_users(), and manager_status_voicemail_user().
|
static |
Sets a specific property value.
vmu | The voicemail user object to work with. |
var | The name of the property to be set. |
value | The value to be set to the property. |
The property name must be one of the understood properties. See the source for details.
Definition at line 1252 of file app_voicemail.c.
References apply_options(), ast_copy_string(), ast_free, ast_log, AST_LOG_WARNING, ast_set2_flag, ast_strdup, ast_true(), ast_vm_user::attachfmt, ast_vm_user::callback, ast_vm_user::dialout, ast_vm_user::emailbody, ast_vm_user::emailsubject, ast_vm_user::exit, ast_vm_user::fromstring, ast_vm_user::language, ast_vm_user::locale, LOG_WARNING, ast_vm_user::maxdeletedmsg, MAXMSG, ast_vm_user::maxmsg, MAXMSGLIMIT, ast_vm_user::maxsecs, ast_vm_user::minsecs, OPT_PWLOC_SPOOLDIR, OPT_PWLOC_VOICEMAILCONF, ast_vm_user::passwordlocation, ast_vm_user::saydurationm, ast_vm_user::serveremail, substitute_escapes(), VM_ATTACH, VM_DELETE, VM_ENVELOPE, VM_FORCEGREET, VM_FORCENAME, VM_MESSAGEWRAP, VM_MOVEHEARD, VM_OPERATOR, VM_REVIEW, VM_SAYCID, VM_SAYDURATION, VM_SKIPAFTERCMD, VM_SVMAIL, VM_TEMPGREETWARN, vmmaxsecs, vmminsecs, ast_vm_user::volgain, and ast_vm_user::zonetag.
Referenced by apply_options(), and apply_options_full().