[asterisk-commits] kmoore: branch kmoore/cel_transfers r393894 - in /team/kmoore/cel_transfers: ...

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Tue Jul 9 14:19:39 CDT 2013


Author: kmoore
Date: Tue Jul  9 14:19:37 2013
New Revision: 393894

URL: http://svnview.digium.com/svn/asterisk?view=rev&rev=393894
Log:
Rip out the last remnants of ast_cel_report_event

Modified:
    team/kmoore/cel_transfers/include/asterisk/cel.h
    team/kmoore/cel_transfers/main/cel.c

Modified: team/kmoore/cel_transfers/include/asterisk/cel.h
URL: http://svnview.digium.com/svn/asterisk/team/kmoore/cel_transfers/include/asterisk/cel.h?view=diff&rev=393894&r1=393893&r2=393894
==============================================================================
--- team/kmoore/cel_transfers/include/asterisk/cel.h (original)
+++ team/kmoore/cel_transfers/include/asterisk/cel.h Tue Jul  9 14:19:37 2013
@@ -166,31 +166,6 @@
 struct ast_channel *ast_cel_fabricate_channel_from_event(const struct ast_event *event);
 
 /*!
- * \brief Report a channel event
- *
- * \param chan This argument is required.  This is the primary channel associated with
- *        this channel event.
- * \param event_type This is the type of call event being reported.
- * \param userdefevname This is an optional custom name for the call event.
- * \param extra This is an optional opaque field that will go into the "CEL_EXTRA"
- *        information element of the call event.
- * \param peer2 All CEL events contain a "peer name" information element.  The first
- *        place the code will look to get a peer name is from the bridged channel to
- *        chan.  If chan has no bridged channel and peer2 is specified, then the name
- *        of peer2 will go into the "peer name" field.  If neither are available, the
- *        peer name field will be blank.
- *
- * \since 1.8
- *
- * \pre chan and peer2 are both unlocked
- *
- * \retval 0 success
- * \retval non-zero failure
- */
-int ast_cel_report_event(struct ast_channel *chan, enum ast_cel_event_type event_type,
-		const char *userdefevname, const char *extra, struct ast_channel *peer2);
-
-/*!
  * \brief Helper struct for getting the fields out of a CEL event
  */
 struct ast_cel_event_record {

Modified: team/kmoore/cel_transfers/main/cel.c
URL: http://svnview.digium.com/svn/asterisk/team/kmoore/cel_transfers/main/cel.c?view=diff&rev=393894&r1=393893&r2=393894
==============================================================================
--- team/kmoore/cel_transfers/main/cel.c (original)
+++ team/kmoore/cel_transfers/main/cel.c Tue Jul  9 14:19:37 2013
@@ -899,109 +899,6 @@
 	return 0;
 }
 
