[asterisk-commits] file: branch file/usecnt-cleanup r53975 - in /team/file/usecnt-cleanup: apps/...

asterisk-commits at lists.digium.com asterisk-commits at lists.digium.com
Sun Feb 11 16:03:48 MST 2007


Author: file
Date: Sun Feb 11 17:03:46 2007
New Revision: 53975

URL: http://svn.digium.com/view/asterisk?view=rev&rev=53975
Log:
Bring in initial version of this... all the stuff that determines whether an application is in use and by what channels has been moved into the core.

Modified:
    team/file/usecnt-cleanup/apps/app_adsiprog.c
    team/file/usecnt-cleanup/apps/app_alarmreceiver.c
    team/file/usecnt-cleanup/apps/app_amd.c
    team/file/usecnt-cleanup/apps/app_authenticate.c
    team/file/usecnt-cleanup/apps/app_cdr.c
    team/file/usecnt-cleanup/apps/app_chanisavail.c
    team/file/usecnt-cleanup/apps/app_channelredirect.c
    team/file/usecnt-cleanup/apps/app_chanspy.c
    team/file/usecnt-cleanup/apps/app_controlplayback.c
    team/file/usecnt-cleanup/apps/app_db.c
    team/file/usecnt-cleanup/apps/app_dial.c
    team/file/usecnt-cleanup/apps/app_dictate.c
    team/file/usecnt-cleanup/apps/app_directed_pickup.c
    team/file/usecnt-cleanup/apps/app_directory.c
    team/file/usecnt-cleanup/apps/app_disa.c
    team/file/usecnt-cleanup/apps/app_dumpchan.c
    team/file/usecnt-cleanup/apps/app_echo.c
    team/file/usecnt-cleanup/apps/app_exec.c
    team/file/usecnt-cleanup/apps/app_externalivr.c
    team/file/usecnt-cleanup/apps/app_festival.c
    team/file/usecnt-cleanup/apps/app_flash.c
    team/file/usecnt-cleanup/apps/app_followme.c
    team/file/usecnt-cleanup/apps/app_forkcdr.c
    team/file/usecnt-cleanup/apps/app_getcpeid.c
    team/file/usecnt-cleanup/apps/app_ices.c
    team/file/usecnt-cleanup/apps/app_image.c
    team/file/usecnt-cleanup/apps/app_macro.c
    team/file/usecnt-cleanup/apps/app_meetme.c
    team/file/usecnt-cleanup/apps/app_milliwatt.c
    team/file/usecnt-cleanup/apps/app_mixmonitor.c
    team/file/usecnt-cleanup/apps/app_morsecode.c
    team/file/usecnt-cleanup/apps/app_mp3.c
    team/file/usecnt-cleanup/apps/app_nbscat.c
    team/file/usecnt-cleanup/apps/app_page.c
    team/file/usecnt-cleanup/apps/app_parkandannounce.c
    team/file/usecnt-cleanup/apps/app_playback.c
    team/file/usecnt-cleanup/apps/app_privacy.c
    team/file/usecnt-cleanup/apps/app_queue.c
    team/file/usecnt-cleanup/apps/app_read.c
    team/file/usecnt-cleanup/apps/app_readfile.c
    team/file/usecnt-cleanup/apps/app_record.c
    team/file/usecnt-cleanup/apps/app_sayunixtime.c
    team/file/usecnt-cleanup/apps/app_senddtmf.c
    team/file/usecnt-cleanup/apps/app_sendtext.c
    team/file/usecnt-cleanup/apps/app_setcallerid.c
    team/file/usecnt-cleanup/apps/app_sms.c
    team/file/usecnt-cleanup/apps/app_softhangup.c
    team/file/usecnt-cleanup/apps/app_speech_utils.c
    team/file/usecnt-cleanup/apps/app_stack.c
    team/file/usecnt-cleanup/apps/app_system.c
    team/file/usecnt-cleanup/apps/app_talkdetect.c
    team/file/usecnt-cleanup/apps/app_test.c
    team/file/usecnt-cleanup/apps/app_transfer.c
    team/file/usecnt-cleanup/apps/app_url.c
    team/file/usecnt-cleanup/apps/app_userevent.c
    team/file/usecnt-cleanup/apps/app_verbose.c
    team/file/usecnt-cleanup/apps/app_voicemail.c
    team/file/usecnt-cleanup/apps/app_waitforring.c
    team/file/usecnt-cleanup/apps/app_waitforsilence.c
    team/file/usecnt-cleanup/apps/app_while.c
    team/file/usecnt-cleanup/apps/app_zapateller.c
    team/file/usecnt-cleanup/apps/app_zapbarge.c
    team/file/usecnt-cleanup/apps/app_zapras.c
    team/file/usecnt-cleanup/apps/app_zapscan.c
    team/file/usecnt-cleanup/channels/chan_agent.c
    team/file/usecnt-cleanup/channels/chan_iax2.c
    team/file/usecnt-cleanup/channels/chan_local.c
    team/file/usecnt-cleanup/channels/chan_sip.c
    team/file/usecnt-cleanup/channels/chan_zap.c
    team/file/usecnt-cleanup/funcs/func_curl.c
    team/file/usecnt-cleanup/funcs/func_cut.c
    team/file/usecnt-cleanup/funcs/func_enum.c
    team/file/usecnt-cleanup/funcs/func_rand.c
    team/file/usecnt-cleanup/funcs/func_realtime.c
    team/file/usecnt-cleanup/funcs/func_strings.c
    team/file/usecnt-cleanup/funcs/func_version.c
    team/file/usecnt-cleanup/funcs/func_vmcount.c
    team/file/usecnt-cleanup/include/asterisk/module.h
    team/file/usecnt-cleanup/include/asterisk/pbx.h
    team/file/usecnt-cleanup/main/pbx.c
    team/file/usecnt-cleanup/pbx/pbx_dundi.c
    team/file/usecnt-cleanup/res/res_agi.c
    team/file/usecnt-cleanup/res/res_features.c
    team/file/usecnt-cleanup/res/res_indications.c
    team/file/usecnt-cleanup/res/res_jabber.c
    team/file/usecnt-cleanup/res/res_monitor.c
    team/file/usecnt-cleanup/res/res_musiconhold.c

