[svn-commits] oej: branch oej/iaxtrunkfix-1.2 r53955 - in /team/oej/iaxtrunkfix-1.2: ./ app...

svn-commits at lists.digium.com svn-commits at lists.digium.com
Sun Feb 11 14:14:52 MST 2007


Author: oej
Date: Sun Feb 11 15:14:50 2007
New Revision: 53955

URL: http://svn.digium.com/view/asterisk?view=rev&rev=53955
Log:
Update branch, reset automerge

Added:
    team/oej/iaxtrunkfix-1.2/codecs/codec_zap.c
      - copied unchanged from r53658, branches/1.2/codecs/codec_zap.c
    team/oej/iaxtrunkfix-1.2/doc/voicemail_odbc_postgresql.txt
      - copied unchanged from r53658, branches/1.2/doc/voicemail_odbc_postgresql.txt
    team/oej/iaxtrunkfix-1.2/sounds/silence/
      - copied from r53658, branches/1.2/sounds/silence/
    team/oej/iaxtrunkfix-1.2/sounds/silence/1.gsm
      - copied unchanged from r53658, branches/1.2/sounds/silence/1.gsm
    team/oej/iaxtrunkfix-1.2/sounds/silence/10.gsm
      - copied unchanged from r53658, branches/1.2/sounds/silence/10.gsm
    team/oej/iaxtrunkfix-1.2/sounds/silence/2.gsm
      - copied unchanged from r53658, branches/1.2/sounds/silence/2.gsm
    team/oej/iaxtrunkfix-1.2/sounds/silence/3.gsm
      - copied unchanged from r53658, branches/1.2/sounds/silence/3.gsm
    team/oej/iaxtrunkfix-1.2/sounds/silence/4.gsm
      - copied unchanged from r53658, branches/1.2/sounds/silence/4.gsm
    team/oej/iaxtrunkfix-1.2/sounds/silence/5.gsm
      - copied unchanged from r53658, branches/1.2/sounds/silence/5.gsm
    team/oej/iaxtrunkfix-1.2/sounds/silence/6.gsm
      - copied unchanged from r53658, branches/1.2/sounds/silence/6.gsm
    team/oej/iaxtrunkfix-1.2/sounds/silence/7.gsm
      - copied unchanged from r53658, branches/1.2/sounds/silence/7.gsm
    team/oej/iaxtrunkfix-1.2/sounds/silence/8.gsm
      - copied unchanged from r53658, branches/1.2/sounds/silence/8.gsm
    team/oej/iaxtrunkfix-1.2/sounds/silence/9.gsm
      - copied unchanged from r53658, branches/1.2/sounds/silence/9.gsm
