[asterisk-commits] branch oej/metermaids-trunk r24203 - in /team/oej/metermaids-trunk: ./ apps/ ...

asterisk-commits at lists.digium.com asterisk-commits at lists.digium.com
Tue May 2 08:10:49 MST 2006


Author: oej
Date: Tue May  2 10:10:48 2006
New Revision: 24203

URL: http://svn.digium.com/view/asterisk?rev=24203&view=rev
Log:
Trying to slowly get back up to date with trunk...

Modified:
    team/oej/metermaids-trunk/   (props changed)
    team/oej/metermaids-trunk/app.c
    team/oej/metermaids-trunk/apps/app_adsiprog.c
    team/oej/metermaids-trunk/apps/app_alarmreceiver.c
    team/oej/metermaids-trunk/apps/app_cdr.c
    team/oej/metermaids-trunk/apps/app_channelredirect.c
    team/oej/metermaids-trunk/apps/app_chanspy.c
    team/oej/metermaids-trunk/apps/app_controlplayback.c
    team/oej/metermaids-trunk/apps/app_db.c
    team/oej/metermaids-trunk/apps/app_dictate.c
    team/oej/metermaids-trunk/apps/app_directed_pickup.c
    team/oej/metermaids-trunk/apps/app_dumpchan.c
    team/oej/metermaids-trunk/apps/app_exec.c
    team/oej/metermaids-trunk/apps/app_festival.c
    team/oej/metermaids-trunk/apps/app_forkcdr.c
    team/oej/metermaids-trunk/apps/app_getcpeid.c
    team/oej/metermaids-trunk/apps/app_ices.c
    team/oej/metermaids-trunk/apps/app_image.c
    team/oej/metermaids-trunk/apps/app_ivrdemo.c
    team/oej/metermaids-trunk/apps/app_lookupcidname.c
    team/oej/metermaids-trunk/apps/app_macro.c
    team/oej/metermaids-trunk/apps/app_meetme.c
    team/oej/metermaids-trunk/apps/app_milliwatt.c
    team/oej/metermaids-trunk/apps/app_mixmonitor.c
    team/oej/metermaids-trunk/apps/app_morsecode.c
    team/oej/metermaids-trunk/apps/app_mp3.c
    team/oej/metermaids-trunk/apps/app_parkandannounce.c
    team/oej/metermaids-trunk/apps/app_read.c
    team/oej/metermaids-trunk/apps/app_readfile.c
    team/oej/metermaids-trunk/apps/app_rpt.c
    team/oej/metermaids-trunk/apps/app_senddtmf.c
    team/oej/metermaids-trunk/apps/app_setcallerid.c
    team/oej/metermaids-trunk/apps/app_setcdruserfield.c
    team/oej/metermaids-trunk/apps/app_settransfercapability.c
    team/oej/metermaids-trunk/apps/app_skel.c
    team/oej/metermaids-trunk/apps/app_sms.c
    team/oej/metermaids-trunk/apps/app_softhangup.c
    team/oej/metermaids-trunk/apps/app_stack.c
    team/oej/metermaids-trunk/apps/app_talkdetect.c
    team/oej/metermaids-trunk/apps/app_test.c
    team/oej/metermaids-trunk/apps/app_verbose.c
    team/oej/metermaids-trunk/apps/app_zapateller.c
    team/oej/metermaids-trunk/apps/app_zapras.c
    team/oej/metermaids-trunk/build_tools/make_defaults_h
    team/oej/metermaids-trunk/cdr.c
    team/oej/metermaids-trunk/channel.c
    team/oej/metermaids-trunk/channels/chan_agent.c
    team/oej/metermaids-trunk/channels/chan_alsa.c
    team/oej/metermaids-trunk/channels/chan_features.c
    team/oej/metermaids-trunk/channels/chan_iax2.c
    team/oej/metermaids-trunk/channels/chan_local.c
    team/oej/metermaids-trunk/channels/chan_mgcp.c
    team/oej/metermaids-trunk/channels/chan_misdn.c
    team/oej/metermaids-trunk/channels/chan_nbs.c
    team/oej/metermaids-trunk/channels/chan_oss.c
    team/oej/metermaids-trunk/channels/chan_phone.c
    team/oej/metermaids-trunk/channels/chan_skinny.c
    team/oej/metermaids-trunk/channels/chan_vpb.c
    team/oej/metermaids-trunk/channels/chan_zap.c
    team/oej/metermaids-trunk/http.c
    team/oej/metermaids-trunk/image.c
    team/oej/metermaids-trunk/loader.c
    team/oej/metermaids-trunk/manager.c
    team/oej/metermaids-trunk/pbx/pbx_ael.c
    team/oej/metermaids-trunk/pbx/pbx_config.c
    team/oej/metermaids-trunk/pbx/pbx_dundi.c
    team/oej/metermaids-trunk/pbx/pbx_loopback.c
    team/oej/metermaids-trunk/pbx/pbx_realtime.c
    team/oej/metermaids-trunk/pbx/pbx_spool.c

Propchange: team/oej/metermaids-trunk/
------------------------------------------------------------------------------
    automerge = http://edvina.net/training/

Modified: team/oej/metermaids-trunk/app.c
URL: http://svn.digium.com/view/asterisk/team/oej/metermaids-trunk/app.c?rev=24203&r1=24202&r2=24203&view=diff
==============================================================================
--- team/oej/metermaids-trunk/app.c (original)
+++ team/oej/metermaids-trunk/app.c Tue May  2 10:10:48 2006
@@ -155,10 +155,7 @@
 	struct ast_dsp *sildet;
 	/* Play prompt if requested */
 	if (prompt) {
-		res = ast_streamfile(c, prompt, c->language);
-		if (res < 0)
-			return res;
-		res = ast_waitstream(c,"");
+		res = ast_stream_and_wait(c, prompt, c->language, "");
 		if (res < 0)
 			return res;
 	}
@@ -414,7 +411,7 @@
 		if (filename[0] == '/') 
 			ast_copy_string(tmpf, filename, sizeof(tmpf));
 		else