Modified: team/file/usecnt-cleanup/apps/app_adsiprog.c
URL: http://svn.digium.com/view/asterisk/team/file/usecnt-cleanup/apps/app_adsiprog.c?view=diff&rev=53975&r1=53974&r2=53975
==============================================================================
--- team/file/usecnt-cleanup/apps/app_adsiprog.c (original)
+++ team/file/usecnt-cleanup/apps/app_adsiprog.c Sun Feb 11 17:03:46 2007
@@ -1549,9 +1549,6 @@
 static int adsi_exec(struct ast_channel *chan, void *data)
 {
 	int res=0;
-	struct ast_module_user *u;
-
-	u = ast_module_user_add(chan);
 	
 	if (ast_strlen_zero(data))
 		data = "asterisk.adsi";
@@ -1564,8 +1561,6 @@
 			ast_verbose(VERBOSE_PREFIX_3 "ADSI Available on CPE.  Attempting Upload.\n");
 		res = adsi_prog(chan, data);
 	}
-
-	ast_module_user_remove(u);
 	
 	return res;
 }
@@ -1584,7 +1579,7 @@
 
 static int load_module(void)
 {
-	return ast_register_application(app, adsi_exec, synopsis, descrip);
+	return ast_register_application(app, adsi_exec, synopsis, descrip, ast_module_info->self);
 }
 
 AST_MODULE_INFO_STANDARD(ASTERISK_GPL_KEY, "Asterisk ADSI Programming Application");

Modified: team/file/usecnt-cleanup/apps/app_alarmreceiver.c
URL: http://svn.digium.com/view/asterisk/team/file/usecnt-cleanup/apps/app_alarmreceiver.c?view=diff&rev=53975&r1=53974&r2=53975
==============================================================================
--- team/file/usecnt-cleanup/apps/app_alarmreceiver.c (original)
+++ team/file/usecnt-cleanup/apps/app_alarmreceiver.c Sun Feb 11 17:03:46 2007
@@ -635,13 +635,9 @@
 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 */
 
@@ -650,13 +646,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;
 	}
 
@@ -675,7 +669,6 @@
 		res = ast_answer(chan);
 		
 		if (res) {
-			ast_module_user_remove(u);
 			return -1;
 		}
 	}
@@ -729,9 +722,6 @@
 		elp = elp->next;
 		free(efree);
 	}
-
-
-	ast_module_user_remove(u);
 
 	return 0;
 }
@@ -843,7 +833,7 @@
 static int load_module(void)
 {
 	if(load_config())
-		return ast_register_application(app, alarmreceiver_exec, synopsis, descrip);
+		return ast_register_application(app, alarmreceiver_exec, synopsis, descrip, ast_module_info->self);
 	else
 		return AST_MODULE_LOAD_DECLINE;
 }

