mirror of
https://github.com/asterisk/asterisk.git
synced 2025-11-09 11:28:25 +00:00
protect agent_bridgedchannel() from segfaulting when there is no bridged channel (issue #5879)
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.2@7271 65c4cc65-6c06-0410-ace0-fbb531ad65f3
This commit is contained in:
@@ -910,15 +910,16 @@ static int agent_ack_sleep( void *data )
|
||||
|
||||
static struct ast_channel *agent_bridgedchannel(struct ast_channel *chan, struct ast_channel *bridge)
|
||||
{
|
||||
struct agent_pvt *p;
|
||||
struct agent_pvt *p = bridge->tech_pvt;
|
||||
struct ast_channel *ret=NULL;
|
||||
|
||||
|
||||
p = bridge->tech_pvt;
|
||||
if (p) {
|
||||
if (chan == p->chan)
|
||||
ret = bridge->_bridge;
|
||||
else if (chan == bridge->_bridge)
|
||||
ret = p->chan;
|
||||
}
|
||||
|
||||
if (option_debug)
|
||||
ast_log(LOG_DEBUG, "Asked for bridged channel on '%s'/'%s', returning '%s'\n", chan->name, bridge->name, ret ? ret->name : "<none>");
|
||||
return ret;
|
||||
|
||||
Reference in New Issue
Block a user