[asterisk-commits] russell: branch group/newcdr r201990 - in /team/group/newcdr: apps/ cel/ chan...

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


Author: russell
Date: Fri Jun 19 14:28:38 2009
New Revision: 201990

URL: http://svn.asterisk.org/svn-view/asterisk?view=rev&rev=201990
Log:
Fix a bunch of public constants that lacked an AST_ prefix

Modified:
    team/group/newcdr/apps/app_celgenuserevent.c
    team/group/newcdr/apps/app_dial.c
    team/group/newcdr/apps/app_directed_pickup.c
    team/group/newcdr/apps/app_queue.c
    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/channels/chan_sip.c
    team/group/newcdr/include/asterisk/cel.h
    team/group/newcdr/main/cel.c
    team/group/newcdr/main/channel.c
    team/group/newcdr/main/features.c
    team/group/newcdr/main/pbx.c

Modified: team/group/newcdr/apps/app_celgenuserevent.c
URL: http://svn.asterisk.org/svn-view/asterisk/team/group/newcdr/apps/app_celgenuserevent.c?view=diff&rev=201990&r1=201989&r2=201990
==============================================================================
--- team/group/newcdr/apps/app_celgenuserevent.c (original)
+++ team/group/newcdr/apps/app_celgenuserevent.c Fri Jun 19 14:28:38 2009
@@ -67,7 +67,7 @@
 	parse = ast_strdupa(data);
 	AST_STANDARD_APP_ARGS(args, parse);
 
-	ast_cel_report_event(chan, CEL_USER_DEFINED, args.event, args.extra, NULL);
+	ast_cel_report_event(chan, AST_CEL_USER_DEFINED, args.event, args.extra, NULL);
 	return res;
 }
 

Modified: team/group/newcdr/apps/app_dial.c
URL: http://svn.asterisk.org/svn-view/asterisk/team/group/newcdr/apps/app_dial.c?view=diff&rev=201990&r1=201989&r2=201990
==============================================================================
--- team/group/newcdr/apps/app_dial.c (original)
+++ team/group/newcdr/apps/app_dial.c Fri Jun 19 14:28:38 2009
@@ -758,7 +758,7 @@
 		tech = "Local";
 	}
 
-	ast_cel_report_event(in, CEL_FORWARD, NULL, c->call_forward, NULL);
+	ast_cel_report_event(in, AST_CEL_FORWARD, NULL, c->call_forward, NULL);
 
 	/* Before processing channel, go ahead and check for forwarding */
 	ast_verb(3, "Now forwarding %s to '%s/%s' (thanks to %s)\n", in->name, tech, stuff, c->name);

Modified: team/group/newcdr/apps/app_directed_pickup.c
URL: http://svn.asterisk.org/svn-view/asterisk/team/group/newcdr/apps/app_directed_pickup.c?view=diff&rev=201990&r1=201989&r2=201990
==============================================================================
--- team/group/newcdr/apps/app_directed_pickup.c (original)
+++ team/group/newcdr/apps/app_directed_pickup.c Fri Jun 19 14:28:38 2009
@@ -96,7 +96,7 @@
 	struct ast_party_connected_line connected_caller;
 
 	ast_debug(1, "Call pickup on '%s' by '%s'\n", target->name, chan->name);
-	ast_cel_report_event(target, CEL_PICKUP, NULL, NULL, chan);
+	ast_cel_report_event(target, AST_CEL_PICKUP, NULL, NULL, chan);
 
 	connected_caller = target->connected;
 	connected_caller.source = AST_CONNECTED_LINE_UPDATE_SOURCE_ANSWER;

Modified: team/group/newcdr/apps/app_queue.c
URL: http://svn.asterisk.org/svn-view/asterisk/team/group/newcdr/apps/app_queue.c?view=diff&rev=201990&r1=201989&r2=201990
==============================================================================
--- team/group/newcdr/apps/app_queue.c (original)
+++ team/group/newcdr/apps/app_queue.c Fri Jun 19 14:28:38 2009
@@ -3140,7 +3140,7 @@
 						tech = "Local";
 					}
 
