diff options
author | Richard Mudgett <rmudgett@digium.com> | 2012-06-29 17:02:32 +0000 |
---|---|---|
committer | Richard Mudgett <rmudgett@digium.com> | 2012-06-29 17:02:32 +0000 |
commit | ac35b92b628064a1fcf962895f0befd57aff0442 (patch) | |
tree | 0f2a4fb769643d0ae24dfed49468d80e8652aabf /apps/app_queue.c | |
parent | 35c533156cf94b005bd7c561d69e40dc5e837dd6 (diff) |
Hangup handlers - Dialplan subroutines that run when the channel hangs up.
Hangup handlers are an alternative to the h extension. They can be used
in addition to the h extension. The idea is to attach a Gosub routine to
a channel that will execute when the call hangs up. Whereas which h
extension gets executed depends on the location of dialplan execution when
the call hangs up, hangup handlers are attached to the call channel. You
can attach multiple handlers that will execute in the order of most
recently added first.
(closes issue ASTERISK-19549)
Reported by: Mark Murawski
Tested by: rmudgett
Review: https://reviewboard.asterisk.org/r/2002/
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@369493 65c4cc65-6c06-0410-ace0-fbb531ad65f3
Diffstat (limited to 'apps/app_queue.c')
-rw-r--r-- | apps/app_queue.c | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/apps/app_queue.c b/apps/app_queue.c index 4acd799f1..cee5d449f 100644 --- a/apps/app_queue.c +++ b/apps/app_queue.c @@ -5266,7 +5266,7 @@ static int try_calling(struct queue_ent *qe, const struct ast_flags opts, char * "%s", queuename, ast_channel_uniqueid(qe->chan), ast_channel_name(peer), member->interface, member->membername, qe->parent->eventwhencalled == QUEUE_EVENT_VARIABLES ? vars2manager(qe->chan, vars, sizeof(vars)) : ""); - ast_hangup(peer); + ast_autoservice_chan_hangup_peer(qe->chan, peer); ao2_ref(member, -1); goto out; } else if (ast_check_hangup(qe->chan)) { @@ -5274,7 +5274,7 @@ static int try_calling(struct queue_ent *qe, const struct ast_flags opts, char * ast_log(LOG_NOTICE, "Caller was about to talk to agent on %s but the caller hungup.\n", ast_channel_name(peer)); ast_queue_log(queuename, ast_channel_uniqueid(qe->chan), member->membername, "ABANDON", "%d|%d|%ld", qe->pos, qe->opos, (long) time(NULL) - qe->start); record_abandoned(qe); - ast_hangup(peer); + ast_autoservice_chan_hangup_peer(qe->chan, peer); ao2_ref(member, -1); return -1; } @@ -5296,7 +5296,7 @@ static int try_calling(struct queue_ent *qe, const struct ast_flags opts, char * ast_log(LOG_WARNING, "Had to drop call because I couldn't make %s compatible with %s\n", ast_channel_name(qe->chan), ast_channel_name(peer)); record_abandoned(qe); ast_cdr_failed(ast_channel_cdr(qe->chan)); - ast_hangup(peer); + ast_autoservice_chan_hangup_peer(qe->chan, peer); ao2_ref(member, -1); return -1; } @@ -5673,10 +5673,10 @@ static int try_calling(struct queue_ent *qe, const struct ast_flags opts, char * caller_priority + 1); } if (goto_res || ast_pbx_start(peer)) { - ast_hangup(peer); + ast_autoservice_chan_hangup_peer(qe->chan, peer); } } else { - ast_hangup(peer); + ast_autoservice_chan_hangup_peer(qe->chan, peer); } res = bridge ? bridge : 1; |