diff options
author | Kevin P. Fleming <kpfleming@digium.com> | 2006-02-10 23:55:47 +0000 |
---|---|---|
committer | Kevin P. Fleming <kpfleming@digium.com> | 2006-02-10 23:55:47 +0000 |
commit | 7b2988821a771420fb0279926ee6671d79ae3fce (patch) | |
tree | 9d37bc419c37f5395bcc63a1a25ba743b5eb2225 /apps/app_voicemail.c | |
parent | 4f803dfda0ea9b498b887f8ba28fd5b1ba9dbc04 (diff) |
clean up SMDI support commit:
copyright header format and dates
code formatting and guidelines conformance
use of timeval wrapper functions
use of memory allocation wrappers
propery unref created interface objects during config load
document new variable set by chan_zap in doc/channelvariables.txt
remove useless 'extern' on function prototypes and definitions
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@9451 65c4cc65-6c06-0410-ace0-fbb531ad65f3
Diffstat (limited to 'apps/app_voicemail.c')
-rw-r--r-- | apps/app_voicemail.c | 11 |
1 files changed, 4 insertions, 7 deletions
diff --git a/apps/app_voicemail.c b/apps/app_voicemail.c index cb6d9e876..c6311f8e1 100644 --- a/apps/app_voicemail.c +++ b/apps/app_voicemail.c @@ -1,7 +1,7 @@ /* * Asterisk -- An open source telephony toolkit. * - * Copyright (C) 1999 - 2005, Digium, Inc. + * Copyright (C) 1999 - 2006, Digium, Inc. * * Mark Spencer <markster@digium.com> * @@ -2335,14 +2335,12 @@ static void run_externnotify(char *context, char *extension) #ifdef WITH_SMDI if (!strcasecmp(externnotify, "smdi")) { - if (ast_app_has_voicemail(ext_context, NULL)) ast_smdi_mwi_set(smdi_iface, extension); else ast_smdi_mwi_unset(smdi_iface, extension); - mwi_msg = ast_smdi_mwi_message_wait(smdi_iface, SMDI_MWI_WAIT_TIMEOUT); - if (mwi_msg) { + if ((mwi_msg = ast_smdi_mwi_message_wait(smdi_iface, SMDI_MWI_WAIT_TIMEOUT))) { ast_log(LOG_ERROR, "Error executing SMDI MWI change for %s on %s\n", extension, smdi_iface->name); if (!strncmp(mwi_msg->cause, "INV", 3)) ast_log(LOG_ERROR, "Invalid MWI extension: %s\n", mwi_msg->fwd_st); @@ -5987,9 +5985,8 @@ static int load_config(void) ast_copy_string(externnotify, notifystr, sizeof(externnotify)); ast_log(LOG_DEBUG, "found externnotify: %s\n", externnotify); #ifdef WITH_SMDI - if(!strcasecmp(externnotify, "smdi")) { + if (!strcasecmp(externnotify, "smdi")) { ast_log(LOG_DEBUG, "Using SMDI for external voicemail notification\n"); - if ((smdistr = ast_variable_retrieve(cfg, "general", "smdiport"))) { smdi_iface = ast_smdi_interface_find(smdistr); } else { @@ -5997,7 +5994,7 @@ static int load_config(void) smdi_iface = ast_smdi_interface_find("/dev/ttyS0"); } - if(!smdi_iface) { + if (!smdi_iface) { ast_log(LOG_ERROR, "No valid SMDI interface specfied, disabling external voicemail notification\n"); externnotify[0] = '\0'; } else { |