[svn-commits] brushtyler: branch brushtyler/voicemail_menu_branch r213245 - in /team/brusht...

SVN commits to the Digium repositories svn-commits at lists.digium.com
Thu Aug 20 08:10:36 CDT 2009


Author: brushtyler
Date: Thu Aug 20 08:10:32 2009
New Revision: 213245

URL: http://svn.asterisk.org/svn-view/asterisk?view=rev&rev=213245
Log:
added TODO document

Added:
    team/brushtyler/voicemail_menu_branch/apps/myvm/README   (contents, props changed)
      - copied, changed from r212428, team/brushtyler/voicemail_menu_branch/apps/myvm/brief.txt
    team/brushtyler/voicemail_menu_branch/apps/myvm/TODO   (with props)
Removed:
    team/brushtyler/voicemail_menu_branch/apps/myvm/brief.txt
    team/brushtyler/voicemail_menu_branch/apps/myvm/voicemail_menu.conf.sample
Modified:
    team/brushtyler/voicemail_menu_branch/apps/myvm/voicemail_menu-actual.conf
    team/brushtyler/voicemail_menu_branch/apps/newvoicemail.c

Copied: team/brushtyler/voicemail_menu_branch/apps/myvm/README (from r212428, team/brushtyler/voicemail_menu_branch/apps/myvm/brief.txt)
URL: http://svn.asterisk.org/svn-view/asterisk/team/brushtyler/voicemail_menu_branch/apps/myvm/README?view=diff&rev=213245&p1=team/brushtyler/voicemail_menu_branch/apps/myvm/brief.txt&r1=212428&p2=team/brushtyler/voicemail_menu_branch/apps/myvm/README&r2=213245
==============================================================================
--- team/brushtyler/voicemail_menu_branch/apps/myvm/brief.txt (original)
+++ team/brushtyler/voicemail_menu_branch/apps/myvm/README Thu Aug 20 08:10:32 2009
@@ -1,4 +1,10 @@
-=== VOICEMAIL_MENU.CONF FILE ===
+=== README ===
+
+Asterisk Voicemail Application with Customizable Menu
+
+ $Id: TODO 2009-08-22 12:14:06Z brushtyler $
+
+-------------------------------------------------------------------------------
 
 A few notes on the proposed architecture for the new voicemail application.
 To use it, call the VoiceMailMenu2 application from dialplan with the same 

Propchange: team/brushtyler/voicemail_menu_branch/apps/myvm/README
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: team/brushtyler/voicemail_menu_branch/apps/myvm/README
------------------------------------------------------------------------------
    svn:keywords = brushtyler 2009-06-10

Propchange: team/brushtyler/voicemail_menu_branch/apps/myvm/README
------------------------------------------------------------------------------
    svn:mergeinfo = 

Propchange: team/brushtyler/voicemail_menu_branch/apps/myvm/README
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Added: team/brushtyler/voicemail_menu_branch/apps/myvm/TODO
URL: http://svn.asterisk.org/svn-view/asterisk/team/brushtyler/voicemail_menu_branch/apps/myvm/TODO?view=auto&rev=213245
==============================================================================
--- team/brushtyler/voicemail_menu_branch/apps/myvm/TODO (added)
+++ team/brushtyler/voicemail_menu_branch/apps/myvm/TODO Thu Aug 20 08:10:32 2009
@@ -1,0 +1,43 @@
+=== TODO ===
+
+Asterisk Voicemail Application with Customizable Menu
+
+Current status as of 2009.08.22
+ $Id: TODO 2009-08-22 12:14:06Z brushtyler $
+
+-------------------------------------------------------------------------------
+
+DONE:
+1.  Play a voice message
+2.  Play a message envelope
+3.  Change the selected message
+4.  Change the opened folder
+5.  Save a message in another folder
+6.  Make an external call (dialout and callback)
+7.  Record a temporary message
+8.  Store the temporary message as greeting message
+9.  Forward a message to another mailbox (forward)
+10. Forward the temporary message to another mailbox (leave a message and reply)
+11. Delete/undelete a message
+12. Delete a greeting or temporary message
+
+-------------------------------------------------------------------------------
+
+TODO:
+1.  Prepend a message to the selected one
+        Prepending could be an option for the record function (i.e. 
+        record_msg(prepend)) that record a message and prepend it to the 
+        selected message or could be a new function (i.e. prepend(rec))
+        that prepend the temporary message to the selected one.
+2.  Create a notify function
+        Try to port it from app_voicemail.c
+3.  Add ADSI support
+
+-------------------------------------------------------------------------------
+
+NOT DONE:
+1.  Play the recipient greeting message when leave a message to his mailbox
+        In this moment the leave a message functionality is done by recording 
+        new message and forward it to the recipient mailbox.
+2.  Use the Directory application to select a recipient
+

