[svn-commits] kmoore: branch kmoore/channel_event_refactor r392857 - in /team/kmoore/channe...

SVN commits to the Digium repositories svn-commits at lists.digium.com
Tue Jun 25 13:37:07 CDT 2013


Author: kmoore
Date: Tue Jun 25 13:37:04 2013
New Revision: 392857

URL: http://svnview.digium.com/svn/asterisk?view=rev&rev=392857
Log:
Rip out ChannelUpdate events and exclusively supporting code

Modified:
    team/kmoore/channel_event_refactor/channels/chan_gtalk.c
    team/kmoore/channel_event_refactor/channels/chan_iax2.c
    team/kmoore/channel_event_refactor/channels/chan_sip.c
    team/kmoore/channel_event_refactor/channels/sip/include/sip.h
    team/kmoore/channel_event_refactor/configs/sip.conf.sample

Modified: team/kmoore/channel_event_refactor/channels/chan_gtalk.c
URL: http://svnview.digium.com/svn/asterisk/team/kmoore/channel_event_refactor/channels/chan_gtalk.c?view=diff&rev=392857&r1=392856&r2=392857
==============================================================================
--- team/kmoore/channel_event_refactor/channels/chan_gtalk.c (original)
+++ team/kmoore/channel_event_refactor/channels/chan_gtalk.c Tue Jun 25 13:37:04 2013
@@ -46,23 +46,6 @@
 	<use type="external">openssl</use>
 	<support_level>deprecated</support_level>
 	<replacement>chan_motif</replacement>
- ***/
-
-/*** DOCUMENTATION
-	<managerEvent language="en_US" name="ChannelUpdate">
-		<managerEventInstance class="EVENT_FLAG_SYSTEM">
-			<synopsis>Raised when a GTalk SID is established for a call.</synopsis>
-			<syntax>
-				<xi:include xpointer="xpointer(/docs/managerEvent[@name='Newchannel']/managerEventInstance/syntax/parameter)" />
-				<parameter name="Gtalk-SID">
-					<para>The Gtalk session identifier.</para>
-				</parameter>
-				<parameter name="Channeltype">
-					<para>The type of the channel (always <literal>Gtalk</literal>).</para>
-				</parameter>
-			</syntax>
-		</managerEventInstance>
-	</managerEvent>
  ***/
 
 #include "asterisk.h"
@@ -273,11 +256,6 @@
 
 static struct gtalk_container gtalk_list;
 
-static struct ast_manager_event_blob *channel_update_to_ami(struct stasis_message *msg);
-STASIS_MESSAGE_TYPE_DEFN_LOCAL(channel_update_type,
-	.to_ami = channel_update_to_ami,
-	);
-
 static void gtalk_member_destroy(struct gtalk *obj)
 {
 	obj->cap = ast_format_cap_destroy(obj->cap);
@@ -561,40 +539,6 @@
 	return IKS_FILTER_EAT;
 }
 
-static struct ast_manager_event_blob *channel_update_to_ami(struct stasis_message *msg)
-{
-	RAII_VAR(struct ast_str *, channel_string, NULL, ast_free);
-	struct ast_channel_blob *obj = stasis_message_data(msg);
-	const char *sid = ast_json_string_get(ast_json_object_get(obj->blob, "gtalk_sid"));
-
-	if (obj->snapshot) {
-		channel_string = ast_manager_build_channel_state_string(obj->snapshot);
-		if (!channel_string) {
-			return NULL;
-		}
-	}
-
-	return ast_manager_event_blob_create(EVENT_FLAG_SYSTEM, "ChannelUpdate",
-		"%s"
-		"Channeltype: Gtalk\r\n"
-		"Gtalk-SID: %s\r\n",
-		S_COR(obj->snapshot, ast_str_buffer(channel_string), ""), sid);
-}
-
-static void send_channel_update(struct ast_channel *chan, const char *sid)
-{
-	RAII_VAR(struct ast_json *, blob, NULL, ast_json_unref);
-
-	ast_assert(sid != NULL);
-
-	blob = ast_json_pack("{s: s}", "gtalk_sid", sid);
-	if (!blob) {
-		return;
-	}
-
-	ast_channel_publish_blob(chan, channel_update_type(), blob);
-}
-
 static int gtalk_answer(struct ast_channel *ast)
 {
 	struct gtalk_pvt *p = ast_channel_tech_pvt(ast);
@@ -603,7 +547,6 @@
 	ast_debug(1, "Answer!\n");
 	ast_mutex_lock(&p->lock);
 	gtalk_invite(p, p->them, p->us,p->sid, 0);
-	send_channel_update(ast, p->sid);
 	ast_mutex_unlock(&p->lock);
 	return res;
 }
@@ -2376,10 +2319,6 @@
 	char *jabber_loaded = ast_module_helper("", "res_jabber.so", 0, 0, 0, 0);
 	struct ast_format tmpfmt;
 
