[asterisk-commits] mmichelson: branch jrothenberger/asterisk-urgent r104838 - in /team/jrothenbe...

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Wed Feb 27 15:41:25 CST 2008


Author: mmichelson
Date: Wed Feb 27 15:41:25 2008
New Revision: 104838

URL: http://svn.digium.com/view/asterisk?view=rev&rev=104838
Log:
Resolve and reset


Modified:
    team/jrothenberger/asterisk-urgent/   (props changed)
    team/jrothenberger/asterisk-urgent/apps/app_chanspy.c
    team/jrothenberger/asterisk-urgent/apps/app_voicemail.c
    team/jrothenberger/asterisk-urgent/channels/chan_sip.c
    team/jrothenberger/asterisk-urgent/channels/chan_vpb.cc
    team/jrothenberger/asterisk-urgent/configs/vpb.conf.sample
    team/jrothenberger/asterisk-urgent/include/asterisk/module.h
    team/jrothenberger/asterisk-urgent/main/features.c
    team/jrothenberger/asterisk-urgent/main/file.c
    team/jrothenberger/asterisk-urgent/main/loader.c
    team/jrothenberger/asterisk-urgent/main/manager.c
    team/jrothenberger/asterisk-urgent/main/rtp.c
    team/jrothenberger/asterisk-urgent/res/res_smdi.c
    team/jrothenberger/asterisk-urgent/utils/astcanary.c

Propchange: team/jrothenberger/asterisk-urgent/
------------------------------------------------------------------------------
    automerge = *

Propchange: team/jrothenberger/asterisk-urgent/
------------------------------------------------------------------------------
Binary property 'branch-1.4-blocked' - no diff available.

Propchange: team/jrothenberger/asterisk-urgent/
------------------------------------------------------------------------------
Binary property 'branch-1.4-merged' - no diff available.

Propchange: team/jrothenberger/asterisk-urgent/
------------------------------------------------------------------------------
--- svnmerge-integrated (original)
+++ svnmerge-integrated Wed Feb 27 15:41:25 2008
@@ -1,1 +1,1 @@
-/trunk:1-104351
+/trunk:1-104788

Modified: team/jrothenberger/asterisk-urgent/apps/app_chanspy.c
URL: http://svn.digium.com/view/asterisk/team/jrothenberger/asterisk-urgent/apps/app_chanspy.c?view=diff&rev=104838&r1=104837&r2=104838
==============================================================================
--- team/jrothenberger/asterisk-urgent/apps/app_chanspy.c (original)
+++ team/jrothenberger/asterisk-urgent/apps/app_chanspy.c Wed Feb 27 15:41:25 2008
@@ -500,6 +500,10 @@
 	if (!strncmp(this->name, "Zap/pseudo", 10)) {
 		ast_channel_unlock(this);
 		goto redo;
+	} else if (this == chan) {
+		last = this;
+		ast_channel_unlock(this);
+		goto redo;
 	}
 
 	return setup_chanspy_ds(this, chanspy_ds);
@@ -610,9 +614,10 @@
 				break;
 			}
 
-			if (peer == chan) {
+			if (ast_check_hangup(chan)) {
 				ast_channel_unlock(peer);
-				continue;
+				chanspy_ds_free(peer_chanspy_ds);
+				break;
 			}
 
 			if (ast_test_flag(flags, OPTION_BRIDGED) && !ast_bridged_channel(peer)) {
@@ -708,6 +713,7 @@
 			num_spyed_upon++;	
 
 			if (res == -1) {
+				chanspy_ds_free(peer_chanspy_ds);
 				goto exit;
 			} else if (res == -2) {
 				res = 0;
@@ -738,6 +744,8 @@
 				peer = NULL;
 			}
 		}
+		if (res == -1 || ast_check_hangup(chan))
+			break;
 	}
 exit:
 

Modified: team/jrothenberger/asterisk-urgent/apps/app_voicemail.c
URL: http://svn.digium.com/view/asterisk/team/jrothenberger/asterisk-urgent/apps/app_voicemail.c?view=diff&rev=104838&r1=104837&r2=104838
==============================================================================
--- team/jrothenberger/asterisk-urgent/apps/app_voicemail.c (original)
+++ team/jrothenberger/asterisk-urgent/apps/app_voicemail.c Wed Feb 27 15:41:25 2008
@@ -61,7 +61,7 @@
 </category>
  ***/
 
-/*It is important to include the IMAP_STORAGE related headers
+/* It is important to include the IMAP_STORAGE related headers
  * before asterisk.h since asterisk.h includes logger.h. logger.h
  * and c-client.h have conflicting definitions for LOG_WARNING and
  * LOG_DEBUG, so it's important that we use Asterisk's definitions
@@ -345,7 +345,7 @@
 \arg \b vm-ri		A class-word for day (ri4)
 \arg \b vm-you		You (ni3)
 \arg \b vm-haveno   Have no (mei2 you3)
-\arg \b vm-have	    Have (you3)
+\arg \b vm-have     Have (you3)
 \arg \b vm-listen   To listen (yao4 ting1)
 
 
@@ -390,7 +390,7 @@
 	char imapuser[80];               /*!< IMAP server login */
 	char imappassword[80];           /*!< IMAP server password if authpassword not defined */
 #endif
-	double volgain;		         /*!< Volume gain for voicemails sent via email */
+	double volgain;                  /*!< Volume gain for voicemails sent via email */
 	AST_LIST_ENTRY(ast_vm_user) list;
 };
 
@@ -1175,8 +1175,8 @@
 		snprintf(full_fn, sizeof(full_fn), "%s.txt", fn);
 		
 		if (!(f = fopen(full_fn, "w+"))) {
-		        ast_log(LOG_WARNING, "Failed to open/create '%s'\n", full_fn);
-		        goto yuck;
+			ast_log(LOG_WARNING, "Failed to open/create '%s'\n", full_fn);
+			goto yuck;
 		}
 		
 		snprintf(full_fn, sizeof(full_fn), "%s.%s", fn, fmt);
@@ -1192,8 +1192,7 @@
 			SQLFreeHandle (SQL_HANDLE_STMT, stmt);
 			ast_odbc_release_obj(obj);
 			goto yuck;
-		}
-		else if ((res != SQL_SUCCESS) && (res != SQL_SUCCESS_WITH_INFO)) {
+		} else if ((res != SQL_SUCCESS) && (res != SQL_SUCCESS_WITH_INFO)) {
 			ast_log(LOG_WARNING, "SQL Fetch error!\n[%s]\n\n", sql);
 			SQLFreeHandle (SQL_HANDLE_STMT, stmt);
 			ast_odbc_release_obj(obj);
@@ -1632,6 +1631,42 @@
 	}
 	rename(stxt, dtxt);
 }
