[asterisk-commits] russell: branch group/newcdr r201992 - in /team/group/newcdr: cel/ include/as...

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Fri Jun 19 15:04:43 CDT 2009


Author: russell
Date: Fri Jun 19 15:04:39 2009
New Revision: 201992

URL: http://svn.asterisk.org/svn-view/asterisk?view=rev&rev=201992
Log:
doxygen updates, naming tweaks

Modified:
    team/group/newcdr/cel/cel_manager.c
    team/group/newcdr/cel/cel_pgsql.c
    team/group/newcdr/cel/cel_radius.c
    team/group/newcdr/cel/cel_sqlite.c
    team/group/newcdr/cel/cel_tds.c
    team/group/newcdr/include/asterisk/cel.h
    team/group/newcdr/main/cel.c

Modified: team/group/newcdr/cel/cel_manager.c
URL: http://svn.asterisk.org/svn-view/asterisk/team/group/newcdr/cel/cel_manager.c?view=diff&rev=201992&r1=201991&r2=201992
==============================================================================
--- team/group/newcdr/cel/cel_manager.c (original)
+++ team/group/newcdr/cel/cel_manager.c Fri Jun 19 15:04:39 2009
@@ -140,7 +140,7 @@
 	struct timeval t;
 	struct ast_tm timeresult;
 	char strStartTime[80] = "";
-	enum ast_cel_eventtype eventtype;
+	enum ast_cel_event_type event_type;
 	const char *userdefname = 0;
 	struct timeval eventtime = {0};
 	const char *cid_ani, *cid_rdnis, *cid_name, *cid_num, *cid_dnid;
@@ -152,10 +152,10 @@
 	}
 	ast_log(LOG_NOTICE,"Logging event to manager interface\n");
 
-	eventtype = (enum ast_cel_eventtype) ast_event_get_ie_uint(event, AST_EVENT_IE_CEL_EVENT_TYPE);
+	event_type = (enum ast_cel_event_type) ast_event_get_ie_uint(event, AST_EVENT_IE_CEL_EVENT_TYPE);
 	eventtime.tv_sec = (time_t) ast_event_get_ie_uint(event, AST_EVENT_IE_CEL_EVENT_TIME);
 	eventtime.tv_usec = (time_t) ast_event_get_ie_uint(event, AST_EVENT_IE_CEL_EVENT_TIME_USEC);
-	if (eventtype == AST_CEL_USER_DEFINED) {
+	if (event_type == AST_CEL_USER_DEFINED) {
 		userdefname = ast_event_get_ie_str(event, AST_EVENT_IE_CEL_USEREVENT_NAME);
 	}
 	cid_name = ast_event_get_ie_str(event, AST_EVENT_IE_CEL_CIDNAME);
@@ -198,7 +198,7 @@
 	    "LinkedID: %s\r\n"
 	    "Userfield: %s\r\n"
 	    "Peer: %s\r\n",
-				  (eventtype == AST_CEL_USER_DEFINED ? userdefname : ast_cel_eventtype2str(eventtype)),
+				  (event_type == AST_CEL_USER_DEFINED ? userdefname : ast_cel_get_type_name(event_type)),
 				  accountcode, cid_num, cid_name, cid_ani, cid_rdnis, cid_dnid,
 				  exten, context, channame, appname, appdata, strStartTime,
 				  ast_cel_flags2str(amaflag), uniqueid, linkedid, userfield, peer);

Modified: team/group/newcdr/cel/cel_pgsql.c
URL: http://svn.asterisk.org/svn-view/asterisk/team/group/newcdr/cel/cel_pgsql.c?view=diff&rev=201992&r1=201991&r2=201992
==============================================================================
--- team/group/newcdr/cel/cel_pgsql.c (original)
+++ team/group/newcdr/cel/cel_pgsql.c Fri Jun 19 15:04:39 2009
@@ -118,7 +118,7 @@
 	struct ast_tm tm;
 	char timestr[128];
 	char *pgerror;
-	enum ast_cel_eventtype eventtype;
+	enum ast_cel_event_type event_type;
 	const char *userdefname = 0;
 	struct timeval eventtime = {0};
 	const char *cid_ani, *cid_rdnis, *cid_name, *cid_num, *cid_dnid;
