[asterisk-commits] branch bweschke/bug_5374 - r8252 in /team/bweschke/bug_5374: ./ apps/ channel...

asterisk-commits at lists.digium.com asterisk-commits at lists.digium.com
Wed Jan 18 22:21:13 MST 2006


Author: bweschke
Date: Wed Jan 18 23:20:58 2006
New Revision: 8252

URL: http://svn.digium.com/view/asterisk?rev=8252&view=rev
Log:
 Latest SVNMerge updates on this branch


Added:
    team/bweschke/bug_5374/configs/udptl.conf.sample
      - copied unchanged from r8243, trunk/configs/udptl.conf.sample
    team/bweschke/bug_5374/res/res_clioriginate.c
      - copied unchanged from r8243, trunk/res/res_clioriginate.c
Modified:
    team/bweschke/bug_5374/   (props changed)
    team/bweschke/bug_5374/Makefile
    team/bweschke/bug_5374/app.c
    team/bweschke/bug_5374/apps/Makefile
    team/bweschke/bug_5374/apps/app_dial.c
    team/bweschke/bug_5374/apps/app_disa.c
    team/bweschke/bug_5374/apps/app_festival.c
    team/bweschke/bug_5374/apps/app_macro.c
    team/bweschke/bug_5374/apps/app_meetme.c
    team/bweschke/bug_5374/apps/app_milliwatt.c
    team/bweschke/bug_5374/apps/app_queue.c
    team/bweschke/bug_5374/apps/app_voicemail.c
    team/bweschke/bug_5374/asterisk.8
    team/bweschke/bug_5374/asterisk.c
    team/bweschke/bug_5374/channel.c
    team/bweschke/bug_5374/channels/Makefile
    team/bweschke/bug_5374/channels/chan_agent.c
    team/bweschke/bug_5374/channels/chan_iax2.c
    team/bweschke/bug_5374/channels/chan_local.c
    team/bweschke/bug_5374/channels/chan_misdn.c
    team/bweschke/bug_5374/channels/chan_oss.c
    team/bweschke/bug_5374/channels/chan_sip.c
    team/bweschke/bug_5374/channels/chan_vpb.c
    team/bweschke/bug_5374/channels/chan_zap.c
    team/bweschke/bug_5374/channels/iax2-provision.c
    team/bweschke/bug_5374/channels/iax2-provision.h
    team/bweschke/bug_5374/cli.c
    team/bweschke/bug_5374/codecs/Makefile
    team/bweschke/bug_5374/configs/agents.conf.sample
    team/bweschke/bug_5374/configs/features.conf.sample
    team/bweschke/bug_5374/doc/CODING-GUIDELINES
    team/bweschke/bug_5374/doc/README.variables
    team/bweschke/bug_5374/doc/manager.txt
    team/bweschke/bug_5374/doc/queuelog.txt
    team/bweschke/bug_5374/dsp.c
    team/bweschke/bug_5374/formats/Makefile
    team/bweschke/bug_5374/funcs/Makefile
    team/bweschke/bug_5374/funcs/func_strings.c
    team/bweschke/bug_5374/include/asterisk/app.h
    team/bweschke/bug_5374/include/asterisk/cli.h
    team/bweschke/bug_5374/include/asterisk/doxyref.h
    team/bweschke/bug_5374/include/asterisk/frame.h
    team/bweschke/bug_5374/include/asterisk/module.h
    team/bweschke/bug_5374/include/asterisk/monitor.h
    team/bweschke/bug_5374/include/asterisk/utils.h
    team/bweschke/bug_5374/loader.c
    team/bweschke/bug_5374/logger.c
    team/bweschke/bug_5374/manager.c
    team/bweschke/bug_5374/pbx.c
    team/bweschke/bug_5374/pbx/Makefile
    team/bweschke/bug_5374/pbx/pbx_config.c
    team/bweschke/bug_5374/pbx/pbx_dundi.c
    team/bweschke/bug_5374/res/Makefile
    team/bweschke/bug_5374/res/res_features.c
    team/bweschke/bug_5374/res/res_monitor.c
    team/bweschke/bug_5374/rtp.c
    team/bweschke/bug_5374/utils/Makefile

Propchange: team/bweschke/bug_5374/
------------------------------------------------------------------------------
--- svnmerge-blocked (added)
+++ svnmerge-blocked Wed Jan 18 23:20:58 2006
@@ -1,0 +1,1 @@
+/branches/1.2:7490,7497,7517,7529,7546,7550,7552,7557,7580,7586,7595,7605,7641,7663,7706,7738,7771,7792,7812,7870-7871,7898-7900,7915,7960,7965,7970,7976,8047,8112

Propchange: team/bweschke/bug_5374/
------------------------------------------------------------------------------
--- svnmerge-integrated (original)
+++ svnmerge-integrated Wed Jan 18 23:20:58 2006
@@ -1,1 +1,1 @@
-/trunk:1-8060
+/trunk:1-8251

Modified: team/bweschke/bug_5374/Makefile
URL: http://svn.digium.com/view/asterisk/team/bweschke/bug_5374/Makefile?rev=8252&r1=8251&r2=8252&view=diff
==============================================================================
--- team/bweschke/bug_5374/Makefile (original)
+++ team/bweschke/bug_5374/Makefile Wed Jan 18 23:20:58 2006
@@ -106,7 +106,7 @@
 # Detect the busy signal looking only at tone lengths
 # For example if you have 3 beeps 100ms tone, 100ms silence separated by 500 ms of silence
 BUSYDETECT+= #-DBUSYDETECT_TONEONLY
-# Inforce the detection of busy singal (get rid of false hangups)
+# Enforce the detection of busy singal (get rid of false hangups)
 # Don't use together with -DBUSYDETECT_TONEONLY
 BUSYDETECT+= #-DBUSYDETECT_COMPARE_TONE_AND_SILENCE
 