-			snprintf(tmpf, sizeof(tmpf), "%s/%s/%s", (char *)ast_config_AST_VAR_DIR, "sounds", filename);
+			snprintf(tmpf, sizeof(tmpf), "%s/%s/%s", (char *)ast_config_AST_DATA_DIR, "sounds", filename);
 		fd = open(tmpf, O_RDONLY);
 		if (fd < 0){
 			ast_log(LOG_WARNING, "Unable to open file '%s': %s\n", tmpf, strerror(errno));
@@ -573,9 +570,7 @@
 	if (playfile) {
 		d = ast_play_and_wait(chan, playfile);
 		if (d > -1)
-			d = ast_streamfile(chan, "beep",chan->language);
-		if (!d)
-			d = ast_waitstream(chan,"");
+			d = ast_stream_and_wait(chan, "beep", chan->language, "");
 		if (d < 0)
 			return -1;
 	}
@@ -739,24 +734,17 @@
 	for (x=0;x<fmtcnt;x++) {
 		if (!others[x])
 			break;
-		if (res > 0) {
-			if (totalsilence)
-				ast_stream_rewind(others[x], totalsilence-200);
-			else
-				ast_stream_rewind(others[x], 200);
-		}
+		if (res > 0)
+			ast_stream_rewind(others[x], totalsilence ? totalsilence-200 : 200);
 		ast_truncstream(others[x]);
 		ast_closestream(others[x]);
 	}
-	if (rfmt) {
-		if (ast_set_read_format(chan, rfmt)) {
-			ast_log(LOG_WARNING, "Unable to restore format %s to channel '%s'\n", ast_getformatname(rfmt), chan->name);
-		}
+	if (rfmt && ast_set_read_format(chan, rfmt)) {
+		ast_log(LOG_WARNING, "Unable to restore format %s to channel '%s'\n", ast_getformatname(rfmt), chan->name);
 	}
 	if (outmsg > 1) {
 		/* Let them know recording is stopped */
-		if(!ast_streamfile(chan, "auth-thankyou", chan->language))
-			ast_waitstream(chan, "");
+		ast_stream_and_wait(chan, "auth-thankyou", chan->language, "");
 	}
 	if (sildet)
 		ast_dsp_free(sildet);
@@ -800,9 +788,7 @@
 		if (!beep)
 			d = ast_play_and_wait(chan, playfile);
 		if (d > -1)
-			d = ast_streamfile(chan, "beep",chan->language);
-		if (!d)
-			d = ast_waitstream(chan,"");
+			d = ast_stream_and_wait(chan, "beep",chan->language, "");
 		if (d < 0)
 			return -1;
 	}
@@ -982,17 +968,12 @@
 			ast_filedelete(prependfile, sfmt[x]);
 		}
 	}
-	if (rfmt) {
-		if (ast_set_read_format(chan, rfmt)) {
-			ast_log(LOG_WARNING, "Unable to restore format %s to channel '%s'\n", ast_getformatname(rfmt), chan->name);
-		}
-	}
-	if (outmsg) {
-		if (outmsg > 1) {
-			/* Let them know it worked */
-			ast_streamfile(chan, "auth-thankyou", chan->language);
-			ast_waitstream(chan, "");
-		}
+	if (rfmt && ast_set_read_format(chan, rfmt)) {
+		ast_log(LOG_WARNING, "Unable to restore format %s to channel '%s'\n", ast_getformatname(rfmt), chan->name);
+	}
+	if (outmsg > 1) {
+		/* Let them know it worked */
+		ast_stream_and_wait(chan, "auth-thankyou", chan->language, "");
 	}	
 	return res;
 }
@@ -1215,16 +1196,14 @@
 				cmd = '3';
 				break;
 			} else {
-				ast_streamfile(chan, "vm-msgsaved", chan->language);
-				ast_waitstream(chan, "");
+				ast_stream_and_wait(chan, "vm-msgsaved", chan->language, "");
 				cmd = 't';
 				return res;
 			}
 		case '2':
 			/* Review */
 			ast_verbose(VERBOSE_PREFIX_3 "Reviewing the recording\n");
-			ast_streamfile(chan, recordfile, chan->language);
-			cmd = ast_waitstream(chan, AST_DIGIT_ANY);
+			cmd = ast_stream_and_wait(chan, recordfile, chan->language, AST_DIGIT_ANY);
 			break;
 		case '3':
 			message_exists = 0;
@@ -1310,19 +1289,15 @@
 	case AST_ACTION_NOOP:
 		return 0;
 	case AST_ACTION_BACKGROUND:
