Revision
15471
Author
anthm
Date
2009-11-14 14:31:53 -0600 (Sat, 14 Nov 2009)

Log Message

MODAPP-365

Modified Paths

Diff

Modified: freeswitch/trunk/src/mod/applications/mod_voicemail/mod_voicemail.c (15470 => 15471)


--- freeswitch/trunk/src/mod/applications/mod_voicemail/mod_voicemail.c	2009-11-14 20:23:38 UTC (rev 15470)
+++ freeswitch/trunk/src/mod/applications/mod_voicemail/mod_voicemail.c	2009-11-14 20:31:53 UTC (rev 15471)
@@ -1737,7 +1737,7 @@
 	char pass_buf[80] = "", *mypass = NULL, id_buf[80] = "", *myfolder = NULL;
 	const char *thepass = NULL, *myid = id, *thehash = NULL, *vmhash = NULL;
 	char term = 0;
-	uint32_t timeout, attempts = 0;
+	uint32_t timeout, attempts = 0, retries = 0;
 	int failed = 0;
 	msg_type_t play_msg_type = MSG_NONE;
 	char *dir_path = NULL, *file_path = NULL;
@@ -1782,6 +1782,7 @@
 				heard_auto_new = 0;
 				play_msg_type = MSG_NONE;
 				attempts = profile->max_login_attempts;
+				retries = profile->max_retries;
 				myid = id;
 				mypass = NULL;
 				myfolder = "inbox";
@@ -2049,6 +2050,13 @@
 				char input[10] = "";
 				char key_buf[80] = "";
 				play_msg_type = MSG_NONE;
+
+				if (!retries) {
+					goto end;
+				}
+
+				retries--;
+
 				if (!zstr_buf(global_buf)) {
 					switch_set_string(input, global_buf);
 					*global_buf = '\0';
@@ -2076,6 +2084,7 @@
 
 				if (play_msg_type) {
 					vm_check_state = VM_CHECK_PLAY_MESSAGES;
+					retries = profile->max_retries;
 				}
 
 				continue;