diff options
author | Jason Parker <jparker@digium.com> | 2011-03-02 21:08:39 +0000 |
---|---|---|
committer | Jason Parker <jparker@digium.com> | 2011-03-02 21:08:39 +0000 |
commit | a7bfa104728212a4c0ee61bf5ddf4f0a9415ede0 (patch) | |
tree | 5c5d9710bce8f285c78b7a2d03e3e971a4aa70de /main | |
parent | 070cb4ef871c40acc3f71a2a0415e0c381e1307d (diff) |
Add HangupRequest manager event, to specify when/where a channel gets hung up.
(closes issue #18226)
Reported by: clegall_proformatique
Patches:
asterisk_1.8_293157_hanguprequests.svn.patch uploaded by clegall proformatique (license 1139)
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@309300 65c4cc65-6c06-0410-ace0-fbb531ad65f3
Diffstat (limited to 'main')
-rw-r--r-- | main/channel.c | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/main/channel.c b/main/channel.c index cba634bae..c3b3981f1 100644 --- a/main/channel.c +++ b/main/channel.c @@ -1496,6 +1496,11 @@ int ast_queue_hangup(struct ast_channel *chan) /* Yeah, let's not change a lock-critical value without locking */ if (!ast_channel_trylock(chan)) { chan->_softhangup |= AST_SOFTHANGUP_DEV; + manager_event(EVENT_FLAG_CALL, "HangupRequest", + "Channel: %s\r\n" + "Uniqueid: %s\r\n", + chan->name, + chan->uniqueid); ast_channel_unlock(chan); } return ast_queue_frame(chan, &f); @@ -1515,6 +1520,13 @@ int ast_queue_hangup_with_cause(struct ast_channel *chan, int cause) if (cause < 0) f.data.uint32 = chan->hangupcause; + manager_event(EVENT_FLAG_CALL, "HangupRequest", + "Channel: %s\r\n" + "Uniqueid: %s\r\n" + "Cause: %d\r\n", + chan->name, + chan->uniqueid, + cause); ast_channel_unlock(chan); } @@ -2661,6 +2673,13 @@ int ast_softhangup(struct ast_channel *chan, int cause) ast_channel_lock(chan); res = ast_softhangup_nolock(chan, cause); + manager_event(EVENT_FLAG_CALL, "SoftHangupRequest", + "Channel: %s\r\n" + "Uniqueid: %s\r\n" + "Cause: %d\r\n", + chan->name, + chan->uniqueid, + cause); ast_channel_unlock(chan); return res; |