[svn-commits] russell: branch russell/events r75305 - in /team/russell/events: ./ apps/ fun...

SVN commits to the Digium repositories svn-commits at lists.digium.com
Mon Jul 16 15:50:48 CDT 2007


Author: russell
Date: Mon Jul 16 15:50:46 2007
New Revision: 75305

URL: http://svn.digium.com/view/asterisk?view=rev&rev=75305
Log:
resolve conflict, enable automerge

Modified:
    team/russell/events/   (props changed)
    team/russell/events/apps/app_adsiprog.c
    team/russell/events/apps/app_alarmreceiver.c
    team/russell/events/apps/app_amd.c
    team/russell/events/apps/app_authenticate.c
    team/russell/events/apps/app_cdr.c
    team/russell/events/apps/app_chanisavail.c
    team/russell/events/apps/app_channelredirect.c
    team/russell/events/apps/app_chanspy.c
    team/russell/events/apps/app_controlplayback.c
    team/russell/events/apps/app_db.c
    team/russell/events/apps/app_dial.c
    team/russell/events/apps/app_dictate.c
    team/russell/events/apps/app_directed_pickup.c
    team/russell/events/apps/app_directory.c
    team/russell/events/apps/app_disa.c
    team/russell/events/apps/app_dumpchan.c
    team/russell/events/apps/app_echo.c
    team/russell/events/apps/app_exec.c
    team/russell/events/apps/app_externalivr.c
    team/russell/events/apps/app_festival.c
    team/russell/events/apps/app_flash.c
    team/russell/events/apps/app_followme.c
    team/russell/events/apps/app_forkcdr.c
    team/russell/events/apps/app_getcpeid.c
    team/russell/events/apps/app_ices.c
    team/russell/events/apps/app_image.c
    team/russell/events/apps/app_ivrdemo.c
    team/russell/events/apps/app_macro.c
    team/russell/events/apps/app_meetme.c
    team/russell/events/apps/app_milliwatt.c
    team/russell/events/apps/app_minivm.c
    team/russell/events/apps/app_mixmonitor.c
    team/russell/events/apps/app_morsecode.c
    team/russell/events/apps/app_mp3.c
    team/russell/events/apps/app_nbscat.c
    team/russell/events/apps/app_osplookup.c
    team/russell/events/apps/app_page.c
    team/russell/events/apps/app_parkandannounce.c
    team/russell/events/apps/app_playback.c
    team/russell/events/apps/app_privacy.c
    team/russell/events/apps/app_queue.c
    team/russell/events/apps/app_read.c
    team/russell/events/apps/app_readfile.c
    team/russell/events/apps/app_record.c
    team/russell/events/apps/app_rpt.c
    team/russell/events/apps/app_sayunixtime.c
    team/russell/events/apps/app_senddtmf.c
    team/russell/events/apps/app_sendtext.c
    team/russell/events/apps/app_setcallerid.c
    team/russell/events/apps/app_skel.c
    team/russell/events/apps/app_sms.c
    team/russell/events/apps/app_softhangup.c
    team/russell/events/apps/app_speech_utils.c
    team/russell/events/apps/app_stack.c
    team/russell/events/apps/app_system.c
    team/russell/events/apps/app_talkdetect.c
    team/russell/events/apps/app_test.c
    team/russell/events/apps/app_transfer.c
    team/russell/events/apps/app_url.c
    team/russell/events/apps/app_userevent.c
    team/russell/events/apps/app_verbose.c
    team/russell/events/apps/app_voicemail.c
    team/russell/events/apps/app_waitforring.c
    team/russell/events/apps/app_waitforsilence.c
    team/russell/events/apps/app_while.c
    team/russell/events/apps/app_zapateller.c
    team/russell/events/apps/app_zapbarge.c
    team/russell/events/apps/app_zapras.c
    team/russell/events/apps/app_zapscan.c
    team/russell/events/configure
    team/russell/events/configure.ac
    team/russell/events/funcs/func_blacklist.c
    team/russell/events/funcs/func_curl.c
    team/russell/events/funcs/func_cut.c
    team/russell/events/funcs/func_enum.c
    team/russell/events/funcs/func_iconv.c
    team/russell/events/funcs/func_rand.c
    team/russell/events/funcs/func_realtime.c
    team/russell/events/funcs/func_version.c
    team/russell/events/funcs/func_vmcount.c
    team/russell/events/include/asterisk/abstract_jb.h
    team/russell/events/include/asterisk/adsi.h
    team/russell/events/include/asterisk/autoconfig.h.in
    team/russell/events/include/asterisk/cdr.h
    team/russell/events/include/asterisk/channel.h
    team/russell/events/include/asterisk/cli.h
    team/russell/events/include/asterisk/config.h
    team/russell/events/include/asterisk/crypto.h
    team/russell/events/include/asterisk/devicestate.h
    team/russell/events/include/asterisk/doxyref.h
    team/russell/events/include/asterisk/dundi.h
    team/russell/events/include/asterisk/enum.h
    team/russell/events/include/asterisk/file.h
    team/russell/events/include/asterisk/frame.h
    team/russell/events/include/asterisk/image.h
    team/russell/events/include/asterisk/io.h
    team/russell/events/include/asterisk/jabber.h
    team/russell/events/include/asterisk/linkedlists.h
    team/russell/events/include/asterisk/manager.h
    team/russell/events/include/asterisk/module.h
    team/russell/events/include/asterisk/musiconhold.h
    team/russell/events/include/asterisk/pbx.h
    team/russell/events/include/asterisk/res_odbc.h
    team/russell/events/include/asterisk/say.h
    team/russell/events/include/asterisk/strings.h
    team/russell/events/include/asterisk/tdd.h
    team/russell/events/include/asterisk/translate.h
    team/russell/events/main/pbx.c
    team/russell/events/res/res_agi.c
    team/russell/events/res/res_config_odbc.c
    team/russell/events/res/res_config_pgsql.c
    team/russell/events/res/res_features.c
    team/russell/events/res/res_realtime.c

Propchange: team/russell/events/
------------------------------------------------------------------------------
    automerge = *

Propchange: team/russell/events/
------------------------------------------------------------------------------
Binary property 'branch-1.4-merged' - no diff available.

