summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorMatthew Jordan <mjordan@digium.com>2014-08-14 19:21:51 +0000
committerMatthew Jordan <mjordan@digium.com>2014-08-14 19:21:51 +0000
commit0b11c48522884fb9d1ce2698d0f61899fa299900 (patch)
tree95392a0ac2e806ace1778d23392ffcb62fe283d2 /tests
parent79c5c08db9ff3f640e6464c385a0cc9baf13e656 (diff)
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 git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@421043 65c4cc65-6c06-0410-ace0-fbb531ad65f3
Diffstat (limited to 'tests')
-rw-r--r--tests/test_cel.c19
1 files changed, 13 insertions, 6 deletions
diff --git a/tests/test_cel.c b/tests/test_cel.c
index 2cde0978d..b2a1fd3e5 100644
--- a/tests/test_cel.c
+++ b/tests/test_cel.c
@@ -169,22 +169,27 @@ static void do_sleep(void)
#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 @@ AST_TEST_DEFINE(test_cel_dial_pickup)
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 @@ AST_TEST_DEFINE(test_cel_local_optimize)
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);