-		res = ast_streamfile(chan, (char *)option->adata, chan->language);
-		if (!res) {
-			res = ast_waitstream(chan, AST_DIGIT_ANY);
-		} else {
+		res = ast_stream_and_wait(chan, (char *)option->adata, chan->language, AST_DIGIT_ANY);
+		if (res < 0) {
 			ast_log(LOG_NOTICE, "Unable to find file '%s'!\n", (char *)option->adata);
 			res = 0;
 		}
 		return res;
 	case AST_ACTION_PLAYBACK:
-		res = ast_streamfile(chan, (char *)option->adata, chan->language);
-		if (!res) {
-			res = ast_waitstream(chan, "");
-		} else {
+		res = ast_stream_and_wait(chan, (char *)option->adata, chan->language, "");
+		if (res < 0) {
 			ast_log(LOG_NOTICE, "Unable to find file '%s'!\n", (char *)option->adata);
 			res = 0;
 		}
@@ -1351,7 +1326,8 @@
 		c = ast_strdupa(option->adata);
 		if (c) {
 			while((n = strsep(&c, ";")))
-				if ((res = ast_streamfile(chan, n, chan->language)) || (res = ast_waitstream(chan, (option->action == AST_ACTION_BACKLIST) ? AST_DIGIT_ANY : "")))
+				if ((res = ast_stream_and_wait(chan, n, chan->language,
+						(option->action == AST_ACTION_BACKLIST) ? AST_DIGIT_ANY : "")))
 					break;
 			ast_stopstream(chan);
 		}

Modified: team/oej/metermaids-trunk/apps/app_adsiprog.c
URL: http://svn.digium.com/view/asterisk/team/oej/metermaids-trunk/apps/app_adsiprog.c?rev=24203&r1=24202&r2=24203&view=diff
==============================================================================
--- team/oej/metermaids-trunk/apps/app_adsiprog.c (original)
+++ team/oej/metermaids-trunk/apps/app_adsiprog.c Tue May  2 10:10:48 2006
@@ -58,8 +58,6 @@
 static char *descrip =
 "  ADSIProg(script): This application programs an ADSI Phone with the given\n"
 "script. If nothing is specified, the default script (asterisk.adsi) is used.\n";
-
-LOCAL_USER_DECL;
 
 struct adsi_event {
 	int id;
@@ -1568,35 +1566,32 @@
 	return res;
 }
 
-int unload_module(void)
+static int unload_module(void *mod)
 {
 	int res;
+
+	STANDARD_HANGUP_LOCALUSERS;
 
 	res = ast_unregister_application(app);	
 	
-	STANDARD_HANGUP_LOCALUSERS;
 
 	return res;
 }
 
-int load_module(void)
-{
+static int load_module(void *mod)
+{
+	__mod_desc = mod;
 	return ast_register_application(app, adsi_exec, synopsis, descrip);
 }
 
-const char *description(void)
+static const char *description(void)
 {
 	return "Asterisk ADSI Programming Application";
 }
 
-int usecount(void)
-{
-	int res;
-	STANDARD_USECOUNT(res);
-	return res;
-}
-
-const char *key(void)
+static const char *key(void)
 {
 	return ASTERISK_GPL_KEY;
 }
+
+STD_MOD(MOD_1, NULL, NULL, NULL);

Modified: team/oej/metermaids-trunk/apps/app_alarmreceiver.c
URL: http://svn.digium.com/view/asterisk/team/oej/metermaids-trunk/apps/app_alarmreceiver.c?rev=24203&r1=24202&r2=24203&view=diff
==============================================================================
--- team/oej/metermaids-trunk/apps/app_alarmreceiver.c (original)
+++ team/oej/metermaids-trunk/apps/app_alarmreceiver.c Tue May  2 10:10:48 2006
@@ -96,8 +96,6 @@
 /* Misc variables */
 	
 static char event_file[14] = "/event-XXXXXX";
-
-LOCAL_USER_DECL;
 
 /*
 * Attempt to access a database variable and increment it,
@@ -818,7 +816,7 @@
 */
 
 
-int unload_module(void)
+static int unload_module(void *mod)
 {
 	int res;
 
@@ -829,25 +827,21 @@
 	return res;
 }
 
-int load_module(void)
-{
+static int load_module(void *mod)
+{
+	__mod_desc = mod;
 	load_config();
 	return ast_register_application(app, alarmreceiver_exec, synopsis, descrip);
 }
 
-const char *description(void)
+static const char *description(void)
 {
 	return "Alarm Receiver for Asterisk";
 }
 
-int usecount(void)
-{
-	int res;
-	STANDARD_USECOUNT(res);
-	return res;
-}
-
-const char *key(void)
+static const char *key(void)
 {
 	return ASTERISK_GPL_KEY;
 }
+
+STD_MOD1;

Modified: team/oej/metermaids-trunk/apps/app_cdr.c
URL: http://svn.digium.com/view/asterisk/team/oej/metermaids-trunk/apps/app_cdr.c?rev=24203&r1=24202&r2=24203&view=diff
==============================================================================
--- team/oej/metermaids-trunk/apps/app_cdr.c (original)
+++ team/oej/metermaids-trunk/apps/app_cdr.c Tue May  2 10:10:48 2006
@@ -27,8 +27,6 @@
 
 #include <sys/types.h>
 #include <stdlib.h>
-
-#define STATIC_MODULE
 
 #include "asterisk.h"
 
@@ -63,7 +61,7 @@
 	return 0;
 }
 
-STATIC_MODULE int unload_module(void)
+static int unload_module(void *mod)
 {
 	int res;
 
@@ -74,24 +72,17 @@
 	return res;
 }
 
-STATIC_MODULE int load_module(void)
+static int load_module(void *mod)
 {
 	return ast_register_application(nocdr_app, nocdr_exec, nocdr_synopsis, nocdr_descrip);
 }
 
-STATIC_MODULE const char *description(void)
+static const char *description(void)
 {
 	return "Tell Asterisk to not maintain a CDR for the current call";
 }
 
-STATIC_MODULE int usecount(void)
-{
-	int res;
-	STANDARD_USECOUNT(res);
-	return res;
-}
-
-STATIC_MODULE const char *key(void)
+static const char *key(void)
 {
 	return ASTERISK_GPL_KEY;
 }

Modified: team/oej/metermaids-trunk/apps/app_channelredirect.c
URL: http://svn.digium.com/view/asterisk/team/oej/metermaids-trunk/apps/app_channelredirect.c?rev=24203&r1=24202&r2=24203&view=diff
==============================================================================
--- team/oej/metermaids-trunk/apps/app_channelredirect.c (original)
+++ team/oej/metermaids-trunk/apps/app_channelredirect.c Tue May  2 10:10:48 2006
@@ -120,7 +120,7 @@
 	return res;
 }
 
-int unload_module(void)
+static int unload_module(void *mod)
 {
 	int res;
 
@@ -131,26 +131,20 @@
 	return res;	
 }
 
-int load_module(void)
+static int load_module(void *mod)
 {
+	__mod_desc = mod;
 	return ast_register_application(app, asyncgoto_exec, synopsis, descrip);
 }
 
-const char *description(void)
+static const char *description(void)
 {
 	return "Channel Redirect";
 }
 
-int usecount(void)
-{
-	int res;
-
-	STANDARD_USECOUNT(res);
-
-	return res;
-}
-
-const char *key(void)
+static const char *key(void)
 {
 	return ASTERISK_GPL_KEY;
 }
+
+STD_MOD1;

Modified: team/oej/metermaids-trunk/apps/app_chanspy.c
URL: http://svn.digium.com/view/asterisk/team/oej/metermaids-trunk/apps/app_chanspy.c?rev=24203&r1=24202&r2=24203&view=diff
==============================================================================
--- team/oej/metermaids-trunk/apps/app_chanspy.c (original)
+++ team/oej/metermaids-trunk/apps/app_chanspy.c Tue May  2 10:10:48 2006
@@ -554,7 +554,7 @@
 	ALL_DONE(u, res);
 }
 
-int unload_module(void)
+static int unload_module(void *mod)
 {
 	int res;
 
@@ -565,24 +565,20 @@
 	return res;
 }
 
-int load_module(void)
-{
+static int load_module(void *mod)
+{
+	__mod_desc = mod;
 	return ast_register_application(app, chanspy_exec, synopsis, desc);
 }
 
-const char *description(void)
+static const char *description(void)
 {
 	return (char *) synopsis;
 }
 
-int usecount(void)
-{
-	int res;
-	STANDARD_USECOUNT(res);
-	return res;
-}
-
-const char *key()
+static const char *key(void)
 {
 	return ASTERISK_GPL_KEY;
 }
+
+STD_MOD(MOD_1, NULL, NULL, NULL);

Modified: team/oej/metermaids-trunk/apps/app_controlplayback.c
URL: http://svn.digium.com/view/asterisk/team/oej/metermaids-trunk/apps/app_controlplayback.c?rev=24203&r1=24202&r2=24203&view=diff
==============================================================================
--- team/oej/metermaids-trunk/apps/app_controlplayback.c (original)
+++ team/oej/metermaids-trunk/apps/app_controlplayback.c Tue May  2 10:10:48 2006
@@ -154,36 +154,26 @@
 	return res;
 }
 
-int unload_module(void)
+static int unload_module(void *mod)
 {
 	int res;
-
 	res = ast_unregister_application(app);
-
-	STANDARD_HANGUP_LOCALUSERS;
-
 	return res;
 }
 
-int load_module(void)
+static int load_module(void *mod)
 {
 	return ast_register_application(app, controlplayback_exec, synopsis, descrip);
 }
 
-const char *description(void)
+static const char *description(void)
 {
 	return "Control Playback Application";
 }
 
-int usecount(void)
-{
-	int res;
-
-	STANDARD_USECOUNT(res);
-	return res;
-}
-
-const char *key(void)
+static const char *key(void)
 {
 	return ASTERISK_GPL_KEY;
 }
+
+STD_MOD(MOD_1, NULL, NULL, NULL);

Modified: team/oej/metermaids-trunk/apps/app_db.c
URL: http://svn.digium.com/view/asterisk/team/oej/metermaids-trunk/apps/app_db.c?rev=24203&r1=24202&r2=24203&view=diff
==============================================================================
--- team/oej/metermaids-trunk/apps/app_db.c (original)
+++ team/oej/metermaids-trunk/apps/app_db.c Tue May  2 10:10:48 2006
@@ -143,41 +143,35 @@
 	return 0;
 }
 
