[asterisk-commits] kmoore: branch kmoore/cel_transfers r393895 - /team/kmoore/cel_transfers/main/

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


Author: kmoore
Date: Tue Jul  9 14:26:56 2013
New Revision: 393895

URL: http://svnview.digium.com/svn/asterisk?view=rev&rev=393895
Log:
Do some cleanup

Modified:
    team/kmoore/cel_transfers/main/cel.c

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=393895&r1=393894&r2=393895
==============================================================================
--- team/kmoore/cel_transfers/main/cel.c (original)
+++ team/kmoore/cel_transfers/main/cel.c Tue Jul  9 14:26:56 2013
@@ -667,7 +667,7 @@
 		AST_EVENT_IE_END);
 }
 
-static int report_event_snapshot(struct ast_channel_snapshot *snapshot,
+static int cel_report_event(struct ast_channel_snapshot *snapshot,
 		enum ast_cel_event_type event_type, const char *userdefevname,
 		struct ast_json *extra, const char *peer2_name)
 {
@@ -739,7 +739,7 @@
 	 * before unreffing the channel we have a refcount of 3, we're done. Unlink and report. */
 	if (ao2_ref(lid, -1) == 3) {
 		ast_str_container_remove(linkedids, lid);
-		report_event_snapshot(snapshot, AST_CEL_LINKEDID_END, NULL, NULL, NULL);
+		cel_report_event(snapshot, AST_CEL_LINKEDID_END, NULL, NULL, NULL);
 	}
 	ao2_ref(lid, -1);
 }
@@ -975,13 +975,13 @@
 	int is_hungup, was_hungup;
 
 	if (!new_snapshot) {
-		report_event_snapshot(old_snapshot, AST_CEL_CHANNEL_END, NULL, NULL, NULL);
+		cel_report_event(old_snapshot, AST_CEL_CHANNEL_END, NULL, NULL, NULL);
 		check_retire_linkedid(old_snapshot);
 		return;
 	}
 
 	if (!old_snapshot) {
-		report_event_snapshot(new_snapshot, AST_CEL_CHANNEL_START, NULL, NULL, NULL);
+		cel_report_event(new_snapshot, AST_CEL_CHANNEL_START, NULL, NULL, NULL);
 		return;
 	}
 
@@ -999,12 +999,12 @@
 			"hangupcause", new_snapshot->hangupcause,
 			"hangupsource", new_snapshot->hangupsource,
 			"dialstatus", dialstatus);
-		report_event_snapshot(new_snapshot, AST_CEL_HANGUP, NULL, extra, NULL);
+		cel_report_event(new_snapshot, AST_CEL_HANGUP, NULL, extra, NULL);
 		return;
 	}
 
 	if (old_snapshot->state != new_snapshot->state && new_snapshot->state == AST_STATE_UP) {
-		report_event_snapshot(new_snapshot, AST_CEL_ANSWER, NULL, NULL, NULL);
+		cel_report_event(new_snapshot, AST_CEL_ANSWER, NULL, NULL, NULL);
 		return;
 	}
 }
@@ -1037,12 +1037,12 @@
 
 	/* old snapshot has an application, end it */
 	if (old_snapshot && !ast_strlen_zero(old_snapshot->appl)) {
-		report_event_snapshot(old_snapshot, AST_CEL_APP_END, NULL, NULL, NULL);
+		cel_report_event(old_snapshot, AST_CEL_APP_END, NULL, NULL, NULL);
 	}
 
 	/* new snapshot has an application, start it */
 	if (new_snapshot && !ast_strlen_zero(new_snapshot->appl)) {
-		report_event_snapshot(new_snapshot, AST_CEL_APP_START, NULL, NULL, NULL);
+		cel_report_event(new_snapshot, AST_CEL_APP_START, NULL, NULL, NULL);
 	}
 }
 
@@ -1143,7 +1143,7 @@
 			RAII_VAR(struct ast_json *, extra, NULL, ast_json_unref);
 			extra = ast_json_pack("{s: s}", "bridge_id", snapshot->uniqueid);
 			if (extra) {
-				report_event_snapshot(chan_snapshot, AST_CEL_CONF_ENTER, NULL, extra, NULL);
+				cel_report_event(chan_snapshot, AST_CEL_CONF_ENTER, NULL, extra, NULL);
 			}
 			return;
 		}
@@ -1170,7 +1170,7 @@
 			}
 
 			add_bridge_primary(latest_primary, snapshot->uniqueid, chan_snapshot->name);