Propchange: team/russell/events/
------------------------------------------------------------------------------
--- svnmerge-integrated (original)
+++ svnmerge-integrated Mon Jul 16 15:50:46 2007
@@ -1,1 +1,1 @@
-/trunk:1-75152
+/trunk:1-75304

Modified: team/russell/events/apps/app_adsiprog.c
URL: http://svn.digium.com/view/asterisk/team/russell/events/apps/app_adsiprog.c?view=diff&rev=75305&r1=75304&r2=75305
==============================================================================
--- team/russell/events/apps/app_adsiprog.c (original)
+++ team/russell/events/apps/app_adsiprog.c Mon Jul 16 15:50:46 2007
@@ -1548,10 +1548,7 @@
 
 static int adsi_exec(struct ast_channel *chan, void *data)
 {
-	int res=0;
-	struct ast_module_user *u;
-
-	u = ast_module_user_add(chan);
+	int res = 0;
 	
 	if (ast_strlen_zero(data))
 		data = "asterisk.adsi";
@@ -1564,22 +1561,13 @@
 			ast_verbose(VERBOSE_PREFIX_3 "ADSI Available on CPE.  Attempting Upload.\n");
 		res = adsi_prog(chan, data);
 	}
-
-	ast_module_user_remove(u);
 	
 	return res;
 }
 
 static int unload_module(void)
 {
-	int res;
-
-	ast_module_user_hangup_all();
-
-	res = ast_unregister_application(app);	
-	
-
-	return res;
+	return ast_unregister_application(app);
 }
 
 static int load_module(void)

Modified: team/russell/events/apps/app_alarmreceiver.c
URL: http://svn.digium.com/view/asterisk/team/russell/events/apps/app_alarmreceiver.c?view=diff&rev=75305&r1=75304&r2=75305
==============================================================================
--- team/russell/events/apps/app_alarmreceiver.c (original)
+++ team/russell/events/apps/app_alarmreceiver.c Mon Jul 16 15:50:46 2007
@@ -628,14 +628,11 @@
 static int alarmreceiver_exec(struct ast_channel *chan, void *data)
 {
 	int res = 0;
-	struct ast_module_user *u;
 	event_node_t *elp, *efree;
 	char signalling_type[64] = "";
 
 	event_node_t *event_head = NULL;
 
-	u = ast_module_user_add(chan);
-
 	/* Set write and read formats to ULAW */
 
 	if(option_verbose >= 4)
@@ -643,13 +640,11 @@
 
 	if (ast_set_write_format(chan,AST_FORMAT_ULAW)){
 		ast_log(LOG_WARNING, "AlarmReceiver: Unable to set write format to Mu-law on %s\n",chan->name);
-		ast_module_user_remove(u);
 		return -1;
 	}
 	
 	if (ast_set_read_format(chan,AST_FORMAT_ULAW)){
 		ast_log(LOG_WARNING, "AlarmReceiver: Unable to set read format to Mu-law on %s\n",chan->name);
-		ast_module_user_remove(u);
 		return -1;
 	}
 
@@ -664,13 +659,8 @@
 		ast_verbose(VERBOSE_PREFIX_4 "AlarmReceiver: Answering channel\n");
 
 	if (chan->_state != AST_STATE_UP) {
-	
-		res = ast_answer(chan);
-		
-		if (res) {
-			ast_module_user_remove(u);
+		if ((res = ast_answer(chan)))
 			return -1;
-		}
 	}
 
 	/* Wait for the connection to settle post-answer */
@@ -721,9 +711,6 @@
 		elp = elp->next;
 		ast_free(efree);
 	}
-
-
-	ast_module_user_remove(u);
 
 	return 0;
 }
@@ -823,13 +810,7 @@
 
 static int unload_module(void)
 {
-	int res;
-
-	res = ast_unregister_application(app);
-
-	ast_module_user_hangup_all();
-
-	return res;
+	return ast_unregister_application(app);
 }
 
 static int load_module(void)

Modified: team/russell/events/apps/app_amd.c
URL: http://svn.digium.com/view/asterisk/team/russell/events/apps/app_amd.c?view=diff&rev=75305&r1=75304&r2=75305
==============================================================================
--- team/russell/events/apps/app_amd.c (original)
+++ team/russell/events/apps/app_amd.c Mon Jul 16 15:50:46 2007
@@ -318,11 +318,7 @@
 
 static int amd_exec(struct ast_channel *chan, void *data)
 {
-	struct ast_module_user *u = NULL;
-
-	u = ast_module_user_add(chan);
 	isAnsweringMachine(chan, data);
-	ast_module_user_remove(u);
 
 	return 0;
 }
@@ -383,7 +379,6 @@
 
 static int unload_module(void)
 {
-	ast_module_user_hangup_all();
 	return ast_unregister_application(app);
 }
 

Modified: team/russell/events/apps/app_authenticate.c
URL: http://svn.digium.com/view/asterisk/team/russell/events/apps/app_authenticate.c?view=diff&rev=75305&r1=75304&r2=75305
==============================================================================
--- team/russell/events/apps/app_authenticate.c (original)
+++ team/russell/events/apps/app_authenticate.c Mon Jul 16 15:50:46 2007
@@ -90,7 +90,6 @@
 {
 	int res=0;
 	int retries;
-	struct ast_module_user *u;
 	char passwd[256];
 	char *prompt;
 	int maxdigits;
@@ -107,15 +106,10 @@
 		ast_log(LOG_WARNING, "Authenticate requires an argument(password)\n");
 		return -1;
 	}
-	
-	u = ast_module_user_add(chan);
 
 	if (chan->_state != AST_STATE_UP) {
-		res = ast_answer(chan);
-		if (res) {
-			ast_module_user_remove(u);
+		if ((res = ast_answer(chan)))
 			return -1;
-		}
 	}
 	
 	argcopy = ast_strdupa(data);
@@ -217,20 +211,13 @@
 			res = ast_waitstream(chan, "");
 		res = -1;
 	}
-	ast_module_user_remove(u);
+
 	return res;
 }
 
 static int unload_module(void)
 {
-	int res;
-
-	ast_module_user_hangup_all();
-
-	res = ast_unregister_application(app);
-
-	
-	return res;
+	return ast_unregister_application(app);
 }
 
 static int load_module(void)