-int unload_module(void)
+static int unload_module(void *mod)
 {
 	int retval;
 
 	retval = ast_unregister_application(dt_app);
 	retval |= ast_unregister_application(d_app);
 
-	STANDARD_HANGUP_LOCALUSERS;
-
 	return retval;
 }
 
-int load_module(void)
+static int load_module(void *mod)
 {
 	int retval;
 
+	__mod_desc = mod;
 	retval = ast_register_application(d_app, del_exec, d_synopsis, d_descrip);
 	retval |= ast_register_application(dt_app, deltree_exec, dt_synopsis, dt_descrip);
 	
 	return retval;
 }
 
-const char *description(void)
+static const char *description(void)
 {
 	return "Database Access Functions";
 }
 
-int usecount(void)
-{
-	int res;
-	STANDARD_USECOUNT(res);
-	return res;
-}
-
-const char *key(void)
+static const char *key(void)
 {
 	return ASTERISK_GPL_KEY;
 }
+
+STD_MOD(MOD_1, NULL, NULL, NULL);

Modified: team/oej/metermaids-trunk/apps/app_dictate.c
URL: http://svn.digium.com/view/asterisk/team/oej/metermaids-trunk/apps/app_dictate.c?rev=24203&r1=24202&r2=24203&view=diff
==============================================================================
--- team/oej/metermaids-trunk/apps/app_dictate.c (original)
+++ team/oej/metermaids-trunk/apps/app_dictate.c Tue May  2 10:10:48 2006
@@ -46,7 +46,6 @@
 #include "asterisk/lock.h"
 #include "asterisk/app.h"
 
-static char *tdesc = "Virtual Dictation Machine";
 static char *app = "Dictate";
 static char *synopsis = "Virtual Dictation Machine";
 static char *desc = "  Dictate([<base_dir>[|<filename>]])\n"
@@ -336,36 +335,27 @@
 	return res;
 }
 
-int unload_module(void)
+static int unload_module(void *mod)
 {
 	int res;
-
 	res = ast_unregister_application(app);
-	
-	STANDARD_HANGUP_LOCALUSERS;
-	
 	return res;
 }
 
-int load_module(void)
-{
+static int load_module(void *mod)
+{
+	__mod_desc = mod;
 	return ast_register_application(app, dictate_exec, synopsis, desc);
 }
 
-const char *description(void)
-{
-	return tdesc;
-}
-
-int usecount(void)
-{
-	int res;
-	STANDARD_USECOUNT(res);
-	return res;
-}
-
-const char *key()
+static const char *description(void)
+{
+	return "Virtual Dictation Machine";
+}
+
+static const char *key(void)
 {
 	return ASTERISK_GPL_KEY;
 }
 
+STD_MOD(MOD_1, NULL, NULL, NULL);

Modified: team/oej/metermaids-trunk/apps/app_directed_pickup.c
URL: http://svn.digium.com/view/asterisk/team/oej/metermaids-trunk/apps/app_directed_pickup.c?rev=24203&r1=24202&r2=24203&view=diff
==============================================================================
--- team/oej/metermaids-trunk/apps/app_directed_pickup.c (original)
+++ team/oej/metermaids-trunk/apps/app_directed_pickup.c Tue May  2 10:10:48 2006
@@ -42,7 +42,6 @@
 #include "asterisk/lock.h"
 #include "asterisk/app.h"
 
-static const char *tdesc = "Directed Call Pickup Application";
 static const char *app = "Pickup";
 static const char *synopsis = "Directed Call Pickup";
 static const char *descrip =
@@ -134,37 +133,29 @@
 	return res;
 }
 
-int unload_module(void)
+static int unload_module(void *mod)
 {
 	int res;
 
 	res = ast_unregister_application(app);
 	
-	STANDARD_HANGUP_LOCALUSERS;
-
 	return res;
 }
 
-int load_module(void)
+static int load_module(void *mod)
 {
+	__mod_desc = mod;
 	return ast_register_application(app, pickup_exec, synopsis, descrip);
 }
 
-const char *description(void)
+static const char *description(void)
 {
-	return (char *) tdesc;
+	return "Directed Call Pickup Application";
 }
 
