]> git.ipfire.org Git - thirdparty/asterisk.git/commitdiff
We aren't talking to ourselves; we're talking to someone else.
authorTilghman Lesher <tilghman@meg.abyt.es>
Wed, 13 Feb 2008 06:25:03 +0000 (06:25 +0000)
committerTilghman Lesher <tilghman@meg.abyt.es>
Wed, 13 Feb 2008 06:25:03 +0000 (06:25 +0000)
(closes issue #11771)
 Reported by: msetim
 Patches:
       ami_agent_talkingto-1.4.diff uploaded by caio1982 (license 22)
 Tested by: caio1982, msetim

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

channels/chan_agent.c

index 08a29a7d60edd21c83f9be8f53244ae3dfca71ea..789461bea3aaf55a3ebc4277a3858d8c8efee477 100644 (file)
@@ -1495,7 +1495,11 @@ static int action_agents(struct mansession *s, const struct message *m)
                } else if (p->chan) {
                        loginChan = ast_strdupa(p->chan->name);
                        if (p->owner && p->owner->_bridge) {
-                               talkingtoChan = p->chan->cid.cid_num;
+                               if (ast_bridged_channel(p->owner)) {
+                                       talkingtoChan = ast_strdupa(ast_bridged_channel(p->owner)->cid.cid_num);
+                               } else {
+                                       talkingtoChan = "n/a";
+                               }
                                status = "AGENT_ONCALL";
                        } else {
                                talkingtoChan = "n/a";