[asterisk-commits] branch jrothenberger/asterisk-imap r30908 - in /team/jrothenberger/asterisk-i...

asterisk-commits at lists.digium.com asterisk-commits at lists.digium.com
Tue May 30 13:27:21 MST 2006


Author: mogorman
Date: Tue May 30 15:27:20 2006
New Revision: 30908

URL: http://svn.digium.com/view/asterisk?rev=30908&view=rev
Log:
brought up to date with 1.2

Modified:
    team/jrothenberger/asterisk-imap/   (props changed)
    team/jrothenberger/asterisk-imap/CREDITS
    team/jrothenberger/asterisk-imap/Makefile
    team/jrothenberger/asterisk-imap/app.c
    team/jrothenberger/asterisk-imap/apps/Makefile
    team/jrothenberger/asterisk-imap/apps/app_alarmreceiver.c
    team/jrothenberger/asterisk-imap/apps/app_dial.c
    team/jrothenberger/asterisk-imap/apps/app_directed_pickup.c
    team/jrothenberger/asterisk-imap/apps/app_externalivr.c
    team/jrothenberger/asterisk-imap/apps/app_festival.c
    team/jrothenberger/asterisk-imap/apps/app_hasnewvoicemail.c
    team/jrothenberger/asterisk-imap/apps/app_ices.c
    team/jrothenberger/asterisk-imap/apps/app_macro.c
    team/jrothenberger/asterisk-imap/apps/app_meetme.c
    team/jrothenberger/asterisk-imap/apps/app_mp3.c
    team/jrothenberger/asterisk-imap/apps/app_nbscat.c
    team/jrothenberger/asterisk-imap/apps/app_osplookup.c
    team/jrothenberger/asterisk-imap/apps/app_page.c
    team/jrothenberger/asterisk-imap/apps/app_privacy.c
    team/jrothenberger/asterisk-imap/apps/app_queue.c
    team/jrothenberger/asterisk-imap/apps/app_random.c
    team/jrothenberger/asterisk-imap/apps/app_skel.c
    team/jrothenberger/asterisk-imap/apps/app_sms.c
    team/jrothenberger/asterisk-imap/apps/app_sql_postgres.c
    team/jrothenberger/asterisk-imap/apps/app_verbose.c
    team/jrothenberger/asterisk-imap/apps/app_voicemail.c
    team/jrothenberger/asterisk-imap/apps/app_waitforsilence.c
    team/jrothenberger/asterisk-imap/apps/app_while.c
    team/jrothenberger/asterisk-imap/apps/app_zapras.c
    team/jrothenberger/asterisk-imap/asterisk.c
    team/jrothenberger/asterisk-imap/cdr/Makefile
    team/jrothenberger/asterisk-imap/cdr/cdr_odbc.c
    team/jrothenberger/asterisk-imap/cdr/cdr_sqlite.c
    team/jrothenberger/asterisk-imap/channel.c
    team/jrothenberger/asterisk-imap/channels/Makefile
    team/jrothenberger/asterisk-imap/channels/chan_agent.c
    team/jrothenberger/asterisk-imap/channels/chan_h323.c
    team/jrothenberger/asterisk-imap/channels/chan_iax2.c
    team/jrothenberger/asterisk-imap/channels/chan_local.c
    team/jrothenberger/asterisk-imap/channels/chan_sip.c
    team/jrothenberger/asterisk-imap/channels/chan_zap.c
    team/jrothenberger/asterisk-imap/codecs/gsm/Makefile
    team/jrothenberger/asterisk-imap/configs/extensions.conf.sample
    team/jrothenberger/asterisk-imap/configs/mgcp.conf.sample
    team/jrothenberger/asterisk-imap/configs/sip.conf.sample
    team/jrothenberger/asterisk-imap/configs/zapata.conf.sample
    team/jrothenberger/asterisk-imap/contrib/scripts/safe_asterisk
    team/jrothenberger/asterisk-imap/contrib/scripts/safe_asterisk.8
    team/jrothenberger/asterisk-imap/db1-ast/Makefile
    team/jrothenberger/asterisk-imap/dnsmgr.c
    team/jrothenberger/asterisk-imap/doc/README.variables
    team/jrothenberger/asterisk-imap/editline/configure
    team/jrothenberger/asterisk-imap/editline/makelist
    team/jrothenberger/asterisk-imap/enum.c
    team/jrothenberger/asterisk-imap/file.c
    team/jrothenberger/asterisk-imap/formats/format_jpeg.c
    team/jrothenberger/asterisk-imap/frame.c
    team/jrothenberger/asterisk-imap/funcs/func_logic.c
    team/jrothenberger/asterisk-imap/include/asterisk/app.h
    team/jrothenberger/asterisk-imap/include/asterisk/linkedlists.h
    team/jrothenberger/asterisk-imap/include/asterisk/lock.h
    team/jrothenberger/asterisk-imap/include/asterisk/options.h
    team/jrothenberger/asterisk-imap/logger.c
    team/jrothenberger/asterisk-imap/pbx.c
    team/jrothenberger/asterisk-imap/pbx/pbx_config.c
    team/jrothenberger/asterisk-imap/redhat/asterisk.spec
    team/jrothenberger/asterisk-imap/res/res_agi.c
    team/jrothenberger/asterisk-imap/res/res_features.c
    team/jrothenberger/asterisk-imap/res/res_musiconhold.c
    team/jrothenberger/asterisk-imap/rtp.c
    team/jrothenberger/asterisk-imap/sounds.txt
    team/jrothenberger/asterisk-imap/utils/smsq.c

Propchange: team/jrothenberger/asterisk-imap/
------------------------------------------------------------------------------
--- svnmerge-integrated (original)
+++ svnmerge-integrated Tue May 30 15:27:20 2006
@@ -1,1 +1,1 @@
-/branches/1.2:1-17386
+/branches/1.2:1-30860

Modified: team/jrothenberger/asterisk-imap/CREDITS
URL: http://svn.digium.com/view/asterisk/team/jrothenberger/asterisk-imap/CREDITS?rev=30908&r1=30907&r2=30908&view=diff
==============================================================================
--- team/jrothenberger/asterisk-imap/CREDITS (original)
+++ team/jrothenberger/asterisk-imap/CREDITS Tue May 30 15:27:20 2006
@@ -12,6 +12,8 @@
 Telesthetic - for supporting SIP development
 
 Christos Ricudis - for substantial code contributions