Modified: team/bweschke/bug_5374/app.c
URL: http://svn.digium.com/view/asterisk/team/bweschke/bug_5374/app.c?rev=8252&r1=8251&r2=8252&view=diff
==============================================================================
--- team/bweschke/bug_5374/app.c (original)
+++ team/bweschke/bug_5374/app.c Wed Jan 18 23:20:58 2006
@@ -55,7 +55,7 @@
 
 /* !
 This function presents a dialtone and reads an extension into 'collect' 
-which must be a pointer to a **pre-initilized** array of char having a 
+which must be a pointer to a **pre-initialized** array of char having a 
 size of 'size' suitable for writing to.  It will collect no more than the smaller 
 of 'maxlen' or 'size' minus the original strlen() of collect digits.
 \return 0 if extension does not exist, 1 if extension exists
@@ -1109,7 +1109,7 @@
 {
 	int argc;
 	char *scan;
-	int paren = 0;
+	int paren = 0, quote = 0;
 
 	if (!buf || !array || !arraylen)
 		return 0;
@@ -1126,7 +1126,15 @@
 			else if (*scan == ')') {
 				if (paren)
 					paren--;
-			} else if ((*scan == delim) && !paren) {
+			} else if (*scan == '"') {
+				quote = quote ? 0 : 1;
+				/* Remove quote character from argument */
+				memmove(scan, scan + 1, strlen(scan));
+				scan--;
+			} else if (*scan == '\\') {
+				/* Literal character, don't parse */
+				memmove(scan, scan + 1, strlen(scan));
+			} else if ((*scan == delim) && !paren && !quote) {
 				*scan++ = '\0';
 				break;
 			}

Modified: team/bweschke/bug_5374/apps/Makefile
URL: http://svn.digium.com/view/asterisk/team/bweschke/bug_5374/apps/Makefile?rev=8252&r1=8251&r2=8252&view=diff
==============================================================================
--- team/bweschke/bug_5374/apps/Makefile (original)
+++ team/bweschke/bug_5374/apps/Makefile Wed Jan 18 23:20:58 2006
@@ -48,10 +48,6 @@
 
 ifneq ($(wildcard $(CROSS_COMPILE_TARGET)/usr/local/include/osp/osp.h $(CROSS_COMPILE_TARGET)/usr/include/osp/osp.h),)
 APPS+=app_osplookup.so
-endif
-
-ifeq ($(findstring BSD,${OSARCH}),BSD)
-CFLAGS+=-I$(CROSS_COMPILE_TARGET)/usr/local/include -L$(CROSS_COMPILE_TARGET)/usr/local/lib
 endif
 
 CURLLIBS=$(shell $(CROSS_COMPILE_BIN)curl-config --libs)

Modified: team/bweschke/bug_5374/apps/app_dial.c
URL: http://svn.digium.com/view/asterisk/team/bweschke/bug_5374/apps/app_dial.c?rev=8252&r1=8251&r2=8252&view=diff
==============================================================================
--- team/bweschke/bug_5374/apps/app_dial.c (original)
+++ team/bweschke/bug_5374/apps/app_dial.c Wed Jan 18 23:20:58 2006
@@ -189,30 +189,30 @@
 "to the Dial application.\n";
 
 enum {
-	OPT_ANNOUNCE = (1 << 0),
-	OPT_RESETCDR = (1 << 1),
-	OPT_DTMF_EXIT = (1 << 2),
-	OPT_SENDDTMF = (1 << 3),
-	OPT_FORCECLID = (1 << 4),
-	OPT_GO_ON = (1 << 5),
-	OPT_CALLEE_HANGUP = (1 << 6),
-	OPT_CALLER_HANGUP = (1 << 7),
-	OPT_PRIORITY_JUMP = (1 << 8),
-	OPT_DURATION_LIMIT = (1 << 9),
-	OPT_MUSICBACK = (1 << 10),
-	OPT_CALLEE_MACRO = (1 << 11),
-	OPT_SCREEN_NOINTRO = (1 << 12),
-	OPT_SCREEN_NOCLID = (1 << 13),
-	OPT_ORIGINAL_CLID = (1 << 14),
-	OPT_SCREENING = (1 << 15),
-	OPT_PRIVACY = (1 << 16),
-	OPT_RINGBACK = (1 << 17),
-	OPT_DURATION_STOP = (1 << 18),
-	OPT_CALLEE_TRANSFER = (1 << 19),
-	OPT_CALLER_TRANSFER = (1 << 20),
-	OPT_CALLEE_MONITOR = (1 << 21),
-	OPT_CALLER_MONITOR = (1 << 22),
-	OPT_GOTO = (1 << 23),
+	OPT_ANNOUNCE =		(1 << 0),
+	OPT_RESETCDR =		(1 << 1),
+	OPT_DTMF_EXIT =		(1 << 2),
+	OPT_SENDDTMF =		(1 << 3),
+	OPT_FORCECLID =		(1 << 4),
+	OPT_GO_ON =		(1 << 5),
+	OPT_CALLEE_HANGUP =	(1 << 6),
+	OPT_CALLER_HANGUP =	(1 << 7),
+	OPT_PRIORITY_JUMP =	(1 << 8),
+	OPT_DURATION_LIMIT =	(1 << 9),
+	OPT_MUSICBACK =		(1 << 10),
+	OPT_CALLEE_MACRO =	(1 << 11),
+	OPT_SCREEN_NOINTRO =	(1 << 12),
+	OPT_SCREEN_NOCLID =	(1 << 13),
+	OPT_ORIGINAL_CLID =	(1 << 14),
+	OPT_SCREENING =		(1 << 15),
+	OPT_PRIVACY =		(1 << 16),
+	OPT_RINGBACK =		(1 << 17),
+	OPT_DURATION_STOP =	(1 << 18),
+	OPT_CALLEE_TRANSFER =	(1 << 19),
+	OPT_CALLER_TRANSFER =	(1 << 20),
+	OPT_CALLEE_MONITOR =	(1 << 21),
+	OPT_CALLER_MONITOR =	(1 << 22),
+	OPT_GOTO =		(1 << 23),
 } dial_exec_option_flags;
 
 #define DIAL_STILLGOING			(1 << 30)
@@ -425,7 +425,7 @@
 					ast_goto_if_exists(in, in->context, in->exten, in->priority + 101);
 			} else {
 				if (option_verbose > 2)
-					ast_verbose( VERBOSE_PREFIX_2 "No one is available to answer at this time (%d:%d/%d/%d)\n", numlines, numbusy, numcongestion, numnochan);
+					ast_verbose(VERBOSE_PREFIX_3 "No one is available to answer at this time (%d:%d/%d/%d)\n", numlines, numbusy, numcongestion, numnochan);
 			}
 			*to = 0;
 			return NULL;