Modified: team/russell/events/apps/app_cdr.c
URL: http://svn.digium.com/view/asterisk/team/russell/events/apps/app_cdr.c?view=diff&rev=75305&r1=75304&r2=75305
==============================================================================
--- team/russell/events/apps/app_cdr.c (original)
+++ team/russell/events/apps/app_cdr.c Mon Jul 16 15:50:46 2007
@@ -46,28 +46,15 @@
 
 static int nocdr_exec(struct ast_channel *chan, void *data)
 {
-	struct ast_module_user *u;
-	
-	u = ast_module_user_add(chan);
-
-	if (chan->cdr) {
+	if (chan->cdr)
 		ast_set_flag(chan->cdr, AST_CDR_FLAG_POST_DISABLED);
-	}
-
-	ast_module_user_remove(u);
 
 	return 0;
 }
 
 static int unload_module(void)
 {
-	int res;
-
-	res = ast_unregister_application(nocdr_app);
-
-	ast_module_user_hangup_all();
-
-	return res;
+	return ast_unregister_application(nocdr_app);
 }
 
 static int load_module(void)

Modified: team/russell/events/apps/app_chanisavail.c
URL: http://svn.digium.com/view/asterisk/team/russell/events/apps/app_chanisavail.c?view=diff&rev=75305&r1=75304&r2=75305
==============================================================================
--- team/russell/events/apps/app_chanisavail.c (original)
+++ team/russell/events/apps/app_chanisavail.c Mon Jul 16 15:50:46 2007
@@ -69,7 +69,6 @@
 {
 	int res=-1, inuse=-1, option_state=0, string_compare=0;
 	int status;
-	struct ast_module_user *u;
 	char *info, tmp[512], trychan[512], *peers, *tech, *number, *rest, *cur;
 	struct ast_channel *tempchan;
 	AST_DECLARE_APP_ARGS(args,
@@ -81,8 +80,6 @@
 		ast_log(LOG_WARNING, "ChanIsAvail requires an argument (Zap/1&Zap/2)\n");
 		return -1;
 	}
-
-	u = ast_module_user_add(chan);
 
 	info = ast_strdupa(data); 
 
@@ -108,7 +105,6 @@
 			number = strchr(tech, '/');
 			if (!number) {
 				ast_log(LOG_WARNING, "ChanIsAvail argument takes format ([technology]/[device])\n");
-				ast_module_user_remove(u);
 				return -1;
 			}
 			*number = '\0';
@@ -151,19 +147,12 @@
 		pbx_builtin_setvar_helper(chan, "AVAILORIGCHAN", "");
 	}
 
-	ast_module_user_remove(u);
 	return 0;
 }
 
 static int unload_module(void)
 {
-	int res = 0;
-
-	res = ast_unregister_application(app);
-
-	ast_module_user_hangup_all();
-	
-	return res;
+	return ast_unregister_application(app);
 }
 
 static int load_module(void)

Modified: team/russell/events/apps/app_channelredirect.c
URL: http://svn.digium.com/view/asterisk/team/russell/events/apps/app_channelredirect.c?view=diff&rev=75305&r1=75304&r2=75305
==============================================================================
--- team/russell/events/apps/app_channelredirect.c (original)
+++ team/russell/events/apps/app_channelredirect.c Mon Jul 16 15:50:46 2007
@@ -52,7 +52,6 @@
 static int asyncgoto_exec(struct ast_channel *chan, void *data)
 {
 	int res = -1;
-	struct ast_module_user *u;
 	char *info, *context, *exten, *priority;
 	int prio = 1;
 	struct ast_channel *chan2 = NULL;
@@ -66,8 +65,6 @@
 		ast_log(LOG_WARNING, "%s requires an argument (channel|[[context|]exten|]priority)\n", app);
 		return -1;
 	}
-
-	u = ast_module_user_add(chan);
 
 	info = ast_strdupa(data);
 	AST_STANDARD_APP_ARGS(args, info);
@@ -115,20 +112,13 @@
  chanquit:
 	ast_mutex_unlock(&chan2->lock);
  quit:
-	ast_module_user_remove(u);
 
 	return res;
 }
 
 static int unload_module(void)
 {
-	int res;
-
-	res = ast_unregister_application(app);
-
-	ast_module_user_hangup_all();
-
-	return res;	
+	return ast_unregister_application(app);
 }
 
 static int load_module(void)

