[asterisk-commits] kpfleming: branch kpfleming/constify r195446 - in /team/kpfleming/constify: ....

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Mon May 18 17:48:06 CDT 2009


Author: kpfleming
Date: Mon May 18 17:48:02 2009
New Revision: 195446

URL: http://svn.asterisk.org/svn-view/asterisk?view=rev&rev=195446
Log:
merge up to date and re-enable automerge

Modified:
    team/kpfleming/constify/   (props changed)
    team/kpfleming/constify/apps/app_queue.c
    team/kpfleming/constify/apps/app_voicemail.c
    team/kpfleming/constify/include/asterisk/monitor.h
    team/kpfleming/constify/include/asterisk/smdi.h
    team/kpfleming/constify/main/manager.c
    team/kpfleming/constify/res/res_agi.c
    team/kpfleming/constify/res/res_monitor.c
    team/kpfleming/constify/res/res_smdi.c

Propchange: team/kpfleming/constify/
------------------------------------------------------------------------------
    automerge = *

Propchange: team/kpfleming/constify/
------------------------------------------------------------------------------
Binary property 'branch-1.4-merged' - no diff available.

Propchange: team/kpfleming/constify/
------------------------------------------------------------------------------
--- svnmerge-integrated (original)
+++ svnmerge-integrated Mon May 18 17:48:02 2009
@@ -1,1 +1,1 @@
-/trunk:1-195339
+/trunk:1-195444

Modified: team/kpfleming/constify/apps/app_queue.c
URL: http://svn.asterisk.org/svn-view/asterisk/team/kpfleming/constify/apps/app_queue.c?view=diff&rev=195446&r1=195445&r2=195446
==============================================================================
--- team/kpfleming/constify/apps/app_queue.c (original)
+++ team/kpfleming/constify/apps/app_queue.c Mon May 18 17:48:02 2009
@@ -4092,16 +4092,18 @@
 				else
 					which = peer;
 				ast_channel_unlock(qe->chan);
