[asterisk-commits] alecdavis: trunk r262005 - in /trunk: UPGRADE.txt apps/app_voicemail.c

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Fri May 7 18:54:18 CDT 2010


Author: alecdavis
Date: Fri May  7 18:54:15 2010
New Revision: 262005

URL: http://svnview.digium.com/svn/asterisk?view=rev&rev=262005
Log:
VoicemailMain and VMauthenticate, allow escape to the 'a' extension when a single '*' is entered

Where a site uses VoicemailMain(mailbox) the users have to be at their own extension to clear
their voicemail, they have no way of escaping VoicemailMain to allow entry of new boxnumber.

This patch, allows a site to include to 'a' priority in the VoicemailMain context, to allow an escape.

If the 'a' priority doesn't exist in the context that VoicemailMain was called from then it acts as the old behaviour.

  Reported by: alecdavis
  Tested by: alecdavis
  Patch
	 vm_a_extension.diff2.txt uploaded by alecdavis (license 585)

Review: https://reviewboard.asterisk.org/r/489/

Modified:
    trunk/UPGRADE.txt
    trunk/apps/app_voicemail.c

Modified: trunk/UPGRADE.txt
URL: http://svnview.digium.com/svn/asterisk/trunk/UPGRADE.txt?view=diff&rev=262005&r1=262004&r2=262005
==============================================================================
--- trunk/UPGRADE.txt (original)
+++ trunk/UPGRADE.txt Fri May  7 18:54:15 2010
@@ -77,6 +77,10 @@
 
 * The Manager event 'iax2 show peers' output has been updated.  It now has a
   similar output of 'sip show peers'.
+
+* VoiceMailMain and VMAuthenticate, if a '*' is entered in the first position
+  of a Mailbox or Password, will, if it exists, jump to the 'a' extension in
+  the current dialplan context.
 
 From 1.6.1 to 1.6.2:
 

Modified: trunk/apps/app_voicemail.c
URL: http://svnview.digium.com/svn/asterisk/trunk/apps/app_voicemail.c?view=diff&rev=262005&r1=262004&r2=262005
==============================================================================
--- trunk/apps/app_voicemail.c (original)
+++ trunk/apps/app_voicemail.c Fri May  7 18:54:15 2010
@@ -250,6 +250,13 @@
 			may be specified. If a <replaceable>mailbox</replaceable> is not provided, the calling party will
 			be prompted to enter one. If a <replaceable>context</replaceable> is not specified, the
 			<literal>default</literal> context will be used.</para>
+			<para>The VoiceMailMain application will exit if the following DTMF digit is entered as Mailbox
+			or Password, and the extension exists:</para>
+			<enumlist>
+				<enum name="*">
+					<para>Jump to the <literal>a</literal> extension in the current dialplan context.</para>
+				</enum>
+			</enumlist>
 		</description>
 	</application>
 	<application name="MailboxExists" language="en_US">
@@ -303,6 +310,13 @@
 			specified, only that mailbox's password will be considered valid. If the <replaceable>mailbox</replaceable>
 			is not specified, the channel variable <variable>AUTH_MAILBOX</variable> will be set with the authenticated
 			mailbox.</para>
+			<para>The VMAuthenticate application will exit if the following DTMF digit is entered as Mailbox
+			or Password, and the extension exists:</para>
+			<enumlist>
+				<enum name="*">
+					<para>Jump to the <literal>a</literal> extension in the current dialplan context.</para>
+				</enum>
+			</enumlist>
 		</description>
 	</application>
 	<application name="VMSayName" language="en_US">
@@ -9342,7 +9356,14 @@
 				ast_verb(3, "Username not entered\n");	
 				return -1;
 			}
-		}
+		} else if (mailbox[0] == '*') {
+			/* user entered '*' */
+			if (ast_exists_extension(chan, chan->context, "a", 1, chan->cid.cid_num)) {
+				return -1;
+			}
+			mailbox[0] = '\0';
+		}
+
 		if (useadsi)
 			adsi_password(chan);
 
@@ -9366,6 +9387,13 @@
 			if (ast_readstring(chan, password, sizeof(password) - 1, 2000, 10000, "#") < 0) {
 				ast_log(AST_LOG_WARNING, "Unable to read password\n");
 				return -1;
+			} else if (password[0] == '*') {
+				/* user entered '*' */
+				if (ast_exists_extension(chan, chan->context, "a", 1, chan->cid.cid_num)) {
+					mailbox[0] = '*';
+					return -1;
+				}
+				mailbox[0] = '\0';
 			}
 		}
 
@@ -9531,6 +9559,17 @@
 		res = vm_authenticate(chan, vms.username, sizeof(vms.username), &vmus, context, prefixstr, skipuser, maxlogins, 0);
 
 	ast_debug(1, "After vm_authenticate\n");
+
+	if (vms.username[0] == '*') {
+		ast_debug(1, "user pressed * in context '%s'\n", chan->context);
+
+		/* user entered '*' */
+		if (!ast_goto_if_exists(chan, chan->context, "a", 1)) {
+			res = 0;	/* prevent hangup */
+			goto out;
+		}
+	}
+
 	if (!res) {
 		valid = 1;
 		if (!skipuser)
@@ -10536,6 +10575,11 @@
 		pbx_builtin_setvar_helper(chan, "AUTH_CONTEXT", vmus.context);
 		ast_play_and_wait(chan, "auth-thankyou");
 		res = 0;
+	} else if (mailbox[0] == '*') {
+		/* user entered '*' */
+		if (!ast_goto_if_exists(chan, chan->context, "a", 1)) {
+			res = 0;	/* prevent hangup */
+		}
 	}
 
 	return res;




More information about the asterisk-commits mailing list