Propchange: team/brushtyler/voicemail_menu_branch/apps/myvm/TODO
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: team/brushtyler/voicemail_menu_branch/apps/myvm/TODO
------------------------------------------------------------------------------
    svn:keywords = brushtyler 2009-08-20

Propchange: team/brushtyler/voicemail_menu_branch/apps/myvm/TODO
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Modified: team/brushtyler/voicemail_menu_branch/apps/myvm/voicemail_menu-actual.conf
URL: http://svn.asterisk.org/svn-view/asterisk/team/brushtyler/voicemail_menu_branch/apps/myvm/voicemail_menu-actual.conf?view=diff&rev=213245&r1=213244&r2=213245
==============================================================================
--- team/brushtyler/voicemail_menu_branch/apps/myvm/voicemail_menu-actual.conf (original)
+++ team/brushtyler/voicemail_menu_branch/apps/myvm/voicemail_menu-actual.conf Thu Aug 20 08:10:32 2009
@@ -4,10 +4,12 @@
 ;
 ; This configuration file replicates the exact behaviour of
 ; the original app_voicemail.c with the following exceptions:
-; 
-; 1. if you press any key when there is the play of the message envelope, 
-;       only it are skipped and not the play of the message.
-; 2. ... /* TODO */
+;
+; 1.  before forward a message to another mailbox, you cannot prepend a message 
+;       to the selected one
+; 2.  when leave a message to a mailbox, the recipient greeting message is not 
+;       played
+; 3.  you cannot use the Directory application to select a recipient
 ;
 ; The voicemail is organized as a set of submenus, where the user
 ; can navigate through explicit input or via timeouts.
@@ -25,9 +27,8 @@
 ; then voicemail waits for input and tries to match the pattern,
 ; executing the corresponding action if present.
 ; After a matching action, the 'default' entry is executed, if present.
-; after 'max_retries' consecutive timeouts, we execute
-; execute the 'timeout' action, if not present, we exit from the voicemail.
-; 
+; After 'max_retries' consecutive timeouts, we execute the 'timeout' action or, 
+; if not present, we exit from the voicemail. 
 ;
 ;------------------- global settings -----------------------;
 

Modified: team/brushtyler/voicemail_menu_branch/apps/newvoicemail.c
URL: http://svn.asterisk.org/svn-view/asterisk/team/brushtyler/voicemail_menu_branch/apps/newvoicemail.c?view=diff&rev=213245&r1=213244&r2=213245
==============================================================================
--- team/brushtyler/voicemail_menu_branch/apps/newvoicemail.c (original)
+++ team/brushtyler/voicemail_menu_branch/apps/newvoicemail.c Thu Aug 20 08:10:32 2009
@@ -169,7 +169,7 @@
 static char *pagersubject = NULL;
 static char fromstring[100];
 static char pagerfromstring[100];
-static char emailtitle[100];
+/*static char emailtitle[100];*/
 static char charset[32] = "ISO-8859-1";
 
 static unsigned char adsifdn[4] = "\x00\x00\x00\x0F";
@@ -1158,11 +1158,6 @@
 }
 #endif
 
-static void free_zone(struct vm_zone *z)
-{
-	ast_free(z);
-}
-
 static void free_user(struct ast_vm_user *vmu)
 {
 	if (!ast_test_flag(vmu, VM_ALLOCED))
@@ -1172,12 +1167,6 @@
 }
 
 #if !(defined(IMAP_STORAGE) || defined(ODBC_STORAGE))
-static int messagecount(const char *context, const char *mailbox, const char *folder)
-{
-	return __has_voicemail(context, mailbox, folder, 0);
-}
-
-
 static int __has_voicemail(const char *context, const char *mailbox, const char *folder, int shortcircuit)
 {
 	DIR *dir;
@@ -1227,57 +1216,6 @@
 		if (__has_voicemail(context, mbox, folder, 1))
 			return 1;
 	}