-int usecount(void)
-{
-	int res;
-
-	STANDARD_USECOUNT(res);
-
-	return res;
-}
-
-const char *key()
+static const char *key(void)
 {
 	return ASTERISK_GPL_KEY;
 }
+
+STD_MOD(MOD_1, NULL, NULL, NULL);

Modified: team/oej/metermaids-trunk/apps/app_dumpchan.c
URL: http://svn.digium.com/view/asterisk/team/oej/metermaids-trunk/apps/app_dumpchan.c?rev=24203&r1=24202&r2=24203&view=diff
==============================================================================
--- team/oej/metermaids-trunk/apps/app_dumpchan.c (original)
+++ team/oej/metermaids-trunk/apps/app_dumpchan.c Tue May  2 10:10:48 2006
@@ -46,7 +46,6 @@
 #include "asterisk/lock.h"
 #include "asterisk/utils.h"
 
-static char *tdesc = "Dump Info About The Calling Channel";
 static char *app = "DumpChan";
 static char *synopsis = "Dump Info About The Calling Channel";
 static char *desc = 
@@ -115,8 +114,8 @@
 			 c->nativeformats,
 			 c->writeformat,
 			 c->readformat,
-			 c->fds[0], c->fin & 0x7fffffff, (c->fin & 0x80000000) ? " (DEBUGGED)" : "",
-			 c->fout & 0x7fffffff, (c->fout & 0x80000000) ? " (DEBUGGED)" : "", (long)c->whentohangup,
+			 c->fds[0], c->fin & ~DEBUGCHAN_FLAG, (c->fin & DEBUGCHAN_FLAG) ? " (DEBUGGED)" : "",
+			 c->fout & ~DEBUGCHAN_FLAG, (c->fout & DEBUGCHAN_FLAG) ? " (DEBUGGED)" : "", (long)c->whentohangup,
 			 hour,
 			 min,
 			 sec,
@@ -157,7 +156,7 @@
 	return res;
 }
 
-int unload_module(void)
+static int unload_module(void *mod)
 {
 	int res;
 
@@ -168,25 +167,19 @@
 	return res;
 }
 
-int load_module(void)
+static int load_module(void *mod)
 {
 	return ast_register_application(app, dumpchan_exec, synopsis, desc);
 }
 
-const char *description(void)
+static const char *description(void)
 {
-	return tdesc;
+	return "Dump Info About The Calling Channel";
 }
 
-int usecount(void)
-{
-	int res;
-	STANDARD_USECOUNT(res);
-	return res;
-}
-
-const char *key()
+static const char *key(void)
 {
 	return ASTERISK_GPL_KEY;
 }
 
+STD_MOD1;

Modified: team/oej/metermaids-trunk/apps/app_exec.c
URL: http://svn.digium.com/view/asterisk/team/oej/metermaids-trunk/apps/app_exec.c?rev=24203&r1=24202&r2=24203&view=diff
==============================================================================
--- team/oej/metermaids-trunk/apps/app_exec.c (original)
+++ team/oej/metermaids-trunk/apps/app_exec.c Tue May  2 10:10:48 2006
@@ -160,7 +160,7 @@
 	return 0;
 }
 
-int unload_module(void)
+static int unload_module(void *mod)
 {
 	int res;
 
@@ -172,26 +172,21 @@
 	return res;
 }
 
-int load_module(void)
+static int load_module(void *mod)
 {
 	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);
 	return res;
 }
 
-const char *description(void)
+static const char *description(void)
 {
 	return tdesc;
 }
 
-int usecount(void)
-{
-	int res;
-	STANDARD_USECOUNT(res);
-	return res;
-}
-
-const char *key()
+static const char *key(void)
 {
 	return ASTERISK_GPL_KEY;
 }
+
+STD_MOD1;

Modified: team/oej/metermaids-trunk/apps/app_festival.c
URL: http://svn.digium.com/view/asterisk/team/oej/metermaids-trunk/apps/app_festival.c?rev=24203&r1=24202&r2=24203&view=diff
==============================================================================
--- team/oej/metermaids-trunk/apps/app_festival.c (original)
+++ team/oej/metermaids-trunk/apps/app_festival.c Tue May  2 10:10:48 2006
@@ -57,8 +57,6 @@
 #include "asterisk/lock.h"
 
 #define FESTIVAL_CONFIG "festival.conf"
-
-static char *tdesc = "Simple Festival Interface";
 
 static char *app = "Festival";
 
@@ -501,7 +499,7 @@
 
 }
 
-int unload_module(void)
+static int unload_module(void *mod)
 {
 	int res;
 
@@ -512,25 +510,20 @@
 	return res;
 }
 
-int load_module(void)
+static int load_module(void *mod)
 {
-	
 	return ast_register_application(app, festival_exec, synopsis, descrip);
 }
 
-const char *description(void)
+static const char *description(void)
 {
-	return tdesc;
-}
-
-int usecount(void)
-{
-	int res;
-	STANDARD_USECOUNT(res);
-	return res;
-}
-
-const char *key()
+	return "Simple Festival Interface";
+
+}
+
+static const char *key(void)
 {
 	return ASTERISK_GPL_KEY;
 }
+
+STD_MOD1;

Modified: team/oej/metermaids-trunk/apps/app_forkcdr.c
URL: http://svn.digium.com/view/asterisk/team/oej/metermaids-trunk/apps/app_forkcdr.c?rev=24203&r1=24202&r2=24203&view=diff
==============================================================================
--- team/oej/metermaids-trunk/apps/app_forkcdr.c (original)
+++ team/oej/metermaids-trunk/apps/app_forkcdr.c Tue May  2 10:10:48 2006
@@ -42,7 +42,6 @@
 #include "asterisk/cdr.h"
 #include "asterisk/module.h"
 
-static char *tdesc = "Fork The CDR into 2 separate entities.";
 static char *app = "ForkCDR";
 static char *synopsis = 
 "Forks the Call Data Record";
@@ -98,7 +97,7 @@
 	return res;
 }
 
-int unload_module(void)
+static int unload_module(void *mod)
 {
 	int res;
 
@@ -109,24 +108,19 @@
 	return res;	
 }
 
-int load_module(void)
+static int load_module(void *mod)
 {
 	return ast_register_application(app, forkcdr_exec, synopsis, descrip);
 }
 
-const char *description(void)
+static const char *description(void)
 {
-	return tdesc;
+	return "Fork The CDR into 2 separate entities.";
 }
 
