<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2//EN">
<HTML>
<HEAD>
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=iso-8859-1">
<META NAME="Generator" CONTENT="MS Exchange Server version 5.5.2658.24">
<TITLE>app_queue.c when agent prematurely hangs up</TITLE>
</HEAD>
<BODY>
<P><FONT SIZE=2 FACE="Arial">First of all - a HUGE thank you to all the people out there who have produced this brilliant software :)</FONT>
</P>
<P><FONT SIZE=2 FACE="Arial">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).</FONT></P>
<P><FONT SIZE=2 FACE="Arial">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.</FONT></P>
<P><FONT SIZE=2 FACE="Arial">The following patch seems to make everything the way I expect. I don't _think_ anything's broken in the process.</FONT>
</P>
<P><FONT SIZE=2 FACE="Arial">Cheers</FONT>
<BR><FONT SIZE=2 FACE="Arial">Mick</FONT>
</P>
<P><FONT SIZE=2 FACE="Arial">--------------------------------------------------</FONT>
</P>
<P><FONT SIZE=2 FACE="Arial">--- app_queue.c.orig Sat Feb 12 19:29:33 2005</FONT>
<BR><FONT SIZE=2 FACE="Arial">+++ app_queue.c Sat Feb 12 19:30:58 2005</FONT>
<BR><FONT SIZE=2 FACE="Arial">@@ -1557,7 +1557,7 @@</FONT>
<BR><FONT SIZE=2 FACE="Arial"> }</FONT>
<BR><FONT SIZE=2 FACE="Arial"> }</FONT>
<BR><FONT SIZE=2 FACE="Arial"> res2 |= ast_autoservice_stop(qe->chan);</FONT>
<BR><FONT SIZE=2 FACE="Arial">- if (res2) {</FONT>
<BR><FONT SIZE=2 FACE="Arial">+ if (peer->_softhangup) {</FONT>
<BR><FONT SIZE=2 FACE="Arial"> /* Agent must have hung up */</FONT>
<BR><FONT SIZE=2 FACE="Arial"> ast_log(LOG_WARNING, "Agent on %s hungup on the customer. They're going to be pissed.\n", peer->name);</FONT></P>
<P><FONT SIZE=2 FACE="Arial"> ast_queue_log(queuename, qe->chan->uniqueid, peer->name, "AGENTDUMP", "%s", "");</FONT>
<BR><FONT SIZE=2 FACE="Arial">@@ -1570,7 +1570,7 @@</FONT>
<BR><FONT SIZE=2 FACE="Arial"> queuename, qe->chan->uniqueid, peer->name, member->interface);</FONT>
<BR><FONT SIZE=2 FACE="Arial"> }</FONT>
<BR><FONT SIZE=2 FACE="Arial"> ast_hangup(peer);</FONT>
<BR><FONT SIZE=2 FACE="Arial">- return -1;</FONT>
<BR><FONT SIZE=2 FACE="Arial">+ return;</FONT>
<BR><FONT SIZE=2 FACE="Arial"> }</FONT>
<BR><FONT SIZE=2 FACE="Arial"> }</FONT>
<BR><FONT SIZE=2 FACE="Arial"> /* Stop music on hold */</FONT>
</P>
</BODY>
</HTML>