diff options
author | Joshua Colp <jcolp@digium.com> | 2007-05-07 21:47:08 +0000 |
---|---|---|
committer | Joshua Colp <jcolp@digium.com> | 2007-05-07 21:47:08 +0000 |
commit | 5394364048dd8e530d5fd8ddbdd4c46729b7727c (patch) | |
tree | 2f5e2d2152ad75356911f6e76c4460d03da70d69 | |
parent | b6ef87dbf38ea40a20f06796e38466426460fad0 (diff) |
Merged revisions 63286 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4
................
r63286 | file | 2007-05-07 17:45:01 -0400 (Mon, 07 May 2007) | 10 lines
Merged revisions 63285 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.2
........
r63285 | file | 2007-05-07 17:39:52 -0400 (Mon, 07 May 2007) | 2 lines
Properly handle what happens during a masquerade in relation to group counting. (issue #9657 reported by ramonpeek)
........
................
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@63287 65c4cc65-6c06-0410-ace0-fbb531ad65f3
-rw-r--r-- | include/asterisk/app.h | 3 | ||||
-rw-r--r-- | main/app.c | 14 | ||||
-rw-r--r-- | main/channel.c | 2 |
3 files changed, 18 insertions, 1 deletions
diff --git a/include/asterisk/app.h b/include/asterisk/app.h index 15a2e5dad..e4eca117d 100644 --- a/include/asterisk/app.h +++ b/include/asterisk/app.h @@ -227,6 +227,9 @@ int ast_app_group_match_get_count(const char *groupmatch, const char *category); /*! Discard all group counting for a channel */ int ast_app_group_discard(struct ast_channel *chan); +/*! Update all group counting for a channel to a new one */ +int ast_app_group_update(struct ast_channel *old, struct ast_channel *new); + /*! Lock the group count list */ int ast_app_group_list_lock(void); diff --git a/main/app.c b/main/app.c index 91441f64e..10b9fea80 100644 --- a/main/app.c +++ b/main/app.c @@ -894,6 +894,20 @@ int ast_app_group_match_get_count(const char *groupmatch, const char *category) return count; } +int ast_app_group_update(struct ast_channel *old, struct ast_channel *new) +{ + struct ast_group_info *gi = NULL; + + AST_LIST_LOCK(&groups); + AST_LIST_TRAVERSE(&groups, gi, list) { + if (gi->chan == old) + gi->chan = new; + } + AST_LIST_UNLOCK(&groups); + + return 0; +} + int ast_app_group_discard(struct ast_channel *chan) { struct ast_group_info *gi = NULL; diff --git a/main/channel.c b/main/channel.c index c92530c34..e48042793 100644 --- a/main/channel.c +++ b/main/channel.c @@ -3575,7 +3575,7 @@ int ast_do_masquerade(struct ast_channel *original) original->fds[x] = clone->fds[x]; } - ast_app_group_discard(original); + ast_app_group_update(clone, original); /* move any whisperer over */ ast_channel_whisper_stop(original); |