diff options
author | file <file@f38db490-d61c-443f-a65b-d21fe96a405b> | 2007-02-19 15:57:24 +0000 |
---|---|---|
committer | file <file@f38db490-d61c-443f-a65b-d21fe96a405b> | 2007-02-19 15:57:24 +0000 |
commit | c016e76f9834fd0371d183cee0402e5db47a263b (patch) | |
tree | 45f94704fbc4cd2a040a82f92f950c95286d94d9 /apps | |
parent | 12c3f5928769f7a424dc092b6d6dc0ab82762b04 (diff) |
Allow both an external application and SMDI to do voicemail notification at the same time. (issue #8625 reported by lters)
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@55410 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'apps')
-rw-r--r-- | apps/app_voicemail.c | 45 |
1 files changed, 23 insertions, 22 deletions
diff --git a/apps/app_voicemail.c b/apps/app_voicemail.c index 091cffebe..4c39dfa45 100644 --- a/apps/app_voicemail.c +++ b/apps/app_voicemail.c @@ -2817,7 +2817,7 @@ static void run_externnotify(char *context, char *extension) else ast_copy_string(ext_context, extension, sizeof(ext_context)); - if (!strcasecmp(externnotify, "smdi")) { + if (smdi_iface) { if (ast_app_has_voicemail(ext_context, NULL)) ast_smdi_mwi_set(smdi_iface, extension); else @@ -2835,7 +2835,9 @@ static void run_externnotify(char *context, char *extension) if (option_debug) ast_log(LOG_DEBUG, "Successfully executed SMDI MWI change for %s on %s\n", extension, smdi_iface->name); } - } else if (!ast_strlen_zero(externnotify)) { + } + + if (!ast_strlen_zero(externnotify)) { if (inboxcount(ext_context, &newvoicemails, &oldvoicemails)) { ast_log(LOG_ERROR, "Problem in calculating number of voicemail messages available for extension %s\n", extension); } else { @@ -7294,34 +7296,33 @@ static int load_config(void) } #endif /* External voicemail notify application */ - if ((notifystr = ast_variable_retrieve(cfg, "general", "externnotify"))) { ast_copy_string(externnotify, notifystr, sizeof(externnotify)); if (option_debug) ast_log(LOG_DEBUG, "found externnotify: %s\n", externnotify); - if (!strcasecmp(externnotify, "smdi")) { - if (option_debug) - 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 { - if (option_debug) - ast_log(LOG_DEBUG, "No SMDI interface set, trying default (/dev/ttyS0)\n"); - smdi_iface = ast_smdi_interface_find("/dev/ttyS0"); - } - - if (!smdi_iface) { - ast_log(LOG_ERROR, "No valid SMDI interface specfied, disabling external voicemail notification\n"); - externnotify[0] = '\0'; - } else { - if (option_debug) - ast_log(LOG_DEBUG, "Using SMDI port %s\n", smdi_iface->name); - } - } } else { externnotify[0] = '\0'; } + /* SMDI voicemail notification */ + if ((s = ast_variable_retrieve(cfg, "general", "smdienable")) && ast_true(s)) { + if (option_debug) + ast_log(LOG_DEBUG, "Enabled SMDI voicemail notification\n"); + if ((smdistr = ast_variable_retrieve(cfg, "general", "smdiport"))) { + smdi_iface = ast_smdi_interface_find(smdistr); + } else { + if (option_debug) + ast_log(LOG_DEBUG, "No SMDI interface set, trying default (/dev/ttyS0)\n"); + smdi_iface = ast_smdi_interface_find("/dev/ttyS0"); + } + if (!smdi_iface) { + ast_log(LOG_ERROR, "No valid SMDI interface specfied, disabling SMDI voicemail notification\n"); + } else { + if (option_debug) + ast_log(LOG_DEBUG, "Using SMDI port %s\n", smdi_iface->name); + } + } + /* Silence treshold */ silencethreshold = 256; if ((thresholdstr = ast_variable_retrieve(cfg, "general", "silencethreshold"))) |