Modified:
    team/oej/iaxtrunkfix-1.2/   (props changed)
    team/oej/iaxtrunkfix-1.2/BUGS
    team/oej/iaxtrunkfix-1.2/Makefile
    team/oej/iaxtrunkfix-1.2/apps/app_chanspy.c
    team/oej/iaxtrunkfix-1.2/apps/app_cut.c
    team/oej/iaxtrunkfix-1.2/apps/app_db.c
    team/oej/iaxtrunkfix-1.2/apps/app_dial.c
    team/oej/iaxtrunkfix-1.2/apps/app_dictate.c
    team/oej/iaxtrunkfix-1.2/apps/app_directory.c
    team/oej/iaxtrunkfix-1.2/apps/app_externalivr.c
    team/oej/iaxtrunkfix-1.2/apps/app_festival.c
    team/oej/iaxtrunkfix-1.2/apps/app_groupcount.c
    team/oej/iaxtrunkfix-1.2/apps/app_ices.c
    team/oej/iaxtrunkfix-1.2/apps/app_macro.c
    team/oej/iaxtrunkfix-1.2/apps/app_meetme.c
    team/oej/iaxtrunkfix-1.2/apps/app_mixmonitor.c
    team/oej/iaxtrunkfix-1.2/apps/app_mp3.c
    team/oej/iaxtrunkfix-1.2/apps/app_nbscat.c
    team/oej/iaxtrunkfix-1.2/apps/app_page.c
    team/oej/iaxtrunkfix-1.2/apps/app_queue.c
    team/oej/iaxtrunkfix-1.2/apps/app_rpt.c
    team/oej/iaxtrunkfix-1.2/apps/app_sms.c
    team/oej/iaxtrunkfix-1.2/apps/app_voicemail.c
    team/oej/iaxtrunkfix-1.2/apps/app_while.c
    team/oej/iaxtrunkfix-1.2/apps/app_zapras.c
    team/oej/iaxtrunkfix-1.2/asterisk.c
    team/oej/iaxtrunkfix-1.2/cdr.c
    team/oej/iaxtrunkfix-1.2/cdr/Makefile
    team/oej/iaxtrunkfix-1.2/cdr/cdr_pgsql.c
    team/oej/iaxtrunkfix-1.2/channel.c
    team/oej/iaxtrunkfix-1.2/channels/chan_h323.c
    team/oej/iaxtrunkfix-1.2/channels/chan_iax2.c
    team/oej/iaxtrunkfix-1.2/channels/chan_local.c
    team/oej/iaxtrunkfix-1.2/channels/chan_mgcp.c
    team/oej/iaxtrunkfix-1.2/channels/chan_misdn.c
    team/oej/iaxtrunkfix-1.2/channels/chan_phone.c
    team/oej/iaxtrunkfix-1.2/channels/chan_sip.c
    team/oej/iaxtrunkfix-1.2/channels/chan_skinny.c
    team/oej/iaxtrunkfix-1.2/channels/chan_zap.c
    team/oej/iaxtrunkfix-1.2/channels/misdn/   (props changed)
    team/oej/iaxtrunkfix-1.2/channels/misdn/chan_misdn_config.h
    team/oej/iaxtrunkfix-1.2/channels/misdn/fac.c
    team/oej/iaxtrunkfix-1.2/channels/misdn/ie.c
    team/oej/iaxtrunkfix-1.2/channels/misdn/isdn_lib.c
    team/oej/iaxtrunkfix-1.2/channels/misdn/isdn_lib.h
    team/oej/iaxtrunkfix-1.2/channels/misdn/isdn_msg_parser.c
    team/oej/iaxtrunkfix-1.2/channels/misdn_config.c
    team/oej/iaxtrunkfix-1.2/codecs/Makefile
    team/oej/iaxtrunkfix-1.2/config.c
    team/oej/iaxtrunkfix-1.2/configs/dnsmgr.conf.sample
    team/oej/iaxtrunkfix-1.2/configs/extensions.conf.sample
    team/oej/iaxtrunkfix-1.2/configs/iax.conf.sample
    team/oej/iaxtrunkfix-1.2/configs/misdn.conf.sample
    team/oej/iaxtrunkfix-1.2/configs/sip.conf.sample
    team/oej/iaxtrunkfix-1.2/contrib/scripts/vmdb.sql
    team/oej/iaxtrunkfix-1.2/db1-ast/btree/bt_close.c
    team/oej/iaxtrunkfix-1.2/db1-ast/btree/bt_conv.c
    team/oej/iaxtrunkfix-1.2/db1-ast/btree/bt_debug.c
    team/oej/iaxtrunkfix-1.2/db1-ast/btree/bt_delete.c
    team/oej/iaxtrunkfix-1.2/db1-ast/btree/bt_get.c
    team/oej/iaxtrunkfix-1.2/db1-ast/btree/bt_open.c
    team/oej/iaxtrunkfix-1.2/db1-ast/btree/bt_overflow.c
    team/oej/iaxtrunkfix-1.2/db1-ast/btree/bt_page.c
    team/oej/iaxtrunkfix-1.2/db1-ast/btree/bt_put.c
    team/oej/iaxtrunkfix-1.2/db1-ast/btree/bt_search.c
    team/oej/iaxtrunkfix-1.2/db1-ast/btree/bt_seq.c
    team/oej/iaxtrunkfix-1.2/db1-ast/btree/bt_split.c
    team/oej/iaxtrunkfix-1.2/db1-ast/btree/bt_utils.c
    team/oej/iaxtrunkfix-1.2/db1-ast/db/db.c
    team/oej/iaxtrunkfix-1.2/db1-ast/hash/hash.c
    team/oej/iaxtrunkfix-1.2/db1-ast/hash/hash_bigkey.c
    team/oej/iaxtrunkfix-1.2/db1-ast/hash/hash_buf.c
    team/oej/iaxtrunkfix-1.2/db1-ast/hash/hash_func.c
    team/oej/iaxtrunkfix-1.2/db1-ast/hash/hash_log2.c
    team/oej/iaxtrunkfix-1.2/db1-ast/hash/hash_page.c
    team/oej/iaxtrunkfix-1.2/db1-ast/hash/hsearch.c
    team/oej/iaxtrunkfix-1.2/db1-ast/include/ndbm.h
    team/oej/iaxtrunkfix-1.2/db1-ast/mpool/mpool.c
    team/oej/iaxtrunkfix-1.2/db1-ast/recno/rec_close.c
    team/oej/iaxtrunkfix-1.2/db1-ast/recno/rec_delete.c
    team/oej/iaxtrunkfix-1.2/db1-ast/recno/rec_get.c
    team/oej/iaxtrunkfix-1.2/db1-ast/recno/rec_open.c
    team/oej/iaxtrunkfix-1.2/db1-ast/recno/rec_put.c
    team/oej/iaxtrunkfix-1.2/db1-ast/recno/rec_search.c
    team/oej/iaxtrunkfix-1.2/db1-ast/recno/rec_seq.c
    team/oej/iaxtrunkfix-1.2/db1-ast/recno/rec_utils.c
    team/oej/iaxtrunkfix-1.2/doc/README.cdr
    team/oej/iaxtrunkfix-1.2/doc/README.misdn
    team/oej/iaxtrunkfix-1.2/frame.c
    team/oej/iaxtrunkfix-1.2/funcs/func_math.c
    team/oej/iaxtrunkfix-1.2/funcs/func_strings.c
    team/oej/iaxtrunkfix-1.2/include/asterisk/channel.h
    team/oej/iaxtrunkfix-1.2/include/asterisk/config.h
    team/oej/iaxtrunkfix-1.2/jitterbuf.c
    team/oej/iaxtrunkfix-1.2/manager.c
    team/oej/iaxtrunkfix-1.2/pbx.c
    team/oej/iaxtrunkfix-1.2/pbx/pbx_dundi.c
    team/oej/iaxtrunkfix-1.2/pbx/pbx_spool.c
    team/oej/iaxtrunkfix-1.2/redhat/asterisk.spec
    team/oej/iaxtrunkfix-1.2/res/res_agi.c
    team/oej/iaxtrunkfix-1.2/res/res_features.c
    team/oej/iaxtrunkfix-1.2/res/res_musiconhold.c
    team/oej/iaxtrunkfix-1.2/res/res_odbc.c
    team/oej/iaxtrunkfix-1.2/rtp.c
    team/oej/iaxtrunkfix-1.2/sounds.txt
    team/oej/iaxtrunkfix-1.2/stdtime/localtime.c
    team/oej/iaxtrunkfix-1.2/utils.c
    team/oej/iaxtrunkfix-1.2/utils/Makefile
    team/oej/iaxtrunkfix-1.2/utils/check_expr.c

Propchange: team/oej/iaxtrunkfix-1.2/
------------------------------------------------------------------------------
    automerge = http://edvina.net/training/

Propchange: team/oej/iaxtrunkfix-1.2/
------------------------------------------------------------------------------
--- svnmerge-integrated (original)
+++ svnmerge-integrated Sun Feb 11 15:14:50 2007
@@ -1,1 +1,1 @@
-/branches/1.2:1-46982
+/branches/1.2:1-53953

Modified: team/oej/iaxtrunkfix-1.2/BUGS
URL: http://svn.digium.com/view/asterisk/team/oej/iaxtrunkfix-1.2/BUGS?view=diff&rev=53955&r1=53954&r2=53955
==============================================================================
--- team/oej/iaxtrunkfix-1.2/BUGS (original)
+++ team/oej/iaxtrunkfix-1.2/BUGS Sun Feb 11 15:14:50 2007
@@ -10,7 +10,7 @@
 learn how you can contribute by acting as a bug marshall
 please see:
 
-	http://www.digium.com/index.php?menu=bugguidelines
+	http://www.asterisk.org/developers/bug-guidelines
 
 If you would like to submit a feature request, please
 resist the temptation to post it to the bug tracker.

Modified: team/oej/iaxtrunkfix-1.2/Makefile
URL: http://svn.digium.com/view/asterisk/team/oej/iaxtrunkfix-1.2/Makefile?view=diff&rev=53955&r1=53954&r2=53955
==============================================================================
--- team/oej/iaxtrunkfix-1.2/Makefile (original)
+++ team/oej/iaxtrunkfix-1.2/Makefile Sun Feb 11 15:14:50 2007
@@ -317,7 +317,7 @@
 
 ifneq ($(wildcard .version),)
   ASTERISKVERSION:=$(shell cat .version)
-  ASTERISKVERSIONNUM:=$(shell awk -F. '{printf "%02d%02d%02d", $$1, $$2, $$3}' .version)
+  ASTERISKVERSIONNUM:=$(shell awk -F. '{printf "%01d%02d%02d", $$1, $$2, $$3}' .version)
   RPMVERSION:=$(shell sed 's/[-\/:]/_/g' .version)
 else
   RPMVERSION=unknown
@@ -553,10 +553,19 @@
 datafiles: all
 	if [ x`$(ID) -un` = xroot ]; then sh mkpkgconfig $(DESTDIR)/usr/lib/pkgconfig; fi
 	mkdir -p $(DESTDIR)$(ASTVARLIBDIR)/sounds/digits