-int ast_cel_report_event(struct ast_channel *chan, enum ast_cel_event_type event_type,
-		const char *userdefevname, const char *extra, struct ast_channel *peer2)
-{
-	struct timeval eventtime;
-	struct ast_event *ev;
-	const char *peername = "";
-	struct ast_channel *peer;
-	char *linkedid = ast_strdupa(ast_channel_linkedid(chan));
-
-	if (!ast_cel_check_enabled()) {
-		return 0;
-	}
-
-	/* Record the linkedid of new channels if we are tracking LINKEDID_END even if we aren't
-	 * reporting on CHANNEL_START so we can track when to send LINKEDID_END */
-	if (ast_cel_track_event(AST_CEL_LINKEDID_END) && event_type == AST_CEL_CHANNEL_START && linkedid) {
-		if (cel_linkedid_ref(linkedid)) {
-			return -1;
-		}
-	}
-
-	if (!ast_cel_track_event(event_type)) {
-		return 0;
-	}
-
-	if ((event_type == AST_CEL_APP_START || event_type == AST_CEL_APP_END)
-		&& !cel_track_app(ast_channel_appl(chan))) {
-		return 0;
-	}
-
-	ast_channel_lock(chan);
-	peer = ast_bridged_channel(chan);
-	if (peer) {
-		ast_channel_ref(peer);
-	}
-	ast_channel_unlock(chan);
-
-	if (peer) {
-		ast_channel_lock(peer);
-		peername = ast_strdupa(ast_channel_name(peer));
-		ast_channel_unlock(peer);
-	} else if (peer2) {
-		ast_channel_lock(peer2);
-		peername = ast_strdupa(ast_channel_name(peer2));
-		ast_channel_unlock(peer2);
-	}
-
-	if (!userdefevname) {
-		userdefevname = "";
-	}
-
-	if (!extra) {
-		extra = "";
-	}
-
-	eventtime = ast_tvnow();
-
-	ast_channel_lock(chan);
-
-	ev = ast_event_new(AST_EVENT_CEL,
-		AST_EVENT_IE_CEL_EVENT_TYPE, AST_EVENT_IE_PLTYPE_UINT, event_type,
-		AST_EVENT_IE_CEL_EVENT_TIME, AST_EVENT_IE_PLTYPE_UINT, eventtime.tv_sec,
-		AST_EVENT_IE_CEL_EVENT_TIME_USEC, AST_EVENT_IE_PLTYPE_UINT, eventtime.tv_usec,
-		AST_EVENT_IE_CEL_USEREVENT_NAME, AST_EVENT_IE_PLTYPE_STR, userdefevname,
-		AST_EVENT_IE_CEL_CIDNAME, AST_EVENT_IE_PLTYPE_STR,
-			S_COR(ast_channel_caller(chan)->id.name.valid, ast_channel_caller(chan)->id.name.str, ""),
-		AST_EVENT_IE_CEL_CIDNUM, AST_EVENT_IE_PLTYPE_STR,
-			S_COR(ast_channel_caller(chan)->id.number.valid, ast_channel_caller(chan)->id.number.str, ""),
-		AST_EVENT_IE_CEL_CIDANI, AST_EVENT_IE_PLTYPE_STR,
-			S_COR(ast_channel_caller(chan)->ani.number.valid, ast_channel_caller(chan)->ani.number.str, ""),
-		AST_EVENT_IE_CEL_CIDRDNIS, AST_EVENT_IE_PLTYPE_STR,
-			S_COR(ast_channel_redirecting(chan)->from.number.valid, ast_channel_redirecting(chan)->from.number.str, ""),
-		AST_EVENT_IE_CEL_CIDDNID, AST_EVENT_IE_PLTYPE_STR,
-			S_OR(ast_channel_dialed(chan)->number.str, ""),
-		AST_EVENT_IE_CEL_EXTEN, AST_EVENT_IE_PLTYPE_STR, ast_channel_exten(chan),
-		AST_EVENT_IE_CEL_CONTEXT, AST_EVENT_IE_PLTYPE_STR, ast_channel_context(chan),
-		AST_EVENT_IE_CEL_CHANNAME, AST_EVENT_IE_PLTYPE_STR, ast_channel_name(chan),
-		AST_EVENT_IE_CEL_APPNAME, AST_EVENT_IE_PLTYPE_STR, S_OR(ast_channel_appl(chan), ""),
-		AST_EVENT_IE_CEL_APPDATA, AST_EVENT_IE_PLTYPE_STR, S_OR(ast_channel_data(chan), ""),
-		AST_EVENT_IE_CEL_AMAFLAGS, AST_EVENT_IE_PLTYPE_UINT, ast_channel_amaflags(chan),
-		AST_EVENT_IE_CEL_ACCTCODE, AST_EVENT_IE_PLTYPE_STR, ast_channel_accountcode(chan),
-		AST_EVENT_IE_CEL_PEERACCT, AST_EVENT_IE_PLTYPE_STR, ast_channel_peeraccount(chan),
-		AST_EVENT_IE_CEL_UNIQUEID, AST_EVENT_IE_PLTYPE_STR, ast_channel_uniqueid(chan),
-		AST_EVENT_IE_CEL_LINKEDID, AST_EVENT_IE_PLTYPE_STR, ast_channel_linkedid(chan),
-		AST_EVENT_IE_CEL_USERFIELD, AST_EVENT_IE_PLTYPE_STR, ast_channel_userfield(chan),
-		AST_EVENT_IE_CEL_EXTRA, AST_EVENT_IE_PLTYPE_STR, extra,
-		AST_EVENT_IE_CEL_PEER, AST_EVENT_IE_PLTYPE_STR, peername,
-		AST_EVENT_IE_END);
-
-	ast_channel_unlock(chan);
-
-	if (peer) {
-		peer = ast_channel_unref(peer);
-	}
-
-	if (ev && ast_event_queue(ev)) {
-		ast_event_destroy(ev);
-		return -1;
-	}
-
-	return 0;
-}
-
 int ast_cel_fill_record(const struct ast_event *e, struct ast_cel_event_record *r)
 {
 	if (r->version != AST_CEL_EVENT_RECORD_VERSION) {




More information about the asterisk-commits mailing list