Modified: team/russell/events/apps/app_chanspy.c
URL: http://svn.digium.com/view/asterisk/team/russell/events/apps/app_chanspy.c?view=diff&rev=75305&r1=75304&r2=75305
==============================================================================
--- team/russell/events/apps/app_chanspy.c (original)
+++ team/russell/events/apps/app_chanspy.c Mon Jul 16 15:50:46 2007
@@ -626,7 +626,6 @@
 
 static int chanspy_exec(struct ast_channel *chan, void *data)
 {
-	struct ast_module_user *u;
 	char *options = NULL;
 	char *spec = NULL;
 	char *argv[2];
@@ -641,8 +640,6 @@
 
 	data = ast_strdupa(data);
 
-	u = ast_module_user_add(chan);
-
 	if ((argc = ast_app_separate_args(data, '|', argv, sizeof(argv) / sizeof(argv[0])))) {
 		spec = argv[0];
 		if (argc > 1)
@@ -680,7 +677,6 @@
 	oldwf = chan->writeformat;
 	if (ast_set_write_format(chan, AST_FORMAT_SLINEAR) < 0) {
 		ast_log(LOG_ERROR, "Could Not Set Write Format.\n");
-		ast_module_user_remove(u);
 		return -1;
 	}
 
@@ -702,14 +698,11 @@
 	if (oldwf && ast_set_write_format(chan, oldwf) < 0)
 		ast_log(LOG_ERROR, "Could Not Set Write Format.\n");
 
-	ast_module_user_remove(u);
-
 	return res;
 }
 
 static int extenspy_exec(struct ast_channel *chan, void *data)
 {
-	struct ast_module_user *u;
 	char *options = NULL;
 	char *exten = NULL;
 	char *context = NULL;
@@ -725,8 +718,6 @@
 
 	data = ast_strdupa(data);
 
-	u = ast_module_user_add(chan);
-
 	if ((argc = ast_app_separate_args(data, '|', argv, sizeof(argv) / sizeof(argv[0])))) {
 		context = argv[0];
 		if (!ast_strlen_zero(argv[0]))
@@ -765,7 +756,6 @@
 	oldwf = chan->writeformat;
 	if (ast_set_write_format(chan, AST_FORMAT_SLINEAR) < 0) {
 		ast_log(LOG_ERROR, "Could Not Set Write Format.\n");
-		ast_module_user_remove(u);
 		return -1;
 	}
 
@@ -787,8 +777,6 @@
 	if (oldwf && ast_set_write_format(chan, oldwf) < 0)
 		ast_log(LOG_ERROR, "Could Not Set Write Format.\n");
 
-	ast_module_user_remove(u);
-
 	return res;
 }
 
@@ -799,8 +787,6 @@
 	res |= ast_unregister_application(app_chan);
 	res |= ast_unregister_application(app_ext);
 
-	ast_module_user_hangup_all();
-
 	return res;
 }
 

Modified: team/russell/events/apps/app_controlplayback.c
URL: http://svn.digium.com/view/asterisk/team/russell/events/apps/app_controlplayback.c?view=diff&rev=75305&r1=75304&r2=75305
==============================================================================
--- team/russell/events/apps/app_controlplayback.c (original)
+++ team/russell/events/apps/app_controlplayback.c Mon Jul 16 15:50:46 2007
@@ -93,7 +93,6 @@
 	int skipms = 0;
 	long offsetms = 0;
 	char offsetbuf[20];
-	struct ast_module_user *u;
 	char *tmp;
 	int argc;
 	char *argv[8] = { NULL, };
@@ -114,8 +113,6 @@
 		ast_log(LOG_WARNING, "ControlPlayback requires an argument (filename)\n");
 		return -1;
 	}
-
-	u = ast_module_user_add(chan);
 	
 	tmp = ast_strdupa(data);
 
@@ -123,7 +120,6 @@
 
 	if (argc < 1) {
 		ast_log(LOG_WARNING, "ControlPlayback requires an argument (filename)\n");
-		ast_module_user_remove(u);
 		return -1;
 	}
 
@@ -165,8 +161,6 @@
 	snprintf(offsetbuf, sizeof(offsetbuf), "%ld", offsetms);
 	pbx_builtin_setvar_helper(chan, "CPLAYBACKOFFSET", offsetbuf);
 
-	ast_module_user_remove(u);
-
 	return res;
 }
 

Modified: team/russell/events/apps/app_db.c
URL: http://svn.digium.com/view/asterisk/team/russell/events/apps/app_db.c?view=diff&rev=75305&r1=75304&r2=75305
==============================================================================
--- team/russell/events/apps/app_db.c (original)
+++ team/russell/events/apps/app_db.c Mon Jul 16 15:50:46 2007
@@ -68,9 +68,6 @@
 static int deltree_exec(struct ast_channel *chan, void *data)
 {
 	char *argv, *family, *keytree;
-	struct ast_module_user *u;
-
-	u = ast_module_user_add(chan);
 
 	argv = ast_strdupa(data);
 
@@ -79,7 +76,6 @@
 		keytree = strsep(&argv, "\0");
 			if (!family || !keytree) {
 				ast_debug(1, "Ignoring; Syntax error in argument\n");
-				ast_module_user_remove(u);
 				return 0;
 			}
 		if (ast_strlen_zero(keytree))
@@ -101,18 +97,13 @@
 			ast_verbose(VERBOSE_PREFIX_3 "DBdeltree: Error deleting key from database.\n");
 	}
 
-	ast_module_user_remove(u);
-
 	return 0;
 }
 
 static int del_exec(struct ast_channel *chan, void *data)
 {
 	char *argv, *family, *key;
-	struct ast_module_user *u;
 	static int deprecation_warning = 0;
-
-	u = ast_module_user_add(chan);
 
 	if (!deprecation_warning) {
 		deprecation_warning = 1;
@@ -126,7 +117,6 @@
 		key = strsep(&argv, "\0");
 		if (!family || !key) {
 			ast_debug(1, "Ignoring; Syntax error in argument\n");
-			ast_module_user_remove(u);
 			return 0;
 		}
 		if (option_verbose > 2)
@@ -138,8 +128,6 @@
 	} else {
 		ast_debug(1, "Ignoring, no parameters\n");
 	}
-
-	ast_module_user_remove(u);
 	
 	return 0;
 }

Modified: team/russell/events/apps/app_dial.c
URL: http://svn.digium.com/view/asterisk/team/russell/events/apps/app_dial.c?view=diff&rev=75305&r1=75304&r2=75305
==============================================================================
--- team/russell/events/apps/app_dial.c (original)
+++ team/russell/events/apps/app_dial.c Mon Jul 16 15:50:46 2007
@@ -1195,7 +1195,6 @@
 static int dial_exec_full(struct ast_channel *chan, void *data, struct ast_flags *peerflags, int *continue_exec)
 {
 	int res = -1;	/* default: error */
-	struct ast_module_user *u;
 	char *rest, *cur;	/* scan the list of destinations */
 	struct chanlist *outgoing = NULL;	/* list of destinations */
 	struct ast_channel *peer;
@@ -1233,8 +1232,6 @@
 		pbx_builtin_setvar_helper(chan, "DIALSTATUS", pa.status);
 		return -1;
 	}
-
-	u = ast_module_user_add(chan);	/* XXX is this the right place ? */
 
 	parse = ast_strdupa(data);
 	
@@ -1820,7 +1817,6 @@
 	}
 
 done:
-	ast_module_user_remove(u);    	/* XXX probably not the right place for this. */
 	return res;
 }
 
@@ -1838,15 +1834,12 @@
 	char *announce = NULL, *dialdata = NULL;
 	const char *context = NULL;
 	int sleep = 0, loops = 0, res = -1;
-	struct ast_module_user *u;
 	struct ast_flags peerflags;
 	
 	if (ast_strlen_zero(data)) {
 		ast_log(LOG_WARNING, "RetryDial requires an argument!\n");
 		return -1;
 	}	