+	mkdir -p $(DESTDIR)$(ASTVARLIBDIR)/sounds/silence
 	mkdir -p $(DESTDIR)$(ASTVARLIBDIR)/sounds/priv-callerintros
 	for x in sounds/digits/*.gsm; do \
 		if $(GREP) -q "^%`basename $$x`%" sounds.txt; then \
 			$(INSTALL) -m 644 $$x $(DESTDIR)$(ASTVARLIBDIR)/sounds/digits ; \
+		else \
+			echo "No description for $$x"; \
+			exit 1; \
+		fi; \
+	done
+	for x in sounds/silence/*.gsm; do \
+		if $(GREP) -q "^%`basename $$x`%" sounds.txt; then \
+			$(INSTALL) -m 644 $$x $(DESTDIR)$(ASTVARLIBDIR)/sounds/silence ; \
 		else \
 			echo "No description for $$x"; \
 			exit 1; \

Modified: team/oej/iaxtrunkfix-1.2/apps/app_chanspy.c
URL: http://svn.digium.com/view/asterisk/team/oej/iaxtrunkfix-1.2/apps/app_chanspy.c?view=diff&rev=53955&r1=53954&r2=53955
==============================================================================
--- team/oej/iaxtrunkfix-1.2/apps/app_chanspy.c (original)
+++ team/oej/iaxtrunkfix-1.2/apps/app_chanspy.c Sun Feb 11 15:14:50 2007
@@ -53,7 +53,7 @@
 #define ALL_DONE(u, ret) LOCAL_USER_REMOVE(u); return ret;
 #define get_volfactor(x) x ? ((x > 0) ? (1 << x) : ((1 << abs(x)) * -1)) : 0
 
-static const char *synopsis = "Listen to the audio of an active channel\n";
+static const char *synopsis = "Listen to the audio of an active channel";
 static const char *app = "ChanSpy";
 static const char *desc = 
 "  ChanSpy([chanprefix][|options]): This application is used to listen to the\n"

Modified: team/oej/iaxtrunkfix-1.2/apps/app_cut.c
URL: http://svn.digium.com/view/asterisk/team/oej/iaxtrunkfix-1.2/apps/app_cut.c?view=diff&rev=53955&r1=53954&r2=53955
==============================================================================
--- team/oej/iaxtrunkfix-1.2/apps/app_cut.c (original)
+++ team/oej/iaxtrunkfix-1.2/apps/app_cut.c Sun Feb 11 15:14:50 2007
@@ -48,7 +48,7 @@
 static char *cut_synopsis = "Splits a variable's contents using the specified delimiter";
 
 static char *cut_descrip =
-"  Cut(newvar=varname,delimiter,fieldspec): This applicaiton will split the\n"
+"  Cut(newvar=varname,delimiter,fieldspec): This application will split the\n"
 "contents of a variable based on the given delimeter and store the result in\n"
 "a new variable.\n"
 "Parameters:\n"
@@ -66,7 +66,7 @@
 "  Sort(newvar=key1:val1[,key2:val2[[...],keyN:valN]]): This application will\n"
 "sort the list provided in ascending order. The result will be stored in the\n"
 "specified variable name.\n"
-"  This applicaiton has been deprecated in favor of the SORT function.\n";
+"  This application has been deprecated in favor of the SORT function.\n";
 
 STANDARD_LOCAL_USER;
 

Modified: team/oej/iaxtrunkfix-1.2/apps/app_db.c
URL: http://svn.digium.com/view/asterisk/team/oej/iaxtrunkfix-1.2/apps/app_db.c?view=diff&rev=53955&r1=53954&r2=53955
==============================================================================
--- team/oej/iaxtrunkfix-1.2/apps/app_db.c (original)
+++ team/oej/iaxtrunkfix-1.2/apps/app_db.c Sun Feb 11 15:14:50 2007
@@ -63,7 +63,7 @@
 "  This application has been deprecated in favor of the DB function.\n";
 
 static char *d_descrip =
-"  DBdel(family/key): This applicaiton will delete a key from the Asterisk\n"
+"  DBdel(family/key): This application will delete a key from the Asterisk\n"
 "database.\n";
 
 static char *dt_descrip =

Modified: team/oej/iaxtrunkfix-1.2/apps/app_dial.c
URL: http://svn.digium.com/view/asterisk/team/oej/iaxtrunkfix-1.2/apps/app_dial.c?view=diff&rev=53955&r1=53954&r2=53955
==============================================================================
--- team/oej/iaxtrunkfix-1.2/apps/app_dial.c (original)
+++ team/oej/iaxtrunkfix-1.2/apps/app_dial.c Sun Feb 11 15:14:50 2007
@@ -65,7 +65,7 @@
 
 static char *descrip =
 "  Dial(Technology/resource[&Tech2/resource2...][|timeout][|options][|URL]):\n"
-"This applicaiton will place calls to one or more specified channels. As soon\n"
+"This application will place calls to one or more specified channels. As soon\n"
 "as one of the requested channels answers, the originating channel will be\n"
 "answered, if it has not already been answered. These two channels will then\n"
 "be active in a bridged call. All other channels that were requested will then\n"
@@ -80,7 +80,7 @@
 "    ANSWEREDTIME - This is the amount of time for actual call.\n"
 "    DIALSTATUS   - This is the status of the call:\n"
 "                   CHANUNAVAIL | CONGESTION | NOANSWER | BUSY | ANSWER | CANCEL\n" 
-"                   DONTCALL | TORTURE\n"
+"                   DONTCALL | TORTURE | INVALIDARGS\n"
 "  For the Privacy and Screening Modes, the DIALSTATUS variable will be set to\n"
 "DONTCALL if the called party chooses to send the calling party to the 'Go Away'\n"
 "script. The DIALSTATUS variable will be set to TORTURE if the called party\n"
@@ -759,7 +759,7 @@
 	char *start_sound=NULL;
 	char *dtmfcalled=NULL, *dtmfcalling=NULL;
 	char *var;
-	char status[256];
+	char status[256] = "INVALIDARGS";
 	int play_to_caller=0,play_to_callee=0;
 	int sentringing=0, moh=0;
 	char *outbound_group = NULL;
@@ -780,21 +780,19 @@
 
 	if (ast_strlen_zero(data)) {
 		ast_log(LOG_WARNING, "Dial requires an argument (technology/number)\n");
+		pbx_builtin_setvar_helper(chan, "DIALSTATUS", status);
 		return -1;
 	}
 
 	LOCAL_USER_ADD(u);
 
-	if (!(parse = ast_strdupa(data))) {
-		ast_log(LOG_WARNING, "Memory allocation failure\n");
-		LOCAL_USER_REMOVE(u);
-		return -1;
-	}
+	parse = ast_strdupa(data);
 	
 	AST_STANDARD_APP_ARGS(args, parse);
 
 	if (!ast_strlen_zero(args.options)) {
 		if (ast_app_parse_options(dial_exec_options, &opts, opt_args, args.options)) {
+			pbx_builtin_setvar_helper(chan, "DIALSTATUS", status);
 			LOCAL_USER_REMOVE(u);
 			return -1;
 		}
@@ -802,6 +800,7 @@
 
 	if (ast_strlen_zero(args.peers)) {
 		ast_log(LOG_WARNING, "Dial requires an argument (technology/number)\n");
+		pbx_builtin_setvar_helper(chan, "DIALSTATUS", status);
 		LOCAL_USER_REMOVE(u);
 		return -1;
 	}
@@ -1058,6 +1057,7 @@
 			cur = rest;
 			if (!cur)
 				chan->hangupcause = cause;
+			free(tmp);
 			continue;
 		}
 		pbx_builtin_setvar_helper(tmp->chan, "DIALEDPEERNUMBER", numsubst);
@@ -1096,6 +1096,7 @@
 			if (!tmp->chan) {
 				HANDLE_CAUSE(cause, chan);
 				cur = rest;
+				free(tmp);
 				continue;
 			}
 		}
@@ -1163,6 +1164,7 @@
 			ast_hangup(tmp->chan);
 			tmp->chan = NULL;
 			cur = rest;
+			free(tmp);
 			continue;
 		} else {
 			senddialevent(chan, tmp->chan);
@@ -1197,6 +1199,7 @@
 		strcpy(status, "NOANSWER");
 		if (ast_test_flag(outgoing, OPT_MUSICBACK)) {
 			moh=1;
+			ast_indicate(chan, AST_CONTROL_PROGRESS);
 			ast_moh_start(chan, opt_args[OPT_ARG_MUSICBACK]);
 		} else if (ast_test_flag(outgoing, OPT_RINGBACK)) {
 			ast_indicate(chan, AST_CONTROL_RINGING);
@@ -1466,7 +1469,7 @@
 			ast_pbx_start(peer);
 			hanguptree(outgoing, NULL);
 			LOCAL_USER_REMOVE(u);
-			return 0;
+			return 1;
 		}
 
 		if (ast_test_flag(&opts, OPT_CALLEE_MACRO) && !ast_strlen_zero(opt_args[OPT_ARG_CALLEE_MACRO])) {
@@ -1645,8 +1648,12 @@
 static int dial_exec(struct ast_channel *chan, void *data)
 {
 	struct ast_flags peerflags;
+	int res = 0;
+
 	memset(&peerflags, 0, sizeof(peerflags));
-	return dial_exec_full(chan, data, &peerflags);
+	res = dial_exec_full(chan, data, &peerflags);
+
+	return (res >= 0 ? 0 : -1);
 }
 
 static int retrydial_exec(struct ast_channel *chan, void *data)
@@ -1715,7 +1722,10 @@
 		if (ast_test_flag(chan, AST_FLAG_MOH))
 			ast_moh_stop(chan);
 
-		if ((res = dial_exec_full(chan, dialdata, &peerflags)) == 0) {
+		res = dial_exec_full(chan, dialdata, &peerflags);
+		if (res == 1) {
+			break;
+		} else if (res == 0) {
 			if (ast_test_flag(&peerflags, OPT_DTMF_EXIT)) {
 				if (!(res = ast_streamfile(chan, announce, chan->language)))
 					res = ast_waitstream(chan, AST_DIGIT_ANY);
@@ -1751,7 +1761,7 @@
 		ast_moh_stop(chan);
 
 	LOCAL_USER_REMOVE(u);
-	return loops ? res : 0;
+	return loops ? (res >= 0 ? 0 : -1) : 0;
 
 }
 

Modified: team/oej/iaxtrunkfix-1.2/apps/app_dictate.c
URL: http://svn.digium.com/view/asterisk/team/oej/iaxtrunkfix-1.2/apps/app_dictate.c?view=diff&rev=53955&r1=53954&r2=53955
==============================================================================
--- team/oej/iaxtrunkfix-1.2/apps/app_dictate.c (original)
+++ team/oej/iaxtrunkfix-1.2/apps/app_dictate.c Sun Feb 11 15:14:50 2007
@@ -257,7 +257,8 @@
 						if (lastop != DFLAG_PLAY) {
 							lastop = DFLAG_PLAY;
 							ast_closestream(fs);
-							fs = ast_openstream(chan, path, chan->language);
+							if (!(fs = ast_openstream(chan, path, chan->language)))
+								break;
 							ast_seekstream(fs, samples, SEEK_SET);
 							chan->stream = NULL;
 						}

Modified: team/oej/iaxtrunkfix-1.2/apps/app_directory.c
URL: http://svn.digium.com/view/asterisk/team/oej/iaxtrunkfix-1.2/apps/app_directory.c?view=diff&rev=53955&r1=53954&r2=53955
==============================================================================
--- team/oej/iaxtrunkfix-1.2/apps/app_directory.c (original)
+++ team/oej/iaxtrunkfix-1.2/apps/app_directory.c Sun Feb 11 15:14:50 2007
@@ -61,7 +61,7 @@
 "the calling channel with a directory of extensions from which they can search\n"
 "by name. The list of names and corresponding extensions is retrieved from the\n"
 "voicemail configuration file, voicemail.conf.\n"
-"  This applicaiton will immediate exit if one of the following DTMF digits are\n"
+"  This application will immediately exit if one of the following DTMF digits are\n"
 "received and the extension to jump to exists:\n"
 "    0 - Jump to the 'o' extension, if it exists.\n"
 "    * - Jump to the 'a' extension, if it exists.\n\n"

Modified: team/oej/iaxtrunkfix-1.2/apps/app_externalivr.c
URL: http://svn.digium.com/view/asterisk/team/oej/iaxtrunkfix-1.2/apps/app_externalivr.c?view=diff&rev=53955&r1=53954&r2=53955
==============================================================================
--- team/oej/iaxtrunkfix-1.2/apps/app_externalivr.c (original)
+++ team/oej/iaxtrunkfix-1.2/apps/app_externalivr.c Sun Feb 11 15:14:50 2007
@@ -31,6 +31,7 @@
 #include <string.h>
 #include <unistd.h>
 #include <errno.h>
+#include <signal.h>
 
 #include "asterisk.h"
 
@@ -152,7 +153,7 @@
 		if (state->current) {
 			file_to_stream = state->current->filename;
 		} else {
-			file_to_stream = "silence-10";
+			file_to_stream = "silence/10";
 			u->playing_silence = 1;
 		}
 
@@ -258,9 +259,13 @@
 	FILE *child_commands = NULL;
 	FILE *child_errors = NULL;
 	FILE *child_events = NULL;
+	sigset_t fullset, oldset;
 
 	LOCAL_USER_ADD(u);
-	
+
+	sigfillset(&fullset);
+	pthread_sigmask(SIG_BLOCK, &fullset, &oldset);
+
 	AST_LIST_HEAD_INIT(&u->playlist);
 	AST_LIST_HEAD_INIT(&u->finishlist);
 	u->abort_current_sound = 0;
@@ -313,6 +318,9 @@
 	if (!pid) {
 		/* child process */
 		int i;
