--- /tmp/tmp2 2006-12-19 16:12:16.000000000 -0500 +++ app_voicemail.c 2006-12-19 16:12:45.000000000 -0500 @@ -508,7 +508,8 @@ static int silencethreshold = 128; static char serveremail[80]; static char mailcmd[160]; /* Configurable mail cmd */ -static char externnotify[160]; +static char externnotify[160]; +static char externappnotify[160]; /* External App */ static struct ast_smdi_interface *smdi_iface = NULL; static char vmfmts[80]; static double volgain; @@ -2811,6 +2812,16 @@ ast_safe_system(arguments); } } + /* Custom App even if we are using smdi */ + if (!ast_strlen_zero(externappnotify)) { + if (inboxcount(ext_context, &newvoicemails, &oldvoicemails)) { + ast_log(LOG_ERROR, "Problem in calculating number of voicemail messages available for extension %s\n", extension); + } else { + snprintf(arguments, sizeof(arguments), "%s %s %s %d&", externappnotify, context, extension, newvoicemails); + ast_log(LOG_DEBUG, "Executing %s\n", arguments); + ast_safe_system(arguments); + } + } } struct leave_vm_options { @@ -7264,6 +7275,13 @@ } else { externnotify[0] = '\0'; } + + if ((notifystr = ast_variable_retrieve(cfg, "general", "externappnotify"))) { + ast_copy_string(externappnotify, notifystr, sizeof(externappnotify)); + ast_log(LOG_DEBUG, "Found externappnotify: %s\n", externappnotify); + } else { + externappnotify[0] = '\0'; + } /* Silence treshold */ silencethreshold = 256;