Merged revisions 84274 via svnmerge from

https://origsvn.digium.com/svn/asterisk/branches/1.4

........
r84274 | dhubbard | 2007-10-01 16:25:37 -0500 (Mon, 01 Oct 2007) | 1 line

moved get_base_channel() code from action_redirect to ast_channel_masquerade() for issue 7706 and BE-160
........


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@84275 65c4cc65-6c06-0410-ace0-fbb531ad65f3
This commit is contained in:
Dwayne M. Hubbard
2007-10-01 21:31:16 +00:00
parent 9334e72e76
commit 71a0672560
3 changed files with 14 additions and 23 deletions

View File

@@ -702,17 +702,20 @@ static void set_agentbycallerid(const char *callerid, const char *agent)
pbx_builtin_setvar_helper(NULL, buf, agent);
}
/*! \brief return the channel or base channel if one exists. This function assumes the channel it is called on is already locked */
struct ast_channel* agent_get_base_channel(struct ast_channel *chan)
{
struct agent_pvt *p = NULL;
struct ast_channel *base = NULL;
struct ast_channel *base = chan;
/* chan is locked by the calling function */
if (!chan || !chan->tech_pvt) {
ast_log(LOG_ERROR, "whoa, you need a channel (0x%ld) with a tech_pvt (0x%ld) to get a base channel.\n", (long)chan, (chan)?(long)chan->tech_pvt:(long)NULL);
} else {
p = chan->tech_pvt;
base = p->chan;
return NULL;
}
p = chan->tech_pvt;
if (p->chan)
base = p->chan;
return base;
}