summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorMatt Jordan <mjordan@digium.com>2016-10-15 20:05:05 -0500
committerGeorge Joseph <gjoseph@digium.com>2016-10-17 08:13:46 -0500
commit42cfdcd1b700af157746b897dc04362e853065c0 (patch)
tree4483bc91f3c3ce79b8f109bc4863b2e99a96e8e4 /tests
parentd1d446b23795baa73969f725a1231dff6e0b0538 (diff)
res/ari: Add the Asterisk EID field to outgoing events
This patch adds the Asterisk EID field to all outgoing ARI events. Because this field should be added to all events as they are transmitted, it is appended to the JSON message just prior to it being handed off to the application message handler. This makes it somewhat resilient to both new events being added to ARI, as well as other potential event transport mechanisms. ASTERISK-26470 #close Change-Id: Ieff0ecc24464e83f3f44e9c3e7bd9a5d70b87a1d
Diffstat (limited to 'tests')
-rw-r--r--tests/test_res_stasis.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/tests/test_res_stasis.c b/tests/test_res_stasis.c
index 5865f0951..805634f26 100644
--- a/tests/test_res_stasis.c
+++ b/tests/test_res_stasis.c
@@ -137,6 +137,7 @@ AST_TEST_DEFINE(app_replaced)
RAII_VAR(struct ast_json *, expected_message1, NULL, ast_json_unref);
RAII_VAR(struct ast_json *, message, NULL, ast_json_unref);
RAII_VAR(struct ast_json *, expected_message2, NULL, ast_json_unref);
+ char eid[20];
int res;
switch (cmd) {
@@ -157,9 +158,10 @@ AST_TEST_DEFINE(app_replaced)
stasis_app_register(app_name, test_handler, app_data1);
stasis_app_register(app_name, test_handler, app_data2);
- expected_message1 = ast_json_pack("[{s: s, s: s}]",
+ expected_message1 = ast_json_pack("[{s: s, s: s, s: s}]",
"type", "ApplicationReplaced",
- "application", app_name);
+ "application", app_name,
+ "asterisk_id", ast_eid_to_str(eid, sizeof(eid), &ast_eid_default));
message = ast_json_pack("{ s: o }", "test-message", ast_json_null());
expected_message2 = ast_json_pack("[o]", ast_json_ref(message));