mirror of
https://github.com/asterisk/asterisk.git
synced 2025-11-13 13:28:34 +00:00
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/branches/1.4@84274 65c4cc65-6c06-0410-ace0-fbb531ad65f3
This commit is contained in:
@@ -730,17 +730,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