-int usecount(void)
-{
-	int res;
-	STANDARD_USECOUNT(res);
-	return res;
-}
-
-const char *key()
+static const char *key(void)
 {
 	return ASTERISK_GPL_KEY;
 }
+
+STD_MOD1;

Modified: team/oej/metermaids-trunk/apps/app_getcpeid.c
URL: http://svn.digium.com/view/asterisk/team/oej/metermaids-trunk/apps/app_getcpeid.c?rev=24203&r1=24202&r2=24203&view=diff
==============================================================================
--- team/oej/metermaids-trunk/apps/app_getcpeid.c (original)
+++ team/oej/metermaids-trunk/apps/app_getcpeid.c Tue May  2 10:10:48 2006
@@ -42,8 +42,6 @@
 #include "asterisk/module.h"
 #include "asterisk/adsi.h"
 #include "asterisk/options.h"
-
-static char *tdesc = "Get ADSI CPE ID";
 
 static char *app = "GetCPEID";
 
@@ -133,7 +131,7 @@
 	return res;
 }
 
-int unload_module(void)
+static int unload_module(void *mod)
 {
 	int res;
 
@@ -144,24 +142,19 @@
 	return res;	
 }
 
-int load_module(void)
+static int load_module(void *mod)
 {
 	return ast_register_application(app, cpeid_exec, synopsis, descrip);
 }
 
-const char *description(void)
+static const char *description(void)
 {
-	return tdesc;
+	return "Get ADSI CPE ID";
 }
 
-int usecount(void)
-{
-	int res;
-	STANDARD_USECOUNT(res);
-	return res;
-}
-
-const char *key()
+static const char *key(void)
 {
 	return ASTERISK_GPL_KEY;
 }
+
+STD_MOD1;

Modified: team/oej/metermaids-trunk/apps/app_ices.c
URL: http://svn.digium.com/view/asterisk/team/oej/metermaids-trunk/apps/app_ices.c?rev=24203&r1=24202&r2=24203&view=diff
==============================================================================
--- team/oej/metermaids-trunk/apps/app_ices.c (original)
+++ team/oej/metermaids-trunk/apps/app_ices.c Tue May  2 10:10:48 2006
@@ -49,8 +49,6 @@
 
 #define ICES "/usr/bin/ices"
 #define LOCAL_ICES "/usr/local/bin/ices"
-
-static char *tdesc = "Encode and Stream via icecast and ices";
 
 static char *app = "ICES";
 
@@ -191,7 +189,7 @@
 	return res;
 }
 
-int unload_module(void)
+static int unload_module(void *mod)
 {
 	int res;
 
@@ -202,24 +200,19 @@
 	return res;
 }
 
-int load_module(void)
+static int load_module(void *mod)
 {
 	return ast_register_application(app, ices_exec, synopsis, descrip);
 }
 
-const char *description(void)
-{
-	return tdesc;
-}
-
-int usecount(void)
-{
-	int res;
-	STANDARD_USECOUNT(res);
-	return res;
-}
-
-const char *key()
+static const char *description(void)
+{
+	return "Encode and Stream via icecast and ices";
+}
+
+static const char *key(void)
 {
 	return ASTERISK_GPL_KEY;
 }
+
+STD_MOD1;

Modified: team/oej/metermaids-trunk/apps/app_image.c
URL: http://svn.digium.com/view/asterisk/team/oej/metermaids-trunk/apps/app_image.c?rev=24203&r1=24202&r2=24203&view=diff
==============================================================================
--- team/oej/metermaids-trunk/apps/app_image.c (original)
+++ team/oej/metermaids-trunk/apps/app_image.c Tue May  2 10:10:48 2006
@@ -112,7 +112,7 @@
 	return res;
 }
 
-int unload_module(void)
+static int unload_module(void *mod)
 {
 	int res;
 
@@ -123,24 +123,19 @@
 	return res; 
 }
 
-int load_module(void)
+static int load_module(void *mod)
 {
 	return ast_register_application(app, sendimage_exec, synopsis, descrip);
 }
 
-const char *description(void)
+static const char *description(void)
 {
 	return tdesc;
 }
 
-int usecount(void)
-{
-	int res;
-	STANDARD_USECOUNT(res);
-	return res;
-}
-
-const char *key()
+static const char *key(void)
 {
 	return ASTERISK_GPL_KEY;
 }
+
+STD_MOD1;

Modified: team/oej/metermaids-trunk/apps/app_ivrdemo.c
URL: http://svn.digium.com/view/asterisk/team/oej/metermaids-trunk/apps/app_ivrdemo.c?rev=24203&r1=24202&r2=24203&view=diff
==============================================================================
--- team/oej/metermaids-trunk/apps/app_ivrdemo.c (original)
+++ team/oej/metermaids-trunk/apps/app_ivrdemo.c Tue May  2 10:10:48 2006
@@ -110,7 +110,7 @@
 	return res;
 }
 
-int unload_module(void)
+static int unload_module(void *mod)
 {
 	int res;
 	
@@ -121,24 +121,19 @@
 	return res;
 }
 
-int load_module(void)
+static int load_module(void *mod)
 {
 	return ast_register_application(app, skel_exec, tdesc, synopsis);
 }
 
-const char *description(void)
+static const char *description(void)
 {
 	return tdesc;
 }
 
-int usecount(void)
-{
-	int res;
-	STANDARD_USECOUNT(res);
-	return res;
-}
-
-const char *key()
+static const char *key(void)
 {
 	return ASTERISK_GPL_KEY;
 }
+
+STD_MOD1;

Modified: team/oej/metermaids-trunk/apps/app_lookupcidname.c
URL: http://svn.digium.com/view/asterisk/team/oej/metermaids-trunk/apps/app_lookupcidname.c?rev=24203&r1=24202&r2=24203&view=diff
==============================================================================
--- team/oej/metermaids-trunk/apps/app_lookupcidname.c (original)
+++ team/oej/metermaids-trunk/apps/app_lookupcidname.c Tue May  2 10:10:48 2006
@@ -80,8 +80,7 @@
   return 0;
 }
 
-int
-unload_module (void)
+static int unload_module(void *mod)
 {
 	int res;
 
@@ -92,27 +91,19 @@
 	return res;
 }
 