-
-	u = ast_module_user_add(chan);
 
 	announce = ast_strdupa(data);
 
@@ -1895,22 +1888,33 @@
 		res = dial_exec_full(chan, dialdata, &peerflags, &continue_exec);
 		if (continue_exec)
 			break;
+
 		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);
+				if (!ast_strlen_zero(announce)) {
+					if (ast_fileexists(announce, NULL, chan->language)) {
+						if(!(res = ast_streamfile(chan, announce, chan->language)))								
+							ast_waitstream(chan, AST_DIGIT_ANY);
+					} else
+						ast_log(LOG_WARNING, "Announce file \"%s\" specified in Retrydial does not exist\n", announce);
+				}
 				if (!res && sleep) {
 					if (!ast_test_flag(chan, AST_FLAG_MOH))
 						ast_moh_start(chan, NULL, NULL);
 					res = ast_waitfordigit(chan, sleep);
 				}
 			} else {
-				if (!(res = ast_streamfile(chan, announce, chan->language)))
-					res = ast_waitstream(chan, "");
+				if (!ast_strlen_zero(announce)) {
+					if (ast_fileexists(announce, NULL, chan->language)) {
+						if (!(res = ast_streamfile(chan, announce, chan->language)))
+							res = ast_waitstream(chan, "");
+					} else
+						ast_log(LOG_WARNING, "Announce file \"%s\" specified in Retrydial does not exist\n", announce);
+				}
 				if (sleep) {
 					if (!ast_test_flag(chan, AST_FLAG_MOH))
 						ast_moh_start(chan, NULL, NULL);
-					if (!res) 
+					if (!res)
 						res = ast_waitfordigit(chan, sleep);
 				}
 			}
@@ -1934,7 +1938,6 @@
 	if (ast_test_flag(chan, AST_FLAG_MOH))
 		ast_moh_stop(chan);
  done:
-	ast_module_user_remove(u);
 	return res;
 }
 
@@ -1946,11 +1949,8 @@
 	res = ast_unregister_application(app);
 	res |= ast_unregister_application(rapp);
 
-	ast_module_user_hangup_all();
-
-	if ((con = ast_context_find("app_dial_gosub_virtual_context"))) {
+	if ((con = ast_context_find("app_dial_gosub_virtual_context")))
 		ast_context_remove_extension2(con, "s", 1, NULL);
-	}
 
 	return res;
 }

Modified: team/russell/events/apps/app_dictate.c
URL: http://svn.digium.com/view/asterisk/team/russell/events/apps/app_dictate.c?view=diff&rev=75305&r1=75304&r2=75305
==============================================================================
--- team/russell/events/apps/app_dictate.c (original)
+++ team/russell/events/apps/app_dictate.c Mon Jul 16 15:50:46 2007
@@ -89,7 +89,6 @@
 	struct ast_flags flags = {0};
 	struct ast_filestream *fs;
 	struct ast_frame *f = NULL;
-	struct ast_module_user *u;
 	int ffactor = 320 * 80,
 		res = 0,
 		done = 0,
@@ -101,8 +100,6 @@
 		len = 0,
 		maxlen = 0,
 		mode = 0;
-		
-	u = ast_module_user_add(chan);
 	
 	snprintf(dftbase, sizeof(dftbase), "%s/dictate", ast_config_AST_SPOOL_DIR);
 	if (!ast_strlen_zero(data)) {
@@ -122,7 +119,6 @@
 	oldr = chan->readformat;
 	if ((res = ast_set_read_format(chan, AST_FORMAT_SLINEAR)) < 0) {
 		ast_log(LOG_WARNING, "Unable to set to linear mode.\n");
-		ast_module_user_remove(u);
 		return -1;
 	}
 
@@ -330,7 +326,6 @@
 	if (oldr) {
 		ast_set_read_format(chan, oldr);
 	}
-	ast_module_user_remove(u);
 	return 0;
 }
 

Modified: team/russell/events/apps/app_directed_pickup.c
URL: http://svn.digium.com/view/asterisk/team/russell/events/apps/app_directed_pickup.c?view=diff&rev=75305&r1=75304&r2=75305
==============================================================================
--- team/russell/events/apps/app_directed_pickup.c (original)
+++ team/russell/events/apps/app_directed_pickup.c Mon Jul 16 15:50:46 2007
@@ -133,7 +133,6 @@
 static int pickup_exec(struct ast_channel *chan, void *data)
 {
 	int res = 0;
-	struct ast_module_user *u = NULL;
 	char *tmp = ast_strdupa(data);
 	char *exten = NULL, *context = NULL;
 
@@ -141,8 +140,6 @@
 		ast_log(LOG_WARNING, "Pickup requires an argument (extension)!\n");
 		return -1;	
 	}
-
-	u = ast_module_user_add(chan);
 	
 	/* Parse extension (and context if there) */
 	while (!ast_strlen_zero(tmp) && (exten = strsep(&tmp, "&"))) {
@@ -157,8 +154,6 @@
 		}
 		ast_log(LOG_NOTICE, "No target channel found for %s.\n", exten);
 	}
-
-	ast_module_user_remove(u);
 
 	return res;
 }

Modified: team/russell/events/apps/app_directory.c
URL: http://svn.digium.com/view/asterisk/team/russell/events/apps/app_directory.c?view=diff&rev=75305&r1=75304&r2=75305
==============================================================================
--- team/russell/events/apps/app_directory.c (original)
+++ team/russell/events/apps/app_directory.c Mon Jul 16 15:50:46 2007
@@ -566,7 +566,6 @@
 static int directory_exec(struct ast_channel *chan, void *data)
 {
 	int res = 0;
-	struct ast_module_user *u;
 	struct ast_config *cfg, *ucfg;
 	int last = 1;
 	int readext = 0;
@@ -584,8 +583,6 @@
 		return -1;
 	}
 
-	u = ast_module_user_add(chan);
-
 	parse = ast_strdupa(data);
 
 	AST_STANDARD_APP_ARGS(args, parse);
