[Asterisk-Dev] app_queue.c when agent prematurely hangs up

Michael Haigh MHaigh at Synstar.com
Sat Feb 12 12:42:26 MST 2005


First of all - a HUGE thank you to all the people out there who have
produced this brilliant software :)

The behaviour of app_queue.c in the latest CVS is broken in the event that
the agent hangs up while being played the announce message or being told the
customer hold time (ie: the agent has picked up and acknowledged but has not
yet been connected to the caller).

Current behaviour results in the customer call being terminated in an ugly
way.  The reason is that the customer channel is being checked for hangup
rather than the agent channel.  The return code of -1 also seems odd, since
I would expect we want to just keep the customer first in the queue rather
than dropping them.

The following patch seems to make everything the way I expect.  I don't
_think_ anything's broken in the process.

Cheers
Mick

--------------------------------------------------

--- app_queue.c.orig    Sat Feb 12 19:29:33 2005
+++ app_queue.c Sat Feb 12 19:30:58 2005
@@ -1557,7 +1557,7 @@
                                }
                        }
                        res2 |= ast_autoservice_stop(qe->chan);
-                       if (res2) {
+                       if (peer->_softhangup) {
                                /* Agent must have hung up */
                                ast_log(LOG_WARNING, "Agent on %s hungup on
the customer.  They're going to be pissed.\n", peer->name);
                                ast_queue_log(queuename, qe->chan->uniqueid,
peer->name, "AGENTDUMP", "%s", "");
@@ -1570,7 +1570,7 @@
                                                queuename,
qe->chan->uniqueid, peer->name, member->interface);
                                }
                                ast_hangup(peer);
-                               return -1;
+                               return;
                        }
                }
                /* Stop music on hold */
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.digium.com/pipermail/asterisk-dev/attachments/20050212/0c26ef26/attachment.htm


More information about the asterisk-dev mailing list