+
+		signal(SIGPIPE, SIG_DFL);
+		pthread_sigmask(SIG_UNBLOCK, &fullset, NULL);
 
 		if (option_highpriority)
 			ast_set_priority(0);
@@ -336,6 +344,8 @@
 		int ready_fd;
 		int waitfds[2] = { child_errors_fd, child_commands_fd };
 		struct ast_channel *rchan;
+
+		pthread_sigmask(SIG_SETMASK, &oldset, NULL);
 
 		close(child_stdin[0]);
 		child_stdin[0] = 0;

Modified: team/oej/iaxtrunkfix-1.2/apps/app_festival.c
URL: http://svn.digium.com/view/asterisk/team/oej/iaxtrunkfix-1.2/apps/app_festival.c?view=diff&rev=53955&r1=53954&r2=53955
==============================================================================
--- team/oej/iaxtrunkfix-1.2/apps/app_festival.c (original)
+++ team/oej/iaxtrunkfix-1.2/apps/app_festival.c Sun Feb 11 15:14:50 2007
@@ -127,19 +127,26 @@
 #ifdef __PPC__ 
 	char c;
 #endif
+	sigset_t fullset, oldset;
+
+	sigfillset(&fullset);
+	pthread_sigmask(SIG_BLOCK, &fullset, &oldset);
 
         res = fork();
         if (res < 0)
                 ast_log(LOG_WARNING, "Fork failed\n");
