[asterisk-commits] mattf: trunk r43294 - in /trunk: apps/ channels/ funcs/ pbx/ res/

asterisk-commits at lists.digium.com asterisk-commits at lists.digium.com
Tue Sep 19 14:07:50 MST 2006


Author: mattf
Date: Tue Sep 19 16:07:49 2006
New Revision: 43294

URL: http://svn.digium.com/view/asterisk?rev=43294&view=rev
Log:
Various updates from PCadach's chan_h323-live branch

Modified:
    trunk/apps/app_macro.c
    trunk/apps/app_voicemail.c
    trunk/channels/chan_zap.c
    trunk/funcs/func_callerid.c
    trunk/pbx/pbx_ael.c
    trunk/pbx/pbx_gtkconsole.c
    trunk/res/res_musiconhold.c

Modified: trunk/apps/app_macro.c
URL: http://svn.digium.com/view/asterisk/trunk/apps/app_macro.c?rev=43294&r1=43293&r2=43294&view=diff
==============================================================================
--- trunk/apps/app_macro.c (original)
+++ trunk/apps/app_macro.c Tue Sep 19 16:07:49 2006
@@ -238,14 +238,14 @@
 			case AST_PBX_KEEPALIVE:
 				if (option_debug)
 					ast_log(LOG_DEBUG, "Spawn extension (%s,%s,%d) exited KEEPALIVE in macro %s on '%s'\n", chan->context, chan->exten, chan->priority, macro, chan->name);
-				if (option_verbose > 1)
+				else if (option_verbose > 1)
 					ast_verbose( VERBOSE_PREFIX_2 "Spawn extension (%s, %s, %d) exited KEEPALIVE in macro '%s' on '%s'\n", chan->context, chan->exten, chan->priority, macro, chan->name);
 				goto out;
 				break;
 			default:
 				if (option_debug)
 					ast_log(LOG_DEBUG, "Spawn extension (%s,%s,%d) exited non-zero on '%s' in macro '%s'\n", chan->context, chan->exten, chan->priority, chan->name, macro);
-				if (option_verbose > 1)
+				else if (option_verbose > 1)
 					ast_verbose( VERBOSE_PREFIX_2 "Spawn extension (%s, %s, %d) exited non-zero on '%s' in macro '%s'\n", chan->context, chan->exten, chan->priority, chan->name, macro);
 				dead = 1;
 				goto out;

Modified: trunk/apps/app_voicemail.c
URL: http://svn.digium.com/view/asterisk/trunk/apps/app_voicemail.c?rev=43294&r1=43293&r2=43294&view=diff
==============================================================================
--- trunk/apps/app_voicemail.c (original)
+++ trunk/apps/app_voicemail.c Tue Sep 19 16:07:49 2006
@@ -4607,12 +4607,15 @@
 static int close_mailbox(struct vm_state *vms, struct ast_vm_user *vmu)
 {
 	int x = 0;
+#ifndef IMAP_STORAGE
+	int res = 0, nummsg;
+#endif
+
 	if (vms->lastmsg <= -1)
 		goto done;
 
 	vms->curmsg = -1; 
 #ifndef IMAP_STORAGE
-	int res = 0, nummsg;
 	/* Get the deleted messages fixed */ 
 	if (vm_lock_path(vms->curdir))
 		return ERROR_LOCK_PATH;

Modified: trunk/channels/chan_zap.c
URL: http://svn.digium.com/view/asterisk/trunk/channels/chan_zap.c?rev=43294&r1=43293&r2=43294&view=diff
==============================================================================
--- trunk/channels/chan_zap.c (original)
+++ trunk/channels/chan_zap.c Tue Sep 19 16:07:49 2006
@@ -2070,6 +2070,8 @@
 		int prilocaldialplan;
 		int ldp_strip;
 		int exclusive;
+		const char *rr_str;
+		int redirect_reason;
 
 		c = strchr(dest, '/');
 		if (c)
@@ -2176,7 +2178,20 @@
 		}
 		pri_sr_set_caller(sr, l ? (l + ldp_strip) : NULL, n, prilocaldialplan,
 			p->use_callingpres ? ast->cid.cid_pres : (l ? PRES_ALLOWED_USER_NUMBER_PASSED_SCREEN : PRES_NUMBER_NOT_AVAILABLE));
-		pri_sr_set_redirecting(sr, ast->cid.cid_rdnis, p->pri->localdialplan - 1, PRES_ALLOWED_USER_NUMBER_PASSED_SCREEN, PRI_REDIR_UNCONDITIONAL);
+		if ((rr_str = pbx_builtin_getvar_helper(ast, "PRIREDIRECTREASON"))) {
+			if (!strcasecmp(rr_str, "UNKNOWN"))
+				redirect_reason = 0;
+			else if (!strcasecmp(rr_str, "BUSY"))
+				redirect_reason = 1;
+			else if (!strcasecmp(rr_str, "NO_REPLY"))
+				redirect_reason = 2;
+			else if (!strcasecmp(rr_str, "UNCONDITIONAL"))
+				redirect_reason = 15;
+			else
+				redirect_reason = PRI_REDIR_UNCONDITIONAL;
+		} else
+			redirect_reason = PRI_REDIR_UNCONDITIONAL;
+		pri_sr_set_redirecting(sr, ast->cid.cid_rdnis, p->pri->localdialplan - 1, PRES_ALLOWED_USER_NUMBER_PASSED_SCREEN, redirect_reason);
 
 #ifdef SUPPORT_USERUSER
 		/* User-user info */