@@ -605,7 +602,6 @@
 	cfg = realtime_directory(args.vmcontext);
 	if (!cfg) {
 		ast_log(LOG_ERROR, "Unable to read the configuration data!\n");
-		ast_module_user_remove(u);
 		return -1;
 	}
 	
@@ -640,7 +636,6 @@
 	if (ucfg)
 		ast_config_destroy(ucfg);
 	ast_config_destroy(cfg);
-	ast_module_user_remove(u);
 	return res;
 }
 

Modified: team/russell/events/apps/app_disa.c
URL: http://svn.digium.com/view/asterisk/team/russell/events/apps/app_disa.c?view=diff&rev=75305&r1=75304&r2=75305
==============================================================================
--- team/russell/events/apps/app_disa.c (original)
+++ team/russell/events/apps/app_disa.c Mon Jul 16 15:50:46 2007
@@ -123,7 +123,6 @@
 	int i,j,k,x,did_ignore,special_noanswer;
 	int firstdigittimeout = 20000;
 	int digittimeout = 10000;
-	struct ast_module_user *u;
 	struct ast_flags flags;
 	char *tmp, exten[AST_MAX_EXTENSION],acctcode[20]="";
 	char pwline[256];
@@ -145,8 +144,6 @@
 		ast_log(LOG_WARNING, "DISA requires an argument (passcode/passcode file)\n");
 		return -1;
 	}
-
-	u = ast_module_user_add(chan);
 	
 	if (chan->pbx) {
 		firstdigittimeout = chan->pbx->rtimeout*1000;
@@ -155,12 +152,10 @@
 	
 	if (ast_set_write_format(chan,AST_FORMAT_ULAW)) {
 		ast_log(LOG_WARNING, "Unable to set write format to Mu-law on %s\n", chan->name);
-		ast_module_user_remove(u);
 		return -1;
 	}
 	if (ast_set_read_format(chan,AST_FORMAT_ULAW)) {
 		ast_log(LOG_WARNING, "Unable to set read format to Mu-law on %s\n", chan->name);
-		ast_module_user_remove(u);
 		return -1;
 	}
 	
@@ -218,13 +213,11 @@
 			
 		f = ast_read(chan);
 		if (f == NULL) {
-			ast_module_user_remove(u);
 			return -1;
 		}
 		if ((f->frametype == AST_FRAME_CONTROL) &&
 		    (f->subclass == AST_CONTROL_HANGUP)) {
 			ast_frfree(f);
-			ast_module_user_remove(u);
 			return -1;
 		}
 		if (f->frametype == AST_FRAME_VOICE) {
@@ -254,7 +247,6 @@
 						fp = fopen(args.passcode,"r");
 						if (!fp) {
 							ast_log(LOG_WARNING,"DISA password file %s not found on chan %s\n",args.passcode,chan->name);
-							ast_module_user_remove(u);
 							return -1;
 						}
 						pwline[0] = 0;
@@ -361,7 +353,6 @@
 			if (special_noanswer) flags.flags = 0;
 			ast_cdr_reset(chan->cdr, &flags);
 			ast_explicit_goto(chan, args.context, exten, 1);
-			ast_module_user_remove(u);
 			return 0;
 		}
 	}
@@ -382,19 +373,12 @@
 		ast_frfree(f);
 	}
 	ast_playtones_stop(chan);
-	ast_module_user_remove(u);
 	return -1;
 }
 
 static int unload_module(void)
 {
-	int res;
-
-	res = ast_unregister_application(app);
-
-	ast_module_user_hangup_all();
-
-	return res;
+	return ast_unregister_application(app);
 }
 
 static int load_module(void)

Modified: team/russell/events/apps/app_dumpchan.c
URL: http://svn.digium.com/view/asterisk/team/russell/events/apps/app_dumpchan.c?view=diff&rev=75305&r1=75304&r2=75305
==============================================================================
--- team/russell/events/apps/app_dumpchan.c (original)
+++ team/russell/events/apps/app_dumpchan.c Mon Jul 16 15:50:46 2007
@@ -142,14 +142,11 @@
 
 static int dumpchan_exec(struct ast_channel *chan, void *data)
 {
-	struct ast_module_user *u;
 	struct ast_str *vars = ast_str_alloca(BUFSIZ * 4); /* XXX very large! */
 	char info[1024];
 	int level = 0;
 	static char *line = "================================================================================";
 	
-	u = ast_module_user_add(chan);
-
 	if (!ast_strlen_zero(data)) 
 		level = atoi(data);
 
@@ -157,21 +154,13 @@
 	serialize_showchan(chan, info, sizeof(info));
 	if (option_verbose >= level)
 		ast_verbose("\nDumping Info For Channel: %s:\n%s\nInfo:\n%s\nVariables:\n%s%s\n", chan->name, line, info, vars->str, line);
-
-	ast_module_user_remove(u);
 	
 	return 0;
 }
 
 static int unload_module(void)
 {
-	int res;
-
-	res = ast_unregister_application(app);
-
-	ast_module_user_hangup_all();
-
-	return res;
+	return ast_unregister_application(app);
 }
 
 static int load_module(void)

Modified: team/russell/events/apps/app_echo.c
URL: http://svn.digium.com/view/asterisk/team/russell/events/apps/app_echo.c?view=diff&rev=75305&r1=75304&r2=75305
==============================================================================
--- team/russell/events/apps/app_echo.c (original)
+++ team/russell/events/apps/app_echo.c Mon Jul 16 15:50:46 2007
@@ -55,9 +55,6 @@
 {
 	int res = -1;
 	int format;
-	struct ast_module_user *u;
-
-	u = ast_module_user_add(chan);
 
 	format = ast_best_codec(chan->nativeformats);
 	ast_set_write_format(chan, format);
@@ -81,19 +78,12 @@
 		ast_frfree(f);
 	}
 end:
-	ast_module_user_remove(u);
 	return res;
 }
 
 static int unload_module(void)
 {
-	int res;
-
-	res = ast_unregister_application(app);
-
-	ast_module_user_hangup_all();
-
-	return res;
+	return ast_unregister_application(app);
 }
 
 static int load_module(void)