-			report_event_snapshot(latest_primary, AST_CEL_BRIDGE_START, NULL, NULL, chan_snapshot->name);
+			cel_report_event(latest_primary, AST_CEL_BRIDGE_START, NULL, NULL, chan_snapshot->name);
 		} else if (ao2_container_count(snapshot->channels) > 2) {
 			if (!assoc) {
 				ast_log(LOG_ERROR, "No association found for bridge %s\n", snapshot->uniqueid);
@@ -1187,7 +1187,7 @@
 					"bridge_id", snapshot->uniqueid);
 
 				if (extra) {
-					report_event_snapshot(assoc->primary_snapshot, AST_CEL_BRIDGE_TO_CONF, NULL,
+					cel_report_event(assoc->primary_snapshot, AST_CEL_BRIDGE_TO_CONF, NULL,
 						extra, assoc->secondary_name);
 				}
 
@@ -1202,7 +1202,7 @@
 		}
 		extra = ast_json_pack("{s: s}", "bridge_id", snapshot->uniqueid);
 		if (extra) {
-			report_event_snapshot(chan_snapshot, AST_CEL_CONF_ENTER, NULL, extra, NULL);
+			cel_report_event(chan_snapshot, AST_CEL_CONF_ENTER, NULL, extra, NULL);
 		}
 	}
 }
@@ -1229,13 +1229,13 @@
 			RAII_VAR(struct ast_json *, extra, NULL, ast_json_unref);
 			extra = ast_json_pack("{s: s}", "bridge_id", snapshot->uniqueid);
 			if (extra) {
-				report_event_snapshot(chan_snapshot, AST_CEL_CONF_EXIT, NULL, extra, NULL);
+				cel_report_event(chan_snapshot, AST_CEL_CONF_EXIT, NULL, extra, NULL);
 			}
 			return;
 		}
 
 		if (ao2_container_count(snapshot->channels) == 1) {
-			report_event_snapshot(assoc->primary_snapshot, AST_CEL_BRIDGE_END, NULL, NULL, assoc->secondary_name);
+			cel_report_event(assoc->primary_snapshot, AST_CEL_BRIDGE_END, NULL, NULL, assoc->secondary_name);
 			remove_bridge_primary(assoc->primary_snapshot->uniqueid);
 			return;
 		}
@@ -1243,7 +1243,7 @@
 		RAII_VAR(struct ast_json *, extra, NULL, ast_json_unref);
 		extra = ast_json_pack("{s: s}", "bridge_id", snapshot->uniqueid);
 		if (extra) {
-			report_event_snapshot(chan_snapshot, AST_CEL_CONF_EXIT, NULL, extra, NULL);
+			cel_report_event(chan_snapshot, AST_CEL_CONF_EXIT, NULL, extra, NULL);
 		}
 	}
 }
@@ -1263,7 +1263,7 @@
 			"parker_dial_string", parked_payload->parker_dial_string,
 			"parking_lot", parked_payload->parkinglot);
 		if (extra) {
-			report_event_snapshot(parked_payload->parkee, AST_CEL_PARK_START, NULL, extra, NULL);
+			cel_report_event(parked_payload->parkee, AST_CEL_PARK_START, NULL, extra, NULL);
 		}
 		return;
 	case PARKED_CALL_TIMEOUT:
@@ -1282,7 +1282,7 @@
 
 	extra = ast_json_pack("{s: s}", "reason", reason);
 	if (extra) {
-		report_event_snapshot(parked_payload->parkee, AST_CEL_PARK_END, NULL, extra, NULL);
+		cel_report_event(parked_payload->parkee, AST_CEL_PARK_END, NULL, extra, NULL);
 	}
 }
 
@@ -1310,7 +1310,7 @@
 
 		extra = ast_json_pack("{s: s}", "forward", get_blob_variable(blob, "forward"));
 		if (extra) {
-			report_event_snapshot(caller, AST_CEL_FORWARD, NULL, extra, NULL);
+			cel_report_event(caller, AST_CEL_FORWARD, NULL, extra, NULL);
 		}
 	}
 
@@ -1335,7 +1335,7 @@
 		{
 			const char *event = ast_json_string_get(ast_json_object_get(event_details, "event"));
 			struct ast_json *extra = ast_json_object_get(event_details, "extra");
-			report_event_snapshot(obj->snapshot, event_type, event, extra, NULL);
+			cel_report_event(obj->snapshot, event_type, event, extra, NULL);
 			break;
 		}
 	default:
@@ -1373,7 +1373,7 @@
 		"bridge_id", bridge_snapshot->uniqueid);
 
 	if (extra) {
-		report_event_snapshot(chan_snapshot, AST_CEL_BLINDTRANSFER, NULL, extra, NULL);
+		cel_report_event(chan_snapshot, AST_CEL_BLINDTRANSFER, NULL, extra, NULL);
 	}
 }
 
@@ -1426,7 +1426,7 @@
 		}
 		break;
 	}
-	report_event_snapshot(channel1, AST_CEL_ATTENDEDTRANSFER, NULL, extra, NULL);
+	cel_report_event(channel1, AST_CEL_ATTENDEDTRANSFER, NULL, extra, NULL);
 }
 
 static void cel_pickup_cb(
@@ -1438,7 +1438,7 @@
 	struct ast_channel_snapshot *channel = ast_multi_channel_blob_get_channel(obj, "channel");
 	struct ast_channel_snapshot *target = ast_multi_channel_blob_get_channel(obj, "target");
 
-	report_event_snapshot(target, AST_CEL_PICKUP, NULL, NULL, channel->name);
+	cel_report_event(target, AST_CEL_PICKUP, NULL, NULL, channel->name);
 }
 
 static void ast_cel_engine_term(void)




More information about the asterisk-commits mailing list