-        if (res)
+        if (res) {
+		pthread_sigmask(SIG_SETMASK, &oldset, NULL);
                 return res;
+	}
         for (x=0;x<256;x++) {
                 if (x != fd)
                         close(x);
         }
 	if (option_highpriority)
 		ast_set_priority(0);
-
+	signal(SIGPIPE, SIG_DFL);
+	pthread_sigmask(SIG_UNBLOCK, &fullset, NULL);
 /*IAS */
 #ifdef __PPC__  
 	for( x=0; x<length; x+=2)

Modified: team/oej/iaxtrunkfix-1.2/apps/app_groupcount.c
URL: http://svn.digium.com/view/asterisk/team/oej/iaxtrunkfix-1.2/apps/app_groupcount.c?view=diff&rev=53955&r1=53954&r2=53955
==============================================================================
--- team/oej/iaxtrunkfix-1.2/apps/app_groupcount.c (original)
+++ team/oej/iaxtrunkfix-1.2/apps/app_groupcount.c Sun Feb 11 15:14:50 2007
@@ -70,7 +70,8 @@
 
 	if (ast_strlen_zero(group)) {
 		grp = pbx_builtin_getvar_helper(chan, category);
-		strncpy(group, grp, sizeof(group) - 1);
+		if (!ast_strlen_zero(grp))
+			ast_copy_string(group, grp, sizeof(group));
 	}
 
 	count = ast_app_group_get_count(group, category);
