]> git.ipfire.org Git - thirdparty/asterisk.git/commitdiff
Use exitcontext when available (bug #2363)
authorMark Spencer <markster@digium.com>
Fri, 3 Sep 2004 03:26:29 +0000 (03:26 +0000)
committerMark Spencer <markster@digium.com>
Fri, 3 Sep 2004 03:26:29 +0000 (03:26 +0000)
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@3715 65c4cc65-6c06-0410-ace0-fbb531ad65f3

apps/app_voicemail.c

index dd227f13e02ac7bc18e2d718cf28b6ee34d42d24..27e16b6ec5293c002068eea89bcc46af3db54998 100755 (executable)
@@ -1769,14 +1769,20 @@ static int leave_voicemail(struct ast_channel *chan, char *ext, int silent, int
                        ast_log(LOG_WARNING, "mkdir '%s' failed: %s\n", dir, strerror(errno));
 
                /* Check current or macro-calling context for special extensions */
-               if (ast_exists_extension(chan, chan->context, "o", 1, chan->callerid))
+               if (!ast_strlen_zero(vmu->exit)) {
+                       if (ast_exists_extension(chan, vmu->exit, "o", 1, chan->callerid))
+                               strncat(ecodes, "0", sizeof(ecodes) - strlen(ecodes) - 1);
+               } else if (ast_exists_extension(chan, chan->context, "o", 1, chan->callerid))
                        strncat(ecodes, "0", sizeof(ecodes) - strlen(ecodes) - 1);
                else if (!ast_strlen_zero(chan->macrocontext) && ast_exists_extension(chan, chan->macrocontext, "o", 1, chan->callerid)) {
                        strncat(ecodes, "0", sizeof(ecodes) - strlen(ecodes) - 1);
                        ousemacro = 1;
                }
 
-               if (ast_exists_extension(chan, chan->context, "a", 1, chan->callerid))
+               if (!ast_strlen_zero(vmu->exit)) {
+                       if (ast_exists_extension(chan, vmu->exit, "a", 1, chan->callerid))
+                               strncat(ecodes, "*", sizeof(ecodes) -  strlen(ecodes) - 1);
+               } else if (ast_exists_extension(chan, chan->context, "a", 1, chan->callerid))
                        strncat(ecodes, "*", sizeof(ecodes) -  strlen(ecodes) - 1);
                else if (!ast_strlen_zero(chan->macrocontext) && ast_exists_extension(chan, chan->macrocontext, "a", 1, chan->callerid)) {
                        strncat(ecodes, "*", sizeof(ecodes) -  strlen(ecodes) - 1);