+#endif
+
+#ifndef IMAP_STORAGE
+/*! \brief
+ * A negative return value indicates an error.
+ * \note Should always be called with a lock already set on dir.
+ */
+static int last_message_index(struct ast_vm_user *vmu, char *dir)
+{
+	int x;
+	unsigned char map[MAXMSGLIMIT] = "";
+	DIR *msgdir;
+	struct dirent *msgdirent;
+	int msgdirint;
+
+	/* Reading the entire directory into a file map scales better than
+	 * doing a stat repeatedly on a predicted sequence.  I suspect this
+	 * is partially due to stat(2) internally doing a readdir(2) itself to
+	 * find each file. */
+	msgdir = opendir(dir);
+	while ((msgdirent = readdir(msgdir))) {
+		if (sscanf(msgdirent->d_name, "msg%d", &msgdirint) == 1 && msgdirint < MAXMSGLIMIT)
+			map[msgdirint] = 1;
+	}
+	closedir(msgdir);
+
+	for (x = 0; x < vmu->maxmsg; x++) {
+		if (map[x] == 0)
+			break;
+	}
+
+	return x - 1;
+}
+
+#endif /* #ifndef IMAP_STORAGE */
+#endif /* #else of #ifdef ODBC_STORAGE */
 
 static int copy(char *infile, char *outfile)
 {
@@ -1724,39 +1759,6 @@
 	copy(frompath2, topath2);
 	ast_variables_destroy(var);
 }