-	return 0;
-}
-
-
-static int inboxcount(const char *mailbox, int *newmsgs, int *oldmsgs)
-{
-	char tmp[256];
-	char *context;
-
-	/* If no mailbox, return immediately */
-	if (ast_strlen_zero(mailbox))
-		return 0;
-
-	if (newmsgs)
-		*newmsgs = 0;
-	if (oldmsgs)
-		*oldmsgs = 0;
-
-	if (strchr(mailbox, ',')) {
-		int tmpnew, tmpold;
-		char *mb, *cur;
-
-		ast_copy_string(tmp, mailbox, sizeof(tmp));
-		mb = tmp;
-		while ((cur = strsep(&mb, ", "))) {
-			if (!ast_strlen_zero(cur)) {
-				if (inboxcount(cur, newmsgs ? &tmpnew : NULL, oldmsgs ? &tmpold : NULL))
-					return -1;
-				else {
-					if (newmsgs)
-						*newmsgs += tmpnew; 
-					if (oldmsgs)
-						*oldmsgs += tmpold;
-				}
-			}
-		}
-		return 0;
-	}
-
-	ast_copy_string(tmp, mailbox, sizeof(tmp));
-	
-	if ((context = strchr(tmp, '@')))
-		*context++ = '\0';
-	else
-		context = "default";
-
-	if (newmsgs)
-		*newmsgs = __has_voicemail(context, tmp, "INBOX", 0);
-	if (oldmsgs)
-		*oldmsgs = __has_voicemail(context, tmp, "Old", 0);
-
 	return 0;
 }
 
@@ -1550,21 +1488,6 @@
 	return ast_control_streamfile(chan, file, listen_control_forward_key, listen_control_reverse_key, listen_control_stop_key, listen_control_pause_key, listen_control_restart_key, skipms, NULL);
 }
 
-static int play_message_category(struct ast_channel *chan, const char *category)
-{
-	int res = 0;
-
-	if (!ast_strlen_zero(category))
-		res = ast_play_and_wait(chan, category);
-
-	if (res) {
-		ast_log(AST_LOG_WARNING, "No sound file for category '%s' was found.\n", category);
-		res = 0;
-	}
-
-	return res;
-}
-
 static int play_message_datetime(struct ast_channel *chan, struct ast_vm_user *vmu, const char *origtime, const char *filename)
 {
 	int res = 0;
@@ -1641,66 +1564,17 @@
 	return 0;
 }
 
