[asterisk-commits] file: branch file/bridge_unreal r410305 - /team/file/bridge_unreal/main/

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Sun Mar 9 15:45:20 CDT 2014


Author: file
Date: Sun Mar  9 15:45:09 2014
New Revision: 410305

URL: http://svnview.digium.com/svn/asterisk?view=rev&rev=410305
Log:
Remove a bit more old optimization stuff.

Modified:
    team/file/bridge_unreal/main/core_local.c

Modified: team/file/bridge_unreal/main/core_local.c
URL: http://svnview.digium.com/svn/asterisk/team/file/bridge_unreal/main/core_local.c?view=diff&rev=410305&r1=410304&r2=410305
==============================================================================
--- team/file/bridge_unreal/main/core_local.c (original)
+++ team/file/bridge_unreal/main/core_local.c Sun Mar  9 15:45:09 2014
@@ -50,88 +50,6 @@
 #include "asterisk/stasis_channels.h"
 #include "asterisk/_private.h"
 #include "asterisk/stasis_channels.h"
-
-/*** DOCUMENTATION
-	<manager name="LocalOptimizeAway" language="en_US">
-		<synopsis>
-			Optimize away a local channel when possible.
-		</synopsis>
-		<syntax>
-			<xi:include xpointer="xpointer(/docs/manager[@name='Login']/syntax/parameter[@name='ActionID'])" />
-			<parameter name="Channel" required="true">
-				<para>The channel name to optimize away.</para>
-			</parameter>
-		</syntax>
-		<description>
-			<para>A local channel created with "/n" will not automatically optimize away.
-			Calling this command on the local channel will clear that flag and allow
-			it to optimize away if it's bridged or when it becomes bridged.</para>
-		</description>
-	</manager>
-	<managerEvent language="en_US" name="LocalBridge">
-		<managerEventInstance class="EVENT_FLAG_CALL">
-			<synopsis>Raised when two halves of a Local Channel form a bridge.</synopsis>
-			<syntax>
-				<channel_snapshot prefix="LocalOne"/>
-				<channel_snapshot prefix="LocalTwo"/>
-				<parameter name="Context">
-					<para>The context in the dialplan that Channel2 starts in.</para>
-				</parameter>
-				<parameter name="Exten">
-					<para>The extension in the dialplan that Channel2 starts in.</para>
-				</parameter>
-				<parameter name="LocalOptimization">
-					<enumlist>
-						<enum name="Yes"/>
-						<enum name="No"/>
-					</enumlist>
-				</parameter>
-			</syntax>
-		</managerEventInstance>
-	</managerEvent>
-	<managerEvent language="en_US" name="LocalOptimizationBegin">
-		<managerEventInstance class="EVENT_FLAG_CALL">
-			<synopsis>Raised when two halves of a Local Channel begin to optimize
-			themselves out of the media path.</synopsis>
-			<syntax>
-				<channel_snapshot prefix="LocalOne"/>
-				<channel_snapshot prefix="LocalTwo"/>
-				<channel_snapshot prefix="Source"/>
-				<parameter name="DestUniqueId">
-					<para>The unique ID of the bridge into which the local channel is optimizing.</para>
-				</parameter>
-				<parameter name="Id">
-					<para>Identification for the optimization operation.</para>
-				</parameter>
-			</syntax>
-			<see-also>
-				<ref type="managerEvent">LocalOptimizationEnd</ref>
-				<ref type="manager">LocalOptimizeAway</ref>
-			</see-also>
-		</managerEventInstance>
-	</managerEvent>
-	<managerEvent language="en_US" name="LocalOptimizationEnd">
-		<managerEventInstance class="EVENT_FLAG_CALL">
-			<synopsis>Raised when two halves of a Local Channel have finished optimizing
-			themselves out of the media path.</synopsis>
-			<syntax>
-				<channel_snapshot prefix="LocalOne"/>
-				<channel_snapshot prefix="LocalTwo"/>
-				<parameter name="Success">
-					<para>Indicates whether the local optimization succeeded.</para>
-				</parameter>
-				<parameter name="Id">
-					<para>Identification for the optimization operation. Matches the <replaceable>Id</replaceable>
-					from a previous <literal>LocalOptimizationBegin</literal></para>
-				</parameter>
-			</syntax>
-			<see-also>
-				<ref type="managerEvent">LocalOptimizationBegin</ref>
-				<ref type="manager">LocalOptimizeAway</ref>
-			</see-also>
-		</managerEventInstance>
-	</managerEvent>
- ***/
 
 static const char tdesc[] = "Local Proxy Channel Driver";
 
@@ -803,43 +721,6 @@
 	AST_CLI_DEFINE(locals_show, "List status of local channels"),
 };
 
-static int manager_optimize_away(struct mansession *s, const struct message *m)
-{
-	const char *channel;
-	struct local_pvt *p;
-	struct local_pvt *found;
-	struct ast_channel *chan;
-
-	channel = astman_get_header(m, "Channel");
-	if (ast_strlen_zero(channel)) {
-		astman_send_error(s, m, "'Channel' not specified.");
-		return 0;
-	}
-
-	chan = ast_channel_get_by_name(channel);
-	if (!chan) {
-		astman_send_error(s, m, "Channel does not exist.");
-		return 0;
-	}
-
-	p = ast_channel_tech_pvt(chan);
-	ast_channel_unref(chan);
-
-	found = p ? ao2_find(locals, p, 0) : NULL;
-	if (found) {
-		ao2_lock(found);
-		ast_clear_flag(&found->base, AST_UNREAL_NO_OPTIMIZATION);
-		ao2_unlock(found);
-		ao2_ref(found, -1);
-		astman_send_ack(s, m, "Queued channel to be optimized away");
-	} else {
-		astman_send_error(s, m, "Unable to find channel");
-	}
-
-	return 0;
-}
-
-
 static int locals_cmp_cb(void *obj, void *arg, int flags)
 {
 	return (obj == arg) ? CMP_MATCH : 0;
@@ -859,7 +740,6 @@
 
 	/* First, take us out of the channel loop */
 	ast_cli_unregister_multiple(cli_local, ARRAY_LEN(cli_local));
-	ast_manager_unregister("LocalOptimizeAway");
 	ast_channel_unregister(&local_tech);
 
 	it = ao2_iterator_init(locals, 0);
@@ -903,7 +783,6 @@
 		return -1;
 	}
 	ast_cli_register_multiple(cli_local, ARRAY_LEN(cli_local));
-	ast_manager_register_xml_core("LocalOptimizeAway", EVENT_FLAG_SYSTEM|EVENT_FLAG_CALL, manager_optimize_away);
 
 	ast_register_atexit(local_shutdown);
 	return 0;




More information about the asterisk-commits mailing list