Modified: trunk/funcs/func_callerid.c
URL: http://svn.digium.com/view/asterisk/trunk/funcs/func_callerid.c?rev=43294&r1=43293&r2=43294&view=diff
==============================================================================
--- trunk/funcs/func_callerid.c (original)
+++ trunk/funcs/func_callerid.c Tue Sep 19 16:07:49 2006
@@ -59,7 +59,7 @@
 
 			ast_copy_string(buf, num, len);
 		} else {
-			ast_log(LOG_ERROR, "Unknown callerid data type.\n");
+			ast_log(LOG_ERROR, "Unknown callerid data type '%s'.\n", data);
 		}
 	} else {
 		if (!strncasecmp("all", data, 3)) {
@@ -88,7 +88,7 @@
 				ast_copy_string(buf, chan->cid.cid_rdnis, len);
 			}
 		} else {
-			ast_log(LOG_ERROR, "Unknown callerid data type.\n");
+			ast_log(LOG_ERROR, "Unknown callerid data type '%s'.\n", data);
 		}
 	}
 
@@ -125,7 +125,7 @@
 			free(chan->cid.cid_rdnis);
 		chan->cid.cid_rdnis = ast_strdup(value);
 	} else {
-		ast_log(LOG_ERROR, "Unknown callerid data type.\n");
+		ast_log(LOG_ERROR, "Unknown callerid data type '%s'.\n", data);
 	}
 
 	return 0;

Modified: trunk/pbx/pbx_ael.c
URL: http://svn.digium.com/view/asterisk/trunk/pbx/pbx_ael.c?rev=43294&r1=43293&r2=43294&view=diff
==============================================================================
--- trunk/pbx/pbx_ael.c (original)
+++ trunk/pbx/pbx_ael.c Tue Sep 19 16:07:49 2006
@@ -1056,6 +1056,7 @@
 	   The method:  well, for each label, find the first label in the context
 	   with the same name. If it's not the current label, then throw an error. */
 	struct pval *curr;
+	struct pval *x;
 	
 	/* printf("==== check_label:   ====\n"); */
 	if( !current_extension )
@@ -1063,7 +1064,7 @@
 	else
 		curr = current_extension;
 	
-	struct pval *x = find_first_label_in_current_context((char *)item->u1.str, curr);
+	x = find_first_label_in_current_context((char *)item->u1.str, curr);
 	/* printf("Hey, check_label found with item = %x, and x is %x, and currcont is %x, label name is %s\n", item,x, current_context, (char *)item->u1.str); */
 	if( x && x != item )
 	{

Modified: trunk/pbx/pbx_gtkconsole.c
URL: http://svn.digium.com/view/asterisk/trunk/pbx/pbx_gtkconsole.c?rev=43294&r1=43293&r2=43294&view=diff
==============================================================================
--- trunk/pbx/pbx_gtkconsole.c (original)
+++ trunk/pbx/pbx_gtkconsole.c Tue Sep 19 16:07:49 2006
@@ -495,7 +495,7 @@
 	} else {
 		if (option_debug)
 			ast_log(LOG_DEBUG, "Unable to start GTK console monitor -- ignoring\n");
-		if (option_verbose > 1)
+		else if (option_verbose > 1)
 			ast_verbose( VERBOSE_PREFIX_2 "GTK is not available -- skipping monitor\n");
 	}
 	return 0;

Modified: trunk/res/res_musiconhold.c
URL: http://svn.digium.com/view/asterisk/trunk/res/res_musiconhold.c?rev=43294&r1=43293&r2=43294&view=diff
==============================================================================
--- trunk/res/res_musiconhold.c (original)
+++ trunk/res/res_musiconhold.c Tue Sep 19 16:07:49 2006
@@ -525,7 +525,7 @@
 				close(class->srcfd);
 				class->srcfd = -1;
 				pthread_testcancel();
-				if (class->pid) {
+				if (class->pid > 1) {
 					kill(class->pid, SIGHUP);
 					usleep(100000);
 					kill(class->pid, SIGTERM);
@@ -776,6 +776,10 @@
 	while ((files_dirent = readdir(files_DIR))) {
 		/* The file name must be at least long enough to have the file type extension */
 		if ((strlen(files_dirent->d_name) < 4))
+			continue;
+
+		/* Skip standard license file - it is not audio */
+		if (!strcmp(files_dirent->d_name, "LICENSE"))
 			continue;
 
 		snprintf(filepath, sizeof(filepath), "%s/%s", class->dir, files_dirent->d_name);
@@ -1095,7 +1099,7 @@
 
 	AST_LIST_LOCK(&mohclasses);
 	while ((moh = AST_LIST_REMOVE_HEAD(&mohclasses, list))) {
-		if (moh->pid) {
+		if (moh->pid > 1) {
 			ast_log(LOG_DEBUG, "killing %d!\n", moh->pid);
 			stime = time(NULL) + 2;
 			pid = moh->pid;



More information about the asterisk-commits mailing list