-int
-load_module (void)
+static int load_module(void *mod)
 {
-  return ast_register_application (app, lookupcidname_exec, synopsis,
-				   descrip);
+	return ast_register_application (app, lookupcidname_exec, synopsis, descrip);
 }
 
-const char *description(void)
+static const char *description(void)
 {
-  return tdesc;
+	return tdesc;
 }
 
-int
-usecount (void)
+static const char *key(void)
 {
-  int res;
-  STANDARD_USECOUNT (res);
-  return res;
+	return ASTERISK_GPL_KEY;
 }
 
-const char *key()
-{
-  return ASTERISK_GPL_KEY;
-}
+STD_MOD1;

Modified: team/oej/metermaids-trunk/apps/app_macro.c
URL: http://svn.digium.com/view/asterisk/team/oej/metermaids-trunk/apps/app_macro.c?rev=24203&r1=24202&r2=24203&view=diff
==============================================================================
--- team/oej/metermaids-trunk/apps/app_macro.c (original)
+++ team/oej/metermaids-trunk/apps/app_macro.c Tue May  2 10:10:48 2006
@@ -343,7 +343,7 @@
 	return MACRO_EXIT_RESULT;
 }
 
-int unload_module(void)
+static int unload_module(void *mod)
 {
 	int res;
 
@@ -356,7 +356,7 @@
 	return res;
 }
 
-int load_module(void)
+static int load_module(void *mod)
 {
 	int res;
 
@@ -367,19 +367,14 @@
 	return res;
 }
 
-const char *description(void)
+static const char *description(void)
 {
 	return tdesc;
 }
 
-int usecount(void)
-{
-	int res;
-	STANDARD_USECOUNT(res);
-	return res;
-}
-
-const char *key()
+static const char *key(void)
 {
 	return ASTERISK_GPL_KEY;
 }
+
+STD_MOD1;

Modified: team/oej/metermaids-trunk/apps/app_meetme.c
URL: http://svn.digium.com/view/asterisk/team/oej/metermaids-trunk/apps/app_meetme.c?rev=24203&r1=24202&r2=24203&view=diff
==============================================================================
--- team/oej/metermaids-trunk/apps/app_meetme.c (original)
+++ team/oej/metermaids-trunk/apps/app_meetme.c Tue May  2 10:10:48 2006
@@ -60,7 +60,6 @@
 #include "asterisk/translate.h"
 #include "asterisk/ulaw.h"
 
-static const char *tdesc = "MeetMe conference bridge";
 
 static const char *app = "MeetMe";
 static const char *app2 = "MeetMeCount";
@@ -667,8 +666,8 @@
 
 			ast_cli(fd, "User #: %-2.2d %12.12s %-20.20s Channel: %s %s %s %s %s %02d:%02d:%02d\n",
 				user->user_no,
-				user->chan->cid.cid_num ? user->chan->cid.cid_num : "<unknown>",
-				user->chan->cid.cid_name ? user->chan->cid.cid_name : "<no name>",
+				S_OR(user->chan->cid.cid_num, "<unknown>"),
+				S_OR(user->chan->cid.cid_name, "<no name>"),
 				user->chan->name,
 				user->userflags & CONFFLAG_ADMIN ? "(Admin)" : "",
 				user->userflags & CONFFLAG_MONITOR ? "(Listen only)" : "",
@@ -1676,12 +1675,11 @@
 		        "CIDnum: %s\r\n"
 			"CIDname: %s\r\n"
 		        "Duration: %02d:%02d:%02d\r\n",
-			 chan->name, chan->uniqueid, conf->confno, 
-			  user->user_no,
-			  user->chan->cid.cid_num ? user->chan->cid.cid_num :
-		         "<unknown>",
-		         user->chan->cid.cid_name ? user->chan->cid.cid_name :
-		          "<no name>", hr, min, sec);
+			chan->name, chan->uniqueid, conf->confno, 
+			user->user_no,
+			S_OR(user->chan->cid.cid_num, "<unknown>"),
+		        S_OR(user->chan->cid.cid_name, "<no name>"),
+			hr, min, sec);
 
 		conf->users--;
 		conf->refcount--;
@@ -2425,7 +2423,7 @@
 	ast_config_destroy(cfg);
 }
 
-int unload_module(void)
+static int unload_module(void *mod)
 {
 	int res;
 	
@@ -2440,7 +2438,7 @@
 	return res;
 }
 
-int load_module(void)
+static int load_module(void *mod)
 {
 	int res;
 
@@ -2455,29 +2453,21 @@
 	return res;
 }
 
-int reload(void)
+static int reload(void *mod)
 {
 	load_config();
 
 	return 0;
 }
 
-const char *description(void)
-{
-	return (char *) tdesc;
-}
-
-int usecount(void)
-{
-	int res;
-
-	STANDARD_USECOUNT(res);
-
-	return res;
-}
-
-const char *key()
+static const char *description(void)
+{
+	return "MeetMe conference bridge";
+}
+
+static const char *key(void)
 {
 	return ASTERISK_GPL_KEY;
 }
  
+STD_MOD(MOD_1, reload, NULL, NULL);

Modified: team/oej/metermaids-trunk/apps/app_milliwatt.c
URL: http://svn.digium.com/view/asterisk/team/oej/metermaids-trunk/apps/app_milliwatt.c?rev=24203&r1=24202&r2=24203&view=diff
==============================================================================
--- team/oej/metermaids-trunk/apps/app_milliwatt.c (original)
+++ team/oej/metermaids-trunk/apps/app_milliwatt.c Tue May  2 10:10:48 2006
@@ -42,8 +42,6 @@
 #include "asterisk/pbx.h"
 #include "asterisk/module.h"
 #include "asterisk/utils.h"
-
-static char *tdesc = "Digital Milliwatt (mu-law) Test Application";
 
 static char *app = "Milliwatt";
 
@@ -140,7 +138,7 @@
 	return -1;
 }
 
-int unload_module(void)
+static int unload_module(void *mod)
 {
 	int res;
 
@@ -151,24 +149,19 @@
 	return res;
 }
 
-int load_module(void)
+static int load_module(void *mod)
 {
 	return ast_register_application(app, milliwatt_exec, synopsis, descrip);
 }
 
-const char *description(void)
+static const char *description(void)
 {
-	return tdesc;
+	return "Digital Milliwatt (mu-law) Test Application";
 }
 
