[svn-commits] mjordan: trunk r421043 - in /trunk: ./ main/cel.c tests/test_cel.c
SVN commits to the Digium repositories
svn-commits at lists.digium.com
Thu Aug 14 14:21:54 CDT 2014
Author: mjordan
Date: Thu Aug 14 14:21:51 2014
New Revision: 421043
URL: http://svnview.digium.com/svn/asterisk?view=rev&rev=421043
Log:
cel: Make sure channels in extra fields include their unique IDs as well
CEL typically tracks a lot of information using the unique ID of the channel.
This is typically needed due to tying events together using the linked ID of
the various channels involved in a "call", which is derived from the channel ID
of the oldest channel involved in a bridge (or in the case of a Dial, the
parent channel).
Previously, we had updated the extra fields to include the involved channel
names, but forgot to put in the unique ID. This patch corrects that error.
........
Merged revisions 421037 from http://svn.asterisk.org/svn/asterisk/branches/12
........
Merged revisions 421042 from http://svn.asterisk.org/svn/asterisk/branches/13
Modified:
trunk/ (props changed)
trunk/main/cel.c
trunk/tests/test_cel.c
Propchange: trunk/
------------------------------------------------------------------------------
--- branch-13-merged (original)
+++ branch-13-merged Thu Aug 14 14:21:51 2014
@@ -1,1 +1,1 @@
-/branches/13:1-420494,420514,420534,420536,420538,420562,420577,420592,420609,420624,420639,420657,420717,420742,420758,420779,420796,420803,420808,420837,420856,420879,420881,420899,420919,420940,420950,420957,420992,421010
+/branches/13:1-420494,420514,420534,420536,420538,420562,420577,420592,420609,420624,420639,420657,420717,420742,420758,420779,420796,420803,420808,420837,420856,420879,420881,420899,420919,420940,420950,420957,420992,421010,421042
Modified: trunk/main/cel.c
URL: http://svnview.digium.com/svn/asterisk/trunk/main/cel.c?view=diff&rev=421043&r1=421042&r2=421043
==============================================================================
--- trunk/main/cel.c (original)
+++ trunk/main/cel.c Thu Aug 14 14:21:51 2014
@@ -1367,11 +1367,12 @@
return;
}
- extra = ast_json_pack("{s: s, s: s, s: s}",
+ extra = ast_json_pack("{s: s, s: s, s: s, s: s, s: s}",
"extension", transfer_msg->exten,
"context", transfer_msg->context,
"bridge_id", bridge_snapshot->uniqueid,
- "transferee_channel_name", transfer_msg->transferee ? transfer_msg->transferee->name: "N/A");
+ "transferee_channel_name", transfer_msg->transferee ? transfer_msg->transferee->name : "N/A",
+ "transferee_channel_uniqueid", transfer_msg->transferee ? transfer_msg->transferee->uniqueid : "N/A");
if (extra) {
cel_report_event(chan_snapshot, AST_CEL_BLINDTRANSFER, NULL, extra, NULL);
ast_json_unref(extra);
@@ -1407,24 +1408,30 @@
case AST_ATTENDED_TRANSFER_DEST_BRIDGE_MERGE:
case AST_ATTENDED_TRANSFER_DEST_LINK:
case AST_ATTENDED_TRANSFER_DEST_THREEWAY:
- extra = ast_json_pack("{s: s, s: s, s: s, s: s, s: s}",
+ extra = ast_json_pack("{s: s, s: s, s: s, s: s, s: s, s: s, s: s, s: s}",
"bridge1_id", bridge1->uniqueid,
"channel2_name", channel2->name,
+ "channel2_uniqueid", channel2->uniqueid,
"bridge2_id", bridge2->uniqueid,
"transferee_channel_name", xfer->transferee ? xfer->transferee->name : "N/A",
- "transfer_target_channel_name", xfer->target ? xfer->target->name : "N/A");
+ "transferee_channel_uniqueid", xfer->transferee ? xfer->transferee->uniqueid : "N/A",
+ "transfer_target_channel_name", xfer->target ? xfer->target->name : "N/A",
+ "transfer_target_channel_uniqueid", xfer->target ? xfer->target->uniqueid : "N/A");
if (!extra) {
return;
}
break;
case AST_ATTENDED_TRANSFER_DEST_APP:
case AST_ATTENDED_TRANSFER_DEST_LOCAL_APP:
- extra = ast_json_pack("{s: s, s: s, s: s, s: s, s: s}",
+ extra = ast_json_pack("{s: s, s: s, s: s, s: s, s: s, s: s, s: s, s: s}",
"bridge1_id", bridge1->uniqueid,
"channel2_name", channel2->name,
+ "channel2_uniqueid", channel2->uniqueid,
"app", xfer->dest.app,
"transferee_channel_name", xfer->transferee ? xfer->transferee->name : "N/A",
- "transfer_target_channel_name", xfer->target ? xfer->target->name : "N/A");
+ "transferee_channel_uniqueid", xfer->transferee ? xfer->transferee->uniqueid : "N/A",
+ "transfer_target_channel_name", xfer->target ? xfer->target->name : "N/A",
+ "transfer_target_channel_uniqueid", xfer->target ? xfer->target->uniqueid : "N/A");
if (!extra) {
return;
}
@@ -1447,7 +1454,9 @@
return;
}
- extra = ast_json_pack("{s: s}", "pickup_channel", channel->name);
+ extra = ast_json_pack("{s: s, s: s}",
+ "pickup_channel", channel->name,
+ "pickup_channel_uniqueid", channel->uniqueid);
if (!extra) {
return;
}
@@ -1469,7 +1478,9 @@
return;
}
- extra = ast_json_pack("{s: s}", "local_two", localtwo->name);
+ extra = ast_json_pack("{s: s, s: s}",
+ "local_two", localtwo->name,
+ "local_two_uniqueid", localtwo->uniqueid);
if (!extra) {
return;
}
Modified: trunk/tests/test_cel.c
URL: http://svnview.digium.com/svn/asterisk/trunk/tests/test_cel.c?view=diff&rev=421043&r1=421042&r2=421043
==============================================================================
--- trunk/tests/test_cel.c (original)
+++ trunk/tests/test_cel.c Thu Aug 14 14:21:51 2014
@@ -169,22 +169,27 @@
#define BLINDTRANSFER_EVENT(channel, bridge, extension, context) do { \
RAII_VAR(struct ast_json *, extra, NULL, ast_json_unref); \
- extra = ast_json_pack("{s: s, s: s, s: s}", \
+ extra = ast_json_pack("{s: s, s: s, s: s, s: s, s: s}", \
"extension", extension, \
"context", context, \
- "bridge_id", bridge->uniqueid); \
+ "bridge_id", bridge->uniqueid, \
+ "transferee_channel_name", "N/A", \
+ "transferee_channel_uniqueid", "N/A"); \
ast_test_validate(test, extra != NULL); \
APPEND_EVENT(channel, AST_CEL_BLINDTRANSFER, NULL, extra); \
} while (0)
#define ATTENDEDTRANSFER_BRIDGE(channel1, bridge1, channel2, bridge2, channel3, channel4) do { \
RAII_VAR(struct ast_json *, extra, NULL, ast_json_unref); \
- extra = ast_json_pack("{s: s, s: s, s: s, s: s, s: s}", \
+ extra = ast_json_pack("{s: s, s: s, s: s, s: s, s: s, s: s, s: s, s: s}", \
"bridge1_id", bridge1->uniqueid, \
"channel2_name", ast_channel_name(channel2), \
+ "channel2_uniqueid", ast_channel_uniqueid(channel2), \
"bridge2_id", bridge2->uniqueid, \
"transferee_channel_name", ast_channel_name(channel4), \
- "transfer_target_channel_name", ast_channel_name(channel3)); \
+ "transferee_channel_uniqueid", ast_channel_uniqueid(channel4), \
+ "transfer_target_channel_name", ast_channel_name(channel3), \
+ "transfer_target_channel_uniqueid", ast_channel_uniqueid(channel3)); \
ast_test_validate(test, extra != NULL); \
APPEND_EVENT(channel1, AST_CEL_ATTENDEDTRANSFER, NULL, extra); \
} while (0)
@@ -1572,7 +1577,8 @@
RAII_VAR(struct ast_json *, extra, NULL, ast_json_unref);
SCOPED_CHANNELLOCK(lock, chan_callee);
- extra = ast_json_pack("{s: s}", "pickup_channel", ast_channel_name(chan_charlie));
+ extra = ast_json_pack("{s: s, s: s}", "pickup_channel", ast_channel_name(chan_charlie),
+ "pickup_channel_uniqueid", ast_channel_uniqueid(chan_charlie));
ast_test_validate(test, extra != NULL);
APPEND_EVENT(chan_callee, AST_CEL_PICKUP, NULL, extra);
@@ -1645,7 +1651,8 @@
stasis_publish(ast_channel_topic(chan_alice), local_opt_begin);
stasis_publish(ast_channel_topic(chan_alice), local_opt_end);
- extra = ast_json_pack("{s: s}", "local_two", bob_snapshot->name);
+ extra = ast_json_pack("{s: s, s: s}", "local_two", bob_snapshot->name,
+ "local_two_uniqueid", bob_snapshot->uniqueid);
ast_test_validate(test, extra != NULL);
APPEND_EVENT_SNAPSHOT(alice_snapshot, AST_CEL_LOCAL_OPTIMIZE, NULL, extra, NULL);
More information about the svn-commits
mailing list