-	if (STASIS_MESSAGE_TYPE_INIT(channel_update_type)) {
-		return AST_MODULE_LOAD_FAILURE;
-	}
-
 	if (!(gtalk_tech.capabilities = ast_format_cap_alloc())) {
 		return AST_MODULE_LOAD_DECLINE;
 	}
@@ -2477,7 +2416,6 @@
 	ASTOBJ_CONTAINER_DESTROY(&gtalk_list);
 	global_capability = ast_format_cap_destroy(global_capability);
 	gtalk_tech.capabilities = ast_format_cap_destroy(gtalk_tech.capabilities);
-	STASIS_MESSAGE_TYPE_CLEANUP(channel_update_type);
 	return 0;
 }
 

Modified: team/kmoore/channel_event_refactor/channels/chan_iax2.c
URL: http://svnview.digium.com/svn/asterisk/team/kmoore/channel_event_refactor/channels/chan_iax2.c?view=diff&rev=392857&r1=392856&r2=392857
==============================================================================
--- team/kmoore/channel_event_refactor/channels/chan_iax2.c (original)
+++ team/kmoore/channel_event_refactor/channels/chan_iax2.c Tue Jun 25 13:37:04 2013
@@ -1392,17 +1392,6 @@
 	reload_config(1);
 }
 
-
-/*! \brief Send manager event at call setup to link between Asterisk channel name
-	and IAX2 call identifiers */
-static void iax2_ami_channelupdate(struct chan_iax2_pvt *pvt)
-{
-	manager_event(EVENT_FLAG_SYSTEM, "ChannelUpdate",
-		"Channel: %s\r\nChanneltype: IAX2\r\nIAX2-callno-local: %d\r\nIAX2-callno-remote: %d\r\nIAX2-peer: %s\r\n",
-		pvt->owner ? ast_channel_name(pvt->owner) : "",
-		pvt->callno, pvt->peercallno, pvt->peer ? pvt->peer : "");
-}
-
 static const struct ast_datastore_info iax2_variable_datastore_info = {
 	.type = "IAX2_VARIABLE",
 	.duplicate = iax2_dup_variable_datastore,
@@ -5552,10 +5541,6 @@
 {
 	unsigned short callno = PTR_TO_CALLNO(ast_channel_tech_pvt(c));
 	ast_debug(1, "Answering IAX2 call\n");
-	ast_mutex_lock(&iaxsl[callno]);
-	if (iaxs[callno])
-		iax2_ami_channelupdate(iaxs[callno]);
-	ast_mutex_unlock(&iaxsl[callno]);
 	return send_command_locked(callno, AST_FRAME_CONTROL, AST_CONTROL_ANSWER, 0, NULL, 0, -1);
 }
 
@@ -5678,7 +5663,6 @@
 		}
 		return NULL;
 	}
-	iax2_ami_channelupdate(i);
 	if (!tmp) {
 		return NULL;
 	}

Modified: team/kmoore/channel_event_refactor/channels/chan_sip.c
URL: http://svnview.digium.com/svn/asterisk/team/kmoore/channel_event_refactor/channels/chan_sip.c?view=diff&rev=392857&r1=392856&r2=392857
==============================================================================
--- team/kmoore/channel_event_refactor/channels/chan_sip.c (original)
+++ team/kmoore/channel_event_refactor/channels/chan_sip.c Tue Jun 25 13:37:04 2013
@@ -8249,13 +8249,6 @@
 		append_history(i, "NewChan", "Channel %s - from %s", ast_channel_name(tmp), i->callid);
 	}
 
-	/* Inform manager user about new channel and their SIP call ID */
-	if (sip_cfg.callevents) {
-		manager_event(EVENT_FLAG_SYSTEM, "ChannelUpdate",
-			"Channel: %s\r\nUniqueid: %s\r\nChanneltype: %s\r\nSIPcallid: %s\r\nSIPfullcontact: %s\r\n",
-			ast_channel_name(tmp), ast_channel_uniqueid(tmp), "SIP", i->callid, i->fullcontact);
-	}
-
 	return tmp;
 }
 
@@ -20913,7 +20906,6 @@
 		ast_cli(a->fd, "  From: Domain:           %s\n", default_fromdomain);
 	}
 	ast_cli(a->fd, "  Record SIP history:     %s\n", AST_CLI_ONOFF(recordhistory));
-	ast_cli(a->fd, "  Call Events:            %s\n", AST_CLI_ONOFF(sip_cfg.callevents));
 	ast_cli(a->fd, "  Auth. Failure Events:   %s\n", AST_CLI_ONOFF(global_authfailureevents));
 
 	ast_cli(a->fd, "  T.38 support:           %s\n", AST_CLI_YESNO(ast_test_flag(&global_flags[1], SIP_PAGE2_T38SUPPORT)));