Modified: team/file/usecnt-cleanup/apps/app_amd.c
URL: http://svn.digium.com/view/asterisk/team/file/usecnt-cleanup/apps/app_amd.c?view=diff&rev=53975&r1=53974&r2=53975
==============================================================================
--- team/file/usecnt-cleanup/apps/app_amd.c (original)
+++ team/file/usecnt-cleanup/apps/app_amd.c Sun Feb 11 17:03:46 2007
@@ -310,12 +310,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;
 }
 
@@ -382,7 +377,7 @@
 static int load_module(void)
 {
 	load_config();
-	return ast_register_application(app, amd_exec, synopsis, descrip);
+	return ast_register_application(app, amd_exec, synopsis, descrip, ast_module_info->self);
 }
 
 static int reload(void)

Modified: team/file/usecnt-cleanup/apps/app_authenticate.c
URL: http://svn.digium.com/view/asterisk/team/file/usecnt-cleanup/apps/app_authenticate.c?view=diff&rev=53975&r1=53974&r2=53975
==============================================================================
--- team/file/usecnt-cleanup/apps/app_authenticate.c (original)
+++ team/file/usecnt-cleanup/apps/app_authenticate.c Sun Feb 11 17:03:46 2007
@@ -95,7 +95,6 @@
 {
 	int res=0;
 	int retries;
-	struct ast_module_user *u;
 	char passwd[256];
 	char *prompt;
 	int maxdigits;
@@ -113,12 +112,9 @@
 		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);
 			return -1;
 		}
 	}
@@ -226,7 +222,6 @@
 			res = -1;
 		}
 	}
-	ast_module_user_remove(u);
 	return res;
 }
 
@@ -244,7 +239,7 @@
 
 static int load_module(void)
 {
-	return ast_register_application(app, auth_exec, synopsis, descrip);
+	return ast_register_application(app, auth_exec, synopsis, descrip, ast_module_info->self);
 }
 
 AST_MODULE_INFO_STANDARD(ASTERISK_GPL_KEY, "Authentication Application");

Modified: team/file/usecnt-cleanup/apps/app_cdr.c
URL: http://svn.digium.com/view/asterisk/team/file/usecnt-cleanup/apps/app_cdr.c?view=diff&rev=53975&r1=53974&r2=53975
==============================================================================
--- team/file/usecnt-cleanup/apps/app_cdr.c (original)
+++ team/file/usecnt-cleanup/apps/app_cdr.c Sun Feb 11 17:03:46 2007
@@ -46,17 +46,10 @@
 
 static int nocdr_exec(struct ast_channel *chan, void *data)
 {
-	struct ast_module_user *u;
-	
-	u = ast_module_user_add(chan);
-
 	if (chan->cdr) {
 		ast_cdr_free(chan->cdr);
 		chan->cdr = NULL;
 	}
-
-	ast_module_user_remove(u);
-
 	return 0;
 }
 
@@ -73,7 +66,7 @@
 
 static int load_module(void)
 {
-	return ast_register_application(nocdr_app, nocdr_exec, nocdr_synopsis, nocdr_descrip);
+	return ast_register_application(nocdr_app, nocdr_exec, nocdr_synopsis, nocdr_descrip, ast_module_info->self);
 }
 
 AST_MODULE_INFO_STANDARD(ASTERISK_GPL_KEY, "Tell Asterisk to not maintain a CDR for the current call");

Modified: team/file/usecnt-cleanup/apps/app_chanisavail.c
URL: http://svn.digium.com/view/asterisk/team/file/usecnt-cleanup/apps/app_chanisavail.c?view=diff&rev=53975&r1=53974&r2=53975
==============================================================================
--- team/file/usecnt-cleanup/apps/app_chanisavail.c (original)
+++ team/file/usecnt-cleanup/apps/app_chanisavail.c Sun Feb 11 17:03:46 2007
@@ -70,7 +70,6 @@
 {
 	int res=-1, inuse=-1, option_state=0, priority_jump=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,
@@ -82,8 +81,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); 
 
@@ -111,7 +108,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';
@@ -154,13 +150,11 @@
 		pbx_builtin_setvar_helper(chan, "AVAILORIGCHAN", "");
 		if (priority_jump || ast_opt_priority_jumping) {
 			if (ast_goto_if_exists(chan, chan->context, chan->exten, chan->priority + 101)) {
-				ast_module_user_remove(u);
 				return -1;
 			}
 		}
 	}
 
-	ast_module_user_remove(u);
 	return 0;
 }
 