@@ -152,6 +153,11 @@
 	if (!deprecation_warning) {
 	        ast_log(LOG_WARNING, "The CheckGroup application has been deprecated, please use a combination of the GotoIf application and the GROUP_COUNT() function.\n");
 		deprecation_warning = 1;
+	}
+
+	if (ast_strlen_zero(data)) {
+		ast_log(LOG_WARNING, "CheckGroup requires an argument(max[@category][|options])\n");
+		return 0;
 	}
 
 	if (!(parse = ast_strdupa(data))) {

Modified: team/oej/iaxtrunkfix-1.2/apps/app_ices.c
URL: http://svn.digium.com/view/asterisk/team/oej/iaxtrunkfix-1.2/apps/app_ices.c?view=diff&rev=53955&r1=53954&r2=53955
==============================================================================
--- team/oej/iaxtrunkfix-1.2/apps/app_ices.c (original)
+++ team/oej/iaxtrunkfix-1.2/apps/app_ices.c Sun Feb 11 15:14:50 2007
@@ -68,15 +68,27 @@
 {
 	int res;
 	int x;
+	sigset_t fullset, oldset;
+
+	sigfillset(&fullset);
+	pthread_sigmask(SIG_BLOCK, &fullset, &oldset);
+
 	res = fork();
 	if (res < 0) 
 		ast_log(LOG_WARNING, "Fork failed\n");
-	if (res)
+	if (res) {
+		pthread_sigmask(SIG_SETMASK, &oldset, NULL);
 		return res;
+	}
+
+	/* Stop ignoring PIPE */
+	signal(SIGPIPE, SIG_DFL);
+	pthread_sigmask(SIG_UNBLOCK, &fullset, NULL);
+
 	if (option_highpriority)
 		ast_set_priority(0);
 	dup2(fd, STDIN_FILENO);
-	for (x=STDERR_FILENO + 1;x<256;x++) {
+	for (x=STDERR_FILENO + 1;x<1024;x++) {
 		if ((x != STDIN_FILENO) && (x != STDOUT_FILENO))
 			close(x);
 	}
@@ -87,7 +99,7 @@
 	/* As a last-ditch effort, try to use PATH */
 	execlp("ices", "ices", filename, (char *)NULL);
 	ast_log(LOG_WARNING, "Execute of ices failed\n");
-	return -1;
+	_exit(0);
 }
 
 static int ices_exec(struct ast_channel *chan, void *data)

Modified: team/oej/iaxtrunkfix-1.2/apps/app_macro.c
URL: http://svn.digium.com/view/asterisk/team/oej/iaxtrunkfix-1.2/apps/app_macro.c?view=diff&rev=53955&r1=53954&r2=53955
==============================================================================
--- team/oej/iaxtrunkfix-1.2/apps/app_macro.c (original)
+++ team/oej/iaxtrunkfix-1.2/apps/app_macro.c Sun Feb 11 15:14:50 2007
@@ -107,10 +107,10 @@
 	int oldpriority;
 	char pc[80], depthc[12];
 	char oldcontext[AST_MAX_CONTEXT] = "";
-	char *offsets, *s;
+	char *offsets, *s, *inhangupc;
 	int offset, depth = 0, maxdepth = 7;
 	int setmacrocontext=0;
-	int autoloopflag, dead = 0;
+	int autoloopflag, dead = 0, inhangup = 0;
   
 	char *save_macro_exten;
 	char *save_macro_context;
@@ -137,6 +137,13 @@
 	} else {
 		depth = 0;
 	}
+
+	/* Used for detecting whether to return when a Macro is called from another Macro after hangup */
+	if (strcmp(chan->exten, "h") == 0)
+		pbx_builtin_setvar_helper(chan, "MACRO_IN_HANGUP", "1");
+	inhangupc = pbx_builtin_getvar_helper(chan, "MACRO_IN_HANGUP");
+	if (!ast_strlen_zero(inhangupc))
+		sscanf(inhangupc, "%d", &inhangup);
 
 	if (depth >= maxdepth) {
 		ast_log(LOG_ERROR, "Macro():  possible infinite loop detected.  Returning early.\n");
@@ -252,7 +259,7 @@
 			break;
 		}
 		/* don't stop executing extensions when we're in "h" */
-		if (chan->_softhangup && strcasecmp(oldexten,"h") && strcasecmp(chan->macroexten,"h")) {
+		if (chan->_softhangup && !inhangup) {
 			ast_log(LOG_DEBUG, "Extension %s, macroexten %s, priority %d returned normally even though call was hung up\n",
 				chan->exten, chan->macroexten, chan->priority);
 			goto out;

Modified: team/oej/iaxtrunkfix-1.2/apps/app_meetme.c
URL: http://svn.digium.com/view/asterisk/team/oej/iaxtrunkfix-1.2/apps/app_meetme.c?view=diff&rev=53955&r1=53954&r2=53955
==============================================================================
--- team/oej/iaxtrunkfix-1.2/apps/app_meetme.c (original)
+++ team/oej/iaxtrunkfix-1.2/apps/app_meetme.c Sun Feb 11 15:14:50 2007
@@ -862,6 +862,7 @@
 		ast_verbose(VERBOSE_PREFIX_4 "Starting recording of MeetMe Conference %s into file %s.%s.\n",
 			    conf->confno, conf->recordingfilename, conf->recordingformat);
 		ast_pthread_create(&conf->recordthread, &conf->attr, recordthread, conf);
+		pthread_attr_destroy(&conf->attr);
 	}
 
 	time(&user->jointime);

Modified: team/oej/iaxtrunkfix-1.2/apps/app_mixmonitor.c
URL: http://svn.digium.com/view/asterisk/team/oej/iaxtrunkfix-1.2/apps/app_mixmonitor.c?view=diff&rev=53955&r1=53954&r2=53955
==============================================================================
--- team/oej/iaxtrunkfix-1.2/apps/app_mixmonitor.c (original)
+++ team/oej/iaxtrunkfix-1.2/apps/app_mixmonitor.c Sun Feb 11 15:14:50 2007
@@ -61,7 +61,8 @@
 "Valid options:\n"
 " a      - Append to the file instead of overwriting it.\n"
 " b      - Only save audio to the file while the channel is bridged.\n"
-"          Note: does not include conferences.\n"
+"          Note: Does not include conferences or sounds played to each bridged\n"
+"                party.\n"
 " v(<x>) - Adjust the heard volume by a factor of <x> (range -4 to 4)\n"	
 " V(<x>) - Adjust the spoken volume by a factor of <x> (range -4 to 4)\n"	
 " W(<x>) - Adjust the both heard and spoken volumes by a factor of <x>\n"
@@ -80,7 +81,7 @@
 
 struct mixmonitor {
 	struct ast_channel_spy spy;
-	struct ast_filestream *fs;
+	char *filename;
 	char *post_process;
 	char *name;
 	unsigned int flags;
@@ -133,6 +134,11 @@
 {
 	struct mixmonitor *mixmonitor = obj;
 	struct ast_frame *f = NULL;
+	struct ast_filestream *fs = NULL;
+	unsigned int oflags;
+	char *ext;
+	int errflag = 0;
+	
 	
 	STANDARD_INCREMENT_USECOUNT;
 	
@@ -162,8 +168,27 @@
 			*/
 			for (; f; f = next) {
 				next = f->next;
-				if (write)
-					ast_writestream(mixmonitor->fs, f);
+				if (write && errflag == 0) {
+					if (!fs) {
+						/* Determine creation flags and filename plus extension for filestream */
+						oflags = O_CREAT | O_WRONLY;
+						oflags |= ast_test_flag(mixmonitor, MUXFLAG_APPEND) ? O_APPEND : O_TRUNC;
+
+						if ((ext = strrchr(mixmonitor->filename, '.')))
+							*(ext++) = '\0';
+						else
+							ext = "raw";
+
+						/* Move onto actually creating the filestream */
+						if (!(fs = ast_writefile(mixmonitor->filename, ext, NULL, oflags, 0, 0644))) {
+							ast_log(LOG_ERROR, "Cannot open %s.%s\n", mixmonitor->filename, ext);
+							errflag = 1;
+						}
+
+					}
+					if (fs)
+						ast_writestream(fs, f);
+				}
 				ast_frfree(f);
 			}
 		}
@@ -182,7 +207,8 @@
 		ast_safe_system(mixmonitor->post_process);
 	}
 		
-	ast_closestream(mixmonitor->fs);
+	if (fs)
+		ast_closestream(fs);
 
 	free(mixmonitor);
 
@@ -197,12 +223,10 @@
 	pthread_attr_t attr;
 	pthread_t thread;
 	struct mixmonitor *mixmonitor;
-	char *file_name, *ext;
 	char postprocess2[1024] = "";
-	unsigned int oflags;
 	size_t len;
 
-	len = sizeof(*mixmonitor) + strlen(chan->name) + 1;
+	len = sizeof(*mixmonitor) + strlen(chan->name) + strlen(filename) + 2;
 
 	/* If a post process system command is given attach it to the structure */
 	if (!ast_strlen_zero(post_process)) {
@@ -231,27 +255,12 @@
 	mixmonitor->name = (char *) mixmonitor + sizeof(*mixmonitor);
 	strcpy(mixmonitor->name, chan->name);
 	if (!ast_strlen_zero(postprocess2)) {
-		mixmonitor->post_process = mixmonitor->name + strlen(mixmonitor->name) + 1;
+		mixmonitor->post_process = mixmonitor->name + strlen(mixmonitor->name) + strlen(filename) + 2;
 		strcpy(mixmonitor->post_process, postprocess2);
 	}
 
-	/* Determine creation flags and filename plus extension for filestream */
-	oflags = O_CREAT | O_WRONLY;
-	oflags |= ast_test_flag(mixmonitor, MUXFLAG_APPEND) ? O_APPEND : O_TRUNC;
-	file_name = ast_strdupa(filename);
-	if ((ext = strrchr(file_name, '.'))) {
-		*(ext++) = '\0';
-	} else {
-		ext = "raw";
-	}
-
-	/* Move onto actually creating the filestream */
-	mixmonitor->fs = ast_writefile(file_name, ext, NULL, oflags, 0, 0644);
-	if (!mixmonitor->fs) {
-		ast_log(LOG_ERROR, "Cannot open %s.%s\n", file_name, ext);
-		free(mixmonitor);
-		return;
-	}
+	mixmonitor->filename = (char *) mixmonitor + sizeof(*mixmonitor) + strlen(chan->name) + 1;
+	strcpy(mixmonitor->filename, filename);
 
 	/* Setup the actual spy before creating our thread */
 	ast_set_flag(&mixmonitor->spy, CHANSPY_FORMAT_AUDIO);
@@ -275,7 +284,6 @@
 			mixmonitor->spy.type, chan->name);
 		/* Since we couldn't add ourselves - bail out! */
 		ast_mutex_destroy(&mixmonitor->spy.lock);
-		ast_closestream(mixmonitor->fs);
 		free(mixmonitor);
 		return;
 	}

Modified: team/oej/iaxtrunkfix-1.2/apps/app_mp3.c
URL: http://svn.digium.com/view/asterisk/team/oej/iaxtrunkfix-1.2/apps/app_mp3.c?view=diff&rev=53955&r1=53954&r2=53955
==============================================================================
--- team/oej/iaxtrunkfix-1.2/apps/app_mp3.c (original)
+++ team/oej/iaxtrunkfix-1.2/apps/app_mp3.c Sun Feb 11 15:14:50 2007
@@ -67,15 +67,25 @@
 {
 	int res;
 	int x;
+	sigset_t fullset, oldset;
+
+	sigfillset(&fullset);
+	pthread_sigmask(SIG_BLOCK, &fullset, &oldset);
+
 	res = fork();
 	if (res < 0) 
 		ast_log(LOG_WARNING, "Fork failed\n");
-	if (res)
+	if (res) {
+		pthread_sigmask(SIG_SETMASK, &oldset, NULL);
 		return res;
+	}
 	if (option_highpriority)
 		ast_set_priority(0);
+	signal(SIGPIPE, SIG_DFL);
+	pthread_sigmask(SIG_UNBLOCK, &fullset, NULL);
+
 	dup2(fd, STDOUT_FILENO);
-	for (x=0;x<256;x++) {
+	for (x=STDERR_FILENO + 1;x<256;x++) {
 		if (x != STDOUT_FILENO)
 			close(x);
 	}
@@ -97,7 +107,7 @@
 	    execlp("mpg123", "mpg123", "-q", "-s", "-f", "8192", "--mono", "-r", "8000", filename, (char *)NULL);
 	}
 	ast_log(LOG_WARNING, "Execute of mpg123 failed\n");
-	return -1;
+	_exit(0);
 }
 
 static int timed_read(int fd, void *data, int datalen, int timeout)

Modified: team/oej/iaxtrunkfix-1.2/apps/app_nbscat.c
URL: http://svn.digium.com/view/asterisk/team/oej/iaxtrunkfix-1.2/apps/app_nbscat.c?view=diff&rev=53955&r1=53954&r2=53955
==============================================================================
--- team/oej/iaxtrunkfix-1.2/apps/app_nbscat.c (original)
+++ team/oej/iaxtrunkfix-1.2/apps/app_nbscat.c Sun Feb 11 15:14:50 2007
@@ -71,16 +71,26 @@
 {
 	int res;
 	int x;
+	sigset_t fullset, oldset;
+
+	sigfillset(&fullset);
+	pthread_sigmask(SIG_BLOCK, &fullset, &oldset);
+
 	res = fork();
 	if (res < 0) 
 		ast_log(LOG_WARNING, "Fork failed\n");
-	if (res)
+	if (res) {
+		pthread_sigmask(SIG_SETMASK, &oldset, NULL);
 		return res;
+	}
+	signal(SIGPIPE, SIG_DFL);
+	pthread_sigmask(SIG_UNBLOCK, &fullset, NULL);
+
 	if (option_highpriority)
 		ast_set_priority(0);
 
 	dup2(fd, STDOUT_FILENO);
-	for (x=0;x<256;x++) {
+	for (x = STDERR_FILENO + 1; x < 1024; x++) {
 		if (x != STDOUT_FILENO)
 			close(x);
 	}
@@ -88,7 +98,7 @@
 	execl(NBSCAT, "nbscat8k", "-d", (char *)NULL);
 	execl(LOCAL_NBSCAT, "nbscat8k", "-d", (char *)NULL);
 	ast_log(LOG_WARNING, "Execute of nbscat8k failed\n");
-	return -1;
+	_exit(0);
 }
 
 static int timed_read(int fd, void *data, int datalen)

Modified: team/oej/iaxtrunkfix-1.2/apps/app_page.c
URL: http://svn.digium.com/view/asterisk/team/oej/iaxtrunkfix-1.2/apps/app_page.c?view=diff&rev=53955&r1=53954&r2=53955
==============================================================================
--- team/oej/iaxtrunkfix-1.2/apps/app_page.c (original)
+++ team/oej/iaxtrunkfix-1.2/apps/app_page.c Sun Feb 11 15:14:50 2007
@@ -135,6 +135,7 @@
 			ast_log(LOG_WARNING, "Unable to create paging thread: %s\n", strerror(errno));
 			free(cd);
 		}
+		pthread_attr_destroy(&attr);
 	}
 }
 