@@ -436,7 +436,7 @@
 			if (ast_test_flag(o, DIAL_STILLGOING) && o->chan && (o->chan->_state == AST_STATE_UP)) {
 				if (!peer) {
 					if (option_verbose > 2)
-						ast_verbose( VERBOSE_PREFIX_3 "%s answered %s\n", o->chan->name, in->name);
+						ast_verbose(VERBOSE_PREFIX_3 "%s answered %s\n", o->chan->name, in->name);
 					peer = o->chan;
 					ast_copy_flags(peerflags, o,
 						       OPT_CALLEE_TRANSFER | OPT_CALLER_TRANSFER |
@@ -449,13 +449,16 @@
 					char tmpchan[256];
 					char *stuff;
 					char *tech;
+					const char *forward_context;
+
 					ast_copy_string(tmpchan, o->chan->call_forward, sizeof(tmpchan));
 					if ((stuff = strchr(tmpchan, '/'))) {
 						*stuff = '\0';
 						stuff++;
 						tech = tmpchan;
 					} else {
-						snprintf(tmpchan, sizeof(tmpchan), "%s@%s", o->chan->call_forward, o->chan->context);
+						forward_context = pbx_builtin_getvar_helper(o->chan, "FORWARD_CONTEXT");
+						snprintf(tmpchan, sizeof(tmpchan), "%s@%s", o->chan->call_forward, forward_context ? forward_context : o->chan->context);
 						stuff = tmpchan;
 						tech = "Local";
 					}
@@ -565,7 +568,7 @@
 							break;
 						case AST_CONTROL_BUSY:
 							if (option_verbose > 2)
-								ast_verbose( VERBOSE_PREFIX_3 "%s is busy\n", o->chan->name);
+								ast_verbose(VERBOSE_PREFIX_3 "%s is busy\n", o->chan->name);
 							in->hangupcause = o->chan->hangupcause;
 							ast_hangup(o->chan);
 							o->chan = NULL;
@@ -574,7 +577,7 @@
 							break;
 						case AST_CONTROL_CONGESTION:
 							if (option_verbose > 2)
-								ast_verbose( VERBOSE_PREFIX_3 "%s is circuit-busy\n", o->chan->name);
+								ast_verbose(VERBOSE_PREFIX_3 "%s is circuit-busy\n", o->chan->name);
 							in->hangupcause = o->chan->hangupcause;
 							ast_hangup(o->chan);
 							o->chan = NULL;
@@ -583,7 +586,7 @@
 							break;
 						case AST_CONTROL_RINGING:
 							if (option_verbose > 2)
-								ast_verbose( VERBOSE_PREFIX_3 "%s is ringing\n", o->chan->name);
+								ast_verbose(VERBOSE_PREFIX_3 "%s is ringing\n", o->chan->name);
 							if (!(*sentringing) && !ast_test_flag(outgoing, OPT_MUSICBACK)) {
 								ast_indicate(in, AST_CONTROL_RINGING);
 								(*sentringing)++;
@@ -591,18 +594,18 @@
 							break;
 						case AST_CONTROL_PROGRESS:
 							if (option_verbose > 2)
-								ast_verbose ( VERBOSE_PREFIX_3 "%s is making progress passing it to %s\n", o->chan->name,in->name);
+								ast_verbose (VERBOSE_PREFIX_3 "%s is making progress passing it to %s\n", o->chan->name,in->name);
 							if (!ast_test_flag(outgoing, OPT_RINGBACK))
 								ast_indicate(in, AST_CONTROL_PROGRESS);
 							break;
 						case AST_CONTROL_VIDUPDATE:
 							if (option_verbose > 2)
-								ast_verbose ( VERBOSE_PREFIX_3 "%s requested a video update, passing it to %s\n", o->chan->name,in->name);
+								ast_verbose (VERBOSE_PREFIX_3 "%s requested a video update, passing it to %s\n", o->chan->name,in->name);
 							ast_indicate(in, AST_CONTROL_VIDUPDATE);
 							break;
 						case AST_CONTROL_PROCEEDING:
 							if (option_verbose > 2)
-								ast_verbose ( VERBOSE_PREFIX_3 "%s is proceeding passing it to %s\n", o->chan->name,in->name);
+								ast_verbose (VERBOSE_PREFIX_3 "%s is proceeding passing it to %s\n", o->chan->name,in->name);
 							if (!ast_test_flag(outgoing, OPT_RINGBACK))
 								ast_indicate(in, AST_CONTROL_PROCEEDING);
 							break;
@@ -623,28 +626,30 @@
 						case -1:
 							if (!ast_test_flag(outgoing, OPT_RINGBACK | OPT_MUSICBACK)) {
 								if (option_verbose > 2)
-									ast_verbose( VERBOSE_PREFIX_3 "%s stopped sounds\n", o->chan->name);
+									ast_verbose(VERBOSE_PREFIX_3 "%s stopped sounds\n", o->chan->name);
 								ast_indicate(in, -1);
 								(*sentringing) = 0;
 							}
 							break;
 						default:
-							ast_log(LOG_DEBUG, "Dunno what to do with control type %d\n", f->subclass);
+							if (option_debug)
+								ast_log(LOG_DEBUG, "Dunno what to do with control type %d\n", f->subclass);
 						}
 					} else if (single && (f->frametype == AST_FRAME_VOICE) && 
 								!(ast_test_flag(outgoing, OPT_RINGBACK|OPT_MUSICBACK))) {
 						if (ast_write(in, f)) 
-							ast_log(LOG_DEBUG, "Unable to forward frame\n");
+							ast_log(LOG_WARNING, "Unable to forward voice frame\n");
 					} else if (single && (f->frametype == AST_FRAME_IMAGE) && 
 								!(ast_test_flag(outgoing, OPT_RINGBACK|OPT_MUSICBACK))) {
 						if (ast_write(in, f))
-							ast_log(LOG_DEBUG, "Unable to forward image\n");
+							ast_log(LOG_WARNING, "Unable to forward image\n");
 					} else if (single && (f->frametype == AST_FRAME_TEXT) && 
 								!(ast_test_flag(outgoing, OPT_RINGBACK|OPT_MUSICBACK))) {
 						if (ast_write(in, f))
-							ast_log(LOG_DEBUG, "Unable to text\n");
+							ast_log(LOG_WARNING, "Unable to send text\n");
 					} else if (single && (f->frametype == AST_FRAME_HTML) && !ast_test_flag(outgoing, DIAL_NOFORWARDHTML))
-						ast_channel_sendhtml(in, f->subclass, f->data, f->datalen);
+						if(ast_channel_sendhtml(in, f->subclass, f->data, f->datalen) == -1)
+							ast_log(LOG_WARNING, "Unable to send URL\n");
 
 					ast_frfree(f);
 				} else {
@@ -666,7 +671,7 @@
 #endif
 			if (!f || ((f->frametype == AST_FRAME_CONTROL) && (f->subclass == AST_CONTROL_HANGUP))) {
 				/* Got hung up */
-				*to=-1;
+				*to = -1;
 				strcpy(status, "CANCEL");
 				if (f)
 					ast_frfree(f);
@@ -677,7 +682,7 @@
 				if (ast_test_flag(peerflags, OPT_DTMF_EXIT)) {
 					context = pbx_builtin_getvar_helper(in, "EXITCONTEXT");
 					if (onedigit_goto(in, context, (char) f->subclass, 1)) {
-						if (option_verbose > 3)
+						if (option_verbose > 2)
 							ast_verbose(VERBOSE_PREFIX_3 "User hit %c to disconnect call.\n", f->subclass);
 						*to=0;
 						*result = f->subclass;
@@ -688,8 +693,8 @@
 				}
 
 				if (ast_test_flag(peerflags, OPT_CALLER_HANGUP) && 
-						  (f->subclass == '*')) { /* hmm it it not guarenteed to be '*' anymore. */
-					if (option_verbose > 3)
+						  (f->subclass == '*')) { /* hmm it it not guaranteed to be '*' anymore. */
+					if (option_verbose > 2)
 						ast_verbose(VERBOSE_PREFIX_3 "User hit %c to disconnect call.\n", f->subclass);
 					*to=0;
 					strcpy(status, "CANCEL");
@@ -700,7 +705,8 @@
 
 			/* Forward HTML stuff */
 			if (single && f && (f->frametype == AST_FRAME_HTML) && !ast_test_flag(outgoing, DIAL_NOFORWARDHTML)) 
-				ast_channel_sendhtml(outgoing->chan, f->subclass, f->data, f->datalen);
+				if(ast_channel_sendhtml(outgoing->chan, f->subclass, f->data, f->datalen) == -1)
+					ast_log(LOG_WARNING, "Unable to send URL\n");
 			
 
 			if (single && ((f->frametype == AST_FRAME_VOICE) || (f->frametype == AST_FRAME_DTMF)))  {
@@ -709,13 +715,13 @@
 			}
 			if (single && (f->frametype == AST_FRAME_CONTROL) && (f->subclass == AST_CONTROL_VIDUPDATE)) {
 				if (option_verbose > 2)
-					ast_verbose ( VERBOSE_PREFIX_3 "%s requested a video update, passing it to %s\n", in->name,outgoing->chan->name);
+					ast_verbose(VERBOSE_PREFIX_3 "%s requested a video update, passing it to %s\n", in->name,outgoing->chan->name);
 				ast_indicate(outgoing->chan, AST_CONTROL_VIDUPDATE);
 			}
 			ast_frfree(f);
 		}
 		if (!*to && (option_verbose > 2))
-			ast_verbose( VERBOSE_PREFIX_3 "Nobody picked up in %d ms\n", orig);
+			ast_verbose(VERBOSE_PREFIX_3 "Nobody picked up in %d ms\n", orig);
 	}
 
 	return peer;
@@ -804,7 +810,7 @@
 	if (ast_test_flag(&opts, OPT_DURATION_STOP) && !ast_strlen_zero(opt_args[OPT_ARG_DURATION_STOP])) {
 		calldurationlimit = atoi(opt_args[OPT_ARG_DURATION_STOP]);
 		if (option_verbose > 2)
-			ast_verbose(VERBOSE_PREFIX_3 "Setting call duration limit to %d seconds.\n",calldurationlimit);			
+			ast_verbose(VERBOSE_PREFIX_3 "Setting call duration limit to %d seconds.\n", calldurationlimit);			
 	}
 
 	if (ast_test_flag(&opts, OPT_SENDDTMF) && !ast_strlen_zero(opt_args[OPT_ARG_SENDDTMF])) {
@@ -881,13 +887,13 @@
 			ast_shrink_phone_number(l);
 			if( ast_test_flag(&opts, OPT_PRIVACY) ) {
 				if (option_verbose > 2)
-					ast_verbose( VERBOSE_PREFIX_3  "Privacy DB is '%s', clid is '%s'\n",
+					ast_verbose(VERBOSE_PREFIX_3  "Privacy DB is '%s', clid is '%s'\n",
 						     opt_args[OPT_ARG_PRIVACY], l);
 				privdb_val = ast_privacy_check(opt_args[OPT_ARG_PRIVACY], l);
 			}
 			else {
 				if (option_verbose > 2)
-					ast_verbose( VERBOSE_PREFIX_3  "Privacy Screening, clid is '%s'\n", l);
+					ast_verbose(VERBOSE_PREFIX_3  "Privacy Screening, clid is '%s'\n", l);
 				privdb_val = AST_PRIVACY_UNKNOWN;
 			}
 		} else {
@@ -900,7 +906,7 @@
 					*tn2 = '=';  /* any other chars to be afraid of? */
 			}
 			if (option_verbose > 2)
-				ast_verbose( VERBOSE_PREFIX_3  "Privacy-- callerid is empty\n");
+				ast_verbose(VERBOSE_PREFIX_3  "Privacy-- callerid is empty\n");
 
 			snprintf(callerid, sizeof(callerid), "NOCALLERID_%s%s", chan->exten, tnam);
 			l = callerid;
@@ -914,35 +920,36 @@
 				ast_verbose( VERBOSE_PREFIX_3  "CallerID set (%s); N option set; Screening should be off\n", privcid);
 			privdb_val = AST_PRIVACY_ALLOW;
 		}
-		else if( ast_test_flag(&opts, OPT_SCREEN_NOCLID) && strncmp(privcid,"NOCALLERID",10) == 0 ) {
+		else if(ast_test_flag(&opts, OPT_SCREEN_NOCLID) && strncmp(privcid,"NOCALLERID",10) == 0 ) {
 			if (option_verbose > 2)
 				ast_verbose( VERBOSE_PREFIX_3  "CallerID blank; N option set; Screening should happen; dbval is %d\n", privdb_val);
 		}
 		
-		if( privdb_val == AST_PRIVACY_DENY ) {
-			ast_verbose( VERBOSE_PREFIX_3  "Privacy DB reports PRIVACY_DENY for this callerid. Dial reports unavailable\n");
+		if(privdb_val == AST_PRIVACY_DENY ) {
+			if (option_verbose > 2)
+				ast_verbose( VERBOSE_PREFIX_3  "Privacy DB reports PRIVACY_DENY for this callerid. Dial reports unavailable\n");
 			res=0;
 			goto out;
 		}
-		else if( privdb_val == AST_PRIVACY_KILL ) {
+		else if(privdb_val == AST_PRIVACY_KILL ) {
 			ast_goto_if_exists(chan, chan->context, chan->exten, chan->priority + 201);
 			res = 0;
 			goto out; /* Is this right? */
 		}
-		else if( privdb_val == AST_PRIVACY_TORTURE ) {
+		else if(privdb_val == AST_PRIVACY_TORTURE ) {
 			ast_goto_if_exists(chan, chan->context, chan->exten, chan->priority + 301);
 			res = 0;
 			goto out; /* is this right??? */
 
 		}
-		else if( privdb_val == AST_PRIVACY_UNKNOWN ) {
+		else if(privdb_val == AST_PRIVACY_UNKNOWN ) {
 			/* Get the user's intro, store it in priv-callerintros/$CID, 
 			   unless it is already there-- this should be done before the 
 			   call is actually dialed  */
 
 			/* make sure the priv-callerintros dir exists? */
 
-			snprintf(privintro,sizeof(privintro),"priv-callerintros/%s", privcid);
+			snprintf(privintro,sizeof(privintro), "priv-callerintros/%s", privcid);
 			if( ast_fileexists(privintro,NULL,NULL ) > 0 && strncmp(privcid,"NOCALLERID",10) != 0) {
 				/* the DELUX version of this code would allow this caller the
 				   option to hear and retape their previously recorded intro.
@@ -958,8 +965,8 @@
 
 				*/
 				ast_play_and_record(chan, "priv-recordintro", privintro, 4, "gsm", &duration, 128, 2000, 0);  /* NOTE: I've reduced the total time to 4 sec */
-															/* don't think we'll need a lock removed, we took care of
-															   conflicts by naming the privintro file */
+										/* don't think we'll need a lock removed, we took care of
+										   conflicts by naming the privintro file */
 			}
 		}
 	}
@@ -1009,7 +1016,7 @@
 		tmp->chan = ast_request(tech, chan->nativeformats, numsubst, &cause);
 		if (!tmp->chan) {
 			/* If we can't, just go on to the next call */
-			ast_log(LOG_NOTICE, "Unable to create channel of type '%s' (cause %d - %s)\n", tech, cause, ast_cause2str(cause));
+			ast_log(LOG_WARNING, "Unable to create channel of type '%s' (cause %d - %s)\n", tech, cause, ast_cause2str(cause));
 			HANDLE_CAUSE(cause, chan);
 			cur = rest;
 			if (!cur)
@@ -1200,7 +1207,8 @@
 			number = numsubst;
 		pbx_builtin_setvar_helper(chan, "DIALEDPEERNUMBER", number);
  		if (!ast_strlen_zero(args.url) && ast_channel_supports_html(peer) ) {
- 			ast_log(LOG_DEBUG, "app_dial: sendurl=%s.\n", args.url);
+			if (option_debug)
+ 				ast_log(LOG_DEBUG, "app_dial: sendurl=%s.\n", args.url);
  			ast_channel_sendurl( peer, args.url );
  		}
 		if (ast_test_flag(&opts, OPT_PRIVACY) || ast_test_flag(&opts, OPT_SCREENING)) {
@@ -1248,7 +1256,8 @@
 							if( ast_test_flag(&opts, OPT_SCREENING) )
 								res2 = ast_play_and_wait(peer,"screen-callee-options");
 						}
-						/* priv-callee-options script:
+						/*! \page DialPrivacy Dial Privacy scripts
+						\par priv-callee-options script:
 							"Dial 1 if you wish this caller to reach you directly in the future,
 								and immediately connect to their incoming call
 							 Dial 2 if you wish to send this caller to voicemail now and 
@@ -1256,18 +1265,16 @@
 							 Dial 3 to send this callerr to the torture menus, now and forevermore.
 							 Dial 4 to send this caller to a simple "go away" menu, now and forevermore.
 							 Dial 5 to allow this caller to come straight thru to you in the future,
-						but right now, just this once, send them to voicemail."
-						*/
-				
-						/* screen-callee-options script:
+								but right now, just this once, send them to voicemail."
+						\par screen-callee-options script:
 							"Dial 1 if you wish to immediately connect to the incoming call
 							 Dial 2 if you wish to send this caller to voicemail.
 							 Dial 3 to send this callerr to the torture menus.
 							 Dial 4 to send this caller to a simple "go away" menu.
 						*/
-						if( !res2 || res2 < '1' || (ast_test_flag(&opts, OPT_PRIVACY) && res2 > '5') || (ast_test_flag(&opts, OPT_SCREENING) && res2 > '4') ) {
+						if(!res2 || res2 < '1' || (ast_test_flag(&opts, OPT_PRIVACY) && res2 > '5') || (ast_test_flag(&opts, OPT_SCREENING) && res2 > '4') ) {
 							/* invalid option */
-							res2 = ast_play_and_wait(peer,"vm-sorry");
+							res2 = ast_play_and_wait(peer, "vm-sorry");
 						}
 						loopcount++; /* give the callee a couple chances to make a choice */
 					} while( (!res2 || res2 < '1' || (ast_test_flag(&opts, OPT_PRIVACY) && res2 > '5') || (ast_test_flag(&opts, OPT_SCREENING) && res2 > '4')) && loopcount < 2 );
@@ -1277,7 +1284,7 @@
 				case '1':
 					if( ast_test_flag(&opts, OPT_PRIVACY) ) {
 						if (option_verbose > 2)
-							ast_verbose( VERBOSE_PREFIX_3 "--Set privacy database entry %s/%s to ALLOW\n",
+							ast_verbose(VERBOSE_PREFIX_3 "--Set privacy database entry %s/%s to ALLOW\n",
 								     opt_args[OPT_ARG_PRIVACY], privcid);
 						ast_privacy_set(opt_args[OPT_ARG_PRIVACY], privcid, AST_PRIVACY_ALLOW);
 					}
@@ -1285,7 +1292,7 @@
 				case '2':
 					if( ast_test_flag(&opts, OPT_PRIVACY) ) {
 						if (option_verbose > 2)
-							ast_verbose( VERBOSE_PREFIX_3 "--Set privacy database entry %s/%s to DENY\n",
+							ast_verbose(VERBOSE_PREFIX_3 "--Set privacy database entry %s/%s to DENY\n",
 								     opt_args[OPT_ARG_PRIVACY], privcid);
 						ast_privacy_set(opt_args[OPT_ARG_PRIVACY], privcid, AST_PRIVACY_DENY);
 					}
@@ -1302,7 +1309,7 @@
 				case '3':
 					if( ast_test_flag(&opts, OPT_PRIVACY) ) {
 						if (option_verbose > 2)
-							ast_verbose( VERBOSE_PREFIX_3 "--Set privacy database entry %s/%s to TORTURE\n",
+							ast_verbose(VERBOSE_PREFIX_3 "--Set privacy database entry %s/%s to TORTURE\n",
 								     opt_args[OPT_ARG_PRIVACY], privcid);
 						ast_privacy_set(opt_args[OPT_ARG_PRIVACY], privcid, AST_PRIVACY_TORTURE);
 					}
@@ -1321,7 +1328,7 @@
 				case '4':
 					if( ast_test_flag(&opts, OPT_PRIVACY) ) {
 						if (option_verbose > 2)
-							ast_verbose( VERBOSE_PREFIX_3 "--Set privacy database entry %s/%s to KILL\n",
+							ast_verbose(VERBOSE_PREFIX_3 "--Set privacy database entry %s/%s to KILL\n",
 								     opt_args[OPT_ARG_PRIVACY], privcid);
 						ast_privacy_set(opt_args[OPT_ARG_PRIVACY], privcid, AST_PRIVACY_KILL);
 					}
@@ -1340,7 +1347,7 @@
 				case '5':
 					if( ast_test_flag(&opts, OPT_PRIVACY) ) {
 						if (option_verbose > 2)
-							ast_verbose( VERBOSE_PREFIX_3 "--Set privacy database entry %s/%s to ALLOW\n",
+							ast_verbose(VERBOSE_PREFIX_3 "--Set privacy database entry %s/%s to ALLOW\n",
 								     opt_args[OPT_ARG_PRIVACY], privcid);
 						ast_privacy_set(opt_args[OPT_ARG_PRIVACY], privcid, AST_PRIVACY_ALLOW);
 						if (ast_test_flag(&opts, OPT_MUSICBACK)) {
@@ -1359,8 +1366,7 @@
 					/* well, there seems basically two choices. Just patch the caller thru immediately,
 				                  or,... put 'em thru to voicemail. */
 					/* since the callee may have hung up, let's do the voicemail thing, no database decision */
-					if (option_verbose > 2)
-						ast_log(LOG_NOTICE,"privacy: no valid response from the callee. Sending the caller to voicemail, the callee isn't responding\n");
+					ast_log(LOG_NOTICE, "privacy: no valid response from the callee. Sending the caller to voicemail, the callee isn't responding\n");
 					if (ast_test_flag(&opts, OPT_MUSICBACK)) {
 						ast_moh_stop(chan);
 					} else if (ast_test_flag(&opts, OPT_RINGBACK)) {
@@ -1383,10 +1389,10 @@
 				   just clog things up, and it's not useful information, not being tied to a CID */
 				if( strncmp(privcid,"NOCALLERID",10) == 0 || ast_test_flag(&opts, OPT_SCREEN_NOINTRO) ) {
 					ast_filedelete(privintro, NULL);
-					if( ast_fileexists(privintro,NULL,NULL ) > 0 )
-						ast_log(LOG_NOTICE,"privacy: ast_filedelete didn't do its job on %s\n", privintro);
+					if( ast_fileexists(privintro, NULL, NULL ) > 0 )
+						ast_log(LOG_NOTICE, "privacy: ast_filedelete didn't do its job on %s\n", privintro);
 					else if (option_verbose > 2)
-						ast_verbose( VERBOSE_PREFIX_3 "Successfully deleted %s intro file\n", privintro);
+						ast_verbose(VERBOSE_PREFIX_3 "Successfully deleted %s intro file\n", privintro);
 				}
 			}
 		}
@@ -1481,12 +1487,12 @@
 					} else if (!strcasecmp(macro_result, "ABORT")) {
 						/* Hangup both ends unless the caller has the g flag */
 						res = -1;
-					} else if (!strncasecmp(macro_result, "GOTO:",5) && (macro_transfer_dest = ast_strdupa(macro_result + 5))) {
+					} else if (!strncasecmp(macro_result, "GOTO:", 5) && (macro_transfer_dest = ast_strdupa(macro_result + 5))) {
 						res = -1;
 						/* perform a transfer to a new extension */
-						if (strchr(macro_transfer_dest,'^')) { /* context^exten^priority*/
+						if (strchr(macro_transfer_dest, '^')) { /* context^exten^priority*/
 							/* no brainer mode... substitute ^ with | and feed it to builtin goto */
-							for (res=0;res<strlen(macro_transfer_dest);res++)
+							for (res = 0; res < strlen(macro_transfer_dest); res++)
 								if (macro_transfer_dest[res] == '^')
 									macro_transfer_dest[res] = '|';
 
@@ -1508,12 +1514,12 @@
 			}
 			if (!ast_strlen_zero(dtmfcalled)) { 
 				if (option_verbose > 2)
-					ast_verbose(VERBOSE_PREFIX_3 "Sending DTMF '%s' to the called party.\n",dtmfcalled);
+					ast_verbose(VERBOSE_PREFIX_3 "Sending DTMF '%s' to the called party.\n", dtmfcalled);
 				res = ast_dtmf_stream(peer,chan,dtmfcalled,250);
 			}
 			if (!ast_strlen_zero(dtmfcalling)) {
 				if (option_verbose > 2)
-					ast_verbose(VERBOSE_PREFIX_3 "Sending DTMF '%s' to the calling party.\n",dtmfcalling);
+					ast_verbose(VERBOSE_PREFIX_3 "Sending DTMF '%s' to the calling party.\n", dtmfcalling);
 				res = ast_dtmf_stream(chan,peer,dtmfcalling,250);
 			}
 		}
@@ -1588,10 +1594,11 @@
 	}
 	hanguptree(outgoing, NULL);
 	pbx_builtin_setvar_helper(chan, "DIALSTATUS", status);
-	ast_log(LOG_DEBUG, "Exiting with DIALSTATUS=%s.\n", status);
+	if (option_debug)
+		ast_log(LOG_DEBUG, "Exiting with DIALSTATUS=%s.\n", status);
 	
 	if ((ast_test_flag(peerflags, OPT_GO_ON)) && (!chan->_softhangup) && (res != AST_PBX_KEEPALIVE))
-		res=0;
+		res = 0;
 	
 	LOCAL_USER_REMOVE(u);    
 	

Modified: team/bweschke/bug_5374/apps/app_disa.c
URL: http://svn.digium.com/view/asterisk/team/bweschke/bug_5374/apps/app_disa.c?rev=8252&r1=8251&r2=8252&view=diff
==============================================================================
--- team/bweschke/bug_5374/apps/app_disa.c (original)
+++ team/bweschke/bug_5374/apps/app_disa.c Wed Jan 18 23:20:58 2006
@@ -93,7 +93,8 @@
 	"If login is successful, the application looks up the dialed number in\n"
 	"the specified (or default) context, and executes it if found.\n"
 	"If the user enters an invalid extension and extension \"i\" (invalid) \n"
-	"exists in the context, it will be used.\n";
+	"exists in the context, it will be used. Also, if you set the 5th argument\n"
+	"to 'NOANSWER', the DISA application will not answer initially.\n";
 
 STANDARD_LOCAL_USER;
 
@@ -114,7 +115,7 @@
 
 static int disa_exec(struct ast_channel *chan, void *data)
 {
-	int i,j,k,x,did_ignore;
+	int i,j,k,x,did_ignore,special_noanswer;
 	int firstdigittimeout = 20000;
 	int digittimeout = 10000;
 	struct localuser *u;
@@ -131,6 +132,7 @@
 		AST_APP_ARG(context);
 		AST_APP_ARG(cid);
 		AST_APP_ARG(mailbox);
+		AST_APP_ARG(noanswer);
 	);
 
 	if (ast_strlen_zero(data)) {
@@ -175,10 +177,15 @@
 
 	ast_log(LOG_DEBUG, "Mailbox: %s\n",args.mailbox);
 	
-	if (chan->_state != AST_STATE_UP) {
-		/* answer */
-		ast_answer(chan);
-	}
+
+	special_noanswer = 0;
+	if ((!args.noanswer) || strcmp(args.noanswer,"NOANSWER"))
+	{
+		if (chan->_state != AST_STATE_UP) {
+			/* answer */
+			ast_answer(chan);
+		}
+	} else special_noanswer = 1;
 	i = k = x = 0; /* k is 0 for pswd entry, 1 for ext entry */
 	did_ignore = 0;
 	exten[0] = 0;
@@ -344,6 +351,7 @@
 			if (!ast_strlen_zero(acctcode))
 				ast_copy_string(chan->accountcode, acctcode, sizeof(chan->accountcode));
 
+			if (special_noanswer) flags.flags = 0;
 			ast_cdr_reset(chan->cdr, &flags);
 			ast_explicit_goto(chan, args.context, exten, 1);
 			LOCAL_USER_REMOVE(u);

Modified: team/bweschke/bug_5374/apps/app_festival.c
URL: http://svn.digium.com/view/asterisk/team/bweschke/bug_5374/apps/app_festival.c?rev=8252&r1=8251&r2=8252&view=diff
==============================================================================
--- team/bweschke/bug_5374/apps/app_festival.c (original)
+++ team/bweschke/bug_5374/apps/app_festival.c Wed Jan 18 23:20:58 2006
@@ -183,7 +183,8 @@
 	if (chan->_state != AST_STATE_UP)
 		ast_answer(chan);
 	ast_stopstream(chan);
-
+	ast_indicate(chan, -1);
+	
 	owriteformat = chan->writeformat;
 	res = ast_set_write_format(chan, AST_FORMAT_SLINEAR);
 	if (res < 0) {

Modified: team/bweschke/bug_5374/apps/app_macro.c
URL: http://svn.digium.com/view/asterisk/team/bweschke/bug_5374/apps/app_macro.c?rev=8252&r1=8251&r2=8252&view=diff
==============================================================================
--- team/bweschke/bug_5374/apps/app_macro.c (original)
+++ team/bweschke/bug_5374/apps/app_macro.c Wed Jan 18 23:20:58 2006
@@ -88,11 +88,6 @@
 STANDARD_LOCAL_USER;
 
 LOCAL_USER_DECL;
-
-static char *safe_strdup(const char *s)
-{
-	return s ? strdup(s) : NULL;
-}
 
 static int macro_exec(struct ast_channel *chan, void *data)
 {
@@ -169,17 +164,17 @@
 	}
 	argc = 1;
 	/* Save old macro variables */
-	save_macro_exten = safe_strdup(pbx_builtin_getvar_helper(chan, "MACRO_EXTEN"));
+	save_macro_exten = ast_strdup(pbx_builtin_getvar_helper(chan, "MACRO_EXTEN"));
 	pbx_builtin_setvar_helper(chan, "MACRO_EXTEN", oldexten);
 
-	save_macro_context = safe_strdup(pbx_builtin_getvar_helper(chan, "MACRO_CONTEXT"));
+	save_macro_context = ast_strdup(pbx_builtin_getvar_helper(chan, "MACRO_CONTEXT"));
 	pbx_builtin_setvar_helper(chan, "MACRO_CONTEXT", oldcontext);
 
-	save_macro_priority = safe_strdup(pbx_builtin_getvar_helper(chan, "MACRO_PRIORITY"));
+	save_macro_priority = ast_strdup(pbx_builtin_getvar_helper(chan, "MACRO_PRIORITY"));
 	snprintf(pc, sizeof(pc), "%d", oldpriority);
 	pbx_builtin_setvar_helper(chan, "MACRO_PRIORITY", pc);
   
-	save_macro_offset = safe_strdup(pbx_builtin_getvar_helper(chan, "MACRO_OFFSET"));
+	save_macro_offset = ast_strdup(pbx_builtin_getvar_helper(chan, "MACRO_OFFSET"));
 	pbx_builtin_setvar_helper(chan, "MACRO_OFFSET", NULL);
 
 	/* Setup environment for new run */

Modified: team/bweschke/bug_5374/apps/app_meetme.c
URL: http://svn.digium.com/view/asterisk/team/bweschke/bug_5374/apps/app_meetme.c?rev=8252&r1=8251&r2=8252&view=diff
==============================================================================
--- team/bweschke/bug_5374/apps/app_meetme.c (original)
+++ team/bweschke/bug_5374/apps/app_meetme.c Wed Jan 18 23:20:58 2006
@@ -688,7 +688,7 @@
 	return 0;
 }
 
-static char *complete_confcmd(char *line, char *word, int pos, int state) {
+static char *complete_confcmd(const char *line, const char *word, int pos, int state) {
 #define CONF_COMMANDS 6
 	int which = 0, x = 0;
 	struct ast_conference *cnf = NULL;
@@ -1759,7 +1759,8 @@
 			if (dynamic_pin) {
 				if (dynamic_pin[0] == 'q') {
 					/* Query the user to enter a PIN */
-					ast_app_getdata(chan, "conf-getpin", dynamic_pin, AST_MAX_EXTENSION - 1, 0);
+					if (ast_app_getdata(chan, "conf-getpin", dynamic_pin, AST_MAX_EXTENSION - 1, 0) < 0)
+						return NULL;
 				}
 				cnf = build_conf(confno, dynamic_pin, "", make, dynamic);
 			} else {

Modified: team/bweschke/bug_5374/apps/app_milliwatt.c
URL: http://svn.digium.com/view/asterisk/team/bweschke/bug_5374/apps/app_milliwatt.c?rev=8252&r1=8251&r2=8252&view=diff
==============================================================================
--- team/bweschke/bug_5374/apps/app_milliwatt.c (original)
+++ team/bweschke/bug_5374/apps/app_milliwatt.c Wed Jan 18 23:20:58 2006
@@ -72,39 +72,30 @@
 static int milliwatt_generate(struct ast_channel *chan, void *data, int len, int samples)
 {
 	struct ast_frame wf;
-	unsigned char waste[AST_FRIENDLY_OFFSET];
-	unsigned char buf[640];
-	const int maxsamples = sizeof (buf) / sizeof (buf[0]);
+	unsigned char buf[AST_FRIENDLY_OFFSET + 640];
 	int i, *indexp = (int *) data;
 
-	/* Instead of len, use samples, because channel.c generator_force 
-	 * generate(chan, tmp, 0, 160) ignores len. In any case, len is  
-	 * a multiple of samples, given by number of samples times bytes per
-	 * sample. In the case of ulaw, len = samples. for signed linear 
-	 * len = 2 * samples                                                 */
+	if (len + AST_FRIENDLY_OFFSET > sizeof(buf))
+	{
+		ast_log(LOG_WARNING,"Only doing %d bytes (%d bytes requested)\n",(int)(sizeof(buf) - AST_FRIENDLY_OFFSET),len);
+		len = sizeof(buf) - AST_FRIENDLY_OFFSET;
+	}
 
-	if (samples > maxsamples)
-	{
-		ast_log(LOG_WARNING, "Only doing %d samples (%d requested)\n", maxsamples, samples);
-		samples = maxsamples;
-	}
-	len = samples * sizeof (buf[0]);
-
-	waste[0] = 0; /* make compiler happy */
 	wf.frametype = AST_FRAME_VOICE;
 	wf.subclass = AST_FORMAT_ULAW;
 	wf.offset = AST_FRIENDLY_OFFSET;
 	wf.mallocd = 0;
-	wf.data = buf;
+	wf.data = buf + AST_FRIENDLY_OFFSET;
 	wf.datalen = len;
 	wf.samples = samples;
 	wf.src = "app_milliwatt";
 	wf.delivery.tv_sec = 0;
 	wf.delivery.tv_usec = 0;
+	wf.prev = wf.next = NULL;
 	/* create a buffer containing the digital milliwatt pattern */
 	for(i = 0; i < len; i++)
 	{
-		buf[i] = digital_milliwatt[(*indexp)++];
+		buf[AST_FRIENDLY_OFFSET + i] = digital_milliwatt[(*indexp)++];
 		*indexp &= 7;
 	}
 	if (ast_write(chan,&wf) < 0)

Modified: team/bweschke/bug_5374/apps/app_queue.c
URL: http://svn.digium.com/view/asterisk/team/bweschke/bug_5374/apps/app_queue.c?rev=8252&r1=8251&r2=8252&view=diff
==============================================================================
--- team/bweschke/bug_5374/apps/app_queue.c (original)
+++ team/bweschke/bug_5374/apps/app_queue.c Wed Jan 18 23:20:58 2006
@@ -114,6 +114,7 @@
 #define DEFAULT_RETRY		5
 #define DEFAULT_TIMEOUT		15
 #define RECHECK			1		/* Recheck every second to see we we're at the top yet */
+#define MAX_PERIODIC_ANNOUNCEMENTS 10 /* The maximum periodic announcements we can have */
 
 #define	RES_OKAY	0		/* Action completed */
 #define	RES_EXISTS	(-1)		/* Entry already exists */
@@ -223,7 +224,7 @@
 
 /*! \brief Persistent Members astdb family */
 static const char *pm_family = "/Queue/PersistentMembers";
-/* The maximum lengh of each persistent member queue database entry */
+/* The maximum length of each persistent member queue database entry */
 #define PM_MAX_LEN 2048
 
 /*! \brief queues.conf [general] option */
@@ -282,7 +283,8 @@
 	int pos;			/*!< Where we are in the queue */
 	int prio;			/*!< Our priority */
 	int last_pos_said;              /*!< Last position we told the user */
-	time_t last_periodic_announce_time;	/*!< The last time we played a periodic anouncement */
+	time_t last_periodic_announce_time;	/*!< The last time we played a periodic announcement */
+	int last_periodic_announce_sound;	/* The last periodic announcement we made */
 	time_t last_pos;                /*!< Last time we told the user their position */
 	int opos;			/*!< Where we started in the queue */
 	int handled;			/*!< Whether our call was handled */
@@ -347,7 +349,7 @@
 	char sound_seconds[80];         /*!< Sound file: "seconds." (def. queue-seconds) */
 	char sound_thanks[80];          /*!< Sound file: "Thank you for your patience." (def. queue-thankyou) */
 	char sound_reporthold[80];	/*!< Sound file: "Hold time" (def. queue-reporthold) */
-	char sound_periodicannounce[80];/*!< Sound file: Custom announce, no default */
+	char sound_periodicannounce[MAX_PERIODIC_ANNOUNCEMENTS][80];/* Sound files: Custom announce, no default */
 
 	int count;			/*!< How many entries */
 	int maxlen;			/*!< Max number of entries */
@@ -563,6 +565,7 @@
 
 static void init_queue(struct ast_call_queue *q)
 {
+	int i;
 	q->dead = 0;
 	q->retry = DEFAULT_RETRY;
 	q->timeout = -1;
@@ -585,7 +588,10 @@
 	ast_copy_string(q->sound_thanks, "queue-thankyou", sizeof(q->sound_thanks));
 	ast_copy_string(q->sound_lessthan, "queue-less-than", sizeof(q->sound_lessthan));
 	ast_copy_string(q->sound_reporthold, "queue-reporthold", sizeof(q->sound_reporthold));
-	ast_copy_string(q->sound_periodicannounce, "queue-periodic-announce", sizeof(q->sound_periodicannounce));
+	ast_copy_string(q->sound_periodicannounce[0], "queue-periodic-announce", sizeof(q->sound_periodicannounce[0]));
+	for (i=1;i<MAX_PERIODIC_ANNOUNCEMENTS;i++) {
+		q->sound_periodicannounce[i][0]='\0';
+	}
 }
 
 static void clear_queue(struct ast_call_queue *q)
@@ -606,6 +612,9 @@
    extra fields in the tables. */
 static void queue_set_param(struct ast_call_queue *q, const char *param, const char *val, int linenum, int failunknown)
 {
+	int i = 0;
+	char *c, *lastc;
+	char buff[80];
 	if (!strcasecmp(param, "music") || !strcasecmp(param, "musiconhold")) {
 		ast_copy_string(q->moh, val, sizeof(q->moh));
 	} else if (!strcasecmp(param, "announce")) {
@@ -660,8 +669,24 @@
 			q->announceholdtime = ANNOUNCEHOLDTIME_ALWAYS;
 		else
 			q->announceholdtime = 0;
-	 } else if (!strcasecmp(param, "periodic-announce")) {

[... 3368 lines stripped ...]


More information about the asterisk-commits mailing list