+
+nic.at - ENUM support in Asterisk
 
 Paul Bagyenda, Digital Solutions - for initial Voicetronix driver development
 

Modified: team/jrothenberger/asterisk-imap/Makefile
URL: http://svn.digium.com/view/asterisk/team/jrothenberger/asterisk-imap/Makefile?rev=30908&r1=30907&r2=30908&view=diff
==============================================================================
--- team/jrothenberger/asterisk-imap/Makefile (original)
+++ team/jrothenberger/asterisk-imap/Makefile Tue May 30 15:27:20 2006
@@ -181,7 +181,6 @@
     # You must have GCC 3.4 to use k8, otherwise use athlon
     PROC=k8
     #PROC=athlon
-    OPTIONS+=-m64
   endif
 
   ifeq ($(PROC),sparc64)
@@ -202,9 +201,9 @@
       OPTIONS+=-fsigned-char -mcpu=ep9312
     else
       ifeq ($(SUB_PROC),xscale)
-        OPTIONS+=-fsigned-char -msoft-float -mcpu=xscale
+        OPTIONS+=-fsigned-char -mcpu=xscale
       else
-        OPTIONS+=-fsigned-char -msoft-float 
+        OPTIONS+=-fsigned-char 
       endif
     endif
   endif
@@ -434,10 +433,10 @@
 noclean: depend asterisk subdirs
 
 editline/config.h:
-	cd editline && unset CFLAGS LIBS && ./configure ; \
+	cd editline && unset CFLAGS LIBS && CFLAGS="$(OPTIMIZE)" ./configure ; \
 
 editline/libedit.a: FORCE
-	cd editline && unset CFLAGS LIBS && test -f config.h || ./configure
+	cd editline && unset CFLAGS LIBS && test -f config.h || CFLAGS="$(OPTIMIZE)" ./configure
 	$(MAKE) -C editline libedit.a
 
 db1-ast/libdb1.a: FORCE
@@ -642,13 +641,11 @@
 		cat contrib/scripts/safe_asterisk | sed 's|__ASTERISK_SBIN_DIR__|$(ASTSBINDIR)|;' > $(DESTDIR)$(ASTSBINDIR)/safe_asterisk ;\
 		chmod 755 $(DESTDIR)$(ASTSBINDIR)/safe_asterisk;\
 	fi