Modified: team/russell/events/apps/app_exec.c
URL: http://svn.digium.com/view/asterisk/team/russell/events/apps/app_exec.c?view=diff&rev=75305&r1=75304&r2=75305
==============================================================================
--- team/russell/events/apps/app_exec.c (original)
+++ team/russell/events/apps/app_exec.c Mon Jul 16 15:50:46 2007
@@ -90,15 +90,12 @@
 
 static int exec_exec(struct ast_channel *chan, void *data)
 {
-	int res=0;
-	struct ast_module_user *u;
+	int res = 0;
 	char *s, *appname, *endargs, args[MAXRESULT] = "";
 	struct ast_app *app;
 
 	if (ast_strlen_zero(data))
 		return 0;
-
-	u = ast_module_user_add(chan);
 	
 	s = ast_strdupa(data);
 	appname = strsep(&s, "(");
@@ -118,22 +115,17 @@
 		}
 	}
 
-	ast_module_user_remove(u);
-
 	return res;
 }
 
 static int tryexec_exec(struct ast_channel *chan, void *data)
 {
-	int res=0;
-	struct ast_module_user *u;
+	int res = 0;
 	char *s, *appname, *endargs, args[MAXRESULT] = "";
 	struct ast_app *app;
 
 	if (ast_strlen_zero(data))
 		return 0;
-
-	u = ast_module_user_add(chan);
 
 	s = ast_strdupa(data);
 	appname = strsep(&s, "(");
@@ -154,21 +146,16 @@
 		}
 	}
 
-	ast_module_user_remove(u);
-
 	return 0;
 }
 
 static int execif_exec(struct ast_channel *chan, void *data)
 {
 	int res = 0;
-	struct ast_module_user *u;
 	char *myapp = NULL;
 	char *mydata = NULL;
 	char *expr = NULL;
 	struct ast_app *app = NULL;
-
-	u = ast_module_user_add(chan);
 
 	expr = ast_strdupa(data);
 
@@ -193,8 +180,6 @@
 		ast_log(LOG_ERROR,"Invalid Syntax.\n");
 		res = -1;
 	}
-		
-	ast_module_user_remove(u);
 
 	return res;
 }
@@ -207,8 +192,6 @@
 	res |= ast_unregister_application(app_tryexec);
 	res |= ast_unregister_application(app_execif);
 
-	ast_module_user_hangup_all();
-
 	return res;
 }
 

Modified: team/russell/events/apps/app_externalivr.c
URL: http://svn.digium.com/view/asterisk/team/russell/events/apps/app_externalivr.c?view=diff&rev=75305&r1=75304&r2=75305
==============================================================================
--- team/russell/events/apps/app_externalivr.c (original)
+++ team/russell/events/apps/app_externalivr.c Mon Jul 16 15:50:46 2007
@@ -243,7 +243,6 @@
 
 static int app_exec(struct ast_channel *chan, void *data)
 {
-	struct ast_module_user *lu;
 	struct playlist_entry *entry;
 	const char *args = data;
 	int child_stdin[2] = { 0,0 };
@@ -265,8 +264,6 @@
 	struct ivr_localuser *u = &foo;
 	sigset_t fullset, oldset;
 
-	lu = ast_module_user_add(chan);
-
 	sigfillset(&fullset);
 	pthread_sigmask(SIG_BLOCK, &fullset, &oldset);
 
@@ -275,7 +272,6 @@
 	
 	if (ast_strlen_zero(args)) {
 		ast_log(LOG_WARNING, "ExternalIVR requires a command to execute\n");
-		ast_module_user_remove(lu);
 		return -1;	
 	}
 
@@ -571,20 +567,12 @@
 	while ((entry = AST_LIST_REMOVE_HEAD(&u->playlist, list)))
 		ast_free(entry);
 
-	ast_module_user_remove(lu);
-
 	return res;
 }
 
 static int unload_module(void)
 {
-	int res;
-
-	res = ast_unregister_application(app);
-
-	ast_module_user_hangup_all();
-
-	return res;
+	return ast_unregister_application(app);
 }
 
 static int load_module(void)

Modified: team/russell/events/apps/app_festival.c
URL: http://svn.digium.com/view/asterisk/team/russell/events/apps/app_festival.c?view=diff&rev=75305&r1=75304&r2=75305
==============================================================================
--- team/russell/events/apps/app_festival.c (original)
+++ team/russell/events/apps/app_festival.c Mon Jul 16 15:50:46 2007
@@ -284,7 +284,6 @@
 {
 	int usecache;
 	int res=0;
-	struct ast_module_user *u;
  	struct sockaddr_in serv_addr;
 	struct hostent *serverhost;
 	struct ast_hostent ahp;
@@ -323,12 +322,9 @@
 		return -1;
 	}
 
-	u = ast_module_user_add(chan);
-
 	cfg = ast_config_load(FESTIVAL_CONFIG);
 	if (!cfg) {
 		ast_log(LOG_WARNING, "No such configuration file %s\n", FESTIVAL_CONFIG);
-		ast_module_user_remove(u);
 		return -1;
 	}
 	if (!(host = ast_variable_retrieve(cfg, "general", "host"))) {
@@ -385,7 +381,6 @@
 	if (fd < 0) {
 		ast_log(LOG_WARNING,"festival_client: can't get socket\n");
 		ast_config_destroy(cfg);
-		ast_module_user_remove(u);
 		return -1;
 	}
 
@@ -398,7 +393,6 @@
 		if (serverhost == (struct hostent *)0) {
 			ast_log(LOG_WARNING,"festival_client: gethostbyname failed\n");
 			ast_config_destroy(cfg);
-			ast_module_user_remove(u);
 			return -1;
 		}
 		memmove(&serv_addr.sin_addr,serverhost->h_addr, serverhost->h_length);
@@ -410,7 +404,6 @@
 	if (connect(fd, (struct sockaddr *)&serv_addr, sizeof(serv_addr)) != 0) {
 		ast_log(LOG_WARNING,"festival_client: connect to server failed\n");
 		ast_config_destroy(cfg);
-		ast_module_user_remove(u);
         	return -1;
     	}
     	
@@ -502,7 +495,6 @@
                                ast_log(LOG_WARNING,"Unable to read from cache/festival fd\n");
 			       close(fd);
 			       ast_config_destroy(cfg);
-			       ast_module_user_remove(u);
                                return -1;
                        }
                        n += read_data;
