diff options
author | Kinsey Moore <kmoore@digium.com> | 2014-07-07 01:22:44 +0000 |
---|---|---|
committer | Kinsey Moore <kmoore@digium.com> | 2014-07-07 01:22:44 +0000 |
commit | edcaa54019a14cdfd2d5e8453b15a52819cecb36 (patch) | |
tree | e6f9a48d1073ace332736bd64a25fd04f913b51f /tests/test_cel.c | |
parent | 9c589571b7b403d14d5af685fe7f531651317fa6 (diff) |
CEL: Fix incorrect/missing extra field information
This corrects two issues with the extra field information in Asterisk
12+ in channel event logs.
It is possible to inject custom values into the dialstatus provided by
ast_channel_dial_type() Stasis messages that fall outside the
enumeration allowed for the DIALSTATUS channel variable. CEL now
filters for the allowed values and ignores other values.
The "hangupsource" extra field key is always blank if the far end
channel is a chan_pjsip channel. This is because the hangupsource is
never set for the pjsip channel driver. This change sets the
hangupsource whenever a hangup is queued for chan_pjsip channels.
This corrects an issue with the pjsip channel driver where the
hangupcause information was not being set properly.
Review: https://reviewboard.asterisk.org/r/3690/
........
Merged revisions 418071 from http://svn.asterisk.org/svn/asterisk/branches/12
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@418084 65c4cc65-6c06-0410-ace0-fbb531ad65f3
Diffstat (limited to 'tests/test_cel.c')
-rw-r--r-- | tests/test_cel.c | 36 |
1 files changed, 36 insertions, 0 deletions
diff --git a/tests/test_cel.c b/tests/test_cel.c index 245a8831c..ff0aaca24 100644 --- a/tests/test_cel.c +++ b/tests/test_cel.c @@ -773,6 +773,40 @@ AST_TEST_DEFINE(test_cel_dial_unanswered) return AST_TEST_PASS; } +AST_TEST_DEFINE(test_cel_dial_unanswered_filter) +{ + RAII_VAR(struct ast_channel *, chan_caller, NULL, safe_channel_release); + RAII_VAR(struct ast_channel *, chan_callee, NULL, safe_channel_release); + struct ast_party_caller caller = ALICE_CALLERID; + + switch (cmd) { + case TEST_INIT: + info->name = __func__; + info->category = TEST_CATEGORY; + info->summary = "Test CEL for a dial that isn't answered"; + info->description = + "Test CEL records for a channel that\n" + "performs a dial operation that isn't answered\n"; + return AST_TEST_NOT_RUN; + case TEST_EXECUTE: + break; + } + + CREATE_ALICE_CHANNEL(chan_caller, &caller); + + EMULATE_DIAL(chan_caller, CHANNEL_TECH_NAME "/Bob"); + + START_DIALED(chan_caller, chan_callee); + + ast_channel_state_set(chan_caller, AST_STATE_RINGING); + ast_channel_publish_dial(chan_caller, chan_callee, NULL, "NOT A VALID DIAL STATUS"); + ast_channel_publish_dial(chan_caller, chan_callee, NULL, "NOANSWER"); + + HANGUP_CHANNEL(chan_caller, AST_CAUSE_NO_ANSWER, "NOANSWER"); + HANGUP_CHANNEL(chan_callee, AST_CAUSE_NO_ANSWER, ""); + + return AST_TEST_PASS; +} AST_TEST_DEFINE(test_cel_dial_busy) { @@ -2040,6 +2074,7 @@ static int unload_module(void) #endif AST_TEST_UNREGISTER(test_cel_dial_unanswered); + AST_TEST_UNREGISTER(test_cel_dial_unanswered_filter); AST_TEST_UNREGISTER(test_cel_dial_congestion); AST_TEST_UNREGISTER(test_cel_dial_busy); AST_TEST_UNREGISTER(test_cel_dial_unavailable); @@ -2114,6 +2149,7 @@ static int load_module(void) #endif AST_TEST_REGISTER(test_cel_dial_unanswered); + AST_TEST_REGISTER(test_cel_dial_unanswered_filter); AST_TEST_REGISTER(test_cel_dial_congestion); AST_TEST_REGISTER(test_cel_dial_busy); AST_TEST_REGISTER(test_cel_dial_unavailable); |