summaryrefslogtreecommitdiff
path: root/main
diff options
context:
space:
mode:
authorKinsey Moore <kmoore@digium.com>2014-07-07 01:22:44 +0000
committerKinsey Moore <kmoore@digium.com>2014-07-07 01:22:44 +0000
commitedcaa54019a14cdfd2d5e8453b15a52819cecb36 (patch)
treee6f9a48d1073ace332736bd64a25fd04f913b51f /main
parent9c589571b7b403d14d5af685fe7f531651317fa6 (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 'main')
-rw-r--r--main/cel.c35
1 files changed, 31 insertions, 4 deletions
diff --git a/main/cel.c b/main/cel.c
index 57fb946a4..a3005af8b 100644
--- a/main/cel.c
+++ b/main/cel.c
@@ -1270,6 +1270,35 @@ static void save_dialstatus(struct ast_multi_channel_blob *blob)
}
}
+static int is_valid_dialstatus(struct ast_multi_channel_blob *blob)
+{
+ const char *dialstatus = get_blob_variable(blob, "dialstatus");
+ int res = 0;
+
+ if (ast_strlen_zero(dialstatus)) {
+ res = 0;
+ } else if (!strcasecmp(dialstatus, "CHANUNAVAIL")) {
+ res = 1;
+ } else if (!strcasecmp(dialstatus, "CONGESTION")) {
+ res = 1;
+ } else if (!strcasecmp(dialstatus, "NOANSWER")) {
+ res = 1;
+ } else if (!strcasecmp(dialstatus, "BUSY")) {
+ res = 1;
+ } else if (!strcasecmp(dialstatus, "ANSWER")) {
+ res = 1;
+ } else if (!strcasecmp(dialstatus, "CANCEL")) {
+ res = 1;
+ } else if (!strcasecmp(dialstatus, "DONTCALL")) {
+ res = 1;
+ } else if (!strcasecmp(dialstatus, "TORTURE")) {
+ res = 1;
+ } else if (!strcasecmp(dialstatus, "INVALIDARGS")) {
+ res = 1;
+ }
+ return res;
+}
+
static void cel_dial_cb(void *data, struct stasis_subscription *sub,
struct stasis_message *message)
{
@@ -1298,11 +1327,9 @@ static void cel_dial_cb(void *data, struct stasis_subscription *sub,
}
}
- if (ast_strlen_zero(get_blob_variable(blob, "dialstatus"))) {
- return;
+ if (is_valid_dialstatus(blob)) {
+ save_dialstatus(blob);
}
-
- save_dialstatus(blob);
}
static void cel_generic_cb(