@@ -529,20 +521,13 @@
 	} while (strcmp(ack,"OK\n") != 0);
 	close(fd);
 	ast_config_destroy(cfg);
-	ast_module_user_remove(u);
 	return res;
 
 }
 
 static int unload_module(void)
 {
-	int res;
-
-	res = ast_unregister_application(app);
-
-	ast_module_user_hangup_all();
-
-	return res;
+	return ast_unregister_application(app);
 }
 
 static int load_module(void)

Modified: team/russell/events/apps/app_flash.c
URL: http://svn.digium.com/view/asterisk/team/russell/events/apps/app_flash.c?view=diff&rev=75305&r1=75304&r2=75305
==============================================================================
--- team/russell/events/apps/app_flash.c (original)
+++ team/russell/events/apps/app_flash.c Mon Jul 16 15:50:46 2007
@@ -73,15 +73,12 @@
 {
 	int res = -1;
 	int x;
-	struct ast_module_user *u;
 	struct zt_params ztp;
 
 	if (strcasecmp(chan->tech->type, "Zap")) {
 		ast_log(LOG_WARNING, "%s is not a Zap channel\n", chan->name);
 		return -1;
 	}
-
-	u = ast_module_user_add(chan);
 	
 	memset(&ztp, 0, sizeof(ztp));
 	res = ioctl(chan->fds[0], ZT_GET_PARAMS, &ztp);
@@ -104,20 +101,12 @@
 	} else
 		ast_log(LOG_WARNING, "Unable to get parameters of %s: %s\n", chan->name, strerror(errno));
 
-	ast_module_user_remove(u);
-
 	return res;
 }
 
 static int unload_module(void)
 {
-	int res;
-
-	res = ast_unregister_application(app);
-
-	ast_module_user_hangup_all();
-
-	return res;
+	return ast_unregister_application(app);
 }
 
 static int load_module(void)

Modified: team/russell/events/apps/app_followme.c
URL: http://svn.digium.com/view/asterisk/team/russell/events/apps/app_followme.c?view=diff&rev=75305&r1=75304&r2=75305
==============================================================================
--- team/russell/events/apps/app_followme.c (original)
+++ team/russell/events/apps/app_followme.c Mon Jul 16 15:50:46 2007
@@ -899,7 +899,6 @@
 	struct call_followme *f;
 	struct number *nm, *newnm;
 	int res = 0;
-	struct ast_module_user *u;
 	char *argstr;
 	char namerecloc[255];
 	int duration = 0;
@@ -921,8 +920,6 @@
 		ast_log(LOG_WARNING, "%s requires an argument (followmeid)\n",app);
 		return -1;
 	}
-
-	u = ast_module_user_add(chan);
 
 	AST_STANDARD_APP_ARGS(args, argstr);
 
@@ -1043,16 +1040,12 @@
 	}
 	outrun:
 	
-	ast_module_user_remove(u);
-
 	return res;
 }
 
 static int unload_module(void)
 {
 	struct call_followme *f;
-
-	ast_module_user_hangup_all();
 
 	ast_unregister_application(app);
 

Modified: team/russell/events/apps/app_forkcdr.c
URL: http://svn.digium.com/view/asterisk/team/russell/events/apps/app_forkcdr.c?view=diff&rev=75305&r1=75304&r2=75305
==============================================================================
--- team/russell/events/apps/app_forkcdr.c (original)
+++ team/russell/events/apps/app_forkcdr.c Mon Jul 16 15:50:46 2007
@@ -77,33 +77,23 @@
 static int forkcdr_exec(struct ast_channel *chan, void *data)
 {
 	int res = 0;
-	struct ast_module_user *u;
 
 	if (!chan->cdr) {
 		ast_log(LOG_WARNING, "Channel does not have a CDR\n");
 		return 0;
 	}
 
-	u = ast_module_user_add(chan);
-
 	if (!ast_strlen_zero(data))
 		ast_set2_flag(chan->cdr, strchr(data, 'v'), AST_CDR_FLAG_KEEP_VARS);
 	
 	ast_cdr_fork(chan);
 
-	ast_module_user_remove(u);
 	return res;
 }
 
 static int unload_module(void)
 {
-	int res;
-
-	res = ast_unregister_application(app);
-
-	ast_module_user_hangup_all();
-
-	return res;	
+	return ast_unregister_application(app);
 }
 
 static int load_module(void)

Modified: team/russell/events/apps/app_getcpeid.c
URL: http://svn.digium.com/view/asterisk/team/russell/events/apps/app_getcpeid.c?view=diff&rev=75305&r1=75304&r2=75305
==============================================================================
--- team/russell/events/apps/app_getcpeid.c (original)
+++ team/russell/events/apps/app_getcpeid.c Mon Jul 16 15:50:46 2007
@@ -66,15 +66,12 @@
 static int cpeid_exec(struct ast_channel *chan, void *idata)
 {
 	int res=0;
-	struct ast_module_user *u;
 	unsigned char cpeid[4];
 	int gotgeometry = 0;
 	int gotcpeid = 0;
 	int width, height, buttons;
 	char *data[4];
 	unsigned int x;
-
-	u = ast_module_user_add(chan);
 
 	for (x = 0; x < 4; x++)
 		data[x] = alloca(80);
@@ -125,19 +122,13 @@
 			ast_adsi_unload_session(chan);
 		}
 	}
-	ast_module_user_remove(u);
+
 	return res;
 }
 
 static int unload_module(void)
 {
-	int res;
-
-	res = ast_unregister_application(app);
-
-	ast_module_user_hangup_all();
-
-	return res;	
+	return ast_unregister_application(app);
 }
 
 static int load_module(void)

Modified: team/russell/events/apps/app_ices.c
URL: http://svn.digium.com/view/asterisk/team/russell/events/apps/app_ices.c?view=diff&rev=75305&r1=75304&r2=75305
==============================================================================
--- team/russell/events/apps/app_ices.c (original)
+++ team/russell/events/apps/app_ices.c Mon Jul 16 15:50:46 2007
@@ -103,8 +103,7 @@
 

[... 6601 lines stripped ...]



More information about the svn-commits mailing list