[asterisk-commits] russell: branch group/upenn r89601 - /team/group/upenn/apps/app_voicemail.c

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Mon Nov 26 12:04:48 CST 2007


Author: russell
Date: Mon Nov 26 12:04:48 2007
New Revision: 89601

URL: http://svn.digium.com/view/asterisk?view=rev&rev=89601
Log:
add patch to support a confirmation before forwarding messages
(from issue #9046)

Modified:
    team/group/upenn/apps/app_voicemail.c

Modified: team/group/upenn/apps/app_voicemail.c
URL: http://svn.digium.com/view/asterisk/team/group/upenn/apps/app_voicemail.c?view=diff&rev=89601&r1=89600&r2=89601
==============================================================================
--- team/group/upenn/apps/app_voicemail.c (original)
+++ team/group/upenn/apps/app_voicemail.c Mon Nov 26 12:04:48 2007
@@ -3940,6 +3940,8 @@
 	struct vm_state *dstvms;
 #endif
 	char username[70]="";
+	char fn[PATH_MAX]; /* for playback of name greeting */
+	char ecodes[16] = "#";
 	int res = 0, cmd = 0;
 	struct ast_vm_user *receiver = NULL, *vmtmp;
 	AST_LIST_HEAD_NOLOCK_STATIC(extensions, ast_vm_user);
@@ -4052,6 +4054,22 @@
 				valid_extensions = 0;
 				break;
 			}
+
+			/* play name if available, else play extension number */
+			snprintf(fn, sizeof(fn), "%s%s/%s/greet", VM_SPOOL_DIR, receiver->context, s);
+ 			RETRIEVE(fn, -1, s, receiver->context);
+			if (ast_fileexists(fn, NULL, NULL) > 0) {
+				res = ast_stream_and_wait(chan, fn, ecodes);
+				if (res) {
+					DISPOSE(fn, -1);
+					return res;
+				}
+			} else {
+				/* Dispose just in case */
+				DISPOSE(fn, -1);
+				res = ast_say_digit_str(chan, s, ecodes, chan->language);
+			}
+
 			s = strsep(&stringp, "*");
 		}
 		/* break from the loop of reading the extensions */




More information about the asterisk-commits mailing list