@@ -177,7 +171,7 @@
 
 static int load_module(void)
 {
-	return ast_register_application(app, chanavail_exec, synopsis, descrip);
+	return ast_register_application(app, chanavail_exec, synopsis, descrip, ast_module_info->self);
 }
 
 AST_MODULE_INFO_STANDARD(ASTERISK_GPL_KEY, "Check channel availability");

Modified: team/file/usecnt-cleanup/apps/app_channelredirect.c
URL: http://svn.digium.com/view/asterisk/team/file/usecnt-cleanup/apps/app_channelredirect.c?view=diff&rev=53975&r1=53974&r2=53975
==============================================================================
--- team/file/usecnt-cleanup/apps/app_channelredirect.c (original)
+++ team/file/usecnt-cleanup/apps/app_channelredirect.c Sun Feb 11 17:03: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);
@@ -116,7 +113,6 @@
  chanquit:
 	ast_mutex_unlock(&chan2->lock);
  quit:
-	ast_module_user_remove(u);
 
 	return res;
 }
@@ -134,7 +130,7 @@
 
 static int load_module(void)
 {
-	return ast_register_application(app, asyncgoto_exec, synopsis, descrip);
+	return ast_register_application(app, asyncgoto_exec, synopsis, descrip, ast_module_info->self);
 }
 
 AST_MODULE_INFO_STANDARD(ASTERISK_GPL_KEY, "Channel Redirect");

Modified: team/file/usecnt-cleanup/apps/app_chanspy.c
URL: http://svn.digium.com/view/asterisk/team/file/usecnt-cleanup/apps/app_chanspy.c?view=diff&rev=53975&r1=53974&r2=53975
==============================================================================
--- team/file/usecnt-cleanup/apps/app_chanspy.c (original)
+++ team/file/usecnt-cleanup/apps/app_chanspy.c Sun Feb 11 17:03:46 2007
@@ -556,7 +556,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];
@@ -571,8 +570,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)
@@ -609,7 +606,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;
 	}
 
@@ -631,14 +627,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;
@@ -654,8 +647,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]))
@@ -693,7 +684,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;
 	}
 
@@ -715,8 +705,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;
 }
 
@@ -736,8 +724,8 @@
 {
 	int res = 0;
 
-	res |= ast_register_application(app_chan, chanspy_exec, tdesc, desc_chan);
-	res |= ast_register_application(app_ext, extenspy_exec, tdesc, desc_ext);
+	res |= ast_register_application(app_chan, chanspy_exec, tdesc, desc_chan, ast_module_info->self);
+	res |= ast_register_application(app_ext, extenspy_exec, tdesc, desc_ext, ast_module_info->self);
 
 	return res;
 }

Modified: team/file/usecnt-cleanup/apps/app_controlplayback.c
URL: http://svn.digium.com/view/asterisk/team/file/usecnt-cleanup/apps/app_controlplayback.c?view=diff&rev=53975&r1=53974&r2=53975
==============================================================================
--- team/file/usecnt-cleanup/apps/app_controlplayback.c (original)
+++ team/file/usecnt-cleanup/apps/app_controlplayback.c Sun Feb 11 17:03:46 2007
@@ -76,7 +76,6 @@
 {
 	int res = 0, priority_jump = 0;
 	int skipms = 0;
-	struct ast_module_user *u;
 	char *tmp;
 	int argc;
 	char *argv[8];
@@ -95,8 +94,6 @@
 		ast_log(LOG_WARNING, "ControlPlayback requires an argument (filename)\n");
 		return -1;
 	}
-
-	u = ast_module_user_add(chan);
 	
 	tmp = ast_strdupa(data);
 	memset(argv, 0, sizeof(argv));
@@ -105,7 +102,6 @@
 
 	if (argc < 1) {
 		ast_log(LOG_WARNING, "ControlPlayback requires an argument (filename)\n");
-		ast_module_user_remove(u);
 		return -1;
 	}
 
@@ -148,8 +144,6 @@
 			pbx_builtin_setvar_helper(chan, "CPLAYBACKSTATUS", "SUCCESS");
 	}
 
-	ast_module_user_remove(u);
-
 	return res;
 }
 
@@ -162,7 +156,7 @@
 
 static int load_module(void)
 {
-	return ast_register_application(app, controlplayback_exec, synopsis, descrip);
+	return ast_register_application(app, controlplayback_exec, synopsis, descrip, ast_module_info->self);
 }
 
 AST_MODULE_INFO_STANDARD(ASTERISK_GPL_KEY, "Control Playback Application");

