diff options
author | zuul <zuul@gerrit.asterisk.org> | 2017-01-25 19:14:12 -0600 |
---|---|---|
committer | Gerrit Code Review <gerrit2@gerrit.digium.api> | 2017-01-25 19:14:12 -0600 |
commit | 1479e049cb250f110834c6c8ba17a3e26a32a451 (patch) | |
tree | b7d735cb9d4b0e04a46b1d7e9a8824775aa6dee2 /apps/app_queue.c | |
parent | 9a0b73e339336085e7907836de6eb173207052e2 (diff) | |
parent | 40b9766a3149158cb3f8c3478af64b5615b01215 (diff) |
Merge "app_queue: add RINGCANCELED log event on caller hang up"
Diffstat (limited to 'apps/app_queue.c')
-rw-r--r-- | apps/app_queue.c | 25 |
1 files changed, 15 insertions, 10 deletions
diff --git a/apps/app_queue.c b/apps/app_queue.c index 68ee6165f..da24c51d6 100644 --- a/apps/app_queue.c +++ b/apps/app_queue.c @@ -4791,6 +4791,7 @@ static struct callattempt *wait_for_answer(struct queue_ent *qe, struct callatte #endif char *inchan_name; struct timeval start_time_tv = ast_tvnow(); + int canceled_by_caller = 0; /* 1 when caller hangs up or press digit or press * */ ast_channel_lock(qe->chan); inchan_name = ast_strdupa(ast_channel_name(qe->chan)); @@ -5229,29 +5230,33 @@ static struct callattempt *wait_for_answer(struct queue_ent *qe, struct callatte if (!f || ((f->frametype == AST_FRAME_CONTROL) && (f->subclass.integer == AST_CONTROL_HANGUP))) { /* Got hung up */ *to = -1; - publish_dial_end_event(in, outgoing, NULL, "CANCEL"); if (f) { if (f->data.uint32) { ast_channel_hangupcause_set(in, f->data.uint32); } ast_frfree(f); } - return NULL; - } - - if ((f->frametype == AST_FRAME_DTMF) && caller_disconnect && (f->subclass.integer == '*')) { + canceled_by_caller = 1; + } else if ((f->frametype == AST_FRAME_DTMF) && caller_disconnect && (f->subclass.integer == '*')) { ast_verb(3, "User hit %c to disconnect call.\n", f->subclass.integer); *to = 0; - publish_dial_end_event(in, outgoing, NULL, "CANCEL"); ast_frfree(f); - return NULL; - } - if ((f->frametype == AST_FRAME_DTMF) && valid_exit(qe, f->subclass.integer)) { + canceled_by_caller = 1; + } else if ((f->frametype == AST_FRAME_DTMF) && valid_exit(qe, f->subclass.integer)) { ast_verb(3, "User pressed digit: %c\n", f->subclass.integer); *to = 0; - publish_dial_end_event(in, outgoing, NULL, "CANCEL"); *digit = f->subclass.integer; ast_frfree(f); + canceled_by_caller = 1; + } + /* When caller hung up or pressed * or digit. */ + if (canceled_by_caller) { + publish_dial_end_event(in, outgoing, NULL, "CANCEL"); + for (o = start; o; o = o->call_next) { + if (o->chan) { + ast_queue_log(qe->parent->name, ast_channel_uniqueid(qe->chan), o->member->membername, "RINGCANCELED", "%d", (int) ast_tvdiff_ms(ast_tvnow(), start_time_tv)); + } + } return NULL; } |