Modified: team/oej/iaxtrunkfix-1.2/apps/app_queue.c
URL: http://svn.digium.com/view/asterisk/team/oej/iaxtrunkfix-1.2/apps/app_queue.c?view=diff&rev=53955&r1=53954&r2=53955
==============================================================================
--- team/oej/iaxtrunkfix-1.2/apps/app_queue.c (original)
+++ team/oej/iaxtrunkfix-1.2/apps/app_queue.c Sun Feb 11 15:14:50 2007
@@ -562,6 +562,7 @@
 		ast_log(LOG_WARNING, "Failed to create update thread!\n");
 		free(sc);
 	}
+	pthread_attr_destroy(&attr);
 
 	return 0;
 }
@@ -2420,8 +2421,8 @@
 		if (strcasecmp(oldcontext, qe->chan->context) || strcasecmp(oldexten, qe->chan->exten)) {
 			ast_queue_log(queuename, qe->chan->uniqueid, peer->name, "TRANSFER", "%s|%s", qe->chan->exten, qe->chan->context);
 		} else if (qe->chan->_softhangup) {
-			ast_queue_log(queuename, qe->chan->uniqueid, peer->name, "COMPLETECALLER", "%ld|%ld",
-				      (long)(callstart - qe->start), (long)(time(NULL) - callstart));
+			ast_queue_log(queuename, qe->chan->uniqueid, peer->name, "COMPLETECALLER", "%ld|%ld|%d",
+				      (long)(callstart - qe->start), (long)(time(NULL) - callstart), qe->opos);
 			if (qe->parent->eventwhencalled)
 				manager_event(EVENT_FLAG_AGENT, "AgentComplete",
 					      "Queue: %s\r\n"
@@ -2434,7 +2435,7 @@
 					      queuename, qe->chan->uniqueid, peer->name, member->interface,
 					      (long)(callstart - qe->start), (long)(time(NULL) - callstart));
 		} else {
-			ast_queue_log(queuename, qe->chan->uniqueid, peer->name, "COMPLETEAGENT", "%ld|%ld", (long)(callstart - qe->start), (long)(time(NULL) - callstart));
+			ast_queue_log(queuename, qe->chan->uniqueid, peer->name, "COMPLETEAGENT", "%ld|%ld|%d", (long)(callstart - qe->start), (long)(time(NULL) - callstart), qe->opos);
 			if (qe->parent->eventwhencalled)
 				manager_event(EVENT_FLAG_AGENT, "AgentComplete",
 					      "Queue: %s\r\n"

Modified: team/oej/iaxtrunkfix-1.2/apps/app_rpt.c
URL: http://svn.digium.com/view/asterisk/team/oej/iaxtrunkfix-1.2/apps/app_rpt.c?view=diff&rev=53955&r1=53954&r2=53955
==============================================================================
--- team/oej/iaxtrunkfix-1.2/apps/app_rpt.c (original)
+++ team/oej/iaxtrunkfix-1.2/apps/app_rpt.c Sun Feb 11 15:14:50 2007
@@ -1521,6 +1521,7 @@
         pthread_attr_init(&attr);
         pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_DETACHED);
 	ast_pthread_create(&tele->threadid,&attr,rpt_tele_thread,(void *) tele);
+	pthread_attr_destroy(&attr);
 	return;
 }
 