Modified: team/file/usecnt-cleanup/apps/app_db.c
URL: http://svn.digium.com/view/asterisk/team/file/usecnt-cleanup/apps/app_db.c?view=diff&rev=53975&r1=53974&r2=53975
==============================================================================
--- team/file/usecnt-cleanup/apps/app_db.c (original)
+++ team/file/usecnt-cleanup/apps/app_db.c Sun Feb 11 17:03: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);
 
@@ -80,7 +77,6 @@
 			if (!family || !keytree) {
 				if (option_debug)
 					ast_log(LOG_DEBUG, "Ignoring; Syntax error in argument\n");
-				ast_module_user_remove(u);
 				return 0;
 			}
 		if (ast_strlen_zero(keytree))
@@ -102,18 +98,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;
@@ -128,7 +119,6 @@
 		if (!family || !key) {
 			if (option_debug)
 				ast_log(LOG_DEBUG, "Ignoring; Syntax error in argument\n");
-			ast_module_user_remove(u);
 			return 0;
 		}
 		if (option_verbose > 2)
@@ -141,8 +131,6 @@
 		if (option_debug)
 			ast_log(LOG_DEBUG, "Ignoring, no parameters\n");
 	}
-
-	ast_module_user_remove(u);
 	
 	return 0;
 }
@@ -161,8 +149,8 @@
 {
 	int retval;
 
-	retval = ast_register_application(d_app, del_exec, d_synopsis, d_descrip);
-	retval |= ast_register_application(dt_app, deltree_exec, dt_synopsis, dt_descrip);
+	retval = ast_register_application(d_app, del_exec, d_synopsis, d_descrip, ast_module_info->self);
+	retval |= ast_register_application(dt_app, deltree_exec, dt_synopsis, dt_descrip, ast_module_info->self);
 	
 	return retval;
 }

Modified: team/file/usecnt-cleanup/apps/app_dial.c
URL: http://svn.digium.com/view/asterisk/team/file/usecnt-cleanup/apps/app_dial.c?view=diff&rev=53975&r1=53974&r2=53975
==============================================================================
--- team/file/usecnt-cleanup/apps/app_dial.c (original)
+++ team/file/usecnt-cleanup/apps/app_dial.c Sun Feb 11 17:03:46 2007
@@ -1170,7 +1170,6 @@
 static int dial_exec_full(struct ast_channel *chan, void *data, struct ast_flags *peerflags)
 {
 	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;
@@ -1208,8 +1207,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);
 	
@@ -1701,7 +1698,6 @@
 		res = 0;
 
 done:
-	ast_module_user_remove(u);    	/* XXX probably not the right place for this. */
 	return res;
 }
 
@@ -1721,15 +1717,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);
 
@@ -1816,7 +1809,6 @@
 		ast_moh_stop(chan);
 
  done:
-	ast_module_user_remove(u);
 	return res;
 }
 
@@ -1836,8 +1828,8 @@
 {
 	int res;
 
-	res = ast_register_application(app, dial_exec, synopsis, descrip);
-	res |= ast_register_application(rapp, retrydial_exec, rsynopsis, rdescrip);
+	res = ast_register_application(app, dial_exec, synopsis, descrip, ast_module_info->self);
+	res |= ast_register_application(rapp, retrydial_exec, rsynopsis, rdescrip, ast_module_info->self);
 	
 	return res;
 }

Modified: team/file/usecnt-cleanup/apps/app_dictate.c
URL: http://svn.digium.com/view/asterisk/team/file/usecnt-cleanup/apps/app_dictate.c?view=diff&rev=53975&r1=53974&r2=53975
==============================================================================
--- team/file/usecnt-cleanup/apps/app_dictate.c (original)
+++ team/file/usecnt-cleanup/apps/app_dictate.c Sun Feb 11 17:03: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 res;
 }
 
@@ -343,7 +338,7 @@
 
 static int load_module(void)
 {
-	return ast_register_application(app, dictate_exec, synopsis, desc);
+	return ast_register_application(app, dictate_exec, synopsis, desc, ast_module_info->self);
 }
 
 AST_MODULE_INFO_STANDARD(ASTERISK_GPL_KEY, "Virtual Dictation Machine");

Modified: team/file/usecnt-cleanup/apps/app_directed_pickup.c
URL: http://svn.digium.com/view/asterisk/team/file/usecnt-cleanup/apps/app_directed_pickup.c?view=diff&rev=53975&r1=53974&r2=53975
==============================================================================
--- team/file/usecnt-cleanup/apps/app_directed_pickup.c (original)
+++ team/file/usecnt-cleanup/apps/app_directed_pickup.c Sun Feb 11 17:03:46 2007
@@ -134,7 +134,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;
 