@@ -23166,11 +23158,6 @@
 		if (!req->ignore && p->owner) {
 			if (!reinvite) {
 				ast_queue_control(p->owner, AST_CONTROL_ANSWER);
-				if (sip_cfg.callevents) {
-					manager_event(EVENT_FLAG_SYSTEM, "ChannelUpdate",
-						"Channel: %s\r\nChanneltype: %s\r\nUniqueid: %s\r\nSIPcallid: %s\r\nSIPfullcontact: %s\r\nPeername: %s\r\n",
-						ast_channel_name(p->owner), "SIP", ast_channel_uniqueid(p->owner), p->callid, p->fullcontact, p->peername);
-				}
 			} else {	/* RE-invite */
 				if (p->t38.state == T38_DISABLED || p->t38.state == T38_REJECTED) {
 					ast_queue_control(p->owner, AST_CONTROL_UPDATE_RTP_PEER);
@@ -29607,10 +29594,6 @@
 		callid = ast_callid_unref(callid);
 	}
 
-	if (sip_cfg.callevents)
-		manager_event(EVENT_FLAG_SYSTEM, "ChannelUpdate",
-			"Channel: %s\r\nChanneltype: %s\r\nSIPcallid: %s\r\nSIPfullcontact: %s\r\nPeername: %s\r\n",
-			p->owner? ast_channel_name(p->owner) : "", "SIP", p->callid, p->fullcontact, p->peername);
 	sip_pvt_unlock(p);
 	if (!tmpc) {
 		dialog_unlink_all(p);
@@ -31216,7 +31199,6 @@
 
 	/* Misc settings for the channel */
 	global_relaxdtmf = FALSE;
-	sip_cfg.callevents = DEFAULT_CALLEVENTS;
 	global_authfailureevents = FALSE;
 	global_t1 = DEFAULT_TIMER_T1;
 	global_timer_b = 64 * DEFAULT_TIMER_T1;
@@ -31697,8 +31679,6 @@
 				ast_log(LOG_WARNING, "Invalid qualifyfreq number '%s' at line %d of %s\n", v->value, v->lineno, config);
 				global_qualifyfreq = DEFAULT_QUALIFYFREQ;
 			}
-		} else if (!strcasecmp(v->name, "callevents")) {
-			sip_cfg.callevents = ast_true(v->value);
 		} else if (!strcasecmp(v->name, "authfailureevents")) {
 			global_authfailureevents = ast_true(v->value);
 		} else if (!strcasecmp(v->name, "maxcallbitrate")) {

Modified: team/kmoore/channel_event_refactor/channels/sip/include/sip.h
URL: http://svnview.digium.com/svn/asterisk/team/kmoore/channel_event_refactor/channels/sip/include/sip.h?view=diff&rev=392857&r1=392856&r2=392857
==============================================================================
--- team/kmoore/channel_event_refactor/channels/sip/include/sip.h (original)
+++ team/kmoore/channel_event_refactor/channels/sip/include/sip.h Tue Jun 25 13:37:04 2013
@@ -219,7 +219,6 @@
 #define DEFAULT_QUALIFY        FALSE    /*!< Don't monitor devices */
 #define DEFAULT_KEEPALIVE      0        /*!< Don't send keep alive packets */
 #define DEFAULT_KEEPALIVE_INTERVAL 60   /*!< Send keep alive packets at 60 second intervals */
-#define DEFAULT_CALLEVENTS     FALSE    /*!< Extra manager SIP call events */
 #define DEFAULT_ALWAYSAUTHREJECT  TRUE  /*!< Don't reject authentication requests always */
 #define DEFAULT_AUTH_OPTIONS  FALSE
 #define DEFAULT_AUTH_MESSAGE  TRUE
@@ -744,7 +743,6 @@
 	int accept_outofcall_message; /*!< Accept MESSAGE outside of a call */
 	int compactheaders;         /*!< send compact sip headers */
 	int allow_external_domains; /*!< Accept calls to external SIP domains? */
-	int callevents;             /*!< Whether we send manager events or not */
 	int regextenonqualify;      /*!< Whether to add/remove regexten when qualifying peers */
 	int legacy_useroption_parsing; /*!< Whether to strip useroptions in URI via semicolons */
 	int send_diversion;	        /*!< Whether to Send SIP Diversion headers */

Modified: team/kmoore/channel_event_refactor/configs/sip.conf.sample
URL: http://svnview.digium.com/svn/asterisk/team/kmoore/channel_event_refactor/configs/sip.conf.sample?view=diff&rev=392857&r1=392856&r2=392857
==============================================================================
--- team/kmoore/channel_event_refactor/configs/sip.conf.sample (original)
+++ team/kmoore/channel_event_refactor/configs/sip.conf.sample Tue Jun 25 13:37:04 2013
@@ -397,8 +397,6 @@
 ;maxcallbitrate=384             ; Maximum bitrate for video calls (default 384 kb/s)
                                 ; Videosupport and maxcallbitrate is settable
                                 ; for peers and users as well
-;callevents=no                  ; generate manager events when sip ua
-                                ; performs events (e.g. hold)
 ;authfailureevents=no           ; generate manager "peerstatus" events when peer can't
                                 ; authenticate with Asterisk. Peerstatus will be "rejected".
 ;alwaysauthreject = yes         ; When an incoming INVITE or REGISTER is to be rejected,




More information about the svn-commits mailing list