-/*! \brief
- * A negative return value indicates an error.
- * \note Should always be called with a lock already set on dir.
- */
-static int last_message_index(struct ast_vm_user *vmu, char *dir)
-{
-	int x;
-	unsigned char map[MAXMSGLIMIT] = "";
-	DIR *msgdir;
-	struct dirent *msgdirent;
-	int msgdirint;
-
-	/* Reading the entire directory into a file map scales better than
-	 * doing a stat repeatedly on a predicted sequence.  I suspect this
-	 * is partially due to stat(2) internally doing a readdir(2) itself to
-	 * find each file. */
-	msgdir = opendir(dir);
-	while ((msgdirent = readdir(msgdir))) {
-		if (sscanf(msgdirent->d_name, "msg%d", &msgdirint) == 1 && msgdirint < MAXMSGLIMIT)
-			map[msgdirint] = 1;
-	}
-	closedir(msgdir);
-
-	for (x = 0; x < vmu->maxmsg; x++) {
-		if (map[x] == 0)
-			break;
-	}
-
-	return x - 1;
-}
-
-#endif /*#ifndef IMAP_STORAGE*/
-#endif /*#else of #ifdef ODBC_STORAGE*/
 #ifndef ODBC_STORAGE
 static int vm_delete(char *file)
 {
@@ -2341,7 +2343,7 @@
 #ifdef IMAP_STORAGE
 static int folder_int(const char *folder)
 {
-	/*assume a NULL folder means INBOX*/
+	/* assume a NULL folder means INBOX */
 	if (!folder)
 		return 0;
 #ifdef IMAP_STORAGE
@@ -2566,9 +2568,10 @@
 		ast_copy_string (fn, dir, sizeof(fn));
 	
 	if (ast_strlen_zero(vmu->email)) {
-		/*we need the vmu->email to be set when we call make_email_file, but if we keep it set,
-		 * a duplicate e-mail will be created. So at the end of this function, we will revert back to an empty
-		 * string if tempcopy is 1
+		/* We need the vmu->email to be set when we call make_email_file, but
+		 * if we keep it set, a duplicate e-mail will be created. So at the end
+		 * of this function, we will revert back to an empty string if tempcopy
+		 * is 1.
 		 */
 		ast_copy_string(vmu->email, vmu->imapuser, sizeof(vmu->email));
 		tempcopy = 1;
@@ -2579,7 +2582,7 @@
 	ast_debug(3, "Storing file '%s', format '%s'\n", fn, fmt);
 
 	/* Make a temporary file instead of piping directly to sendmail, in case the mail
-	   command hangs */
+	   command hangs. */
 	if (!(p = vm_mkftemp(tmp))) {
 		ast_log(LOG_WARNING, "Unable to store '%s' (can't create temporary file)\n", fn);
 		if (tempcopy)
@@ -2634,7 +2637,7 @@
 {
 	SEARCHPGM *pgm;
 	SEARCHHEADER *hdr;
- 
+
 	struct ast_vm_user *vmu, vmus;
 	struct vm_state *vms_p;
 	int ret = 0;
@@ -2662,7 +2665,7 @@
 		ast_log (LOG_WARNING,"IMAP user not set for mailbox %s\n",vmu->mailbox);
 		free_user(vmu);
 		return -1;
- 	}
+	}
 
 	/* check if someone is accessing this box right now... */
 	vms_p = get_vm_state_by_imapuser(vmu->imapuser,1);
@@ -2671,11 +2674,11 @@
 	}
 	if (vms_p) {
 		ast_debug(3, "Returning before search - user is logged in\n");
-		if (fold == 0) {/*INBOX*/
+		if (fold == 0) { /* INBOX */
 			return vms_p->newmessages;
 		}
-		if (fold == 1) {/*Old messages*/
-		 	return vms_p->oldmessages;
+		if (fold == 1) { /* Old messages */
+			return vms_p->oldmessages;
 		}
 		if(fold == 11) {/*URGENT messages*/
 		 	return vms_p->urgentmessages;
@@ -2751,7 +2754,7 @@
 static int inboxcount(const char *mailbox_context, int *urgentmsgs, int *newmsgs, int *oldmsgs)
 {
 	char tmp[PATH_MAX] = "";
-	char *mailboxnc; 	
+	char *mailboxnc;
 	char *context;
 	char *mb;
 	char *cur;
@@ -2836,7 +2839,7 @@
 static int copy_message(struct ast_channel *chan, struct ast_vm_user *vmu, int imbox, int msgnum, long duration, struct ast_vm_user *recip, char *fmt, char *dir, char *flag)
 {
 	struct vm_state *sendvms = NULL, *destvms = NULL;
-	char messagestring[10]; /*I guess this could be a problem if someone has more than 999999999 messages...*/
+	char messagestring[10]; /* I guess this could be a problem if someone has more than 999,999,999 messages... */
 	if (!(sendvms = get_vm_state_by_imapuser(vmu->imapuser, 0))) {
 		ast_log(LOG_ERROR, "Couldn't get vm_state for originator's mailbox!!\n");
 		return -1;
@@ -3162,10 +3165,9 @@
 		} else if (ast_exists_extension(chan, chan->context, "o", 1, chan->cid.cid_num)) {
 			strncat(ecodes, "0", sizeof(ecodes) - strlen(ecodes) - 1);
 			ouseexten = 1;
-		}
-		else if (!ast_strlen_zero(chan->macrocontext) && ast_exists_extension(chan, chan->macrocontext, "o", 1, chan->cid.cid_num)) {
-		strncat(ecodes, "0", sizeof(ecodes) - strlen(ecodes) - 1);
-		ousemacro = 1;
+		} else if (!ast_strlen_zero(chan->macrocontext) && ast_exists_extension(chan, chan->macrocontext, "o", 1, chan->cid.cid_num)) {
+			strncat(ecodes, "0", sizeof(ecodes) - strlen(ecodes) - 1);
+			ousemacro = 1;
 		}
 	}
 
@@ -3293,8 +3295,10 @@
 			return -1;
 		}
 		if (!(vms = get_vm_state_by_mailbox(ext,0))) {
-		/*It is possible under certain circumstances that inboxcount did not create a vm_state when it was needed. This is a catchall which will
-		 * rarely be used*/
+		/* It is possible under certain circumstances that inboxcount did not
+		 * create a vm_state when it was needed. This is a catchall which will
+		 * rarely be used.
+		 */
 			if (!(vms = ast_calloc(1, sizeof(*vms)))) {
 				ast_log(LOG_ERROR, "Couldn't allocate necessary space\n");
 				return -1;
@@ -4126,9 +4130,9 @@
 	ast_adsi_transmit_message(chan, buf, bytes, ADSI_MSG_DISPLAY);
 }
 
-/*--- get_folder: Folder menu ---*/
-/* Plays "press 1 for INBOX messages" etc
-   Should possibly be internationalized
+/*!\brief get_folder: Folder menu
+ *	Plays "press 1 for INBOX messages" etc.
+ *	Should possibly be internationalized
  */
 static int get_folder(struct ast_channel *chan, int start)
 {
@@ -4171,12 +4175,17 @@
 }
 
 static int vm_forwardoptions(struct ast_channel *chan, struct ast_vm_user *vmu, char *curdir, int curmsg, char *vmfmts,
-			     char *context, signed char record_gain, long *duration, struct vm_state *vms)
+			char *context, signed char record_gain, long *duration, struct vm_state *vms)
 {
 	int cmd = 0;
 	int retries = 0;
 	signed char zero_gain = 0;
 	struct ast_flags config_flags = { CONFIG_FLAG_NOCACHE };
+	char msgfile[PATH_MAX];
+	char textfile[PATH_MAX];
+	int prepend_duration = 0;
+	struct ast_config *msg_cfg;
+	const char *duration_str;
 
 	while ((cmd >= 0) && (cmd != 't') && (cmd != '*')) {
 		if (cmd)
@@ -4184,12 +4193,6 @@
 		switch (cmd) {
 		case '1': 
 			/* prepend a message to the current message, update the metadata and return */
-		{
-			char msgfile[PATH_MAX];
-			char textfile[PATH_MAX];
-			int prepend_duration = 0;
-			struct ast_config *msg_cfg;
-			const char *duration_str;
 
 			make_file(msgfile, sizeof(msgfile), curdir, curmsg);
 			strcpy(textfile, msgfile);
@@ -4231,7 +4234,6 @@
 			ast_config_destroy(msg_cfg);
 
 			break;
-		}
 		case '2': 
 			cmd = 't';
 			break;
@@ -4297,7 +4299,7 @@
 	if (!ast_strlen_zero(vmu->attachfmt)) {
 		if (strstr(fmt, vmu->attachfmt))
 			fmt = vmu->attachfmt;
-		 else
+		else
 			ast_log(LOG_WARNING, "Attachment format '%s' is not one of the recorded formats '%s'.  Falling back to default format for '%s@%s'.\n", vmu->attachfmt, fmt, vmu->mailbox, vmu->context);
 	}
 
@@ -4317,7 +4319,7 @@
 		if (attach_user_voicemail)
 			RETRIEVE(todir, msgnum, vmu->mailbox, vmu->context);
 
-		/*XXX possible imap issue, should category be NULL XXX*/
+		/* XXX possible imap issue, should category be NULL XXX */
 		sendmail(myserveremail, vmu, msgnum, vmu->context, vmu->mailbox, cidnum, cidname, fn, fmt, duration, attach_user_voicemail, chan, category, flag);
 
 		if (attach_user_voicemail)
@@ -4405,8 +4407,7 @@
 						cmd = ast_waitfordigit(chan,3000);
 					if (!cmd)
 						retries++;
-					if (retries > 3)
-					{
+					if (retries > 3) {
 						cmd = 't';
 						done = 1;
 					}
@@ -4447,7 +4448,7 @@
 				
 			} else {
 				ast_log(LOG_WARNING, "Could not find the Directory application, disabling directory_forward\n");
-				ast_clear_flag((&globalflags), VM_DIRECFORWARD);	
+				ast_clear_flag((&globalflags), VM_DIRECFORWARD);
 			}
 		} else {
 			/* Ask for an extension */
@@ -4477,7 +4478,7 @@
 
 			/* 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);
+			RETRIEVE(fn, -1, s, receiver->context);
 			if (ast_fileexists(fn, NULL, NULL) > 0) {
 				res = ast_stream_and_wait(chan, fn, ecodes);
 				if (res) {
@@ -4522,7 +4523,7 @@
 		create_dirpath(vmstmp.curdir, sizeof(vmstmp.curdir), sender->context, vmstmp.username, "tmp");
 		make_file(msgfile, sizeof(msgfile), vmstmp.curdir, curmsg);
 
-		memcpy(&vmstmp, vms, sizeof(vmstmp));
+		RETRIEVE(dir, curmsg, sender->mailbox, context);
 
 		make_file(origmsgfile, sizeof(origmsgfile), dir, curmsg);
 		create_dirpath(vmstmp.curdir, sizeof(vmstmp.curdir), sender->context, vmstmp.username, "tmp");
@@ -4537,48 +4538,47 @@
 				int attach_user_voicemail;
 				char buf[1024] = "";
 
- 				/* Need to get message content */
-	 			ast_debug(3,"Before mail_fetchheaders, curmsg is: %d, imap messages is %lu\n",vms->curmsg, vms->msgArray[vms->curmsg]);
- 				if (!vms->msgArray[vms->curmsg]) {
- 					ast_log (LOG_WARNING,"Trying to access unknown message\n");
- 					return -1;
- 				}
- 
- 				/* This will only work for new messages... */
+				/* Need to get message content */
+				ast_debug(3, "Before mail_fetchheaders, curmsg is: %d, imap messages is %lu\n", vms->curmsg, vms->msgArray[vms->curmsg]);
+				if (!vms->msgArray[vms->curmsg]) {
+					ast_log(LOG_WARNING, "Trying to access unknown message\n");
+					return -1;
+				}
+
+				/* This will only work for new messages... */
 				header_content = mail_fetchheader (vms->mailstream, vms->msgArray[vms->curmsg]);
- 				/* empty string means no valid header */
- 				if (ast_strlen_zero(header_content)) {
- 					ast_log (LOG_ERROR,"Could not fetch header for message number %ld\n",vms->msgArray[vms->curmsg]);
- 					return -1;
- 				}
- 				/* Get header info needed by sendmail */
+
+				/* empty string means no valid header */
+				if (ast_strlen_zero(header_content)) {
+					ast_log(LOG_ERROR, "Could not fetch header for message number %ld\n", vms->msgArray[vms->curmsg]);
+					return -1;
+				}
+				/* Get header info needed by sendmail */
 				if ((temp = get_header_by_tag(header_content, "X-Asterisk-VM-Duration:", buf, sizeof(buf))))
- 					duration = atoi(temp);
- 				else
- 					duration = 0;
+					duration = atoi(temp);
+				else
+					duration = 0;
 				
- 				/* Attach only the first format */
+				/* Attach only the first format */
 				if ((fmt = ast_strdupa(fmt))) {
- 					stringp = fmt;
- 					strsep(&stringp, "|");
- 				} else {
- 					ast_log (LOG_ERROR,"audio format not set. Default to WAV\n");
- 					fmt = "WAV";
- 				}
- 				if (!strcasecmp(fmt, "wav49"))
- 					fmt = "WAV";
-	 			ast_debug(3,"**** format set to %s, vmfmts set to %s\n",fmt,vmfmts);
- 				/* ast_copy_string(fmt, vmfmts, sizeof(fmt));*/
- 				/* if (!ast_strlen_zero(fmt)) { */
+					stringp = fmt;
+					strsep(&stringp, "|");
+				} else {
+					ast_log(LOG_ERROR, "audio format not set. Default to WAV\n");
+					fmt = "WAV";
+				}
+				if (!strcasecmp(fmt, "wav49"))
+					fmt = "WAV";
+				ast_debug(3, "**** format set to %s, vmfmts set to %s\n", fmt, vmfmts);
 				snprintf(todir, sizeof(todir), "%s%s/%s/tmp", VM_SPOOL_DIR, vmtmp->context, vmtmp->mailbox);
 				make_gsm_file(vms->fn, sizeof(vms->fn), vms->imapuser, todir, vms->curmsg);
-	 			ast_debug(3,"Before mail_fetchstructure, message number is %ld, filename is:%s\n",vms->msgArray[vms->curmsg], vms->fn);
-				/*mail_fetchstructure (mailstream, vmArray[0], &body); */
-				mail_fetchstructure (vms->mailstream, vms->msgArray[vms->curmsg], &body);
+
+				ast_debug(3, "Before mail_fetchstructure, message number is %ld, filename is:%s\n", vms->msgArray[vms->curmsg], vms->fn);
+				mail_fetchstructure(vms->mailstream, vms->msgArray[vms->curmsg], &body);
 				save_body(body,vms,"3","gsm");
- 				/* should not assume "fmt" here! */
+				/* should not assume "fmt" here! */
 				save_body(body,vms,"2",fmt);
- 
+
 				/* get destination mailbox */
 				dstvms = get_vm_state_by_mailbox(vmtmp->mailbox,0);
 				if (dstvms) {
@@ -4736,8 +4736,13 @@
 	char prefile[PATH_MAX] = "";
 	
 
-	/* If voicemail cid is not enabled, or we didn't get cid or context from the attribute file, leave now. */
-	/* BB: Still need to change this so that if this function is called by the message envelope (and someone is explicitly requesting to hear the CID), it does not check to see if CID is enabled in the config file */
+	/* If voicemail cid is not enabled, or we didn't get cid or context from
+	 * the attribute file, leave now.
+	 *
+	 * TODO Still need to change this so that if this function is called by the
+	 * message envelope (and someone is explicitly requesting to hear the CID),
+	 * it does not check to see if CID is enabled in the config file.
+	 */
 	if ((cid == NULL)||(context == NULL))
 		return res;
 
@@ -4764,18 +4769,16 @@
 						res = ast_stream_and_wait(chan, prefile, "");
 					} else {
 						ast_verb(3, "Playing envelope info: message from '%s'\n", callerid);
-						/* BB: Say "from extension" as one saying to sound smoother */
+						/* Say "from extension" as one saying to sound smoother */
 						if (!callback)
 							res = wait_file2(chan, vms, "vm-from-extension");
 						res = ast_say_digit_str(chan, callerid, "", chan->language);
 					}
 				}
 			}
-		}
-
-		else if (!res) {
+		} else if (!res) {
 			ast_debug(1, "VM-CID: Numeric caller id: (%s)\n", callerid);
-			/* BB: Since this is all nicely figured out, why not say "from phone number" in this case" */
+			/* Since this is all nicely figured out, why not say "from phone number" in this case? */
 			if (!callback)
 				res = wait_file2(chan, vms, "vm-from-phonenumber");
 			res = ast_say_digit_str(chan, callerid, AST_DIGIT_ANY, chan->language);
@@ -4957,8 +4960,6 @@
 	else
 		category[0] = '\0';
 
-	/*if (!strncasecmp("macro",context,5)) Macro names in contexts are useless for our needs */
-	/*	context = ast_variable_retrieve(msg_cfg, "message","macrocontext"); */
 	if (res == '1')
 		res = 0;
 
@@ -4974,11 +4975,6 @@
 	if ((!res) && (ast_test_flag(vmu, VM_SAYDURATION)) && duration[0] != '\0')
 		res = play_message_duration(chan, vms, duration, vmu->saydurationm);
 
-	/* Allow pressing '1' to skip envelope / callerid */
-	/* if (res == '1')
-		res = 0;
-	*/
-	/*ast_config_destroy(msg_cfg);*/
 	res = 0;
 
 	if (!res) {
@@ -5277,7 +5273,6 @@
 	struct vm_state *vms_p;
 	char *file, *filename;
 	char *attachment;
-	/*char *mb, *cur;*/
 	int ret = 0, i;
 	BODY *body;
 
@@ -5422,8 +5417,7 @@
 
 	if (last_msg < 0) 
 		return last_msg;
-	else if (vms->lastmsg != last_msg)
-	{
+	else if (vms->lastmsg != last_msg) {
 		ast_log(LOG_NOTICE, "Resequencing Mailbox: %s\n", vms->curdir);
 		res = resequence_mailbox(vmu, vms->curdir);
 		if (res)
@@ -5449,7 +5443,7 @@
 	/* Get the deleted messages fixed */ 
 	if (vm_lock_path(vms->curdir))
 		return ERROR_LOCK_PATH;
-	 
+
 	for (x = 0; x < vmu->maxmsg; x++) { 
 		if (!vms->deleted[x] && ((strcasecmp(vms->curbox, "INBOX") && strcasecmp(vms->curbox, "URGENT")) || !vms->heard[x] || (vms->heard[x] && !ast_test_flag(vmu, VM_MOVEHEARD)))) { 
 			/* Save this message.  It's not in INBOX or hasn't been heard */ 
@@ -5997,8 +5991,7 @@
 	if (!vms->oldmessages && !vms->newmessages && !vms->urgentmessages) {
 		res = ast_play_and_wait(chan, "vm-nomessages");
 		return res;
-	}
-	else {
+	} else {
 		res = ast_play_and_wait(chan, "vm-youhave");
 	}
 	if (vms->newmessages) {
@@ -6009,8 +6002,7 @@
 				res = ast_play_and_wait(chan, "vm-message");
 			if (!res)
 				res = ast_play_and_wait(chan, "vm-INBOXs");
-		}
-		else {
+		} else {
 			if (!res)
 				res = ast_play_and_wait(chan, "vm-messages");
 			if (!res)
@@ -6027,10 +6019,9 @@
 				res = ast_play_and_wait(chan, "vm-message");
 			if (!res)
 				res = ast_play_and_wait(chan, "vm-Olds");
-		}
-		else {
+		} else {
 			if (!res)
-		res = ast_play_and_wait(chan, "vm-messages");
+				res = ast_play_and_wait(chan, "vm-messages");
 			if (!res)
 				res = ast_play_and_wait(chan, "vm-Old");
 		}
@@ -6335,37 +6326,36 @@
 	/* Introduce messages they have */
 	res = ast_play_and_wait(chan, "vm-you");
 
-    if (!res && vms->newmessages) {
-        res = ast_play_and_wait(chan, "vm-have");
-        if (!res)
-            res = say_and_wait(chan, vms->newmessages, chan->language);
-        if (!res)
-            res = ast_play_and_wait(chan, "vm-tong");
-        if (!res)
-            res = ast_play_and_wait(chan, "vm-INBOX");
-        if (vms->oldmessages && !res)
-            res = ast_play_and_wait(chan, "vm-and");
-        else if (!res) 
-            res = ast_play_and_wait(chan, "vm-messages");
-
-    }
-    if (!res && vms->oldmessages) {
-        res = ast_play_and_wait(chan, "vm-have");
-        if (!res)
-            res = say_and_wait(chan, vms->oldmessages, chan->language);
-        if (!res)
-            res = ast_play_and_wait(chan, "vm-tong");
-        if (!res)
-            res = ast_play_and_wait(chan, "vm-Old");
-        if (!res)
-            res = ast_play_and_wait(chan, "vm-messages");
-    }
-    if (!res && !vms->oldmessages && !vms->newmessages) {
-        res = ast_play_and_wait(chan, "vm-haveno");
-        if (!res)
-            res = ast_play_and_wait(chan, "vm-messages");
-    }
-    return res;
+	if (!res && vms->newmessages) {
+		res = ast_play_and_wait(chan, "vm-have");
+		if (!res)
+			res = say_and_wait(chan, vms->newmessages, chan->language);
+		if (!res)
+			res = ast_play_and_wait(chan, "vm-tong");
+		if (!res)
+			res = ast_play_and_wait(chan, "vm-INBOX");
+		if (vms->oldmessages && !res)
+			res = ast_play_and_wait(chan, "vm-and");
+		else if (!res) 
+			res = ast_play_and_wait(chan, "vm-messages");
+	}
+	if (!res && vms->oldmessages) {
+		res = ast_play_and_wait(chan, "vm-have");
+		if (!res)
+			res = say_and_wait(chan, vms->oldmessages, chan->language);
+		if (!res)
+			res = ast_play_and_wait(chan, "vm-tong");
+		if (!res)
+			res = ast_play_and_wait(chan, "vm-Old");
+		if (!res)
+			res = ast_play_and_wait(chan, "vm-messages");
+	}
+	if (!res && !vms->oldmessages && !vms->newmessages) {
+		res = ast_play_and_wait(chan, "vm-haveno");
+		if (!res)
+			res = ast_play_and_wait(chan, "vm-messages");
+	}
+	return res;
 }
 
 /* UKRAINIAN syntax */
@@ -6678,8 +6668,7 @@
 	unsigned char buf[256];
 	int bytes=0;
 
-	if (ast_adsi_available(chan))
-	{
+	if (ast_adsi_available(chan)) {
 		bytes += adsi_logo(buf + bytes);
 		bytes += ast_adsi_display(buf + bytes, ADSI_COMM_PAGE, 3, ADSI_JUST_CENT, 0, "Options Menu", "");
 		bytes += ast_adsi_display(buf + bytes, ADSI_COMM_PAGE, 4, ADSI_JUST_CENT, 0, "Not Done", "");
@@ -7395,8 +7384,7 @@
 							res = cmd;
 							goto out;
 						}
-					}
-					else 
+					} else 
 						cmd = ast_play_and_wait(chan, "vm-sorry");
 					cmd = 't';
 					break;
@@ -7418,8 +7406,7 @@
 							silentexit = 1;
 							goto out;
 						}
-					}
-					else 
+					} else 
 						cmd = ast_play_and_wait(chan, "vm-sorry");
 					cmd = 't';
 					break;
@@ -7537,8 +7524,7 @@
 					else if (play_folder == 1)
 						vms.oldmessages--;
 					cmd = ast_play_and_wait(chan, "vm-deleted");
-				}
-				else {
+				} else {
 					if (play_folder == 0)
 						vms.newmessages++;
 					else if (play_folder == 1)
@@ -7999,25 +7985,29 @@
 		return CLI_FAILURE;
 	}
 
-	ast_cli(fd, "\n"
-	            "=============================================================\n"
-	            "=== Configured Voicemail Users ==============================\n"
-	            "=============================================================\n"
-	            "===\n");
+	ast_cli(fd,
+		"\n"
+		"=============================================================\n"
+		"=== Configured Voicemail Users ==============================\n"
+		"=============================================================\n"
+		"===\n");
 
 	while ((cat = ast_category_browse(cfg, cat))) {
 		struct ast_variable *var = NULL;
-		ast_cli(fd, "=== Mailbox ...\n"
-		            "===\n");
+		ast_cli(fd,
+			"=== Mailbox ...\n"
+			"===\n");
 		for (var = ast_variable_browse(cfg, cat); var; var = var->next)
 			ast_cli(fd, "=== ==> %s: %s\n", var->name, var->value);
-		ast_cli(fd, "===\n"
-		            "=== ---------------------------------------------------------\n"
-		            "===\n");
-	}
-
-	ast_cli(fd, "=============================================================\n"
-	            "\n");
+		ast_cli(fd,
+			"===\n"
+			"=== ---------------------------------------------------------\n"
+			"===\n");
+	}
+
+	ast_cli(fd,
+		"=============================================================\n"
+		"\n");
 
 	return CLI_SUCCESS;
 }
@@ -8370,67 +8360,67 @@
 		
 		make_dir(dirname, sizeof(dirname), vmu->context, vmu->mailbox, "INBOX");
 		astman_append(s,
-			      "%s"
-			      "Event: VoicemailUserEntry\r\n"
-			      "VMContext: %s\r\n"
-			      "VoiceMailbox: %s\r\n"
-			      "Fullname: %s\r\n"
-			      "Email: %s\r\n"
-			      "Pager: %s\r\n"
-			      "ServerEmail: %s\r\n"
-			      "MailCommand: %s\r\n"
-			      "Language: %s\r\n"
-			      "TimeZone: %s\r\n"
-			      "Callback: %s\r\n"
-			      "Dialout: %s\r\n"
-			      "UniqueID: %s\r\n"
-			      "ExitContext: %s\r\n"
-			      "SayDurationMinimum: %d\r\n"
-			      "SayEnvelope: %s\r\n"
-			      "SayCID: %s\r\n"
-			      "AttachMessage: %s\r\n"
-			      "AttachmentFormat: %s\r\n"
-			      "DeleteMessage: %s\r\n"
-			      "VolumeGain: %.2f\r\n"
-			      "CanReview: %s\r\n"
-			      "CallOperator: %s\r\n"
-			      "MaxMessageCount: %d\r\n"
-			      "MaxMessageLength: %d\r\n"
-			      "NewMessageCount: %d\r\n"
+			"%s"
+			"Event: VoicemailUserEntry\r\n"
+			"VMContext: %s\r\n"
+			"VoiceMailbox: %s\r\n"
+			"Fullname: %s\r\n"
+			"Email: %s\r\n"
+			"Pager: %s\r\n"
+			"ServerEmail: %s\r\n"
+			"MailCommand: %s\r\n"
+			"Language: %s\r\n"
+			"TimeZone: %s\r\n"
+			"Callback: %s\r\n"
+			"Dialout: %s\r\n"
+			"UniqueID: %s\r\n"
+			"ExitContext: %s\r\n"
+			"SayDurationMinimum: %d\r\n"
+			"SayEnvelope: %s\r\n"
+			"SayCID: %s\r\n"
+			"AttachMessage: %s\r\n"
+			"AttachmentFormat: %s\r\n"
+			"DeleteMessage: %s\r\n"
+			"VolumeGain: %.2f\r\n"
+			"CanReview: %s\r\n"
+			"CallOperator: %s\r\n"
+			"MaxMessageCount: %d\r\n"
+			"MaxMessageLength: %d\r\n"
+			"NewMessageCount: %d\r\n"
 #ifdef IMAP_STORAGE
-				  "OldMessageCount: %d\r\n"
-			      "IMAPUser: %s\r\n"
+			"OldMessageCount: %d\r\n"
+			"IMAPUser: %s\r\n"
 #endif
-			      "\r\n",
-			      actionid,
-			      vmu->context,
-			      vmu->mailbox,
-			      vmu->fullname,
-			      vmu->email,
-			      vmu->pager,
-			      vmu->serveremail,
-			      vmu->mailcmd,
-			      vmu->language,
-			      vmu->zonetag,
-			      vmu->callback,
-			      vmu->dialout,
-			      vmu->uniqueid,
-			      vmu->exit,
-			      vmu->saydurationm,
-			      ast_test_flag(vmu, VM_ENVELOPE) ? "Yes" : "No",
-			      ast_test_flag(vmu, VM_SAYCID) ? "Yes" : "No",
-			      ast_test_flag(vmu, VM_ATTACH) ? "Yes" : "No",
-			      vmu->attachfmt,
-			      ast_test_flag(vmu, VM_DELETE) ? "Yes" : "No",
-			      vmu->volgain,
-			      ast_test_flag(vmu, VM_REVIEW) ? "Yes" : "No",
-			      ast_test_flag(vmu, VM_OPERATOR) ? "Yes" : "No",
-			      vmu->maxmsg,
-			      vmu->maxsecs,
+			"\r\n",
+			actionid,
+			vmu->context,
+			vmu->mailbox,
+			vmu->fullname,
+			vmu->email,
+			vmu->pager,
+			vmu->serveremail,
+			vmu->mailcmd,
+			vmu->language,
+			vmu->zonetag,
+			vmu->callback,
+			vmu->dialout,
+			vmu->uniqueid,
+			vmu->exit,
+			vmu->saydurationm,
+			ast_test_flag(vmu, VM_ENVELOPE) ? "Yes" : "No",
+			ast_test_flag(vmu, VM_SAYCID) ? "Yes" : "No",
+			ast_test_flag(vmu, VM_ATTACH) ? "Yes" : "No",
+			vmu->attachfmt,
+			ast_test_flag(vmu, VM_DELETE) ? "Yes" : "No",
+			vmu->volgain,
+			ast_test_flag(vmu, VM_REVIEW) ? "Yes" : "No",
+			ast_test_flag(vmu, VM_OPERATOR) ? "Yes" : "No",
+			vmu->maxmsg,
+			vmu->maxsecs,
 #ifdef IMAP_STORAGE
-				  new, old, vmu->imapuser
+			new, old, vmu->imapuser
 #else
-				  count_messages(vmu, dirname)
+			count_messages(vmu, dirname)
 #endif
 			);
 	}		
@@ -8449,8 +8439,6 @@
 	char *cat;
 	struct ast_variable *var;
 	const char *val;
-	const char *s;
-	const char *key;
 	char *q, *stringp;
 	int x;
 	int tmpadsi[4];
@@ -8662,7 +8650,7 @@
 		}
 
 		/* SMDI voicemail notification */
-		if ((s = ast_variable_retrieve(cfg, "general", "smdienable")) && ast_true(s)) {
+		if ((val = ast_variable_retrieve(cfg, "general", "smdienable")) && ast_true(val)) {
 			ast_debug(1, "Enabled SMDI voicemail notification\n");
 			if ((val = ast_variable_retrieve(cfg, "general", "smdiport"))) {
 				smdi_iface = ast_smdi_interface_find(val);
@@ -8685,19 +8673,19 @@
 		ast_copy_string(serveremail, val, sizeof(serveremail));
 		
 		vmmaxsecs = 0;
-		if ((s = ast_variable_retrieve(cfg, "general", "maxsecs"))) {
-			if (sscanf(s, "%d", &x) == 1) {
+		if ((val = ast_variable_retrieve(cfg, "general", "maxsecs"))) {
+			if (sscanf(val, "%d", &x) == 1) {
 				vmmaxsecs = x;
 			} else {
 				ast_log(LOG_WARNING, "Invalid max message time length\n");
 			}
-		} else if ((s = ast_variable_retrieve(cfg, "general", "maxmessage"))) {
+		} else if ((val = ast_variable_retrieve(cfg, "general", "maxmessage"))) {
 			static int maxmessage_deprecate = 0;
 			if (maxmessage_deprecate == 0) {
 				maxmessage_deprecate = 1;
 				ast_log(LOG_WARNING, "Setting 'maxmessage' has been deprecated in favor of 'maxsecs'.\n");
 			}
-			if (sscanf(s, "%d", &x) == 1) {
+			if (sscanf(val, "%d", &x) == 1) {
 				vmmaxsecs = x;
 			} else {
 				ast_log(LOG_WARNING, "Invalid max message time length\n");
@@ -8705,21 +8693,21 @@
 		}
 
 		vmminsecs = 0;
-		if ((s = ast_variable_retrieve(cfg, "general", "minsecs"))) {
-			if (sscanf(s, "%d", &x) == 1) {
+		if ((val = ast_variable_retrieve(cfg, "general", "minsecs"))) {
+			if (sscanf(val, "%d", &x) == 1) {
 				vmminsecs = x;
 				if (maxsilence <= vmminsecs)
 					ast_log(LOG_WARNING, "maxsilence should be less than minmessage or you may get empty messages\n");
 			} else {
 				ast_log(LOG_WARNING, "Invalid min message time length\n");
 			}
-		} else if ((s = ast_variable_retrieve(cfg, "general", "minmessage"))) {
+		} else if ((val = ast_variable_retrieve(cfg, "general", "minmessage"))) {
 			static int maxmessage_deprecate = 0;
 			if (maxmessage_deprecate == 0) {
 				maxmessage_deprecate = 1;
 				ast_log(LOG_WARNING, "Setting 'minmessage' has been deprecated in favor of 'minsecs'.\n");
 			}
-			if (sscanf(s, "%d", &x) == 1) {
+			if (sscanf(val, "%d", &x) == 1) {
 				vmminsecs = x;
 				if (maxsilence <= vmminsecs)
 					ast_log(LOG_WARNING, "maxsilence should be less than minmessage or you may get empty messages\n");
@@ -8734,16 +8722,16 @@
 		ast_copy_string(vmfmts, val, sizeof(vmfmts));
 
 		skipms = 3000;
-		if ((s = ast_variable_retrieve(cfg, "general", "maxgreet"))) {
-			if (sscanf(s, "%d", &x) == 1) {
+		if ((val = ast_variable_retrieve(cfg, "general", "maxgreet"))) {
+			if (sscanf(val, "%d", &x) == 1) {
 				maxgreet = x;
 			} else {
 				ast_log(LOG_WARNING, "Invalid max message greeting length\n");
 			}
 		}
 
-		if ((s = ast_variable_retrieve(cfg, "general", "skipms"))) {
-			if (sscanf(s, "%d", &x) == 1) {
+		if ((val = ast_variable_retrieve(cfg, "general", "skipms"))) {
+			if (sscanf(val, "%d", &x) == 1) {
 				skipms = x;
 			} else {
 				ast_log(LOG_WARNING, "Invalid skipms value\n");
@@ -8751,8 +8739,8 @@
 		}
 
 		maxlogins = 3;
-		if ((s = ast_variable_retrieve(cfg, "general", "maxlogins"))) {
-			if (sscanf(s, "%d", &x) == 1) {
+		if ((val = ast_variable_retrieve(cfg, "general", "maxlogins"))) {
+			if (sscanf(val, "%d", &x) == 1) {
 				maxlogins = x;
 			} else {
 				ast_log(LOG_WARNING, "Invalid max failed login attempts\n");
@@ -8769,9 +8757,9 @@
 			val = "no";
 		ast_set2_flag((&globalflags), ast_true(val), VM_FORCEGREET);
 
-		if ((s = ast_variable_retrieve(cfg, "general", "cidinternalcontexts"))){
-			ast_debug(1,"VM_CID Internal context string: %s\n",s);
-			stringp = ast_strdupa(s);
+		if ((val = ast_variable_retrieve(cfg, "general", "cidinternalcontexts"))) {
+			ast_debug(1, "VM_CID Internal context string: %s\n", val);
+			stringp = ast_strdupa(val);
 			for (x = 0 ; x < MAX_NUM_CID_CONTEXTS ; x++){
 				if (!ast_strlen_zero(stringp)) {
 					q = strsep(&stringp, ",");
@@ -8790,7 +8778,7 @@
 		}
 		ast_set2_flag((&globalflags), ast_true(val), VM_REVIEW);	
 
-		/*Temporary greeting reminder */
+		/* Temporary greeting reminder */
 		if (!(val = ast_variable_retrieve(cfg, "general", "tempgreetwarn"))) {
 			ast_debug(1, "VM Temporary Greeting Reminder Option disabled globally\n");
 			val = "no";
@@ -8883,16 +8871,16 @@
 		if ((val = ast_variable_retrieve(cfg, "general", "vm-mismatch")))
 			ast_copy_string(vm_mismatch, val, sizeof(vm_mismatch));
 		/* load configurable audio prompts */
-		if ((key = ast_variable_retrieve(cfg, "general", "listen-control-forward-key")) && is_valid_dtmf(key))
-			ast_copy_string(listen_control_forward_key, key, sizeof(listen_control_forward_key));
-		if ((key = ast_variable_retrieve(cfg, "general", "listen-control-reverse-key")) && is_valid_dtmf(key))
-			ast_copy_string(listen_control_reverse_key, key, sizeof(listen_control_reverse_key));
-		if ((key = ast_variable_retrieve(cfg, "general", "listen-control-pause-key")) && is_valid_dtmf(key))
-			ast_copy_string(listen_control_pause_key, key, sizeof(listen_control_pause_key));
-		if ((key = ast_variable_retrieve(cfg, "general", "listen-control-restart-key")) && is_valid_dtmf(key))
-			ast_copy_string(listen_control_restart_key, key, sizeof(listen_control_restart_key));
-		if ((key = ast_variable_retrieve(cfg, "general", "listen-control-stop-key")) && is_valid_dtmf(key))
-			ast_copy_string(listen_control_stop_key, key, sizeof(listen_control_stop_key));
+		if ((val = ast_variable_retrieve(cfg, "general", "listen-control-forward-key")) && is_valid_dtmf(val))
+			ast_copy_string(listen_control_forward_key, val, sizeof(listen_control_forward_key));
+		if ((val = ast_variable_retrieve(cfg, "general", "listen-control-reverse-key")) && is_valid_dtmf(val))
+			ast_copy_string(listen_control_reverse_key, val, sizeof(listen_control_reverse_key));
+		if ((val = ast_variable_retrieve(cfg, "general", "listen-control-pause-key")) && is_valid_dtmf(val))
+			ast_copy_string(listen_control_pause_key, val, sizeof(listen_control_pause_key));
+		if ((val = ast_variable_retrieve(cfg, "general", "listen-control-restart-key")) && is_valid_dtmf(val))
+			ast_copy_string(listen_control_restart_key, val, sizeof(listen_control_restart_key));
+		if ((val = ast_variable_retrieve(cfg, "general", "listen-control-stop-key")) && is_valid_dtmf(val))
+			ast_copy_string(listen_control_stop_key, val, sizeof(listen_control_stop_key));
 
 		if (!(val = ast_variable_retrieve(cfg, "general", "usedirectory"))) 
 			val = "no";
@@ -8982,39 +8970,39 @@
 			ast_free(pagersubject);
 			pagersubject = NULL;
 		}
-		if ((s = ast_variable_retrieve(cfg, "general", "pbxskip")))
-			ast_set2_flag((&globalflags), ast_true(s), VM_PBXSKIP);
-		if ((s = ast_variable_retrieve(cfg, "general", "fromstring")))
-			ast_copy_string(fromstring,s,sizeof(fromstring));
-		if ((s = ast_variable_retrieve(cfg, "general", "pagerfromstring")))
-			ast_copy_string(pagerfromstring,s,sizeof(pagerfromstring));
-		if ((s = ast_variable_retrieve(cfg, "general", "charset")))
-			ast_copy_string(charset,s,sizeof(charset));
-		if ((s = ast_variable_retrieve(cfg, "general", "adsifdn"))) {
-			sscanf(s, "%2x%2x%2x%2x", &tmpadsi[0], &tmpadsi[1], &tmpadsi[2], &tmpadsi[3]);
+		if ((val = ast_variable_retrieve(cfg, "general", "pbxskip")))
+			ast_set2_flag((&globalflags), ast_true(val), VM_PBXSKIP);
+		if ((val = ast_variable_retrieve(cfg, "general", "fromstring")))
+			ast_copy_string(fromstring, val, sizeof(fromstring));
+		if ((val = ast_variable_retrieve(cfg, "general", "pagerfromstring")))
+			ast_copy_string(pagerfromstring, val, sizeof(pagerfromstring));
+		if ((val = ast_variable_retrieve(cfg, "general", "charset")))
+			ast_copy_string(charset, val, sizeof(charset));
+		if ((val = ast_variable_retrieve(cfg, "general", "adsifdn"))) {
+			sscanf(val, "%2x%2x%2x%2x", &tmpadsi[0], &tmpadsi[1], &tmpadsi[2], &tmpadsi[3]);
 			for (x = 0; x < 4; x++) {
 				memcpy(&adsifdn[x], &tmpadsi[x], 1);
 			}
 		}
-		if ((s = ast_variable_retrieve(cfg, "general", "adsisec"))) {
-			sscanf(s, "%2x%2x%2x%2x", &tmpadsi[0], &tmpadsi[1], &tmpadsi[2], &tmpadsi[3]);
+		if ((val = ast_variable_retrieve(cfg, "general", "adsisec"))) {
+			sscanf(val, "%2x%2x%2x%2x", &tmpadsi[0], &tmpadsi[1], &tmpadsi[2], &tmpadsi[3]);
 			for (x = 0; x < 4; x++) {
 				memcpy(&adsisec[x], &tmpadsi[x], 1);
 			}
 		}
-		if ((s = ast_variable_retrieve(cfg, "general", "adsiver")))
-			if (atoi(s)) {
-				adsiver = atoi(s);
-			}
-		if ((s = ast_variable_retrieve(cfg, "general", "emailtitle"))) {
+		if ((val = ast_variable_retrieve(cfg, "general", "adsiver")))
+			if (atoi(val)) {
+				adsiver = atoi(val);
+			}
+		if ((val = ast_variable_retrieve(cfg, "general", "emailtitle"))) {
 			ast_log(LOG_NOTICE, "Keyword 'emailtitle' is DEPRECATED, please use 'emailsubject' instead.\n");
-			ast_copy_string(emailtitle,s,sizeof(emailtitle));
-		}
-		if ((s = ast_variable_retrieve(cfg, "general", "emailsubject")))
-			emailsubject = ast_strdup(s);
-		if ((s = ast_variable_retrieve(cfg, "general", "emailbody"))) {
+			ast_copy_string(emailtitle, val, sizeof(emailtitle));
+		}
+		if ((val = ast_variable_retrieve(cfg, "general", "emailsubject")))
+			emailsubject = ast_strdup(val);
+		if ((val = ast_variable_retrieve(cfg, "general", "emailbody"))) {

[... 4271 lines stripped ...]



More information about the asterisk-commits mailing list