-	for x in $(SUBDIRS); do $(MAKE) -C $$x install || exit 1 ; done
 	$(INSTALL) -d $(DESTDIR)$(ASTHEADERDIR)
 	$(INSTALL) -m 644 include/asterisk/*.h $(DESTDIR)$(ASTHEADERDIR)
 	if [ -n "$(OLDHEADERS)" ]; then \
 		rm -f $(addprefix $(DESTDIR)$(ASTHEADERDIR)/,$(OLDHEADERS)) ;\
 	fi
-	rm -f $(DESTDIR)$(ASTVARLIBDIR)/sounds/voicemail
 	mkdir -p $(DESTDIR)$(ASTVARLIBDIR)/sounds
 	mkdir -p $(DESTDIR)$(ASTLOGDIR)/cdr-csv
 	mkdir -p $(DESTDIR)$(ASTLOGDIR)/cdr-custom
@@ -667,30 +664,10 @@
 	else \
 		echo "You need to do cvs update -d not just cvs update" ; \
 	fi 
-	( cd $(DESTDIR)$(ASTVARLIBDIR)/sounds  ; ln -s $(ASTSPOOLDIR)/voicemail . )
 	if [ -f mpg123-0.59r/mpg123 ]; then $(MAKE) -C mpg123-0.59r install; fi
-	@echo " +---- Asterisk Installation Complete -------+"  
-	@echo " +                                           +"
-	@echo " +    YOU MUST READ THE SECURITY DOCUMENT    +"
-	@echo " +                                           +"
-	@echo " + Asterisk has successfully been installed. +"  
-	@echo " + If you would like to install the sample   +"  
-	@echo " + configuration files (overwriting any      +"
-	@echo " + existing config files), run:              +"  
-	@echo " +                                           +"
-	@echo " +               $(MAKE) samples                +"
-	@echo " +                                           +"
-	@echo " +-----------------  or ---------------------+"
-	@echo " +                                           +"
-	@echo " + You can go ahead and install the asterisk +"
-	@echo " + program documentation now or later run:   +"
-	@echo " +                                           +"
-	@echo " +              $(MAKE) progdocs                +"
-	@echo " +                                           +"
-	@echo " + **Note** This requires that you have      +"
-	@echo " + doxygen installed on your local system    +"
-	@echo " +-------------------------------------------+"
-	@$(MAKE) -s oldmodcheck
+
+install-subdirs:
+	for x in $(SUBDIRS); do $(MAKE) -C $$x install || exit 1 ; done
 
 NEWMODS=$(notdir $(wildcard */*.so))
 OLDMODS=$(filter-out $(NEWMODS),$(notdir $(wildcard $(DESTDIR)$(MODULES_DIR)/*.so)))
@@ -713,10 +690,32 @@
 		echo " WARNING WARNING WARNING" ;\
 	fi
 
-install: all datafiles bininstall
+install: all datafiles bininstall install-subdirs
 	@if [ -x /usr/sbin/asterisk-post-install ]; then \
 		/usr/sbin/asterisk-post-install $(DESTDIR) . ; \
 	fi
+	@echo " +---- Asterisk Installation Complete -------+"  
+	@echo " +                                           +"
+	@echo " +    YOU MUST READ THE SECURITY DOCUMENT    +"
+	@echo " +                                           +"
+	@echo " + Asterisk has successfully been installed. +"  
+	@echo " + If you would like to install the sample   +"  
+	@echo " + configuration files (overwriting any      +"
+	@echo " + existing config files), run:              +"  
+	@echo " +                                           +"
+	@echo " +               $(MAKE) samples                +"
+	@echo " +                                           +"
+	@echo " +-----------------  or ---------------------+"
+	@echo " +                                           +"
+	@echo " + You can go ahead and install the asterisk +"
+	@echo " + program documentation now or later run:   +"
+	@echo " +                                           +"
+	@echo " +              $(MAKE) progdocs                +"
+	@echo " +                                           +"
+	@echo " + **Note** This requires that you have      +"
+	@echo " + doxygen installed on your local system    +"
+	@echo " +-------------------------------------------+"
+	@$(MAKE) -s oldmodcheck
 
 upgrade: all bininstall
 

Modified: team/jrothenberger/asterisk-imap/app.c
URL: http://svn.digium.com/view/asterisk/team/jrothenberger/asterisk-imap/app.c?rev=30908&r1=30907&r2=30908&view=diff
==============================================================================
--- team/jrothenberger/asterisk-imap/app.c (original)
+++ team/jrothenberger/asterisk-imap/app.c Tue May 30 15:27:20 2006
@@ -537,7 +537,7 @@
 static int global_silence_threshold = 128;
 static int global_maxsilence = 0;
 
-int ast_play_and_record(struct ast_channel *chan, const char *playfile, const char *recordfile, int maxtime, const char *fmt, int *duration, int silencethreshold, int maxsilence, const char *path)
+int ast_play_and_record_full(struct ast_channel *chan, const char *playfile, const char *recordfile, int maxtime, const char *fmt, int *duration, int silencethreshold, int maxsilence, const char *path, const char *acceptdtmf, const char *canceldtmf)
 {
 	int d;
 	char *fmts;
@@ -551,7 +551,6 @@
 	struct ast_dsp *sildet=NULL;   	/* silence detector dsp */
 	int totalsilence = 0;
 	int dspsilence = 0;
-	int gotsilence = 0;		/* did we timeout for silence? */
 	int rfmt=0;
 	struct ast_silence_generator *silgen = NULL;
 
@@ -674,7 +673,7 @@
 						if (option_verbose > 2)
 							ast_verbose( VERBOSE_PREFIX_3 "Recording automatically stopped after a silence of %d seconds\n", totalsilence/1000);
 						ast_frfree(f);
-						gotsilence = 1;
+						res = 'S';
 						outmsg=2;
 						break;
 					}
@@ -689,19 +688,18 @@
 				/* Write only once */
 				ast_writestream(others[0], f);
 			} else if (f->frametype == AST_FRAME_DTMF) {
-				if (f->subclass == '#') {
+				if (strchr(acceptdtmf, f->subclass)) {
 					if (option_verbose > 2)
-						ast_verbose( VERBOSE_PREFIX_3 "User ended message by pressing %c\n", f->subclass);
-					res = '#';
+						ast_verbose(VERBOSE_PREFIX_3 "User ended message by pressing %c\n", f->subclass);
+					res = f->subclass;
 					outmsg = 2;
 					ast_frfree(f);
 					break;
 				}
-				if (f->subclass == '0') {
-				/* Check for a '0' during message recording also, in case caller wants operator */
+				if (strchr(canceldtmf, f->subclass)) {
 					if (option_verbose > 2)
-						ast_verbose(VERBOSE_PREFIX_3 "User cancelled by pressing %c\n", f->subclass);
-					res = '0';
+						ast_verbose(VERBOSE_PREFIX_3 "User cancelled message by pressing %c\n", f->subclass);
+					res = f->subclass;
 					outmsg = 0;
 					ast_frfree(f);
 					break;
@@ -761,6 +759,14 @@
 	if (sildet)
 		ast_dsp_free(sildet);
 	return res;
+}
+
+static char default_acceptdtmf[] = "#";
+static char default_canceldtmf[] = "0";
+
+int ast_play_and_record(struct ast_channel *chan, const char *playfile, const char *recordfile, int maxtime, const char *fmt, int *duration, int silencethreshold, int maxsilence, const char *path)
+{
+	return ast_play_and_record_full(chan, playfile, recordfile, maxtime, fmt, duration, silencethreshold, maxsilence, path, default_acceptdtmf, default_canceldtmf);
 }
 
 int ast_play_and_prepend(struct ast_channel *chan, char *playfile, char *recordfile, int maxtime, char *fmt, int *duration, int beep, int silencethreshold, int maxsilence)
@@ -778,7 +784,6 @@
 	struct ast_dsp *sildet;   	/* silence detector dsp */
 	int totalsilence = 0;
 	int dspsilence = 0;
-	int gotsilence = 0;		/* did we timeout for silence? */
 	int rfmt=0;	
 	char prependfile[80];
 	
@@ -897,7 +902,7 @@
 					if (option_verbose > 2) 
 						ast_verbose( VERBOSE_PREFIX_3 "Recording automatically stopped after a silence of %d seconds\n", totalsilence/1000);
 					ast_frfree(f);
-					gotsilence = 1;
+					res = 'S';
 					outmsg=2;
 					break;
 					}

Modified: team/jrothenberger/asterisk-imap/apps/Makefile
URL: http://svn.digium.com/view/asterisk/team/jrothenberger/asterisk-imap/apps/Makefile?rev=30908&r1=30907&r2=30908&view=diff
==============================================================================
--- team/jrothenberger/asterisk-imap/apps/Makefile (original)
+++ team/jrothenberger/asterisk-imap/apps/Makefile Tue May 30 15:27:20 2006
@@ -93,7 +93,7 @@
 all: $(APPS)
 
 clean:
-	rm -f *.so *.o look .depend
+	rm -f *.so *.o .depend
 
 %.so : %.o
 	$(CC) $(SOLINK) -o $@ ${CYGSOLINK} $< ${CYGSOLIB}
@@ -132,9 +132,6 @@
 app_sql_odbc.so: app_sql_odbc.o
 	$(CC) $(SOLINK) -o $@ ${CYGSOLINK} $< ${CYGSOLIB} -lodbc
 
-look:	look.c
-	$(CC) -pipe -O6 -g look.c -o look -lncurses
-
 ifeq (SunOS,$(shell uname))
 app_chanspy.so: app_chanspy.o
 	$(CC) $(SOLINK) -o $@ $< -lrt

Modified: team/jrothenberger/asterisk-imap/apps/app_alarmreceiver.c
URL: http://svn.digium.com/view/asterisk/team/jrothenberger/asterisk-imap/apps/app_alarmreceiver.c?rev=30908&r1=30907&r2=30908&view=diff
==============================================================================
--- team/jrothenberger/asterisk-imap/apps/app_alarmreceiver.c (original)
+++ team/jrothenberger/asterisk-imap/apps/app_alarmreceiver.c Tue May 30 15:27:20 2006
@@ -558,11 +558,10 @@
 
 		if(checksum){
 			database_increment("checksum-errors");
-			if(option_verbose >= 2){
+			if(option_verbose >= 2)
 				ast_verbose(VERBOSE_PREFIX_2 "AlarmReceiver: Nonzero checksum\n");
 			ast_log(LOG_DEBUG, "AlarmReceiver: Nonzero checksum\n");
 			continue;
-			}
 		}
 
 		/* Check the message type for correctness */

Modified: team/jrothenberger/asterisk-imap/apps/app_dial.c
URL: http://svn.digium.com/view/asterisk/team/jrothenberger/asterisk-imap/apps/app_dial.c?rev=30908&r1=30907&r2=30908&view=diff
==============================================================================
--- team/jrothenberger/asterisk-imap/apps/app_dial.c (original)
+++ team/jrothenberger/asterisk-imap/apps/app_dial.c Tue May 30 15:27:20 2006
@@ -1,7 +1,7 @@
 /*
  * Asterisk -- An open source telephony toolkit.
  *
- * Copyright (C) 1999 - 2005, Digium, Inc.
+ * Copyright (C) 1999 - 2006, Digium, Inc.
  *
  * Mark Spencer <markster at digium.com>
  *
@@ -111,7 +111,8 @@
 "    G(context^exten^pri) - If the call is answered, transfer the calling party to\n"
 "           the specified priority and the called party to the specified priority+1.\n"
 "           Optionally, an extension, or extension and context may be specified. \n"
-"           Otherwise, the current extension is used.\n"
+"           Otherwise, the current extension is used. You cannot use any additional\n"
+"           action post answer options in conjunction with this option.\n" 
 "    h    - Allow the called party to hang up by sending the '*' DTMF digit.\n"
 "    H    - Allow the calling party to hang up by hitting the '*' DTMF digit.\n"
 "    j    - Jump to priority n+101 if all of the requested channels were busy.\n"
@@ -144,6 +145,8 @@
 "           * GOTO:<context>^<exten>^<priority> - Transfer the call to the\n"
 "                          specified priority. Optionally, an extension, or\n"
 "                          extension and priority can be specified.\n"
+"           You cannot use any additional action post answer options in conjunction\n"
+"           with this option.\n"
 "    n    - This option is a modifier for the screen/privacy mode. It specifies\n"
 "           that no introductions are to be saved in the priv-callerintros\n"
 "           directory.\n"
@@ -303,6 +306,8 @@
 		if (chan->cdr) \
 			ast_cdr_failed(chan->cdr); \
 		numnochan++; \
+		break; \
+	case AST_CAUSE_NORMAL_CLEARING: \
 		break; \
 	default: \
 		numnochan++; \
@@ -466,6 +471,8 @@
 						o->chan = ast_request(tech, in->nativeformats, stuff, &cause);
 						if (!o->chan)
 							ast_log(LOG_NOTICE, "Unable to create local channel for call forward to '%s/%s' (cause = %d)\n", tech, stuff, cause);
+						else
+							ast_channel_inherit_variables(in, o->chan);
 					} else {
 						if (option_verbose > 2)
 							ast_verbose(VERBOSE_PREFIX_3 "Too many forwards from %s\n", o->chan->name);
@@ -827,6 +834,21 @@
 		if (!timelimit) {
 			timelimit = play_to_caller = play_to_callee = play_warning = warning_freq = 0;
 			warning_sound = NULL;
+		} else if (play_warning > timelimit) {
+			/* If the first warning is requested _after_ the entire call would end,
+			   and no warning frequency is requested, then turn off the warning. If
+			   a warning frequency is requested, reduce the 'first warning' time by
+			   that frequency until it falls within the call's total time limit.
+			*/
+
+			if (!warning_freq) {
+				play_warning = 0;
+			} else {
+				while (play_warning > timelimit)
+					play_warning -= warning_freq;
+				if (play_warning < 1)
+					play_warning = warning_freq = 0;
+			}
 		}
 
 		var = pbx_builtin_getvar_helper(chan,"LIMIT_PLAYAUDIO_CALLER");
@@ -917,20 +939,26 @@
 		}
 		
 		if( privdb_val == AST_PRIVACY_DENY ) {
+			strcpy(status, "NOANSWER");
 			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 ) {
-			ast_goto_if_exists(chan, chan->context, chan->exten, chan->priority + 201);
+			strcpy(status, "DONTCALL");
+			if (option_priority_jumping || ast_test_flag(&opts, OPT_PRIORITY_JUMP)) {
+				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 ) {
-			ast_goto_if_exists(chan, chan->context, chan->exten, chan->priority + 301);
+			strcpy(status, "TORTURE");
+			if (option_priority_jumping || ast_test_flag(&opts, OPT_PRIORITY_JUMP)) {
+				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 ) {
 			/* Get the user's intro, store it in priv-callerintros/$CID, 
@@ -1040,6 +1068,8 @@
 				tmp->chan = ast_request(tech, chan->nativeformats, stuff, &cause);
 				if (!tmp->chan)
 					ast_log(LOG_NOTICE, "Unable to create local channel for call forward to '%s/%s' (cause = %d)\n", tech, stuff, cause);
+				else
+					ast_channel_inherit_variables(chan, tmp->chan);
 			} else {
 				if (option_verbose > 2)
 					ast_verbose(VERBOSE_PREFIX_3 "Too many forwards from %s\n", tmp->chan->name);
@@ -1286,6 +1316,7 @@
 								     opt_args[OPT_ARG_PRIVACY], privcid);
 						ast_privacy_set(opt_args[OPT_ARG_PRIVACY], privcid, AST_PRIVACY_DENY);
 					}
+					strcpy(status,"NOANSWER");
 					if (ast_test_flag(&opts, OPT_MUSICBACK)) {
 						ast_moh_stop(chan);
 					} else if (ast_test_flag(&opts, OPT_RINGBACK)) {

Modified: team/jrothenberger/asterisk-imap/apps/app_directed_pickup.c
URL: http://svn.digium.com/view/asterisk/team/jrothenberger/asterisk-imap/apps/app_directed_pickup.c?rev=30908&r1=30907&r2=30908&view=diff
==============================================================================
--- team/jrothenberger/asterisk-imap/apps/app_directed_pickup.c (original)
+++ team/jrothenberger/asterisk-imap/apps/app_directed_pickup.c Tue May 30 15:27:20 2006
@@ -3,7 +3,7 @@
  *
  * Copyright (C) 2005, Joshua Colp
  *
- * Joshua Colp <jcolp at asterlink.com>
+ * Joshua Colp <jcolp at digium.com>
  *
  * See http://www.asterisk.org for more information about
  * the Asterisk project. Please do not directly contact

Modified: team/jrothenberger/asterisk-imap/apps/app_externalivr.c
URL: http://svn.digium.com/view/asterisk/team/jrothenberger/asterisk-imap/apps/app_externalivr.c?rev=30908&r1=30907&r2=30908&view=diff
==============================================================================
--- team/jrothenberger/asterisk-imap/apps/app_externalivr.c (original)
+++ team/jrothenberger/asterisk-imap/apps/app_externalivr.c Tue May 30 15:27:20 2006
@@ -44,6 +44,7 @@
 #include "asterisk/module.h"
 #include "asterisk/linkedlists.h"
 #include "asterisk/app.h"
+#include "asterisk/options.h"
 
 static const char *tdesc = "External IVR Interface Application";
 
@@ -312,6 +313,9 @@
 	if (!pid) {
 		/* child process */
 		int i;
+
+		if (option_highpriority)
+			ast_set_priority(0);
 
 		dup2(child_stdin[0], STDIN_FILENO);
 		dup2(child_stdout[1], STDOUT_FILENO);

Modified: team/jrothenberger/asterisk-imap/apps/app_festival.c
URL: http://svn.digium.com/view/asterisk/team/jrothenberger/asterisk-imap/apps/app_festival.c?rev=30908&r1=30907&r2=30908&view=diff
==============================================================================
--- team/jrothenberger/asterisk-imap/apps/app_festival.c (original)
+++ team/jrothenberger/asterisk-imap/apps/app_festival.c Tue May 30 15:27:20 2006
@@ -53,6 +53,7 @@
 #include "asterisk/config.h"
 #include "asterisk/utils.h"
 #include "asterisk/lock.h"
+#include "asterisk/options.h"
 
 #define FESTIVAL_CONFIG "festival.conf"
 
@@ -136,6 +137,9 @@
                 if (x != fd)
                         close(x);
         }
+	if (option_highpriority)
+		ast_set_priority(0);
+
 /*IAS */
 #ifdef __PPC__  
 	for( x=0; x<length; x+=2)

Modified: team/jrothenberger/asterisk-imap/apps/app_hasnewvoicemail.c
URL: http://svn.digium.com/view/asterisk/team/jrothenberger/asterisk-imap/apps/app_hasnewvoicemail.c?rev=30908&r1=30907&r2=30908&view=diff
==============================================================================
--- team/jrothenberger/asterisk-imap/apps/app_hasnewvoicemail.c (original)
+++ team/jrothenberger/asterisk-imap/apps/app_hasnewvoicemail.c Tue May 30 15:27:20 2006
@@ -47,6 +47,12 @@
 #include "asterisk/utils.h"
 #include "asterisk/app.h"
 #include "asterisk/options.h"
+#ifdef USE_ODBC_STORAGE
+#include "asterisk/res_odbc.h"
+
+static char odbc_database[80];
+static char odbc_table[80];
+#endif
 
 static char *tdesc = "Indicator for whether a voice mailbox has messages in a given folder.";
 static char *app_hasvoicemail = "HasVoicemail";
@@ -77,25 +83,93 @@
 
 LOCAL_USER_DECL;
 
-static int hasvoicemail_internal(char *context, char *box, char *folder)
-{
-	char vmpath[256];
-	DIR *vmdir;
-	struct dirent *vment;
-	int count=0;
-
-	snprintf(vmpath,sizeof(vmpath), "%s/voicemail/%s/%s/%s", (char *)ast_config_AST_SPOOL_DIR, context, box, folder);
-	if ((vmdir = opendir(vmpath))) {
-		/* No matter what the format of VM, there will always be a .txt file for each message. */
-		while ((vment = readdir(vmdir))) {
-			if (!strncmp(vment->d_name + 7, ".txt", 4)) {
-				count++;
-			}
-		}
-		closedir(vmdir);
-	}
+#ifdef USE_ODBC_STORAGE
+static int hasvoicemail_internal(const char *context, const char *mailbox, const char *folder)
+{
+	int nummsgs = 0;
+	int res;
+	SQLHSTMT stmt;
+	char sql[256];
+	char rowdata[20];
+
+	if (!folder)
+		folder = "INBOX";
+	/* If no mailbox, return immediately */
+	if (ast_strlen_zero(mailbox))
+		return 0;
+	if (ast_strlen_zero(context))
+		context = "default";
+
+	odbc_obj *obj;
+	obj = fetch_odbc_obj(odbc_database, 0);
+	if (obj) {
+		res = SQLAllocHandle(SQL_HANDLE_STMT, obj->con, &stmt);
+		if ((res != SQL_SUCCESS) && (res != SQL_SUCCESS_WITH_INFO)) {
+			ast_log(LOG_WARNING, "SQL Alloc Handle failed!\n");
+			goto yuck;
+		}
+		snprintf(sql, sizeof(sql), "SELECT COUNT(*) FROM %s WHERE dir = '%s/voicemail/%s/%s/%s'", odbc_table, ast_config_AST_SPOOL_DIR, context, mailbox, folder);
+		res = SQLPrepare(stmt, sql, SQL_NTS);
+		if ((res != SQL_SUCCESS) && (res != SQL_SUCCESS_WITH_INFO)) {  
+			ast_log(LOG_WARNING, "SQL Prepare failed![%s]\n", sql);
+			SQLFreeHandle(SQL_HANDLE_STMT, stmt);
+			goto yuck;
+		}
+		res = odbc_smart_execute(obj, stmt);
+		if ((res != SQL_SUCCESS) && (res != SQL_SUCCESS_WITH_INFO)) {
+			ast_log(LOG_WARNING, "SQL Execute error!\n[%s]\n\n", sql);
+			SQLFreeHandle(SQL_HANDLE_STMT, stmt);
+			goto yuck;
+		}
+		res = SQLFetch(stmt);
+		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);
+			goto yuck;
+		}
+		res = SQLGetData(stmt, 1, SQL_CHAR, rowdata, sizeof(rowdata), NULL);
+		if ((res != SQL_SUCCESS) && (res != SQL_SUCCESS_WITH_INFO)) {
+			ast_log(LOG_WARNING, "SQL Get Data error!\n[%s]\n\n", sql);
+			SQLFreeHandle(SQL_HANDLE_STMT, stmt);
+			goto yuck;
+		}
+		nummsgs = atoi(rowdata);
+		SQLFreeHandle(SQL_HANDLE_STMT, stmt);
+	} else
+		ast_log(LOG_WARNING, "Failed to obtain database object for '%s'!\n", odbc_database);
+
+yuck:
+	return nummsgs;
+}
+
+#else
+
+static int hasvoicemail_internal(const char *context, const char *mailbox, const char *folder)
+{
+	DIR *dir;
+	struct dirent *de;
+	char fn[256];
+	int count = 0;
+
+	if (ast_strlen_zero(folder))
+		folder = "INBOX";
+	if (ast_strlen_zero(context))
+		context = "default";
+	/* If no mailbox, return immediately */
+	if (ast_strlen_zero(mailbox))
+		return 0;
+	snprintf(fn, sizeof(fn), "%s/voicemail/%s/%s/%s", ast_config_AST_SPOOL_DIR, context, mailbox, folder);
+	dir = opendir(fn);
+	if (!dir)
+		return 0;
+	while ((de = readdir(dir))) {
+		if (!strncasecmp(de->d_name, "msg", 3) && !strcasecmp(de->d_name + 8, "txt"))
+			count++;
+	}
+	closedir(dir);
 	return count;
 }
+#endif
 
 static int hasvoicemail_exec(struct ast_channel *chan, void *data)
 {
@@ -222,6 +296,31 @@
 	.read = acf_vmcount_exec,
 };
 
+static int load_config(void)
+{
+#ifdef USE_ODBC_STORAGE
+	struct ast_config *cfg;
+	char *tmp;
+	cfg = ast_config_load("voicemail.conf");
+	if (cfg) {
+		if (! (tmp = ast_variable_retrieve(cfg, "general", "odbcstorage")))
+			tmp = "asterisk";
+		ast_copy_string(odbc_database, tmp, sizeof(odbc_database));
+
+		if (! (tmp = ast_variable_retrieve(cfg, "general", "odbctable")))
+			tmp = "voicemessages";
+		ast_copy_string(odbc_table, tmp, sizeof(odbc_table));
+		ast_config_destroy(cfg);
+	}
+#endif
+	return 0;
+}
+
+int reload(void)
+{
+	return load_config();
+}
+
 int unload_module(void)
 {
 	int res;
@@ -238,7 +337,7 @@
 int load_module(void)
 {
 	int res;
-
+	load_config();
 	res = ast_custom_function_register(&acf_vmcount);
 	res |= ast_register_application(app_hasvoicemail, hasvoicemail_exec, hasvoicemail_synopsis, hasvoicemail_descrip);
 	res |= ast_register_application(app_hasnewvoicemail, hasvoicemail_exec, hasnewvoicemail_synopsis, hasnewvoicemail_descrip);

Modified: team/jrothenberger/asterisk-imap/apps/app_ices.c
URL: http://svn.digium.com/view/asterisk/team/jrothenberger/asterisk-imap/apps/app_ices.c?rev=30908&r1=30907&r2=30908&view=diff
==============================================================================
--- team/jrothenberger/asterisk-imap/apps/app_ices.c (original)
+++ team/jrothenberger/asterisk-imap/apps/app_ices.c Tue May 30 15:27:20 2006
@@ -44,6 +44,7 @@
 #include "asterisk/pbx.h"
 #include "asterisk/module.h"
 #include "asterisk/translate.h"
+#include "asterisk/options.h"
 
 #define ICES "/usr/bin/ices"
 #define LOCAL_ICES "/usr/local/bin/ices"
@@ -72,6 +73,8 @@
 		ast_log(LOG_WARNING, "Fork failed\n");
 	if (res)
 		return res;
+	if (option_highpriority)
+		ast_set_priority(0);
 	dup2(fd, STDIN_FILENO);
 	for (x=STDERR_FILENO + 1;x<256;x++) {
 		if ((x != STDIN_FILENO) && (x != STDOUT_FILENO))

Modified: team/jrothenberger/asterisk-imap/apps/app_macro.c
URL: http://svn.digium.com/view/asterisk/team/jrothenberger/asterisk-imap/apps/app_macro.c?rev=30908&r1=30907&r2=30908&view=diff
==============================================================================
--- team/jrothenberger/asterisk-imap/apps/app_macro.c (original)
+++ team/jrothenberger/asterisk-imap/apps/app_macro.c Tue May 30 15:27:20 2006
@@ -337,7 +337,7 @@
 			*label_b = '\0';
 			label_b++;
 		}
-		if (ast_true(expr))
+		if (pbx_checkcondition(expr))
 			macro_exec(chan, label_a);
 		else if (label_b) 
 			macro_exec(chan, label_b);

Modified: team/jrothenberger/asterisk-imap/apps/app_meetme.c
URL: http://svn.digium.com/view/asterisk/team/jrothenberger/asterisk-imap/apps/app_meetme.c?rev=30908&r1=30907&r2=30908&view=diff
==============================================================================
--- team/jrothenberger/asterisk-imap/apps/app_meetme.c (original)
+++ team/jrothenberger/asterisk-imap/apps/app_meetme.c Tue May 30 15:27:20 2006
@@ -1,7 +1,7 @@
 /*
  * Asterisk -- An open source telephony toolkit.
  *
- * Copyright (C) 1999 - 2005, Digium, Inc.
+ * Copyright (C) 1999 - 2006, Digium, Inc.
  *
  * Mark Spencer <markster at digium.com>
  *
@@ -70,8 +70,9 @@
 "If the conference number is omitted, the user will be prompted to enter\n"
 "one. \n"
 "User can exit the conference by hangup, or if the 'p' option is specified, by pressing '#'.\n"
-"Please note: A ZAPTEL INTERFACE MUST BE INSTALLED FOR CONFERENCING TO WORK!\n\n"
-
+"Please note: The Zaptel kernel modules and at least one hardware driver (or ztdummy)\n"
+"             must be present for conferencing to operate properly. In addition, the chan_zap\n"
+"             channel driver must be loaded for the 'i' and 'r' options to operate at all.\n\n"
 "The option string may contain zero or more of the following characters:\n"
 "      'a' -- set admin mode\n"
 "      'A' -- set marked mode\n"
@@ -95,7 +96,6 @@
 "      's' -- Present menu (user or admin) when '*' is received ('send' to menu)\n"
 "      't' -- set talk only mode. (Talk only, no listening)\n"
 "      'T' -- set talker detection (sent to manager interface and meetme list)\n"
-"      'v' -- video mode\n"
 "      'w' -- wait until the marked user enters the conference\n"
 "      'x' -- close the conference when last marked user exits\n"
 "      'X' -- allow user to exit the conference by entering a valid single\n"
@@ -165,7 +165,7 @@
 	int talking;				/* Is user talking */
 	int zapchannel;				/* Is a Zaptel channel */
 	char usrvalue[50];			/* Custom User Value */
-	char namerecloc[AST_MAX_EXTENSION];	/* Name Recorded file Location */
+	char namerecloc[PATH_MAX];	/* Name Recorded file Location */
 	time_t jointime;			/* Time the user joined the conference */
 	struct volume talk;
 	struct volume listen;
@@ -211,7 +211,7 @@
 #define CONFFLAG_STARMENU (1 << 4)		/* If set asterisk will provide a menu to the user when '*' is pressed */
 #define CONFFLAG_TALKER (1 << 5)		/* If set the use can only send audio to the conference */
 #define CONFFLAG_QUIET (1 << 6)			/* If set there will be no enter or leave sounds */
-#define CONFFLAG_VIDEO (1 << 7)			/* Set to enable video mode */
+#define CONFFLAG_ANNOUNCEUSERCOUNT (1 << 7)	/* If set, when user joins the conference, they will be told the number of users that are already in */
 #define CONFFLAG_AGI (1 << 8)			/* Set to run AGI Script in Background */
 #define CONFFLAG_MOH (1 << 9)			/* Set to have music on hold when user is alone in conference */
 #define CONFFLAG_MARKEDEXIT (1 << 10)		/* If set the MeetMe will return if all marked with this flag left */
@@ -226,7 +226,6 @@
 #define CONFFLAG_EMPTY (1 << 19)
 #define CONFFLAG_EMPTYNOPIN (1 << 20)
 #define CONFFLAG_ALWAYSPROMPT (1 << 21)
-#define CONFFLAG_ANNOUNCEUSERCOUNT (1 << 22)	/* If set, when user joins the conference, they will be told the number of users that are already in */
 
 
 AST_APP_OPTIONS(meetme_opts, {
@@ -628,7 +627,7 @@
 				user->chan->name,
 				user->userflags & CONFFLAG_ADMIN ? "(Admin)" : "",
 				user->userflags & CONFFLAG_MONITOR ? "(Listen only)" : "",
-				user->adminflags & ADMINFLAG_MUTED ? "(Admn Muted)" : "",
+				user->adminflags & ADMINFLAG_MUTED ? "(Admin Muted)" : "",
 				istalking(user->talking));
 		ast_cli(fd,"%d users in that conference.\n",cnf->users);
 
@@ -1070,7 +1069,7 @@
 	if (!firstpass && !(confflags & CONFFLAG_MONITOR) && !(confflags & CONFFLAG_ADMIN)) {
 		firstpass = 1;
 		if (!(confflags & CONFFLAG_QUIET))
-			if (!(confflags & CONFFLAG_WAITMARKED) || (conf->markedusers >= 1))
+			if (!(confflags & CONFFLAG_WAITMARKED) || ((confflags & CONFFLAG_MARKEDUSER) && (conf->markedusers >= 1)))
 				conf_play(chan, conf, ENTER);
 	}
 
@@ -1620,7 +1619,8 @@
 	return ret;
 }
 
-static struct ast_conference *find_conf(struct ast_channel *chan, char *confno, int make, int dynamic, char *dynamic_pin)
+static struct ast_conference *find_conf(struct ast_channel *chan, char *confno, int make, int dynamic, char *dynamic_pin,
+					struct ast_flags *confflags)
 {
 	struct ast_config *cfg;
 	struct ast_variable *var;
@@ -1695,6 +1695,21 @@
 			dynamic_pin[0] = '\0';
 	}
 
+	if (cnf) {
+		if (confflags && !cnf->chan &&
+		    !ast_test_flag(confflags, CONFFLAG_QUIET) &&
+		    ast_test_flag(confflags, CONFFLAG_INTROUSER)) {
+			ast_log(LOG_WARNING, "No Zap channel available for conference, user introduction disabled (is chan_zap loaded?)\n");
+			ast_clear_flag(confflags, CONFFLAG_INTROUSER);
+		}
+		
+		if (confflags && !cnf->chan &&
+		    ast_test_flag(confflags, CONFFLAG_RECORDCONF)) {
+			ast_log(LOG_WARNING, "No Zap channel available for conference, conference recording disabled (is chan_zap loaded?)\n");
+			ast_clear_flag(confflags, CONFFLAG_RECORDCONF);
+		}
+	}
+
 	return cnf;
 }
 
@@ -1723,7 +1738,7 @@
 	}
 	
 	confnum = strsep(&localdata,"|");       
-	conf = find_conf(chan, confnum, 0, 0, NULL);
+	conf = find_conf(chan, confnum, 0, 0, NULL, NULL);
 	if (conf)
 		count = conf->users;
 	else
@@ -1910,7 +1925,7 @@
 		}
 		if (!ast_strlen_zero(confno)) {
 			/* Check the validity of the conference */
-			cnf = find_conf(chan, confno, 1, dynamic, the_pin);
+			cnf = find_conf(chan, confno, 1, dynamic, the_pin, &confflags);
 			if (!cnf) {
 				res = ast_streamfile(chan, "conf-invalid", chan->language);
 				if (!res)
@@ -1948,9 +1963,12 @@
 								break;
 							} else {
 								/* Pin invalid */
-								res = ast_streamfile(chan, "conf-invalidpin", chan->language);
-								if (!res)
-									ast_waitstream(chan, AST_DIGIT_ANY);
+								if (!ast_streamfile(chan, "conf-invalidpin", chan->language))
+									res = ast_waitstream(chan, AST_DIGIT_ANY);
+								else {
+									ast_log(LOG_WARNING, "Couldn't play invalid pin msg!\n");
+									break;
+								}
 								if (res < 0)
 									break;
 								pin[0] = res;

Modified: team/jrothenberger/asterisk-imap/apps/app_mp3.c
URL: http://svn.digium.com/view/asterisk/team/jrothenberger/asterisk-imap/apps/app_mp3.c?rev=30908&r1=30907&r2=30908&view=diff
==============================================================================
--- team/jrothenberger/asterisk-imap/apps/app_mp3.c (original)
+++ team/jrothenberger/asterisk-imap/apps/app_mp3.c Tue May 30 15:27:20 2006
@@ -43,6 +43,7 @@
 #include "asterisk/pbx.h"
 #include "asterisk/module.h"
 #include "asterisk/translate.h"
+#include "asterisk/options.h"
 
 #define LOCAL_MPG_123 "/usr/local/bin/mpg123"
 #define MPG_123 "/usr/bin/mpg123"
@@ -71,6 +72,8 @@
 		ast_log(LOG_WARNING, "Fork failed\n");
 	if (res)
 		return res;
+	if (option_highpriority)
+		ast_set_priority(0);
 	dup2(fd, STDOUT_FILENO);
 	for (x=0;x<256;x++) {
 		if (x != STDOUT_FILENO)

Modified: team/jrothenberger/asterisk-imap/apps/app_nbscat.c
URL: http://svn.digium.com/view/asterisk/team/jrothenberger/asterisk-imap/apps/app_nbscat.c?rev=30908&r1=30907&r2=30908&view=diff
==============================================================================
--- team/jrothenberger/asterisk-imap/apps/app_nbscat.c (original)
+++ team/jrothenberger/asterisk-imap/apps/app_nbscat.c Tue May 30 15:27:20 2006
@@ -44,6 +44,7 @@
 #include "asterisk/pbx.h"
 #include "asterisk/module.h"
 #include "asterisk/translate.h"
+#include "asterisk/options.h"
 
 #define LOCAL_NBSCAT "/usr/local/bin/nbscat8k"
 #define NBSCAT "/usr/bin/nbscat8k"
@@ -75,6 +76,9 @@
 		ast_log(LOG_WARNING, "Fork failed\n");
 	if (res)
 		return res;
+	if (option_highpriority)
+		ast_set_priority(0);
+
 	dup2(fd, STDOUT_FILENO);
 	for (x=0;x<256;x++) {
 		if (x != STDOUT_FILENO)

Modified: team/jrothenberger/asterisk-imap/apps/app_osplookup.c
URL: http://svn.digium.com/view/asterisk/team/jrothenberger/asterisk-imap/apps/app_osplookup.c?rev=30908&r1=30907&r2=30908&view=diff
==============================================================================
--- team/jrothenberger/asterisk-imap/apps/app_osplookup.c (original)
+++ team/jrothenberger/asterisk-imap/apps/app_osplookup.c Tue May 30 15:27:20 2006
@@ -216,31 +216,33 @@
 	cause = str2cause(args.cause);
 	temp = pbx_builtin_getvar_helper(chan, "OSPHANDLE");
 	result.handle = -1;
-	if (!ast_strlen_zero(temp) && (sscanf(temp, "%d", &result.handle) == 1) && (result.handle > -1)) {
-		temp = pbx_builtin_getvar_helper(chan, "OSPRESULTS");
-		if (ast_strlen_zero(temp) || (sscanf(temp, "%d", &result.numresults) != 1)) {
-			result.numresults = 0;
-		}
-		if ((res = ast_osp_next(&result, cause)) > 0) {
-			char tmp[80];
-			snprintf(tmp, sizeof(tmp), "%d", result.handle);
-			pbx_builtin_setvar_helper(chan, "_OSPHANDLE", tmp);
-			pbx_builtin_setvar_helper(chan, "_OSPTECH", result.tech);
-			pbx_builtin_setvar_helper(chan, "_OSPDEST", result.dest);
-			pbx_builtin_setvar_helper(chan, "_OSPTOKEN", result.token);
-			snprintf(tmp, sizeof(tmp), "%d", result.numresults);
-			pbx_builtin_setvar_helper(chan, "_OSPRESULTS", tmp);
-			pbx_builtin_setvar_helper(chan, "OSPNEXTSTATUS", "SUCCESS");
-		}
+	if (ast_strlen_zero(temp) || (sscanf(temp, "%d", &result.handle) != 1)) {
+		result.handle = -1;
+	}
+	temp = pbx_builtin_getvar_helper(chan, "OSPRESULTS");
+	if (ast_strlen_zero(temp) || (sscanf(temp, "%d", &result.numresults) != 1)) {
+		result.numresults = 0;
+	}
+	if ((res = ast_osp_next(&result, cause)) > 0) {
+		char tmp[80];
+		snprintf(tmp, sizeof(tmp), "%d", result.handle);
+		pbx_builtin_setvar_helper(chan, "_OSPHANDLE", tmp);
+		pbx_builtin_setvar_helper(chan, "_OSPTECH", result.tech);
+		pbx_builtin_setvar_helper(chan, "_OSPDEST", result.dest);
+		pbx_builtin_setvar_helper(chan, "_OSPTOKEN", result.token);
+		snprintf(tmp, sizeof(tmp), "%d", result.numresults);
+		pbx_builtin_setvar_helper(chan, "_OSPRESULTS", tmp);
+		pbx_builtin_setvar_helper(chan, "OSPNEXTSTATUS", "SUCCESS");
 	} else {
 		if (!res) {

[... 5907 lines stripped ...]


More information about the asterisk-commits mailing list