@@ -2153,6 +2154,7 @@
 	pthread_attr_init(&attr);
 	pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_DETACHED);
 	ast_pthread_create(&myrpt->rpt_call_thread,&attr,rpt_call,(void *) myrpt);
+	pthread_attr_destroy(&attr);
 	return DC_COMPLETE;
 }
 
@@ -5239,6 +5241,7 @@
 					        pthread_attr_init(&attr);
 			 		        pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_DETACHED);
 						ast_pthread_create(&myrpt->rpt_call_thread,&attr,rpt_call,(void *)myrpt);
+						pthread_attr_destroy(&attr);
 						continue;
 					}
 				}
@@ -5781,6 +5784,7 @@
 	        pthread_attr_init(&attr);
 	        pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_DETACHED);
 		ast_pthread_create(&rpt_vars[i].rpt_thread,&attr,rpt,(void *) &rpt_vars[i]);
+		pthread_attr_destroy(&attr);
 	}
 	usleep(500000);
 	for(;;)
@@ -5816,6 +5820,7 @@
 			        pthread_attr_init(&attr);
 	 		        pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_DETACHED);
 				ast_pthread_create(&rpt_vars[i].rpt_thread,&attr,rpt,(void *) &rpt_vars[i]);
+				pthread_attr_destroy(&attr);
 				ast_log(LOG_WARNING, "rpt_thread restarted on node %s\n", rpt_vars[i].name);
 			}
 

Modified: team/oej/iaxtrunkfix-1.2/apps/app_sms.c
URL: http://svn.digium.com/view/asterisk/team/oej/iaxtrunkfix-1.2/apps/app_sms.c?view=diff&rev=53955&r1=53954&r2=53955
==============================================================================
--- team/oej/iaxtrunkfix-1.2/apps/app_sms.c (original)
+++ team/oej/iaxtrunkfix-1.2/apps/app_sms.c Sun Feb 11 15:14:50 2007
@@ -1050,7 +1050,7 @@
 		unsigned char p = 2;
 		h->omsg[0] = 0x91;		  /* SMS_DATA */
 		if (h->smsc) {			 /* deliver */
-			h->omsg[p++] = (more ? 4 : 0);
+			h->omsg[p++] = (more ? 4 : 0) + ((h->udhl > 0) ? 0x40 : 0);
 			p += packaddress (h->omsg + p, h->oa);
 			h->omsg[p++] = h->pid;
 			h->omsg[p++] = h->dcs;

Modified: team/oej/iaxtrunkfix-1.2/apps/app_voicemail.c
URL: http://svn.digium.com/view/asterisk/team/oej/iaxtrunkfix-1.2/apps/app_voicemail.c?view=diff&rev=53955&r1=53954&r2=53955
==============================================================================
--- team/oej/iaxtrunkfix-1.2/apps/app_voicemail.c (original)
+++ team/oej/iaxtrunkfix-1.2/apps/app_voicemail.c Sun Feb 11 15:14:50 2007
@@ -77,6 +77,7 @@
 #define COMMAND_TIMEOUT 5000
 #define	VOICEMAIL_DIR_MODE	0700
 #define	VOICEMAIL_FILE_MODE	0600
+#define	CHUNKSIZE	65536
 
 #define VOICEMAIL_CONFIG "voicemail.conf"
 #define ASTERISK_USERNAME "asterisk"
@@ -242,10 +243,10 @@
 struct vm_state {
 	char curbox[80];
 	char username[80];
-	char curdir[256];
-	char vmbox[256];
-	char fn[256];
-	char fn2[256];
+	char curdir[PATH_MAX];
+	char vmbox[PATH_MAX];
+	char fn[PATH_MAX];
+	char fn2[PATH_MAX];
 	int *deleted;
 	int *heard;
 	int curmsg;
@@ -638,7 +639,7 @@
 	int linenum=0;
 	char inbuf[256];
 	char orig[256];
-	char currcontext[256] ="";
+	char currcontext[256] = "";
 	char tmpin[AST_CONFIG_MAX_PATH];
 	char tmpout[AST_CONFIG_MAX_PATH];
 	struct stat statbuf;
@@ -838,7 +839,7 @@
 	void *fdm=NULL;
 	SQLSMALLINT colcount=0;
 	SQLHSTMT stmt;
-	char sql[256];
+	char sql[PATH_MAX];
 	char fmt[80]="";
 	char *c;
 	char coltitle[256];
@@ -849,8 +850,8 @@
 	SQLULEN colsize;
 	FILE *f=NULL;
 	char rowdata[80];
-	char fn[256];
-	char full_fn[256];
+	char fn[PATH_MAX];
+	char full_fn[PATH_MAX];
 	char msgnums[80];
 	
 	odbc_obj *obj;
@@ -868,7 +869,12 @@
 		else
 			ast_copy_string(fn, dir, sizeof(fn));
 		snprintf(full_fn, sizeof(full_fn), "%s.txt", fn);
-		f = fopen(full_fn, "w+");
+		
+		if (!(f = fopen(full_fn, "w+"))) {
+		        ast_log(LOG_WARNING, "Failed to open/create '%s'\n", full_fn);
+		        goto yuck;
+		}
+		
 		snprintf(full_fn, sizeof(full_fn), "%s.%s", fn, fmt);
 		res = SQLAllocHandle(SQL_HANDLE_STMT, obj->con, &stmt);
 		if ((res != SQL_SUCCESS) && (res != SQL_SUCCESS_WITH_INFO)) {
@@ -925,7 +931,8 @@
 				goto yuck;
 			}
 			if (!strcasecmp(coltitle, "recording")) {
-				res = SQLGetData(stmt, x + 1, SQL_BINARY, NULL, 0, &colsize);
+				off_t offset;
+				res = SQLGetData(stmt, x + 1, SQL_BINARY, rowdata, 0, &colsize);
 				fdlen = colsize;
 				if (fd > -1) {
 					char tmp[1]="";
@@ -935,17 +942,24 @@
 						fd = -1;

[... 7095 lines stripped ...]


More information about the svn-commits mailing list