]> git.ipfire.org Git - thirdparty/asterisk.git/commitdiff
Agent's should not try to call a channel's indicate callback
authorMark Michelson <mmichelson@digium.com>
Fri, 5 Sep 2008 21:10:32 +0000 (21:10 +0000)
committerMark Michelson <mmichelson@digium.com>
Fri, 5 Sep 2008 21:10:32 +0000 (21:10 +0000)
if the channel has been hung up. It will likely crash
otherwise

ABE-1159

git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@141366 65c4cc65-6c06-0410-ace0-fbb531ad65f3

channels/chan_agent.c

index 46f77660707e00f4778d1ea4a59c436ddf991748..efba49e77dce771281cee19ec8cd3100f22c28a5 100644 (file)
@@ -666,7 +666,7 @@ static int agent_indicate(struct ast_channel *ast, int condition, const void *da
        struct agent_pvt *p = ast->tech_pvt;
        int res = -1;
        ast_mutex_lock(&p->lock);
-       if (p->chan)
+       if (p->chan && !ast_check_hangup(p->chan))
                res = p->chan->tech->indicate ? p->chan->tech->indicate(p->chan, condition, data, datalen) : -1;
        else
                res = 0;