@@ -142,8 +141,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, "&"))) {
@@ -159,8 +156,6 @@
 		ast_log(LOG_NOTICE, "No target channel found for %s.\n", exten);
 	}
 
-	ast_module_user_remove(u);
-
 	return res;
 }
 
@@ -175,7 +170,7 @@
 
 static int load_module(void)
 {
-	return ast_register_application(app, pickup_exec, synopsis, descrip);
+	return ast_register_application(app, pickup_exec, synopsis, descrip, ast_module_info->self);
 }
 
 AST_MODULE_INFO_STANDARD(ASTERISK_GPL_KEY, "Directed Call Pickup Application");

Modified: team/file/usecnt-cleanup/apps/app_directory.c
URL: http://svn.digium.com/view/asterisk/team/file/usecnt-cleanup/apps/app_directory.c?view=diff&rev=53975&r1=53974&r2=53975
==============================================================================
--- team/file/usecnt-cleanup/apps/app_directory.c (original)
+++ team/file/usecnt-cleanup/apps/app_directory.c Sun Feb 11 17:03: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;
 }
 
@@ -672,7 +667,7 @@
 		ast_log(LOG_WARNING, "Unable to load " VOICEMAIL_CONFIG " - ODBC defaults will be used\n");
 #endif
 
-	return ast_register_application(app, directory_exec, synopsis, descrip);
+	return ast_register_application(app, directory_exec, synopsis, descrip, ast_module_info->self);
 }
 
 AST_MODULE_INFO_STANDARD(ASTERISK_GPL_KEY, "Extension Directory");

Modified: team/file/usecnt-cleanup/apps/app_disa.c
URL: http://svn.digium.com/view/asterisk/team/file/usecnt-cleanup/apps/app_disa.c?view=diff&rev=53975&r1=53974&r2=53975
==============================================================================
--- team/file/usecnt-cleanup/apps/app_disa.c (original)
+++ team/file/usecnt-cleanup/apps/app_disa.c Sun Feb 11 17:03:46 2007
@@ -115,7 +115,6 @@
 	int i,j,k,x,did_ignore,special_noanswer;
 	int firstdigittimeout = 20000;
 	int digittimeout = 10000;
-	struct ast_module_user *u;
 	char *tmp, exten[AST_MAX_EXTENSION],acctcode[20]="";
 	char pwline[256];
 	char ourcidname[256],ourcidnum[256];
@@ -136,8 +135,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;
@@ -146,12 +143,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;
 	}
 	
@@ -215,13 +210,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) {
@@ -251,7 +244,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;
@@ -355,7 +347,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;
 		}
 	}
@@ -376,7 +367,6 @@
 		ast_frfree(f);
 	}
 	ast_playtones_stop(chan);
-	ast_module_user_remove(u);
 	return -1;
 }
 
@@ -393,7 +383,7 @@
 
 static int load_module(void)
 {
-	return ast_register_application(app, disa_exec, synopsis, descrip);
+	return ast_register_application(app, disa_exec, synopsis, descrip, ast_module_info->self);
 }
 
 AST_MODULE_INFO_STANDARD(ASTERISK_GPL_KEY, "DISA (Direct Inward System Access) Application");

Modified: team/file/usecnt-cleanup/apps/app_dumpchan.c
URL: http://svn.digium.com/view/asterisk/team/file/usecnt-cleanup/apps/app_dumpchan.c?view=diff&rev=53975&r1=53974&r2=53975
==============================================================================
--- team/file/usecnt-cleanup/apps/app_dumpchan.c (original)
+++ team/file/usecnt-cleanup/apps/app_dumpchan.c Sun Feb 11 17:03:46 2007
@@ -136,14 +136,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);
 
@@ -151,8 +148,6 @@
 	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;
 }
@@ -170,7 +165,7 @@
 
 static int load_module(void)
 {
-	return ast_register_application(app, dumpchan_exec, synopsis, desc);
+	return ast_register_application(app, dumpchan_exec, synopsis, desc, ast_module_info->self);
 }
 
 AST_MODULE_INFO_STANDARD(ASTERISK_GPL_KEY, "Dump Info About The Calling Channel");