-int usecount(void)
-{
-	int res;
-	STANDARD_USECOUNT(res);
-	return res;
-}
-
-const char *key()
+static const char *key(void)
 {
 	return ASTERISK_GPL_KEY;
 }
+
+STD_MOD1;

Modified: team/oej/metermaids-trunk/apps/app_mixmonitor.c
URL: http://svn.digium.com/view/asterisk/team/oej/metermaids-trunk/apps/app_mixmonitor.c?rev=24203&r1=24202&r2=24203&view=diff
==============================================================================
--- team/oej/metermaids-trunk/apps/app_mixmonitor.c (original)
+++ team/oej/metermaids-trunk/apps/app_mixmonitor.c Tue May  2 10:10:48 2006
@@ -57,7 +57,6 @@
 
 #define get_volfactor(x) x ? ((x > 0) ? (1 << x) : ((1 << abs(x)) * -1)) : 0
 
-static const char *tdesc = "Mixed Audio Monitoring Application";
 static const char *app = "MixMonitor";
 static const char *synopsis = "Record a call and mix the audio during the recording";
 static const char *desc = ""
@@ -88,7 +87,7 @@
 "on the current channel.\n"
 "";
 
-LOCAL_USER_DECL;
+struct module_symbols *me;
 
 static const char *mixmonitor_spy_type = "MixMonitor";
 
@@ -169,7 +168,7 @@
 	struct ast_frame *f;
 	char post_process[1024] = "";
 	
-	STANDARD_INCREMENT_USECOUNT;
+	ast_atomic_fetchadd_int(&__mod_desc->usecnt, +1);
 
 	name = ast_strdupa(mixmonitor->chan->name);
 
@@ -282,7 +281,7 @@
 out:
 	free(mixmonitor);
 
-	STANDARD_DECREMENT_USECOUNT;
+	ast_atomic_fetchadd_int(&__mod_desc->usecnt, -1);
 
 	return NULL;
 }
@@ -461,7 +460,7 @@
 	complete_mixmonitor_cli
 };
 
-int unload_module(void)
+static int unload_module(void *mod)
 {
 	int res;
 
@@ -474,7 +473,7 @@
 	return res;
 }
 
-int load_module(void)
+static int load_module(void *mod)
 {
 	int res;
 
@@ -485,21 +484,14 @@
 	return res;
 }
 
-const char *description(void)
-{
-	return (char *) tdesc;
-}
-
-int usecount(void)
-{
-	int res;
-
-	STANDARD_USECOUNT(res);
-
-	return res;
-}
-
-const char *key()
+static const char *description(void)
+{
+	return "Mixed Audio Monitoring Application";
+}
+
+static const char *key(void)
 {
 	return ASTERISK_GPL_KEY;
 }
+
+STD_MOD1;

Modified: team/oej/metermaids-trunk/apps/app_morsecode.c
URL: http://svn.digium.com/view/asterisk/team/oej/metermaids-trunk/apps/app_morsecode.c?rev=24203&r1=24202&r2=24203&view=diff
==============================================================================
--- team/oej/metermaids-trunk/apps/app_morsecode.c (original)
+++ team/oej/metermaids-trunk/apps/app_morsecode.c Tue May  2 10:10:48 2006
@@ -162,7 +162,7 @@
 	return res;
 }
 
-int unload_module(void)
+static int unload_module(void *mod)
 {
 	int res;
 
@@ -173,24 +173,19 @@
 	return res;
 }
 
-int load_module(void)
+static int load_module(void *mod)
 {
 	return ast_register_application(app_morsecode, morsecode_exec, morsecode_synopsis, morsecode_descrip);
 }
 
-const char *description(void)
+static const char *description(void)
 {
 	return tdesc;
 }
 
-int usecount(void)
-{
-	int res;
-	STANDARD_USECOUNT(res);
-	return res;
-}
-
-const char *key()
+static const char *key(void)
 {
 	return ASTERISK_GPL_KEY;
 }
+
+STD_MOD1;

Modified: team/oej/metermaids-trunk/apps/app_mp3.c
URL: http://svn.digium.com/view/asterisk/team/oej/metermaids-trunk/apps/app_mp3.c?rev=24203&r1=24202&r2=24203&view=diff
==============================================================================
--- team/oej/metermaids-trunk/apps/app_mp3.c (original)
+++ team/oej/metermaids-trunk/apps/app_mp3.c Tue May  2 10:10:48 2006
@@ -226,7 +226,7 @@
 	return res;
 }
 
-int unload_module(void)
+static int unload_module(void *mod)
 {
 	int res;
 
@@ -237,24 +237,19 @@
 	return res;
 }
 
-int load_module(void)
+static int load_module(void *mod)
 {
 	return ast_register_application(app, mp3_exec, synopsis, descrip);
 }
 
-const char *description(void)
+static const char *description(void)
 {
 	return tdesc;
 }
 
-int usecount(void)
-{
-	int res;
-	STANDARD_USECOUNT(res);
-	return res;
-}
-
-const char *key()
+static const char *key(void)
 {
 	return ASTERISK_GPL_KEY;
 }
+
+STD_MOD1;

Modified: team/oej/metermaids-trunk/apps/app_parkandannounce.c
URL: http://svn.digium.com/view/asterisk/team/oej/metermaids-trunk/apps/app_parkandannounce.c?rev=24203&r1=24202&r2=24203&view=diff
==============================================================================
--- team/oej/metermaids-trunk/apps/app_parkandannounce.c (original)
+++ team/oej/metermaids-trunk/apps/app_parkandannounce.c Tue May  2 10:10:48 2006
@@ -255,9 +255,7 @@
 	return res;
 }
 
-
-
-int unload_module(void)
+static int unload_module(void *mod)
 {
 	int res;
 
@@ -268,25 +266,20 @@
 	return res;
 }
 
-int load_module(void)
+static int load_module(void *mod)
 {
 	/* return ast_register_application(app, park_exec); */
 	return ast_register_application(app, parkandannounce_exec, synopsis, descrip);
 }
 
-const char *description(void)
+static const char *description(void)
 {
 	return tdesc;
 }
 
-int usecount(void)
-{
-	int res;
-	STANDARD_USECOUNT(res);
-	return res;
-}
-
-const char *key()
+static const char *key(void)
 {
 	return ASTERISK_GPL_KEY;
 }
+

[... 5714 lines stripped ...]


More information about the asterisk-commits mailing list