-					ast_cel_report_event(in, CEL_FORWARD, NULL, o->chan->call_forward, NULL);
+					ast_cel_report_event(in, AST_CEL_FORWARD, NULL, o->chan->call_forward, NULL);
 
 					/* Before processing channel, go ahead and check for forwarding */
 					ast_verb(3, "Now forwarding %s to '%s/%s' (thanks to %s)\n", inchan_name, tech, stuff, ochan_name);

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=201990&r1=201989&r2=201990
==============================================================================
--- team/group/newcdr/cel/cel_manager.c (original)
+++ team/group/newcdr/cel/cel_manager.c Fri Jun 19 14:28:38 2009
@@ -155,7 +155,7 @@
 	eventtype = (enum ast_cel_eventtype) 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 == CEL_USER_DEFINED) {
+	if (eventtype == 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,8 +198,8 @@
 	    "LinkedID: %s\r\n"
 	    "Userfield: %s\r\n"
 	    "Peer: %s\r\n",
-				  (eventtype==CEL_USER_DEFINED?userdefname:ast_cel_eventtype2str(eventtype)),
-				  accountcode, cid_num, cid_name, cid_ani, cid_rdnis, cid_dnid, 
+				  (eventtype == AST_CEL_USER_DEFINED ? userdefname : ast_cel_eventtype2str(eventtype)),
+				  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=201990&r1=201989&r2=201990
==============================================================================
--- team/group/newcdr/cel/cel_pgsql.c (original)
+++ team/group/newcdr/cel/cel_pgsql.c Fri Jun 19 14:28:38 2009
@@ -129,7 +129,7 @@
 	eventtype = (enum ast_cel_eventtype)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 == CEL_USER_DEFINED) {
+	if (eventtype == 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_radius.c
URL: http://svn.asterisk.org/svn-view/asterisk/team/group/newcdr/cel/cel_radius.c?view=diff&rev=201990&r1=201989&r2=201990
==============================================================================
--- team/group/newcdr/cel/cel_radius.c (original)
+++ team/group/newcdr/cel/cel_radius.c Fri Jun 19 14:28:38 2009
@@ -196,7 +196,7 @@
 	eventtype = (enum ast_cel_eventtype)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 == CEL_USER_DEFINED) {
+	if (eventtype == 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_sqlite.c
URL: http://svn.asterisk.org/svn-view/asterisk/team/group/newcdr/cel/cel_sqlite.c?view=diff&rev=201990&r1=201989&r2=201990
==============================================================================
--- team/group/newcdr/cel/cel_sqlite.c (original)
+++ team/group/newcdr/cel/cel_sqlite.c Fri Jun 19 14:28:38 2009
@@ -114,7 +114,7 @@
 	eventtype = (enum ast_cel_eventtype)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 == CEL_USER_DEFINED) {
+	if (eventtype == 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=201990&r1=201989&r2=201990
==============================================================================
--- team/group/newcdr/cel/cel_tds.c (original)
+++ team/group/newcdr/cel/cel_tds.c Fri Jun 19 14:28:38 2009
@@ -130,7 +130,7 @@
 	eventtype = (enum ast_cel_eventtype)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 == CEL_USER_DEFINED) {
+	if (eventtype == 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,7 +152,7 @@
 
 	ast_mutex_lock(&tds_lock);
 
-	if (eventtype == CEL_USER_DEFINED) {
+	if (eventtype == AST_CEL_USER_DEFINED) {
 		eventname = userdefname;
 	} else {
 		eventname = ast_cel_eventtype2str(eventtype);

Modified: team/group/newcdr/channels/chan_sip.c
URL: http://svn.asterisk.org/svn-view/asterisk/team/group/newcdr/channels/chan_sip.c?view=diff&rev=201990&r1=201989&r2=201990
==============================================================================
--- team/group/newcdr/channels/chan_sip.c (original)
+++ team/group/newcdr/channels/chan_sip.c Fri Jun 19 14:28:38 2009
@@ -20693,7 +20693,7 @@
 		/* Transfer succeeded! */
 		const char *xfersound = pbx_builtin_getvar_helper(target.chan1, "ATTENDED_TRANSFER_COMPLETE_SOUND");
 
-		ast_cel_report_event(target.chan1, CEL_ATTENDEDTRANSFER, NULL, transferer_linkedid, target.chan2);
+		ast_cel_report_event(target.chan1, AST_CEL_ATTENDEDTRANSFER, NULL, transferer_linkedid, target.chan2);
 
 		/* Tell transferer that we're done. */
 		transmit_notify_with_sipfrag(transferer, seqno, "200 OK", TRUE);
@@ -21060,7 +21060,7 @@
 		ast_debug(3, "%s transfer succeeded. Telling transferer.\n", p->refer->attendedtransfer? "Attended" : "Blind");
 
 		/* XXX - what to we put in CEL 'extra' for attended transfers to external systems? NULL for now */
-		ast_cel_report_event(current.chan1, p->refer->attendedtransfer? CEL_ATTENDEDTRANSFER : CEL_BLINDTRANSFER, NULL, p->refer->attendedtransfer ? NULL : p->refer->refer_to, current.chan2);
+		ast_cel_report_event(current.chan1, p->refer->attendedtransfer? AST_CEL_ATTENDEDTRANSFER : AST_CEL_BLINDTRANSFER, NULL, p->refer->attendedtransfer ? NULL : p->refer->refer_to, current.chan2);
 		transmit_notify_with_sipfrag(p, seqno, "200 Ok", TRUE);
 		if (p->refer->localtransfer)
 			p->refer->status = REFER_200OK;

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=201990&r1=201989&r2=201990
==============================================================================
--- team/group/newcdr/include/asterisk/cel.h (original)
+++ team/group/newcdr/include/asterisk/cel.h Fri Jun 19 14:28:38 2009
@@ -39,55 +39,55 @@
 
 enum ast_cel_eventtype {
 	/*! channel birth */
-	CEL_CHANNEL_START = 1,
+	AST_CEL_CHANNEL_START = 1,
 	/*! channel end */
-	CEL_CHANNEL_END = 2,
+	AST_CEL_CHANNEL_END = 2,
 	/*! hangup terminates connection */
-	CEL_HANGUP = 3,
+	AST_CEL_HANGUP = 3,
 	/*! A ringing phone is answered */
-	CEL_ANSWER = 4,
+	AST_CEL_ANSWER = 4,
 	/*! an app starts */
-	CEL_APP_START = 5,
+	AST_CEL_APP_START = 5,
 	/*! an app ends */
-	CEL_APP_END = 6,
+	AST_CEL_APP_END = 6,
 	/*! a bridge is established */
-	CEL_BRIDGE_START = 7,
+	AST_CEL_BRIDGE_START = 7,
 	/*! a bridge is torn down */
-	CEL_BRIDGE_END = 8,
+	AST_CEL_BRIDGE_END = 8,
 	/*! a conference is started */
-	CEL_CONF_START = 9,
+	AST_CEL_CONF_START = 9,
 	/*! a conference is ended */
-	CEL_CONF_END = 10,
+	AST_CEL_CONF_END = 10,
 	/*! a channel is parked */
-	CEL_PARK_START = 11,
+	AST_CEL_PARK_START = 11,
 	/*! channel out of the park */
-	CEL_PARK_END = 12,
+	AST_CEL_PARK_END = 12,
 	/*! a transfer occurs */
-	CEL_BLINDTRANSFER = 13,
+	AST_CEL_BLINDTRANSFER = 13,
 	/*! a transfer occurs */
-	CEL_ATTENDEDTRANSFER = 14,
+	AST_CEL_ATTENDEDTRANSFER = 14,
 	/*! a transfer occurs */
-	CEL_TRANSFER = 15,
+	AST_CEL_TRANSFER = 15,
 	/*! a 3-way conference, usually part of a transfer */
-	CEL_HOOKFLASH = 16,
+	AST_CEL_HOOKFLASH = 16,
 	/*! a 3-way conference, usually part of a transfer */
-	CEL_3WAY_START = 17,
+	AST_CEL_3WAY_START = 17,
 	/*! a 3-way conference, usually part of a transfer */
-	CEL_3WAY_END = 18,
+	AST_CEL_3WAY_END = 18,
 	/*! channel enters a conference */
-	CEL_CONF_ENTER = 19,
+	AST_CEL_CONF_ENTER = 19,
 	/*! channel exits a conference */
-	CEL_CONF_EXIT = 20,
+	AST_CEL_CONF_EXIT = 20,
 	/*! a user-defined event, the event name field should be set  */
-	CEL_USER_DEFINED = 21,
+	AST_CEL_USER_DEFINED = 21,
 	/*! the last channel with the given linkedid is retired  */
-	CEL_LINKEDID_END = 22,
+	AST_CEL_LINKEDID_END = 22,
 	/*! a masquerade happened to alter the participants on a bridge  */
-	CEL_BRIDGE_UPDATE = 23,
+	AST_CEL_BRIDGE_UPDATE = 23,
 	/*! a directed pickup was performed on this channel  */
-	CEL_PICKUP = 24,
+	AST_CEL_PICKUP = 24,
 	/*! this call was forwarded somewhere else  */
-	CEL_FORWARD = 25,
+	AST_CEL_FORWARD = 25,
 };
 
 /*! 

Modified: team/group/newcdr/main/cel.c
URL: http://svn.asterisk.org/svn-view/asterisk/team/group/newcdr/main/cel.c?view=diff&rev=201990&r1=201989&r2=201990
==============================================================================
--- team/group/newcdr/main/cel.c (original)
+++ team/group/newcdr/main/cel.c Fri Jun 19 14:28:38 2009
@@ -88,58 +88,58 @@
 
 enum ast_cel_eventtype ast_cel_str2eventtype(const char *eventname)
 {
-	if (!strcasecmp(eventname,"ALL")) {
+	if (!strcasecmp(eventname, "ALL")) {
 		return 0;
-	} else if (!strcasecmp(eventname,"CHAN_START")) {
-		return CEL_CHANNEL_START;
-	} else if (!strcasecmp(eventname,"CHAN_END")) {
-		return CEL_CHANNEL_END;
-	} else if (!strcasecmp(eventname,"ANSWER")) {
-		return CEL_ANSWER;
-	} else if (!strcasecmp(eventname,"HANGUP")) {
-		return CEL_HANGUP;
-	} else if (!strcasecmp(eventname,"APP_START")) {
-		return CEL_APP_START;
-	} else if (!strcasecmp(eventname,"APP_END")) {
-		return CEL_APP_END;
-	} else if (!strcasecmp(eventname,"BRIDGE_START")) {
-		return CEL_BRIDGE_START;
-	} else if (!strcasecmp(eventname,"BRIDGE_END")) {
-		return CEL_BRIDGE_END;
-	} else if (!strcasecmp(eventname,"BRIDGE_UPDATE")) {
-		return CEL_BRIDGE_UPDATE;
-	} else if (!strcasecmp(eventname,"CONF_START")) {
-		return CEL_CONF_START;
-	} else if (!strcasecmp(eventname,"CONF_END")) {
-		return CEL_CONF_END;
-	} else if (!strcasecmp(eventname,"PARK_START")) {
-		return CEL_PARK_START;
-	} else if (!strcasecmp(eventname,"PARK_END")) {
-		return CEL_PARK_END;
-	} else if (!strcasecmp(eventname,"TRANSFER")) {
-		return CEL_TRANSFER;
-	} else if (!strcasecmp(eventname,"USER_DEFINED")) {
-		return CEL_USER_DEFINED;
-	} else if (!strcasecmp(eventname,"CONF_ENTER")) {
-		return CEL_CONF_ENTER;
-	} else if (!strcasecmp(eventname,"CONF_EXIT")) {
-		return CEL_CONF_EXIT;
-	} else if (!strcasecmp(eventname,"BLINDTRANSFER")) {
-		return CEL_BLINDTRANSFER;
-	} else if (!strcasecmp(eventname,"ATTENDEDTRANSFER")) {
-		return CEL_ATTENDEDTRANSFER;
-	} else if (!strcasecmp(eventname,"PICKUP")) {
-		return CEL_PICKUP;
-	} else if (!strcasecmp(eventname,"FORWARD")) {
-		return CEL_FORWARD;
-	} else if (!strcasecmp(eventname,"3WAY_START")) {
-		return CEL_3WAY_START;
-	} else if (!strcasecmp(eventname,"3WAY_END")) {
-		return CEL_3WAY_END;
-	} else if (!strcasecmp(eventname,"HOOKFLASH")) {
-		return CEL_HOOKFLASH;
-	} else if (!strcasecmp(eventname,"LINKEDID_END")) {
-		return CEL_LINKEDID_END;
+	} else if (!strcasecmp(eventname, "CHAN_START")) {
+		return AST_CEL_CHANNEL_START;
+	} else if (!strcasecmp(eventname, "CHAN_END")) {
+		return AST_CEL_CHANNEL_END;
+	} else if (!strcasecmp(eventname, "ANSWER")) {
+		return AST_CEL_ANSWER;
+	} else if (!strcasecmp(eventname, "HANGUP")) {
+		return AST_CEL_HANGUP;
+	} else if (!strcasecmp(eventname, "APP_START")) {
+		return AST_CEL_APP_START;
+	} else if (!strcasecmp(eventname, "APP_END")) {
+		return AST_CEL_APP_END;
+	} else if (!strcasecmp(eventname, "BRIDGE_START")) {
+		return AST_CEL_BRIDGE_START;
+	} else if (!strcasecmp(eventname, "BRIDGE_END")) {
+		return AST_CEL_BRIDGE_END;
+	} else if (!strcasecmp(eventname, "BRIDGE_UPDATE")) {
+		return AST_CEL_BRIDGE_UPDATE;
+	} else if (!strcasecmp(eventname, "CONF_START")) {
+		return AST_CEL_CONF_START;
+	} else if (!strcasecmp(eventname, "CONF_END")) {
+		return AST_CEL_CONF_END;
+	} else if (!strcasecmp(eventname, "PARK_START")) {
+		return AST_CEL_PARK_START;
+	} else if (!strcasecmp(eventname, "PARK_END")) {
+		return AST_CEL_PARK_END;
+	} else if (!strcasecmp(eventname, "TRANSFER")) {
+		return AST_CEL_TRANSFER;
+	} else if (!strcasecmp(eventname, "USER_DEFINED")) {
+		return AST_CEL_USER_DEFINED;
+	} else if (!strcasecmp(eventname, "CONF_ENTER")) {
+		return AST_CEL_CONF_ENTER;
+	} else if (!strcasecmp(eventname, "CONF_EXIT")) {
+		return AST_CEL_CONF_EXIT;
+	} else if (!strcasecmp(eventname, "BLINDTRANSFER")) {
+		return AST_CEL_BLINDTRANSFER;
+	} else if (!strcasecmp(eventname, "ATTENDEDTRANSFER")) {
+		return AST_CEL_ATTENDEDTRANSFER;
+	} else if (!strcasecmp(eventname, "PICKUP")) {
+		return AST_CEL_PICKUP;
+	} else if (!strcasecmp(eventname, "FORWARD")) {
+		return AST_CEL_FORWARD;
+	} else if (!strcasecmp(eventname, "3WAY_START")) {
+		return AST_CEL_3WAY_START;
+	} else if (!strcasecmp(eventname, "3WAY_END")) {
+		return AST_CEL_3WAY_END;
+	} else if (!strcasecmp(eventname, "HOOKFLASH")) {
+		return AST_CEL_HOOKFLASH;
+	} else if (!strcasecmp(eventname, "LINKEDID_END")) {
+		return AST_CEL_LINKEDID_END;
 	} else  {
 		return -1;
 	}
@@ -255,7 +255,7 @@
 
 	if ((applist = ast_variable_retrieve(config, "general", "apps"))) {
 		char *t1, *t2, *t3, *myapplist = ast_strdup(applist);
-		if (!ast_cel_track_event(CEL_APP_START) && !ast_cel_track_event(CEL_APP_END)) {
+		if (!ast_cel_track_event(AST_CEL_APP_START) && !ast_cel_track_event(AST_CEL_APP_END)) {
 			ast_log(LOG_ERROR, "An apps= config line, but not tracking APP events!\n");
 		} else {
 			int commacount = 0;
@@ -337,59 +337,39 @@
 
 const char *ast_cel_eventtype2str(enum ast_cel_eventtype eventtype)
 {
+#define EV(e) case e: return # e
+
 	switch (eventtype) {
-	case CEL_CHANNEL_START:
-		return "CEL_CHAN_START";
-	case CEL_CHANNEL_END:
-		return "CEL_CHAN_END";
-	case CEL_HANGUP:
-		return "CEL_HANGUP";
-	case CEL_ANSWER:
-		return "CEL_ANSWER";
-	case CEL_APP_START:
-		return "CEL_APP_START";
-	case CEL_APP_END:
-		return "CEL_APP_END";
-	case CEL_BRIDGE_START:
-		return "CEL_BRIDGE_START";
-	case CEL_BRIDGE_UPDATE:
-		return "CEL_BRIDGE_UPDATE";
-	case CEL_BRIDGE_END:
-		return "CEL_BRIDGE_END";
-	case CEL_CONF_START:
-		return "CEL_CONF_START";
-	case CEL_CONF_END:
-		return "CEL_CONF_END";
-	case CEL_PARK_START:
-		return "CEL_PARK_START";
-	case CEL_PARK_END:
-		return "CEL_PARK_END";
-	case CEL_TRANSFER:
-		return "CEL_TRANSFER";
-	case CEL_CONF_ENTER:
-		return "CEL_CONF_ENTER";
-	case CEL_CONF_EXIT:
-		return "CEL_CONF_EXIT";
-	case CEL_USER_DEFINED:
-		return "CEL_USER_DEF";
-	case CEL_BLINDTRANSFER:
-		return "CEL_BLINDTRANSFER";
-	case CEL_ATTENDEDTRANSFER:
-		return "CEL_ATTENDEDTRANSFER";
-	case CEL_PICKUP:
-		return "CEL_PICKUP";
-	case CEL_FORWARD:
-		return "CEL_FORWARD";
-	case CEL_3WAY_START:
-		return "CEL_3WAY_START";
-	case CEL_3WAY_END:
-		return "CEL_3WAY_END";
-	case CEL_HOOKFLASH:
-		return "CEL_HOOKFLASH";
-	case CEL_LINKEDID_END:
-		return "CEL_LINKEDID_END";
-	}
-	return "";
+	EV(AST_CEL_CHANNEL_START);
+	EV(AST_CEL_CHANNEL_END);
+	EV(AST_CEL_HANGUP);
+	EV(AST_CEL_ANSWER);
+	EV(AST_CEL_APP_START);
+	EV(AST_CEL_APP_END);
+	EV(AST_CEL_BRIDGE_START);
+	EV(AST_CEL_BRIDGE_UPDATE);
+	EV(AST_CEL_BRIDGE_END);
+	EV(AST_CEL_CONF_START);
+	EV(AST_CEL_CONF_END);
+	EV(AST_CEL_PARK_START);
+	EV(AST_CEL_PARK_END);
+	EV(AST_CEL_TRANSFER);
+	EV(AST_CEL_CONF_ENTER);
+	EV(AST_CEL_CONF_EXIT);
+	EV(AST_CEL_USER_DEFINED);
+	EV(AST_CEL_BLINDTRANSFER);
+	EV(AST_CEL_ATTENDEDTRANSFER);
+	EV(AST_CEL_PICKUP);
+	EV(AST_CEL_FORWARD);
+	EV(AST_CEL_3WAY_START);
+	EV(AST_CEL_3WAY_END);
+	EV(AST_CEL_HOOKFLASH);
+	EV(AST_CEL_LINKEDID_END);
+	}
+
+#undef EV
+
+	return "Unknown";
 }
 
 const char *ast_cel_flags2str(enum ast_cel_ama_flag flag)
@@ -433,14 +413,14 @@
 
 	/* make sure we need to do all this work */
 
-	if (!ast_strlen_zero(linkedid) && ast_cel_track_event(CEL_LINKEDID_END)) {
+	if (!ast_strlen_zero(linkedid) && ast_cel_track_event(AST_CEL_LINKEDID_END)) {
 		struct ast_channel *tmp = NULL;
 		find_dat.chan = chan;
 		find_dat.linkedid = linkedid;
 		if ((tmp = ast_channel_callback(linkedid_match, NULL, &find_dat, 0))) {
 			tmp = ast_channel_unref(tmp);
 		} else {
-			ast_cel_report_event(chan, CEL_LINKEDID_END, NULL, NULL, NULL);
+			ast_cel_report_event(chan, AST_CEL_LINKEDID_END, NULL, NULL, NULL);
 		}
 	}
 }
@@ -474,7 +454,7 @@
 	eventtype = (enum ast_cel_eventtype)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 == CEL_USER_DEFINED) {
+	if (eventtype == 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);
@@ -497,7 +477,7 @@
 	peer = ast_event_get_ie_str(event, AST_EVENT_IE_CEL_PEER);
 
 	/* next, fill the channel with their data */
-	if (eventtype == CEL_USER_DEFINED) {
+	if (eventtype == AST_CEL_USER_DEFINED) {
 		newvariable = ast_var_assign("eventtype", userdefname);
 	} else {
 		newvariable = ast_var_assign("eventtype", ast_cel_eventtype2str(eventtype));
@@ -555,7 +535,7 @@
 
 	ast_debug(3, "CEL event tracked: %s\n", ast_cel_eventtype2str(eventtype));
 
-	if (eventtype == CEL_APP_START || eventtype == CEL_APP_END) {
+	if (eventtype == AST_CEL_APP_START || eventtype == AST_CEL_APP_END) {
 		if (!ast_hashtab_lookup(appset, chan->appl)) {
 			return;
 		}

Modified: team/group/newcdr/main/channel.c
URL: http://svn.asterisk.org/svn-view/asterisk/team/group/newcdr/main/channel.c?view=diff&rev=201990&r1=201989&r2=201990
==============================================================================
--- team/group/newcdr/main/channel.c (original)
+++ team/group/newcdr/main/channel.c Fri Jun 19 14:28:38 2009
@@ -953,7 +953,7 @@
 	ast_cdr_init(tmp->cdr, tmp);
 	ast_cdr_start(tmp->cdr);
 
-	ast_cel_report_event(tmp, CEL_CHANNEL_START, NULL, NULL, NULL);
+	ast_cel_report_event(tmp, AST_CEL_CHANNEL_START, NULL, NULL, NULL);
 
 	headp = &tmp->varshead;
 	AST_LIST_HEAD_INIT_NOLOCK(headp);
@@ -1744,7 +1744,7 @@
 
 	headp = &chan->varshead;
 
-	ast_cel_report_event(chan, CEL_CHANNEL_END, NULL, NULL, NULL);
+	ast_cel_report_event(chan, AST_CEL_CHANNEL_END, NULL, NULL, NULL);
 	ast_cel_check_retire_linkedid(chan);
 
 	/* Get rid of each of the data stores on the channel */
@@ -2113,7 +2113,7 @@
 	chan->generator = NULL;
 
 	snprintf(extra_str, sizeof(extra_str), "%d,%s,%s", chan->hangupcause, chan->hangupsource, S_OR(pbx_builtin_getvar_helper(chan, "DIALSTATUS"), ""));
-	ast_cel_report_event(chan, CEL_HANGUP, NULL, extra_str, NULL);
+	ast_cel_report_event(chan, AST_CEL_HANGUP, NULL, extra_str, NULL);
 
 	if (chan->cdr) {		/* End the CDR if it hasn't already */
 		ast_cdr_end(chan->cdr);
@@ -2195,11 +2195,11 @@
 		if (cdr_answer) {
 			ast_cdr_answer(chan->cdr);
 		}
-		ast_cel_report_event(chan, CEL_ANSWER, NULL, NULL, NULL);
+		ast_cel_report_event(chan, AST_CEL_ANSWER, NULL, NULL, NULL);
 		ast_channel_unlock(chan);
 		break;
 	case AST_STATE_UP:
-		ast_cel_report_event(chan, CEL_ANSWER, NULL, NULL, NULL);
+		ast_cel_report_event(chan, AST_CEL_ANSWER, NULL, NULL, NULL);
 		/* Calling ast_cdr_answer when it it has previously been called
 		 * is essentially a no-op, so it is safe.
 		 */
@@ -3185,7 +3185,7 @@
 					/* Answer the CDR */
 					ast_setstate(chan, AST_STATE_UP);
 					/* removed a call to ast_cdr_answer(chan->cdr) from here. */
-					ast_cel_report_event(chan, CEL_ANSWER, NULL, NULL, NULL);
+					ast_cel_report_event(chan, AST_CEL_ANSWER, NULL, NULL, NULL);
 				}
 			}
 			break;
@@ -5167,7 +5167,7 @@
 	if (original->_bridge) {
 		/* XXX - should we try to lock original->_bridge here? */
 		ast_string_field_set(original->_bridge, peeraccount, S_OR(clonechan->accountcode, ""));
-		ast_cel_report_event(original, CEL_BRIDGE_UPDATE, NULL, NULL, NULL);
+		ast_cel_report_event(original, AST_CEL_BRIDGE_UPDATE, NULL, NULL, NULL);
 	}
 
 	ast_debug(1, "Putting channel %s in %d/%d formats\n", original->name, wformat, rformat);
@@ -5821,7 +5821,7 @@
 					      "CallerID1: %s\r\n"
 					      "CallerID2: %s\r\n",
 					      c0->name, c1->name, c0->uniqueid, c1->uniqueid, S_OR(c0->cid.cid_num, "<unknown>"), S_OR(c1->cid.cid_num, "<unknown>"));
-				ast_cel_report_event(c0, CEL_BRIDGE_END, NULL, NULL, NULL);
+				ast_cel_report_event(c0, AST_CEL_BRIDGE_END, NULL, NULL, NULL);
 
 				ast_debug(1, "Returning from native bridge, channels: %s, %s\n", c0->name, c1->name);
 
@@ -5859,7 +5859,7 @@
 			if (ast_channel_make_compatible(c0, c1)) {
 				ast_log(LOG_WARNING, "Can't make %s and %s compatible\n", c0->name, c1->name);
 				manager_bridge_event(0, 1, c0, c1);
-				/* ast_cel_report_event(c0, CEL_BRIDGE_END, NULL, NULL, NULL); */
+				/* ast_cel_report_event(c0, AST_CEL_BRIDGE_END, NULL, NULL, NULL); */
 				return AST_BRIDGE_FAILED;
 			}
 			o0nativeformats = c0->nativeformats;
@@ -5887,7 +5887,7 @@
 	c0->_bridge = NULL;
 	c1->_bridge = NULL;
 
-	ast_cel_report_event(c0, CEL_BRIDGE_END, NULL, NULL, NULL);
+	ast_cel_report_event(c0, AST_CEL_BRIDGE_END, NULL, NULL, NULL);
 	manager_event(EVENT_FLAG_CALL, "Unlink",
 		      "Channel1: %s\r\n"
 		      "Channel2: %s\r\n"

Modified: team/group/newcdr/main/features.c
URL: http://svn.asterisk.org/svn-view/asterisk/team/group/newcdr/main/features.c?view=diff&rev=201990&r1=201989&r2=201990
==============================================================================
--- team/group/newcdr/main/features.c (original)
+++ team/group/newcdr/main/features.c Fri Jun 19 14:28:38 2009
@@ -809,7 +809,7 @@
 	pthread_kill(parking_thread, SIGURG);
 	ast_verb(2, "Parked %s on %d (lot %s). Will timeout back to extension [%s] %s, %d in %d seconds\n", pu->chan->name, pu->parkingnum, pu->parkinglot->name, pu->context, pu->exten, pu->priority, (pu->parkingtime/1000));
 
-	ast_cel_report_event(pu->chan, CEL_PARK_START, NULL, pu->parkinglot->name, peer);
+	ast_cel_report_event(pu->chan, AST_CEL_PARK_START, NULL, pu->parkinglot->name, peer);
 
 	if (peer) {
 		event_from = peer->name;
@@ -2768,7 +2768,7 @@
 			}
 		}
 	}
-	ast_cel_report_event(chan, CEL_BRIDGE_START, NULL, NULL, NULL);
+	ast_cel_report_event(chan, AST_CEL_BRIDGE_START, NULL, NULL, NULL);
 	for (;;) {
 		struct ast_channel *other;	/* used later */
 	
@@ -3249,7 +3249,7 @@
 				set_c_e_p(chan, pu->context, pu->exten, pu->priority);
 			}
 			post_manager_event("ParkedCallTimeOut", pu);
-			ast_cel_report_event(pu->chan, CEL_PARK_END, NULL, "ParkedCallTimeOut", NULL);
+			ast_cel_report_event(pu->chan, AST_CEL_PARK_END, NULL, "ParkedCallTimeOut", NULL);
 
 			ast_verb(2, "Timeout for %s parked on %d (%s). Returning to %s,%s,%d\n", pu->chan->name, pu->parkingnum, pu->parkinglot->name, pu->chan->context, pu->chan->exten, pu->chan->priority);
 			/* Start up the PBX, or hang them up */
@@ -3288,7 +3288,7 @@
 					if (f)
 						ast_frfree(f);
 					post_manager_event("ParkedCallGiveUp", pu);
-					ast_cel_report_event(pu->chan, CEL_PARK_END, NULL, "ParkedCallGiveUp", NULL);
+					ast_cel_report_event(pu->chan, AST_CEL_PARK_END, NULL, "ParkedCallGiveUp", NULL);
 
 					/* There's a problem, hang them up*/
 					ast_verb(2, "%s got tired of being parked\n", chan->name);
@@ -3533,7 +3533,7 @@
 		} else
 			ast_log(LOG_WARNING, "Whoa, no parking context?\n");
 
-		ast_cel_report_event(pu->chan, CEL_PARK_END, NULL, "UnParkedCall", chan);
+		ast_cel_report_event(pu->chan, AST_CEL_PARK_END, NULL, "UnParkedCall", chan);
 		manager_event(EVENT_FLAG_CALL, "UnParkedCall",
 			"Exten: %s\r\n"
 			"Channel: %s\r\n"

Modified: team/group/newcdr/main/pbx.c
URL: http://svn.asterisk.org/svn-view/asterisk/team/group/newcdr/main/pbx.c?view=diff&rev=201990&r1=201989&r2=201990
==============================================================================
--- team/group/newcdr/main/pbx.c (original)
+++ team/group/newcdr/main/pbx.c Fri Jun 19 14:28:38 2009
@@ -1357,7 +1357,7 @@
 
 	c->appl = app->name;
 	c->data = data;
-	ast_cel_report_event(c, CEL_APP_START, NULL, NULL, NULL);
+	ast_cel_report_event(c, AST_CEL_APP_START, NULL, NULL, NULL);
 
 	if (app->module)
 		u = __ast_module_user_add(app->module, c);
@@ -1370,7 +1370,7 @@
 	res = app->execute(c, S_OR(data, ""));
 	if (app->module && u)
 		__ast_module_user_remove(app->module, u);
-	ast_cel_report_event(c, CEL_APP_END, NULL, NULL, NULL);
+	ast_cel_report_event(c, AST_CEL_APP_END, NULL, NULL, NULL);
 	/* restore channel values */
 	c->appl = saved_c_appl;
 	c->data = saved_c_data;




More information about the asterisk-commits mailing list