mirror of
https://github.com/asterisk/asterisk.git
synced 2025-09-06 04:30:28 +00:00
automerge commit
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.2-netsec@42470 65c4cc65-6c06-0410-ace0-fbb531ad65f3
This commit is contained in:
23
channel.c
23
channel.c
@@ -2948,6 +2948,8 @@ int ast_do_masquerade(struct ast_channel *original)
|
|||||||
void *t_pvt;
|
void *t_pvt;
|
||||||
struct ast_callerid tmpcid;
|
struct ast_callerid tmpcid;
|
||||||
struct ast_channel *clone = original->masq;
|
struct ast_channel *clone = original->masq;
|
||||||
|
struct ast_channel_spy_list *spy_list;
|
||||||
|
struct ast_channel_spy *spy = NULL;
|
||||||
int rformat = original->readformat;
|
int rformat = original->readformat;
|
||||||
int wformat = original->writeformat;
|
int wformat = original->writeformat;
|
||||||
char newn[100];
|
char newn[100];
|
||||||
@@ -3025,6 +3027,27 @@ int ast_do_masquerade(struct ast_channel *original)
|
|||||||
original->rawwriteformat = clone->rawwriteformat;
|
original->rawwriteformat = clone->rawwriteformat;
|
||||||
clone->rawwriteformat = x;
|
clone->rawwriteformat = x;
|
||||||
|
|
||||||
|
/* Swap the spies */
|
||||||
|
spy_list = original->spies;
|
||||||
|
original->spies = clone->spies;
|
||||||
|
clone->spies = spy_list;
|
||||||
|
|
||||||
|
/* Update channel on respective spy lists if present */
|
||||||
|
if (original->spies) {
|
||||||
|
AST_LIST_TRAVERSE(&original->spies->list, spy, list) {
|
||||||
|
ast_mutex_lock(&spy->lock);
|
||||||
|
spy->chan = original;
|
||||||
|
ast_mutex_unlock(&spy->lock);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (clone->spies) {
|
||||||
|
AST_LIST_TRAVERSE(&clone->spies->list, spy, list) {
|
||||||
|
ast_mutex_lock(&spy->lock);
|
||||||
|
spy->chan = clone;
|
||||||
|
ast_mutex_unlock(&spy->lock);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/* Save any pending frames on both sides. Start by counting
|
/* Save any pending frames on both sides. Start by counting
|
||||||
* how many we're going to need... */
|
* how many we're going to need... */
|
||||||
prev = NULL;
|
prev = NULL;
|
||||||
|
Reference in New Issue
Block a user