Modified: team/file/usecnt-cleanup/apps/app_echo.c
URL: http://svn.digium.com/view/asterisk/team/file/usecnt-cleanup/apps/app_echo.c?view=diff&rev=53975&r1=53974&r2=53975
==============================================================================
--- team/file/usecnt-cleanup/apps/app_echo.c (original)
+++ team/file/usecnt-cleanup/apps/app_echo.c Sun Feb 11 17:03: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,7 +78,6 @@
 		ast_frfree(f);
 	}
 end:
-	ast_module_user_remove(u);
 	return res;
 }
 
@@ -98,7 +94,7 @@
 
 static int load_module(void)
 {
-	return ast_register_application(app, echo_exec, synopsis, descrip);
+	return ast_register_application(app, echo_exec, synopsis, descrip, ast_module_info->self);
 }
 
 AST_MODULE_INFO_STANDARD(ASTERISK_GPL_KEY, "Simple Echo Application");

Modified: team/file/usecnt-cleanup/apps/app_exec.c
URL: http://svn.digium.com/view/asterisk/team/file/usecnt-cleanup/apps/app_exec.c?view=diff&rev=53975&r1=53974&r2=53975
==============================================================================
--- team/file/usecnt-cleanup/apps/app_exec.c (original)
+++ team/file/usecnt-cleanup/apps/app_exec.c Sun Feb 11 17:03:46 2007
@@ -91,11 +91,8 @@
 static int exec_exec(struct ast_channel *chan, void *data)
 {
 	int res=0;
-	struct ast_module_user *u;
 	char *s, *appname, *endargs, args[MAXRESULT] = "";
 	struct ast_app *app;
-
-	u = ast_module_user_add(chan);
 
 	/* Check and parse arguments */
 	if (data) {
@@ -117,19 +114,14 @@
 			}
 		}
 	}
-
-	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;
 	char *s, *appname, *endargs, args[MAXRESULT] = "";
 	struct ast_app *app;
-
-	u = ast_module_user_add(chan);
 
 	/* Check and parse arguments */
 	if (data) {
@@ -152,21 +144,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);
 
@@ -191,8 +178,6 @@
 		ast_log(LOG_ERROR,"Invalid Syntax.\n");
 		res = -1;
 	}
-		
-	ast_module_user_remove(u);
 
 	return res;
 }
@@ -212,9 +197,9 @@
 
 static int load_module(void)
 {
-	int res = ast_register_application(app_exec, exec_exec, exec_synopsis, exec_descrip);
-	res |= ast_register_application(app_tryexec, tryexec_exec, tryexec_synopsis, tryexec_descrip);
-	res |= ast_register_application(app_execif, execif_exec, execif_synopsis, execif_descrip);
+	int res = ast_register_application(app_exec, exec_exec, exec_synopsis, exec_descrip, ast_module_info->self);
+	res |= ast_register_application(app_tryexec, tryexec_exec, tryexec_synopsis, tryexec_descrip, ast_module_info->self);
+	res |= ast_register_application(app_execif, execif_exec, execif_synopsis, execif_descrip, ast_module_info->self);
 	return res;
 }
 

Modified: team/file/usecnt-cleanup/apps/app_externalivr.c
URL: http://svn.digium.com/view/asterisk/team/file/usecnt-cleanup/apps/app_externalivr.c?view=diff&rev=53975&r1=53974&r2=53975
==============================================================================
--- team/file/usecnt-cleanup/apps/app_externalivr.c (original)
+++ team/file/usecnt-cleanup/apps/app_externalivr.c Sun Feb 11 17:03: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,8 +567,6 @@
 	while ((entry = AST_LIST_REMOVE_HEAD(&u->playlist, list)))
 		free(entry);
 
-	ast_module_user_remove(lu);
-
 	return res;
 }
 
@@ -589,7 +583,7 @@
 
 static int load_module(void)
 {
-	return ast_register_application(app, app_exec, synopsis, descrip);
+	return ast_register_application(app, app_exec, synopsis, descrip, ast_module_info->self);
 }
 
 AST_MODULE_INFO_STANDARD(ASTERISK_GPL_KEY, "External IVR Interface Application");

Modified: team/file/usecnt-cleanup/apps/app_festival.c
URL: http://svn.digium.com/view/asterisk/team/file/usecnt-cleanup/apps/app_festival.c?view=diff&rev=53975&r1=53974&r2=53975
==============================================================================
--- team/file/usecnt-cleanup/apps/app_festival.c (original)
+++ team/file/usecnt-cleanup/apps/app_festival.c Sun Feb 11 17:03: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"))) {
@@ -386,7 +382,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;
 	}
 
@@ -399,7 +394,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);
@@ -411,7 +405,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;
     	}
     	