@@ -126,10 +126,10 @@
 	unsigned int amaflag;
 
 	ast_log(LOG_NOTICE,"Logging event to pgsql interface\n");
-	eventtype = (enum ast_cel_eventtype)ast_event_get_ie_uint(event, AST_EVENT_IE_CEL_EVENT_TYPE);
+	event_type = (enum ast_cel_event_type)ast_event_get_ie_uint(event, AST_EVENT_IE_CEL_EVENT_TYPE);
 	eventtime.tv_sec = (time_t)ast_event_get_ie_uint(event, AST_EVENT_IE_CEL_EVENT_TIME);
 	eventtime.tv_usec = (time_t)ast_event_get_ie_uint(event, AST_EVENT_IE_CEL_EVENT_TIME_USEC);
-	if (eventtype == AST_CEL_USER_DEFINED) {
+	if (event_type == AST_CEL_USER_DEFINED) {
 		userdefname = ast_event_get_ie_str(event, AST_EVENT_IE_CEL_USEREVENT_NAME);
 	}
 	cid_name = ast_event_get_ie_str(event, AST_EVENT_IE_CEL_CIDNAME);
@@ -210,13 +210,13 @@
 				if (cur->type[0] == 'i') {
 					/* Get integer, no need to escape anything */
 					LENGTHEN_BUF2(5);
-					ast_str_append(&sql2, 0, "%s%d", first ? "" : ",", (int)eventtype);
+					ast_str_append(&sql2, 0, "%s%d", first ? "" : ",", (int)event_type);
 				} else if (strncmp(cur->type, "float", 5) == 0) {
 					LENGTHEN_BUF2(31);
-					ast_str_append(&sql2, 0, "%s%f", first ? "" : ",", (double)eventtype);
+					ast_str_append(&sql2, 0, "%s%f", first ? "" : ",", (double)event_type);
 				} else {
 					/* Char field, probably */
-					const char *t2 = ast_cel_eventtype2str(eventtype);
+					const char *t2 = ast_cel_get_type_name(event_type);
 					LENGTHEN_BUF2(strlen(t2)+1);
 					ast_str_append(&sql2, 0, "%s'%s'", first ? "" : ",", t2);
 				}

Modified: team/group/newcdr/cel/cel_radius.c
URL: http://svn.asterisk.org/svn-view/asterisk/team/group/newcdr/cel/cel_radius.c?view=diff&rev=201992&r1=201991&r2=201992
==============================================================================
--- team/group/newcdr/cel/cel_radius.c (original)
+++ team/group/newcdr/cel/cel_radius.c Fri Jun 19 15:04:39 2009
@@ -21,7 +21,7 @@
  * \brief RADIUS CEL Support
  * \author Philippe Sultan
  * \extref The Radius Client Library - http://developer.berlios.de/projects/radiusclient-ng/
- * 
+ *
  * \arg See also \ref AstCEL
  * \ingroup cel_drivers
  */
@@ -92,7 +92,7 @@
 static rc_handle *rh = NULL;
 static struct ast_event_sub *event_sub = 0;
 
-static int build_radius_record(VALUE_PAIR **send, enum ast_cel_eventtype eventtype,
+static int build_radius_record(VALUE_PAIR **send, enum ast_cel_event_type event_type,
 							   struct timeval eventtime, const char *userdefname, const char *cid_name,
 							   const char *cid_num, const char *cid_ani,
 							   const char *cid_rdnis, const char *cid_dnid, const char *exten,
@@ -173,7 +173,7 @@
 		return -1;
 	}
 	/* Setting Acct-Session-Id & User-Name attributes for proper generation
-	   of Acct-Unique-Session-Id on server side */ 
+	   of Acct-Unique-Session-Id on server side */
 	/* Channel */
 	if (!rc_avpair_add(rh, send, PW_USER_NAME, (char**)&channame, strlen(channame), 0)) {
 		return -1;
@@ -185,7 +185,7 @@
 {
 	int result = ERROR_RC;
 	VALUE_PAIR *send = NULL;
-	enum ast_cel_eventtype eventtype;
+	enum ast_cel_event_type event_type;
 	const char *userdefname = 0;
 	struct timeval eventtime = {0};
 	const char *cid_ani, *cid_rdnis, *cid_name, *cid_num, *cid_dnid;
@@ -193,10 +193,10 @@
 	unsigned int amaflag;
 
 	ast_log(LOG_NOTICE,"Logging event to radius interface\n");
-	eventtype = (enum ast_cel_eventtype)ast_event_get_ie_uint(event, AST_EVENT_IE_CEL_EVENT_TYPE);
+	event_type = (enum ast_cel_event_type)ast_event_get_ie_uint(event, AST_EVENT_IE_CEL_EVENT_TYPE);
 	eventtime.tv_sec = (time_t)ast_event_get_ie_uint(event, AST_EVENT_IE_CEL_EVENT_TIME);
 	eventtime.tv_usec = (time_t)ast_event_get_ie_uint(event, AST_EVENT_IE_CEL_EVENT_TIME_USEC);
-	if (eventtype == AST_CEL_USER_DEFINED) {
+	if (event_type == AST_CEL_USER_DEFINED) {
 		userdefname = ast_event_get_ie_str(event, AST_EVENT_IE_CEL_USEREVENT_NAME);
 	}
 	cid_name = ast_event_get_ie_str(event, AST_EVENT_IE_CEL_CIDNAME);
@@ -214,8 +214,8 @@
 	linkedid = ast_event_get_ie_str(event, AST_EVENT_IE_CEL_LINKEDID);
 	amaflag = ast_event_get_ie_uint(event, AST_EVENT_IE_CEL_AMAFLAGS);
 
-	if (build_radius_record(&send, eventtype, eventtime, userdefname, cid_name, cid_num, 
-							cid_ani, cid_rdnis, cid_dnid, exten, context, channame, 
+	if (build_radius_record(&send, event_type, eventtime, userdefname, cid_name, cid_num,
+							cid_ani, cid_rdnis, cid_dnid, exten, context, channame,
 							appname, appdata, accountcode, uniqueid, amaflag, linkedid)) {
 		if (option_debug) {
 			ast_log(LOG_DEBUG, "Unable to create RADIUS record. CEL not recorded!\n");

Modified: team/group/newcdr/cel/cel_sqlite.c
URL: http://svn.asterisk.org/svn-view/asterisk/team/group/newcdr/cel/cel_sqlite.c?view=diff&rev=201992&r1=201991&r2=201992
==============================================================================
--- team/group/newcdr/cel/cel_sqlite.c (original)
+++ team/group/newcdr/cel/cel_sqlite.c Fri Jun 19 15:04:39 2009
@@ -22,7 +22,7 @@
 /*! \file
  *
  * \brief Store CEL records in a SQLite database.
- * 
+ *
  * \author Steve Murphy <murf at digium.com>
  * \author Holger Schurig <hs4233 at mail.mn-solutions.de>
  * \extref SQLite http://www.sqlite.org/
@@ -30,7 +30,7 @@
  * See also
  * \arg \ref Config_cel
  * \arg http://www.sqlite.org/
- * 
+ *
  * Creates the database and table on-the-fly
  * \ingroup cel_drivers
  *
@@ -103,7 +103,7 @@
 	struct timeval t;
 	char startstr[80];
 	int count;
-	enum ast_cel_eventtype eventtype;
+	enum ast_cel_event_type event_type;
 	const char *userdefname = 0;
 	struct timeval eventtime = {0};
 	const char *cid_ani, *cid_rdnis, *cid_name, *cid_num, *cid_dnid;
@@ -111,10 +111,10 @@
 	unsigned int amaflag;
 
 	ast_log(LOG_NOTICE,"Logging event to sqlite interface\n");
-	eventtype = (enum ast_cel_eventtype)ast_event_get_ie_uint(event, AST_EVENT_IE_CEL_EVENT_TYPE);
+	event_type = (enum ast_cel_event_type)ast_event_get_ie_uint(event, AST_EVENT_IE_CEL_EVENT_TYPE);
 	eventtime.tv_sec = (time_t)ast_event_get_ie_uint(event, AST_EVENT_IE_CEL_EVENT_TIME);
 	eventtime.tv_usec = (time_t)ast_event_get_ie_uint(event, AST_EVENT_IE_CEL_EVENT_TIME_USEC);
-	if (eventtype == AST_CEL_USER_DEFINED) {
+	if (event_type == AST_CEL_USER_DEFINED) {
 		userdefname = ast_event_get_ie_str(event, AST_EVENT_IE_CEL_USEREVENT_NAME);
 	}
 	cid_name = ast_event_get_ie_str(event, AST_EVENT_IE_CEL_CIDNAME);

Modified: team/group/newcdr/cel/cel_tds.c
URL: http://svn.asterisk.org/svn-view/asterisk/team/group/newcdr/cel/cel_tds.c?view=diff&rev=201992&r1=201991&r2=201992
==============================================================================
--- team/group/newcdr/cel/cel_tds.c (original)
+++ team/group/newcdr/cel/cel_tds.c Fri Jun 19 15:04:39 2009
@@ -118,7 +118,7 @@
 	char *accountcode_ai, *clidnum_ai, *exten_ai, *context_ai, *clid_ai, *channel_ai, *app_ai, *appdata_ai, *uniqueid_ai, *linkedid_ai, *cidani_ai, *cidrdnis_ai, *ciddnid_ai, *peer_ai, *userfield_ai;
 	RETCODE erc;
 	int attempt = 1;
-	enum ast_cel_eventtype eventtype;
+	enum ast_cel_event_type event_type;
 	const char *userdefname = 0;
 	struct timeval eventtime = {0};
 	const char *cid_ani, *cid_rdnis, *cid_name, *cid_num, *cid_dnid;
@@ -127,10 +127,10 @@
 	unsigned int amaflag;
 
 	ast_log(LOG_NOTICE,"Logging event to TDS interface\n");
-	eventtype = (enum ast_cel_eventtype)ast_event_get_ie_uint(event, AST_EVENT_IE_CEL_EVENT_TYPE);
+	event_type = (enum ast_cel_event_type)ast_event_get_ie_uint(event, AST_EVENT_IE_CEL_EVENT_TYPE);
 	eventtime.tv_sec = (time_t)ast_event_get_ie_uint(event, AST_EVENT_IE_CEL_EVENT_TIME);
 	eventtime.tv_usec = (time_t)ast_event_get_ie_uint(event, AST_EVENT_IE_CEL_EVENT_TIME_USEC);
-	if (eventtype == AST_CEL_USER_DEFINED) {
+	if (event_type == AST_CEL_USER_DEFINED) {
 		userdefname = ast_event_get_ie_str(event, AST_EVENT_IE_CEL_USEREVENT_NAME);
 	}
 	cid_name = ast_event_get_ie_str(event, AST_EVENT_IE_CEL_CIDNAME);
@@ -152,10 +152,10 @@
 
 	ast_mutex_lock(&tds_lock);
 
-	if (eventtype == AST_CEL_USER_DEFINED) {
+	if (event_type == AST_CEL_USER_DEFINED) {
 		eventname = userdefname;
 	} else {
-		eventname = ast_cel_eventtype2str(eventtype);
+		eventname = ast_cel_get_type_name(event_type);
 	}
 
 	accountcode_ai = anti_injection(accountcode, 20);

Modified: team/group/newcdr/include/asterisk/cel.h
URL: http://svn.asterisk.org/svn-view/asterisk/team/group/newcdr/include/asterisk/cel.h?view=diff&rev=201992&r1=201991&r2=201992
==============================================================================
--- team/group/newcdr/include/asterisk/cel.h (original)
+++ team/group/newcdr/include/asterisk/cel.h Fri Jun 19 15:04:39 2009
@@ -37,56 +37,59 @@
 	AST_CEL_DOCUMENTATION,
 };
 
-enum ast_cel_eventtype {
-	/*! channel birth */
+/*!
+ * \brief CEL event types
+ */
+enum ast_cel_event_type {
+	/*! \brief channel birth */
 	AST_CEL_CHANNEL_START = 1,
-	/*! channel end */
+	/*! \brief channel end */
 	AST_CEL_CHANNEL_END = 2,
-	/*! hangup terminates connection */
+	/*! \brief hangup terminates connection */
 	AST_CEL_HANGUP = 3,
-	/*! A ringing phone is answered */
+	/*! \brief A ringing phone is answered */
 	AST_CEL_ANSWER = 4,
-	/*! an app starts */
+	/*! \brief an app starts */
 	AST_CEL_APP_START = 5,
-	/*! an app ends */
+	/*! \brief an app ends */
 	AST_CEL_APP_END = 6,
-	/*! a bridge is established */
+	/*! \brief a bridge is established */
 	AST_CEL_BRIDGE_START = 7,
-	/*! a bridge is torn down */
+	/*! \brief a bridge is torn down */
 	AST_CEL_BRIDGE_END = 8,
-	/*! a conference is started */
+	/*! \brief a conference is started */
 	AST_CEL_CONF_START = 9,
-	/*! a conference is ended */
+	/*! \brief a conference is ended */
 	AST_CEL_CONF_END = 10,
-	/*! a channel is parked */
+	/*! \brief a channel is parked */
 	AST_CEL_PARK_START = 11,
-	/*! channel out of the park */
+	/*! \brief channel out of the park */
 	AST_CEL_PARK_END = 12,
-	/*! a transfer occurs */
+	/*! \brief a transfer occurs */
 	AST_CEL_BLINDTRANSFER = 13,
-	/*! a transfer occurs */
+	/*! \brief a transfer occurs */
 	AST_CEL_ATTENDEDTRANSFER = 14,
-	/*! a transfer occurs */
+	/*! \brief a transfer occurs */
 	AST_CEL_TRANSFER = 15,
-	/*! a 3-way conference, usually part of a transfer */
+	/*! \brief a 3-way conference, usually part of a transfer */
 	AST_CEL_HOOKFLASH = 16,
-	/*! a 3-way conference, usually part of a transfer */
+	/*! \brief a 3-way conference, usually part of a transfer */
 	AST_CEL_3WAY_START = 17,
-	/*! a 3-way conference, usually part of a transfer */
+	/*! \brief a 3-way conference, usually part of a transfer */
 	AST_CEL_3WAY_END = 18,
-	/*! channel enters a conference */
+	/*! \brief channel enters a conference */
 	AST_CEL_CONF_ENTER = 19,
-	/*! channel exits a conference */
+	/*! \brief channel exits a conference */
 	AST_CEL_CONF_EXIT = 20,
-	/*! a user-defined event, the event name field should be set  */
+	/*! \brief a user-defined event, the event name field should be set  */
 	AST_CEL_USER_DEFINED = 21,
-	/*! the last channel with the given linkedid is retired  */
+	/*! \brief the last channel with the given linkedid is retired  */
 	AST_CEL_LINKEDID_END = 22,
-	/*! a masquerade happened to alter the participants on a bridge  */
+	/*! \brief a masquerade happened to alter the participants on a bridge  */
 	AST_CEL_BRIDGE_UPDATE = 23,
-	/*! a directed pickup was performed on this channel  */
+	/*! \brief a directed pickup was performed on this channel  */
 	AST_CEL_PICKUP = 24,
-	/*! this call was forwarded somewhere else  */
+	/*! \brief this call was forwarded somewhere else  */
 	AST_CEL_FORWARD = 25,
 };
 
@@ -100,13 +103,40 @@
 
 /*! 
  * \brief Allocate a CEL record 
- * \return a malloc'd ast_cel structure, returns NULL on error (malloc failure)
+ *
+ * \note The CEL record must be destroyed with ast_cel_destroy().
+ *
+ * \retval non-NULL an allocated ast_cel structure
+ * \retval NULL error
  */
 struct ast_cel *ast_cel_alloc(void);
 
-const char *ast_cel_eventtype2str(enum ast_cel_eventtype eventtype);
+/*! 
+ * \brief Destroy a CEL record.
+ *
+ * \param cel the record to destroy
+ *
+ * \return nothing.
+ */
+void ast_cel_destroy(struct ast_cel *cel);
 
-enum ast_cel_eventtype ast_cel_str2eventtype(const char *eventname);
+/*!
+ * \brief Get the name of a CEL event type
+ *
+ * \param type the type to get the name of
+ *
+ * \return the string representation of the type
+ */
+const char *ast_cel_get_type_name(enum ast_cel_event_type type);
+
+/*!
+ * \brief Get the event type from a string
+ *
+ * \param name the event type name as a string
+ *
+ * \return the ast_cel_event_type given by the string
+ */
+enum ast_cel_event_type ast_cel_str_to_event_type(const char *name);
 
 /*!
  * \brief Convert AMA flag to printable string
@@ -131,10 +161,7 @@
  the given cel event.  Must be released with ast_channel_release */
 struct ast_channel *ast_cel_fabricate_channel_from_event(const struct ast_event *event);
 
-/*! Frees the cel struct */
-void ast_cel_destroy(struct ast_cel *cel);
-
-void ast_cel_report_event(const struct ast_channel *chan, enum ast_cel_eventtype,
+void ast_cel_report_event(const struct ast_channel *chan, enum ast_cel_event_type,
 		char *userdefevname, const char *extra,
 		const struct ast_channel *peer2);
 

Modified: team/group/newcdr/main/cel.c
URL: http://svn.asterisk.org/svn-view/asterisk/team/group/newcdr/main/cel.c?view=diff&rev=201992&r1=201991&r2=201992
==============================================================================
--- team/group/newcdr/main/cel.c (original)
+++ team/group/newcdr/main/cel.c Fri Jun 19 15:04:39 2009
@@ -86,66 +86,66 @@
 
 static struct ast_cli_entry cli_status = AST_CLI_DEFINE(handle_cli_status, "Display the CEL status");
 
-enum ast_cel_eventtype ast_cel_str2eventtype(const char *eventname)
-{
-	if (!strcasecmp(eventname, "ALL")) {
+enum ast_cel_event_type ast_cel_str_to_event_type(const char *name)
+{
+	if (!strcasecmp(name, "ALL")) {
 		return 0;
-	} else if (!strcasecmp(eventname, "CHAN_START")) {
+	} else if (!strcasecmp(name, "CHAN_START")) {
 		return AST_CEL_CHANNEL_START;
-	} else if (!strcasecmp(eventname, "CHAN_END")) {
+	} else if (!strcasecmp(name, "CHAN_END")) {
 		return AST_CEL_CHANNEL_END;
-	} else if (!strcasecmp(eventname, "ANSWER")) {
+	} else if (!strcasecmp(name, "ANSWER")) {
 		return AST_CEL_ANSWER;
-	} else if (!strcasecmp(eventname, "HANGUP")) {
+	} else if (!strcasecmp(name, "HANGUP")) {
 		return AST_CEL_HANGUP;
-	} else if (!strcasecmp(eventname, "APP_START")) {
+	} else if (!strcasecmp(name, "APP_START")) {
 		return AST_CEL_APP_START;
-	} else if (!strcasecmp(eventname, "APP_END")) {
+	} else if (!strcasecmp(name, "APP_END")) {
 		return AST_CEL_APP_END;
-	} else if (!strcasecmp(eventname, "BRIDGE_START")) {
+	} else if (!strcasecmp(name, "BRIDGE_START")) {
 		return AST_CEL_BRIDGE_START;
-	} else if (!strcasecmp(eventname, "BRIDGE_END")) {
+	} else if (!strcasecmp(name, "BRIDGE_END")) {
 		return AST_CEL_BRIDGE_END;
-	} else if (!strcasecmp(eventname, "BRIDGE_UPDATE")) {
+	} else if (!strcasecmp(name, "BRIDGE_UPDATE")) {
 		return AST_CEL_BRIDGE_UPDATE;
-	} else if (!strcasecmp(eventname, "CONF_START")) {
+	} else if (!strcasecmp(name, "CONF_START")) {
 		return AST_CEL_CONF_START;
-	} else if (!strcasecmp(eventname, "CONF_END")) {
+	} else if (!strcasecmp(name, "CONF_END")) {
 		return AST_CEL_CONF_END;
-	} else if (!strcasecmp(eventname, "PARK_START")) {
+	} else if (!strcasecmp(name, "PARK_START")) {
 		return AST_CEL_PARK_START;
-	} else if (!strcasecmp(eventname, "PARK_END")) {
+	} else if (!strcasecmp(name, "PARK_END")) {
 		return AST_CEL_PARK_END;
-	} else if (!strcasecmp(eventname, "TRANSFER")) {
+	} else if (!strcasecmp(name, "TRANSFER")) {
 		return AST_CEL_TRANSFER;
-	} else if (!strcasecmp(eventname, "USER_DEFINED")) {
+	} else if (!strcasecmp(name, "USER_DEFINED")) {
 		return AST_CEL_USER_DEFINED;
-	} else if (!strcasecmp(eventname, "CONF_ENTER")) {
+	} else if (!strcasecmp(name, "CONF_ENTER")) {
 		return AST_CEL_CONF_ENTER;
-	} else if (!strcasecmp(eventname, "CONF_EXIT")) {
+	} else if (!strcasecmp(name, "CONF_EXIT")) {
 		return AST_CEL_CONF_EXIT;
-	} else if (!strcasecmp(eventname, "BLINDTRANSFER")) {
+	} else if (!strcasecmp(name, "BLINDTRANSFER")) {
 		return AST_CEL_BLINDTRANSFER;
-	} else if (!strcasecmp(eventname, "ATTENDEDTRANSFER")) {
+	} else if (!strcasecmp(name, "ATTENDEDTRANSFER")) {
 		return AST_CEL_ATTENDEDTRANSFER;
-	} else if (!strcasecmp(eventname, "PICKUP")) {
+	} else if (!strcasecmp(name, "PICKUP")) {
 		return AST_CEL_PICKUP;
-	} else if (!strcasecmp(eventname, "FORWARD")) {
+	} else if (!strcasecmp(name, "FORWARD")) {
 		return AST_CEL_FORWARD;
-	} else if (!strcasecmp(eventname, "3WAY_START")) {
+	} else if (!strcasecmp(name, "3WAY_START")) {
 		return AST_CEL_3WAY_START;
-	} else if (!strcasecmp(eventname, "3WAY_END")) {
+	} else if (!strcasecmp(name, "3WAY_END")) {
 		return AST_CEL_3WAY_END;
-	} else if (!strcasecmp(eventname, "HOOKFLASH")) {
+	} else if (!strcasecmp(name, "HOOKFLASH")) {
 		return AST_CEL_HOOKFLASH;
-	} else if (!strcasecmp(eventname, "LINKEDID_END")) {
+	} else if (!strcasecmp(name, "LINKEDID_END")) {
 		return AST_CEL_LINKEDID_END;
 	} else  {
 		return -1;
 	}
 }
 
-static int ast_cel_track_event(enum ast_cel_eventtype et)
+static int ast_cel_track_event(enum ast_cel_event_type et)
 {
 	return (eventset & (1 << (int)et));
 }
@@ -159,7 +159,7 @@
 	const char *eventlist;
 	const char *applist;
 	int res = 0;
-	enum ast_cel_eventtype et;
+	enum ast_cel_event_type et;
 	struct ast_flags config_flags = { CONFIG_FLAG_FILEUNCHANGED };
 	const char *s;
 
@@ -237,7 +237,7 @@
 				}
 				*(t3+1) = 0;
 				/* t1 now points to null-terminated entry */
-				et = ast_cel_str2eventtype(t1);
+				et = ast_cel_str_to_event_type(t1);
 				if ((int)et == 0) { /* all events */
 					eventset = -1; /* turn on all the bits */
 				} else if ((int)et == -1) {  /* unmatched event */
@@ -335,11 +335,11 @@
 	return res;
 }
 
-const char *ast_cel_eventtype2str(enum ast_cel_eventtype eventtype)
+const char *ast_cel_get_type_name(enum ast_cel_event_type type)
 {
 #define EV(e) case e: return # e
 
-	switch (eventtype) {
+	switch (type) {
 	EV(AST_CEL_CHANNEL_START);
 	EV(AST_CEL_CHANNEL_END);
 	EV(AST_CEL_HANGUP);
@@ -430,7 +430,7 @@
    a real channel were being used with the CEL func. What we do for re-use!! */
 struct ast_channel* ast_cel_fabricate_channel_from_event(const struct ast_event *event)
 {
-	enum ast_cel_eventtype eventtype;
+	enum ast_cel_event_type event_type;
 	struct timeval eventtime = {0};
 	const char *userdefname = 0;
 	struct varshead *headp;
@@ -451,10 +451,10 @@
 	headp = &tchan->varshead;
 
 	/* first, get the variables from the event */
-	eventtype = (enum ast_cel_eventtype)ast_event_get_ie_uint(event, AST_EVENT_IE_CEL_EVENT_TYPE);
+	event_type = (enum ast_cel_event_type)ast_event_get_ie_uint(event, AST_EVENT_IE_CEL_EVENT_TYPE);
 	eventtime.tv_sec = (time_t)ast_event_get_ie_uint(event, AST_EVENT_IE_CEL_EVENT_TIME);
 	eventtime.tv_usec = (time_t)ast_event_get_ie_uint(event, AST_EVENT_IE_CEL_EVENT_TIME_USEC);
-	if (eventtype == AST_CEL_USER_DEFINED) {
+	if (event_type == AST_CEL_USER_DEFINED) {
 		userdefname = ast_event_get_ie_str(event, AST_EVENT_IE_CEL_USEREVENT_NAME);
 	}
 	cid_name = ast_event_get_ie_str(event, AST_EVENT_IE_CEL_CIDNAME);
@@ -477,10 +477,10 @@
 	peer = ast_event_get_ie_str(event, AST_EVENT_IE_CEL_PEER);
 
 	/* next, fill the channel with their data */
-	if (eventtype == AST_CEL_USER_DEFINED) {
+	if (event_type == AST_CEL_USER_DEFINED) {
 		newvariable = ast_var_assign("eventtype", userdefname);
 	} else {
-		newvariable = ast_var_assign("eventtype", ast_cel_eventtype2str(eventtype));
+		newvariable = ast_var_assign("eventtype", ast_cel_get_type_name(event_type));
 	}
 	AST_LIST_INSERT_HEAD(headp, newvariable, entries);
 
@@ -521,7 +521,7 @@
 	return tchan;
 }
 
-void ast_cel_report_event(const struct ast_channel *chan, enum ast_cel_eventtype eventtype, char *userdefevname, const char *extra, const struct ast_channel *peer2)
+void ast_cel_report_event(const struct ast_channel *chan, enum ast_cel_event_type event_type, char *userdefevname, const char *extra, const struct ast_channel *peer2)
 {
 	struct timeval eventtime;
 	struct ast_event *ev;
@@ -529,13 +529,13 @@
 	const char *peername = "";
 	struct ast_channel *peer = ast_bridged_channel((struct ast_channel *) chan);
 
-	if (!ast_cel_track_event(eventtype)) {
-		ast_debug(1, "CEL event UNtracked: %s\n", ast_cel_eventtype2str(eventtype));
-	}
-
-	ast_debug(3, "CEL event tracked: %s\n", ast_cel_eventtype2str(eventtype));
-
-	if (eventtype == AST_CEL_APP_START || eventtype == AST_CEL_APP_END) {
+	if (!ast_cel_track_event(event_type)) {
+		ast_debug(1, "CEL event UNtracked: %s\n", ast_cel_get_type_name(event_type));
+	}
+
+	ast_debug(3, "CEL event tracked: %s\n", ast_cel_get_type_name(event_type));
+
+	if (event_type == AST_CEL_APP_START || event_type == AST_CEL_APP_END) {
 		if (!ast_hashtab_lookup(appset, chan->appl)) {
 			return;
 		}
@@ -557,7 +557,7 @@
 	eventtime = ast_tvnow();
 
 	ev = ast_event_new(AST_EVENT_CEL,
-			AST_EVENT_IE_CEL_EVENT_TYPE, AST_EVENT_IE_PLTYPE_UINT, eventtype,
+			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, udef,




More information about the asterisk-commits mailing list