-				if (monitorfilename)
-					ast_monitor_start(which, qe->parent->monfmt, monitorfilename, 1, X_REC_IN | X_REC_OUT);
-				else if (qe->chan->cdr)
-					ast_monitor_start(which, qe->parent->monfmt, qe->chan->cdr->uniqueid, 1, X_REC_IN | X_REC_OUT);
-				else {
-					/* Last ditch effort -- no CDR, make up something */
-					snprintf(tmpid, sizeof(tmpid), "chan-%lx", ast_random());
-					ast_monitor_start(which, qe->parent->monfmt, tmpid, 1, X_REC_IN | X_REC_OUT);
+				if (ast_monitor_start) {
+					if (monitorfilename) {
+						ast_monitor_start(which, qe->parent->monfmt, monitorfilename, 1, X_REC_IN | X_REC_OUT);
+					} else if (qe->chan->cdr && ast_monitor_start) {
+						ast_monitor_start(which, qe->parent->monfmt, qe->chan->cdr->uniqueid, 1, X_REC_IN | X_REC_OUT);
+					} else if (ast_monitor_start) {
+						/* Last ditch effort -- no CDR, make up something */
+						snprintf(tmpid, sizeof(tmpid), "chan-%lx", ast_random());
+						ast_monitor_start(which, qe->parent->monfmt, tmpid, 1, X_REC_IN | X_REC_OUT);
+					}
 				}
-				if (!ast_strlen_zero(monexec)) {
+				if (!ast_strlen_zero(monexec) && ast_monitor_setjoinfiles) {
 					ast_monitor_setjoinfiles(which, 1);
 				}
 			} else {

Modified: team/kpfleming/constify/apps/app_voicemail.c
URL: http://svn.asterisk.org/svn-view/asterisk/team/kpfleming/constify/apps/app_voicemail.c?view=diff&rev=195446&r1=195445&r2=195446
==============================================================================
--- team/kpfleming/constify/apps/app_voicemail.c (original)
+++ team/kpfleming/constify/apps/app_voicemail.c Mon May 18 17:48:02 2009
@@ -10686,10 +10686,10 @@
 		if ((val = ast_variable_retrieve(cfg, "general", "smdienable")) && ast_true(val)) {
 			ast_debug(1, "Enabled SMDI voicemail notification\n");
 			if ((val = ast_variable_retrieve(cfg, "general", "smdiport"))) {
-				smdi_iface = ast_smdi_interface_find(val);
+				smdi_iface = ast_smdi_interface_find ? ast_smdi_interface_find(val) : NULL;
 			} else {
 				ast_debug(1, "No SMDI interface set, trying default (/dev/ttyS0)\n");
-				smdi_iface = ast_smdi_interface_find("/dev/ttyS0");
+				smdi_iface = ast_smdi_interface_find ? ast_smdi_interface_find("/dev/ttyS0") : NULL;
 			}
 			if (!smdi_iface) {
 				ast_log(AST_LOG_ERROR, "No valid SMDI interface specfied, disabling SMDI voicemail notification\n");

Modified: team/kpfleming/constify/include/asterisk/monitor.h
URL: http://svn.asterisk.org/svn-view/asterisk/team/kpfleming/constify/include/asterisk/monitor.h?view=diff&rev=195446&r1=195445&r2=195446
==============================================================================
--- team/kpfleming/constify/include/asterisk/monitor.h (original)
+++ team/kpfleming/constify/include/asterisk/monitor.h Mon May 18 17:48:02 2009
@@ -24,6 +24,7 @@
 #define _ASTERISK_MONITOR_H
 
 #include "asterisk/channel.h"
+#include "asterisk/optional_api.h"
 
 enum AST_MONITORING_STATE {
 	AST_MONITOR_RUNNING,
@@ -50,22 +51,27 @@
 };
 
 /* Start monitoring a channel */
-int ast_monitor_start(struct ast_channel *chan, const char *format_spec,
-		      const char *fname_base, int need_lock, int stream_action);
+AST_OPTIONAL_API(int, ast_monitor_start, (struct ast_channel *chan, const char
+	*format_spec, const char *fname_base, int need_lock, int stream_action),
+	{ return -1; });
 
 /* Stop monitoring a channel */
-int ast_monitor_stop(struct ast_channel *chan, int need_lock);
+AST_OPTIONAL_API(int, ast_monitor_stop, (struct ast_channel *chan, int
+	need_lock), { return -1; });
 
 /* Change monitoring filename of a channel */
-int ast_monitor_change_fname(struct ast_channel *chan,
-			     const char *fname_base, int need_lock);
+AST_OPTIONAL_API(int, ast_monitor_change_fname, (struct ast_channel *chan,
+	const char *fname_base, int need_lock), { return -1; });
 
-void ast_monitor_setjoinfiles(struct ast_channel *chan, int turnon);
+AST_OPTIONAL_API(void, ast_monitor_setjoinfiles, (struct ast_channel *chan,
+	int turnon), { return; });
 
 /* Pause monitoring of a channel */
-int ast_monitor_pause(struct ast_channel *chan);
+AST_OPTIONAL_API(int, ast_monitor_pause, (struct ast_channel *chan),
+	{ return -1; });
 
 /* Unpause monitoring of a channel */
-int ast_monitor_unpause(struct ast_channel *chan);
+AST_OPTIONAL_API(int, ast_monitor_unpause, (struct ast_channel *chan),
+	{ return -1; });
 
 #endif /* _ASTERISK_MONITOR_H */

Modified: team/kpfleming/constify/include/asterisk/smdi.h
URL: http://svn.asterisk.org/svn-view/asterisk/team/kpfleming/constify/include/asterisk/smdi.h?view=diff&rev=195446&r1=195445&r2=195446
==============================================================================
--- team/kpfleming/constify/include/asterisk/smdi.h (original)
+++ team/kpfleming/constify/include/asterisk/smdi.h Mon May 18 17:48:02 2009
@@ -37,6 +37,7 @@
 #include "asterisk/config.h"
 #include "asterisk/module.h"
 #include "asterisk/astobj.h"
+#include "asterisk/optional_api.h"
 
 #define SMDI_MESG_DESK_NUM_LEN 3
 #define SMDI_MESG_DESK_TERM_LEN 4
@@ -84,7 +85,8 @@
  */
 struct ast_smdi_interface;
 
-void ast_smdi_interface_unref(struct ast_smdi_interface *iface);
+AST_OPTIONAL_API(void, ast_smdi_interface_unref, (struct ast_smdi_interface
+	*iface), { return; });
 
 /*! 
  * \brief Get the next SMDI message from the queue.
@@ -96,7 +98,8 @@
  *
  * \return the next SMDI message, or NULL if there were no pending messages.
  */
-struct ast_smdi_md_message *ast_smdi_md_message_pop(struct ast_smdi_interface *iface);
+AST_OPTIONAL_API(struct ast_smdi_md_message *, ast_smdi_md_message_pop, (struct
+	ast_smdi_interface *iface), { return NULL; });
 
 /*!
  * \brief Get the next SMDI message from the queue.
@@ -110,7 +113,8 @@
  * \return the next SMDI message, or NULL if there were no pending messages and
  * the timeout has expired.
  */
-struct ast_smdi_md_message *ast_smdi_md_message_wait(struct ast_smdi_interface *iface, int timeout);
+AST_OPTIONAL_API(struct ast_smdi_md_message *, ast_smdi_md_message_wait,
+	(struct ast_smdi_interface *iface, int timeout), { return NULL; });
 
 /*!
  * \brief Put an SMDI message back in the front of the queue.
@@ -121,7 +125,8 @@
  * should be used if a message was popped but is not going to be processed for
  * some reason, and the message needs to be returned to the queue.
  */
-void ast_smdi_md_message_putback(struct ast_smdi_interface *iface, struct ast_smdi_md_message *msg);
+AST_OPTIONAL_API(void, ast_smdi_md_message_putback, (struct ast_smdi_interface
+	*iface, struct ast_smdi_md_message *msg), { return; });
 
 /*!
  * \brief Get the next SMDI message from the queue.
@@ -133,7 +138,8 @@
  *
  * \return the next SMDI message, or NULL if there were no pending messages.
  */
-struct ast_smdi_mwi_message *ast_smdi_mwi_message_pop(struct ast_smdi_interface *iface);
+AST_OPTIONAL_API(struct ast_smdi_mwi_message *, ast_smdi_mwi_message_pop,
+	(struct ast_smdi_interface *iface), { return NULL; });
 
 /*!
  * \brief Get the next SMDI message from the queue.
@@ -147,9 +153,11 @@
  * \return the next SMDI message, or NULL if there were no pending messages and
  * the timeout has expired.
  */
-struct ast_smdi_mwi_message *ast_smdi_mwi_message_wait(struct ast_smdi_interface *iface, int timeout);
-struct ast_smdi_mwi_message *ast_smdi_mwi_message_wait_station(struct ast_smdi_interface *iface, 
-	int timeout, const char *station);
+AST_OPTIONAL_API(struct ast_smdi_mwi_message *, ast_smdi_mwi_message_wait,
+	(struct ast_smdi_interface *iface, int timeout), { return NULL; });
+AST_OPTIONAL_API(struct ast_smdi_mwi_message *,
+	ast_smdi_mwi_message_wait_station, (struct ast_smdi_interface *iface, int
+	timeout, const char *station), { return NULL; });
 
 /*!
  * \brief Put an SMDI message back in the front of the queue.
@@ -160,7 +168,8 @@
  * should be used if a message was popped but is not going to be processed for
  * some reason, and the message needs to be returned to the queue.
  */
-void ast_smdi_mwi_message_putback(struct ast_smdi_interface *iface, struct ast_smdi_mwi_message *msg);
+AST_OPTIONAL_API(void, ast_smdi_mwi_message_putback, (struct ast_smdi_interface
+	*iface, struct ast_smdi_mwi_message *msg), { return; });
 
 /*!
  * \brief Find an SMDI interface with the specified name.
@@ -170,26 +179,31 @@
  * actually returns an ASTOBJ reference and should be released using
  * #ASTOBJ_UNREF(iface, ast_smdi_interface_destroy).
  */
-struct ast_smdi_interface *ast_smdi_interface_find(const char *iface_name);
+AST_OPTIONAL_API(struct ast_smdi_interface *, ast_smdi_interface_find,
+	(const char *iface_name), { return NULL; });
 
 /*!
  * \brief Set the MWI indicator for a mailbox.
  * \param iface the interface to use.
  * \param mailbox the mailbox to use.
  */
-int ast_smdi_mwi_set(struct ast_smdi_interface *iface, const char *mailbox);
+AST_OPTIONAL_API(int, ast_smdi_mwi_set, (struct ast_smdi_interface *iface,
+	const char *mailbox), { return -1; });
 
 /*! 
  * \brief Unset the MWI indicator for a mailbox.
  * \param iface the interface to use.
  * \param mailbox the mailbox to use.
  */
-int ast_smdi_mwi_unset(struct ast_smdi_interface *iface, const char *mailbox);
+AST_OPTIONAL_API(int, ast_smdi_mwi_unset, (struct ast_smdi_interface *iface,
+	const char *mailbox), { return -1; });
 
 /*! \brief ast_smdi_md_message destructor. */
-void ast_smdi_md_message_destroy(struct ast_smdi_md_message *msg);
+AST_OPTIONAL_API(void, ast_smdi_md_message_destroy,
+	(struct ast_smdi_md_message *msg), { return; });
 
 /*! \brief ast_smdi_mwi_message destructor. */
-void ast_smdi_mwi_message_destroy(struct ast_smdi_mwi_message *msg);
+AST_OPTIONAL_API(void, ast_smdi_mwi_message_destroy, (struct
+	ast_smdi_mwi_message *msg), { return; });
 
 #endif /* !ASTERISK_SMDI_H */

Modified: team/kpfleming/constify/main/manager.c
URL: http://svn.asterisk.org/svn-view/asterisk/team/kpfleming/constify/main/manager.c?view=diff&rev=195446&r1=195445&r2=195446
==============================================================================
--- team/kpfleming/constify/main/manager.c (original)
+++ team/kpfleming/constify/main/manager.c Mon May 18 17:48:02 2009
@@ -608,7 +608,7 @@
 	case CLI_INIT:
 		e->command = "manager show command";
 		e->usage =
-			"Usage: manager show command <actionname>\n"
+			"Usage: manager show command <actionname> [<actionname> [<actionname> [...]]]\n"
 			"	Shows the detailed description for a specific Asterisk manager interface command.\n";
 		return NULL;
 	case CLI_GENERATE:
@@ -625,7 +625,7 @@
 		return ret;
 	}
 	authority = ast_str_alloca(80);
-	if (a->argc != 4) {
+	if (a->argc < 4) {
 		return CLI_SHOWUSAGE;
 	}
 

Modified: team/kpfleming/constify/res/res_agi.c
URL: http://svn.asterisk.org/svn-view/asterisk/team/kpfleming/constify/res/res_agi.c?view=diff&rev=195446&r1=195445&r2=195446
==============================================================================
--- team/kpfleming/constify/res/res_agi.c (original)
+++ team/kpfleming/constify/res/res_agi.c Mon May 18 17:48:02 2009
@@ -288,6 +288,64 @@
 			<para>Does nothing.</para>
 		</description>
 	</agi>
+	<agi name="receive char" language="en_US">
+		<synopsis>
+			Receives one character from channels supporting it.
+		</synopsis>
+		<syntax>
+			<parameter name="timeout" required="true">
+				<para>The maximum time to wait for input in milliseconds, or <literal>0</literal>
+				for infinite. Most channels</para>
+			</parameter>
+		</syntax>
+		<description>
+			<para>Receives a character of text on a channel. Most channels do not support
+			the reception of text. Returns the decimal value of the character
+			if one is received, or <literal>0</literal> if the channel does not support
+			text reception. Returns <literal>-1</literal> only on error/hangup.</para>
+		</description>
+	</agi>
+	<agi name="receive text" language="en_US">
+		<synopsis>
+			Receives text from channels supporting it.
+		</synopsis>
+		<syntax>
+			<parameter name="timeout" required="true">
+				<para>The timeout to be the maximum time to wait for input in
+				milliseconds, or <literal>0</literal> for infinite.</para>
+			</parameter>
+		</syntax>
+		<description>
+			<para>Receives a string of text on a channel. Most channels 
+			do not support the reception of text. Returns <literal>-1</literal> for failure
+			or <literal>1</literal> for success, and the string in parenthesis.</para> 
+		</description>
+	</agi>
+	<agi name="record file" language="en_US">
+		<synopsis>
+			Records to a given file.
+		</synopsis>
+		<syntax>
+			<parameter name="filename" required="true" />
+			<parameter name="format" required="true" />
+			<parameter name="escape_digits" required="true" />
+			<parameter name="timeout" required="true" />
+			<parameter name="offset samples" />
+			<parameter name="BEEP" />
+			<parameter name="s=silence" />
+		</syntax>
+		<description>
+			<para>Record to a file until a given dtmf digit in the sequence is received.
+			Returns <literal>-1</literal> on hangup or error.  The format will specify what kind of file
+			will be recorded. The <replaceable>timeout</replaceable> is the maximum record time in
+			milliseconds, or <literal>-1</literal> for no <replaceable>timeout</replaceable>.
+			<replaceable>offset samples</replaceable> is optional, and, if provided, will seek
+			to the offset without exceeding the end of the file. <replaceable>silence</replaceable> is
+			the number of seconds of silence allowed before the function returns despite the
+			lack of dtmf digits or reaching <replaceable>timeout</replaceable>. <replaceable>silence</replaceable>
+			value must be preceeded by <literal>s=</literal> and is also optional.</para>
+		</description>
+	</agi>
 	<agi name="set music" language="en_US">
 		<synopsis>
 			Enable/Disable Music on hold generator
@@ -2326,20 +2384,6 @@
 " consisting of greater than one word should be placed in quotes since the\n"
 " command only accepts a single argument.\n";
 
-static const char usage_recvchar[] =
-" Usage: RECEIVE CHAR <timeout>\n"
-"	Receives a character of text on a channel. Specify timeout to be the\n"
-" maximum time to wait for input in milliseconds, or 0 for infinite. Most channels\n"
-" do not support the reception of text. Returns the decimal value of the character\n"
-" if one is received, or 0 if the channel does not support text reception.  Returns\n"
-" -1 only on error/hangup.\n";
-
-static const char usage_recvtext[] =
-" Usage: RECEIVE TEXT <timeout>\n"
-"	Receives a string of text on a channel. Specify timeout to be the\n"
-" maximum time to wait for input in milliseconds, or 0 for infinite. Most channels\n"
-" do not support the reception of text. Returns -1 for failure or 1 for success, and the string in parentheses.\n";
-
 static const char usage_tddmode[] =
 " Usage: TDD MODE <on|off>\n"
 "	Enable/Disable TDD transmission/reception on a channel. Returns 1 if\n"
@@ -2439,18 +2483,6 @@
 " Usage: SET PRIORITY <priority>\n"
 "	Changes the priority for continuation upon exiting the application.\n"
 " The priority must be a valid priority or label.\n";
-
-static const char usage_recordfile[] =
-" Usage: RECORD FILE <filename> <format> <escape digits> <timeout> \\\n"
-"                                          [offset samples] [BEEP] [s=silence]\n"
-"	Record to a file until a given dtmf digit in the sequence is received\n"
-" Returns -1 on hangup or error.  The format will specify what kind of file\n"
-" will be recorded.  The timeout is the maximum record time in milliseconds, or\n"
-" -1 for no timeout. \"Offset samples\" is optional, and, if provided, will seek\n"
-" to the offset without exceeding the end of the file.  \"silence\" is the number\n"
-" of seconds of silence allowed before the function returns despite the\n"
-" lack of dtmf digits or reaching timeout.  Silence value must be\n"
-" preceeded by \"s=\" and is also optional.\n";
 
 static const char usage_autohangup[] =
 " Usage: SET AUTOHANGUP <time>\n"
@@ -2508,9 +2540,9 @@
 	{ { "get", "variable", NULL }, handle_getvariable, NULL, NULL, 1 },
 	{ { "hangup", NULL }, handle_hangup, NULL, NULL, 0 },
 	{ { "noop", NULL }, handle_noop, NULL, NULL, 1 },
-	{ { "receive", "char", NULL }, handle_recvchar, "Receives one character from channels supporting it", usage_recvchar , 0 },
-	{ { "receive", "text", NULL }, handle_recvtext, "Receives text from channels supporting it", usage_recvtext , 0 },
-	{ { "record", "file", NULL }, handle_recordfile, "Records to a given file", usage_recordfile , 0 },
+	{ { "receive", "char", NULL }, handle_recvchar, NULL, NULL, 0 },
+	{ { "receive", "text", NULL }, handle_recvtext, NULL, NULL, 0 },
+	{ { "record", "file", NULL }, handle_recordfile, NULL, NULL, 0 }, 
 	{ { "say", "alpha", NULL }, handle_sayalpha, "Says a given character string", usage_sayalpha , 0 },
 	{ { "say", "digits", NULL }, handle_saydigits, "Says a given digit string", usage_saydigits , 0 },
 	{ { "say", "number", NULL }, handle_saynumber, "Says a given number", usage_saynumber , 0 },

Modified: team/kpfleming/constify/res/res_monitor.c
URL: http://svn.asterisk.org/svn-view/asterisk/team/kpfleming/constify/res/res_monitor.c?view=diff&rev=195446&r1=195445&r2=195446
==============================================================================
--- team/kpfleming/constify/res/res_monitor.c (original)
+++ team/kpfleming/constify/res/res_monitor.c Mon May 18 17:48:02 2009
@@ -38,6 +38,7 @@
 #include "asterisk/module.h"
 #include "asterisk/manager.h"
 #include "asterisk/cli.h"
+#define AST_API_MODULE
 #include "asterisk/monitor.h"
 #include "asterisk/app.h"
 #include "asterisk/utils.h"

Modified: team/kpfleming/constify/res/res_smdi.c
URL: http://svn.asterisk.org/svn-view/asterisk/team/kpfleming/constify/res/res_smdi.c?view=diff&rev=195446&r1=195445&r2=195446
==============================================================================
--- team/kpfleming/constify/res/res_smdi.c (original)
+++ team/kpfleming/constify/res/res_smdi.c Mon May 18 17:48:02 2009
@@ -43,6 +43,7 @@
 #include "asterisk/module.h"
 #include "asterisk/lock.h"
 #include "asterisk/utils.h"
+#define AST_API_MODULE
 #include "asterisk/smdi.h"
 #include "asterisk/config.h"
 #include "asterisk/astobj.h"
@@ -1332,6 +1333,8 @@
 	.read = smdi_msg_read,
 };
 
+static int unload_module(void);
+
 static int load_module(void)
 {
 	int res;
@@ -1349,8 +1352,10 @@
 	/* load the config and start the listener threads*/
 	res = smdi_load(0);
 	if (res < 0) {
+		unload_module();
 		return res;
 	} else if (res == 1) {
+		unload_module();
 		ast_log(LOG_NOTICE, "No SMDI interfaces are available to listen on, not starting SMDI listener.\n");
 		return AST_MODULE_LOAD_DECLINE;
 	}




More information about the asterisk-commits mailing list