@@ -511,7 +504,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;
@@ -540,7 +532,6 @@
 	} while (strcmp(ack,"OK\n") != 0);
 	close(fd);
 	ast_config_destroy(cfg);
-	ast_module_user_remove(u);
 	return res;
 
 }
@@ -564,7 +555,7 @@
 		return AST_MODULE_LOAD_DECLINE;
 	}
 	ast_config_destroy(cfg);
-	return ast_register_application(app, festival_exec, synopsis, descrip);
+	return ast_register_application(app, festival_exec, synopsis, descrip, ast_module_info->self);
 }
 
 AST_MODULE_INFO_STANDARD(ASTERISK_GPL_KEY, "Simple Festival Interface");

Modified: team/file/usecnt-cleanup/apps/app_flash.c
URL: http://svn.digium.com/view/asterisk/team/file/usecnt-cleanup/apps/app_flash.c?view=diff&rev=53975&r1=53974&r2=53975
==============================================================================
--- team/file/usecnt-cleanup/apps/app_flash.c (original)
+++ team/file/usecnt-cleanup/apps/app_flash.c Sun Feb 11 17:03:46 2007
@@ -73,9 +73,7 @@
 {
 	int res = -1;
 	int x;
-	struct ast_module_user *u;
 	struct zt_params ztp;
-	u = ast_module_user_add(chan);
 	if (!strcasecmp(chan->tech->type, "Zap")) {
 		memset(&ztp, 0, sizeof(ztp));
 		res = ioctl(chan->fds[0], ZT_GET_PARAMS, &ztp);
@@ -99,7 +97,6 @@
 			ast_log(LOG_WARNING, "Unable to get parameters of %s: %s\n", chan->name, strerror(errno));
 	} else
 		ast_log(LOG_WARNING, "%s is not a Zap channel\n", chan->name);
-	ast_module_user_remove(u);
 	return res;
 }
 
@@ -116,7 +113,7 @@
 
 static int load_module(void)
 {
-	return ast_register_application(app, flash_exec, synopsis, descrip);
+	return ast_register_application(app, flash_exec, synopsis, descrip, ast_module_info->self);
 }
 
 AST_MODULE_INFO_STANDARD(ASTERISK_GPL_KEY, "Flash channel application");

Modified: team/file/usecnt-cleanup/apps/app_followme.c
URL: http://svn.digium.com/view/asterisk/team/file/usecnt-cleanup/apps/app_followme.c?view=diff&rev=53975&r1=53974&r2=53975
==============================================================================
--- team/file/usecnt-cleanup/apps/app_followme.c (original)
+++ team/file/usecnt-cleanup/apps/app_followme.c Sun Feb 11 17:03:46 2007
@@ -913,7 +913,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;
@@ -935,8 +934,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);
 
@@ -1058,8 +1055,6 @@
 	}
 	outrun:
 	
-	ast_module_user_remove(u);
-
 	return res;
 }
 
@@ -1088,7 +1083,7 @@
 	if(!reload_followme())
 		return AST_MODULE_LOAD_DECLINE;
 
-	return ast_register_application(app, app_exec, synopsis, descrip);
+	return ast_register_application(app, app_exec, synopsis, descrip, ast_module_info->self);
 }
 
 static int reload(void)

Modified: team/file/usecnt-cleanup/apps/app_forkcdr.c
URL: http://svn.digium.com/view/asterisk/team/file/usecnt-cleanup/apps/app_forkcdr.c?view=diff&rev=53975&r1=53974&r2=53975
==============================================================================
--- team/file/usecnt-cleanup/apps/app_forkcdr.c (original)
+++ team/file/usecnt-cleanup/apps/app_forkcdr.c Sun Feb 11 17:03:46 2007
@@ -77,21 +77,17 @@
 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;
 }
 
@@ -108,7 +104,7 @@
 
 static int load_module(void)
 {
-	return ast_register_application(app, forkcdr_exec, synopsis, descrip);
+	return ast_register_application(app, forkcdr_exec, synopsis, descrip, ast_module_info->self);
 }
 
 AST_MODULE_INFO_STANDARD(ASTERISK_GPL_KEY, "Fork The CDR into 2 separate entities");

Modified: team/file/usecnt-cleanup/apps/app_getcpeid.c
URL: http://svn.digium.com/view/asterisk/team/file/usecnt-cleanup/apps/app_getcpeid.c?view=diff&rev=53975&r1=53974&r2=53975
==============================================================================

[... 3598 lines stripped ...]


More information about the asterisk-commits mailing list