mirror of
https://github.com/asterisk/asterisk.git
synced 2025-10-12 15:45:18 +00:00
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:
@@ -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;
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user