-static int play_message_duration(struct ast_channel *chan, struct vm_state *vms, const char *duration, int minduration)
-{
-	int res = 0;
-	int durationm;
-	int durations;
-	/* Verify that we have a duration for the message */
-	if (duration == NULL)
-		return res;
-
-	/* Convert from seconds to minutes */
-	durations=atoi(duration);
-	durationm=(durations / 60);
-
-	ast_debug(1, "VM-Duration: duration is: %d seconds converted to: %d minutes\n", durations, durationm);
-
-	if ((!res) && (durationm >= minduration)) {
-		res = wait_file2(chan, vms, "vm-duration");
-
-		/* POLISH syntax */
-		if (!strcasecmp(chan->language, "pl")) {
-			div_t num = div(durationm, 10);
-
-			if (durationm == 1) {
-				res = ast_play_and_wait(chan, "digits/1z");
-				res = res ? res : ast_play_and_wait(chan, "vm-minute-ta");
-			} else if (num.rem > 1 && num.rem < 5 && num.quot != 1) {
-				if (num.rem == 2) {
-					if (!num.quot) {
-						res = ast_play_and_wait(chan, "digits/2-ie");
-					} else {
-						res = say_and_wait(chan, durationm - 2 , chan->language);
-						res = res ? res : ast_play_and_wait(chan, "digits/2-ie");
-					}
-				} else {
-					res = say_and_wait(chan, durationm, chan->language);
-				}
-				res = res ? res : ast_play_and_wait(chan, "vm-minute-ty");
-			} else {
-				res = say_and_wait(chan, durationm, chan->language);
-				res = res ? res : ast_play_and_wait(chan, "vm-minute-t");
-			}
-		/* DEFAULT syntax */
-		} else {
-			res = ast_say_number(chan, durationm, AST_DIGIT_ANY, chan->language, NULL);
-			res = wait_file2(chan, vms, "vm-minutes");
-		}
-	}
-	return res;
-}
-
 static int vm_authenticate(struct ast_channel *chan, char *mailbox, int mailbox_size,
 			struct ast_vm_user *res_vmu, const char *context, const char *prefix,
 			int skipuser, int max_logins, int silent)
 {
-	int useadsi=0, valid=0, logretries=0;
+/*	int useadsi=0; */
+    int valid=0, logretries=0;
 	char password[AST_MAX_EXTENSION]="", *passptr;
 	struct ast_vm_user vmus, *vmu = NULL;
 
+#if 0
 	/* If ADSI is supported, setup login screen */
-#if 0
 	adsi_begin(chan, &useadsi);
 	if (!skipuser && useadsi)
 		adsi_login(chan);
@@ -2099,7 +1973,6 @@
 {
     char *cid = NULL, *num = NULL, *name = NULL;
     char curmsg[10];
-    int res;
 
 #if debug
 	if (vms->curmsg < 0)
@@ -2113,14 +1986,11 @@
 
     /* convert the current message number in string */
     snprintf(curmsg, sizeof(curmsg), "%d", vms->curmsg+1);
-	res = pbx_builtin_setvar_helper(chan, "VM_MSG_SELECTED", vms->curmsg >= 0 ? curmsg : "0");
-    if (!res) res = pbx_builtin_setvar_helper(chan, "VM_MSG_IS_DELETED", vms->curmsg >= 0 ? (vms->deleted[vms->curmsg] ? "1" : "0") : "");
-	if (!res) res = pbx_builtin_setvar_helper(chan, "VM_MSG_IS_LAST", vms->curmsg >= 0 ? (vms->curmsg < vms->lastmsg ? "0" : "1") : "");
-	if (!res) res = pbx_builtin_setvar_helper(chan, "VM_MSG_IS_FIRST", vms->curmsg >= 0 ? (vms->curmsg == 0 ? "1" : "0") : "");
-   	if (!res) res = pbx_builtin_setvar_helper(chan, "VM_MSG_SENDER", vms->curmsg >= 0 && num ? num : "");
-
-    if (res)
-        return -1;
+	pbx_builtin_setvar_helper(chan, "VM_MSG_SELECTED", vms->curmsg >= 0 ? curmsg : "0");
+    pbx_builtin_setvar_helper(chan, "VM_MSG_IS_DELETED", vms->curmsg >= 0 ? (vms->deleted[vms->curmsg] ? "1" : "0") : "");
+	pbx_builtin_setvar_helper(chan, "VM_MSG_IS_LAST", vms->curmsg >= 0 ? (vms->curmsg < vms->lastmsg ? "0" : "1") : "");
+	pbx_builtin_setvar_helper(chan, "VM_MSG_IS_FIRST", vms->curmsg >= 0 ? (vms->curmsg == 0 ? "1" : "0") : "");
+   	pbx_builtin_setvar_helper(chan, "VM_MSG_SENDER", vms->curmsg >= 0 && num ? num : "");
 
 #if debug
     {
@@ -2161,13 +2031,11 @@
 static int set_channelvar_full(struct ast_channel* chan, struct vm_state* vms,
 			    struct ast_vm_user* vmu)
 {
-    int res;
-
-	res = pbx_builtin_setvar_helper(chan, "VMU_CALLBACK", S_OR(vmu->callback, "0"));
-	if (!res) res = pbx_builtin_setvar_helper(chan, "VMU_DIALOUT", S_OR(vmu->dialout, "0"));
-	if (!res) res = pbx_builtin_setvar_helper(chan, "VMU_LEAVE_MSG", ast_test_flag(vmu, VM_SVMAIL) ? "1" : "0");
-
-	if (res || set_channelvar(chan, vms, vmu))
+	pbx_builtin_setvar_helper(chan, "VMU_CALLBACK", S_OR(vmu->callback, "0"));
+	pbx_builtin_setvar_helper(chan, "VMU_DIALOUT", S_OR(vmu->dialout, "0"));
+	pbx_builtin_setvar_helper(chan, "VMU_LEAVE_MSG", ast_test_flag(vmu, VM_SVMAIL) ? "1" : "0");
+
+	if (set_channelvar(chan, vms, vmu))
         return -1;
 
 #if debug
@@ -3566,7 +3434,7 @@
         }
 
         /* retrieve the end menu from conf file */
-        vm_var->endmenu_cat == NULL;
+        vm_var->endmenu_cat = NULL;
         if ((val = ast_variable_retrieve(menu_cfg, "general", "end")))
             vm_var->endmenu_cat = ast_category_get(menu_cfg, val);
 
@@ -3910,7 +3778,6 @@
 	struct vm_state vms;
 	struct ast_vm_user *vmu = NULL, vmus;
 	char *context = NULL;
-	int silentexit = 0;		/* was set if a dialout or callback was called */
 	struct ast_flags flags = { 0 };
 	signed char record_gain = 0;
 	int play_auto = 0;




More information about the svn-commits mailing list