[Asterisk-cvs] asterisk/apps app_queue.c,1.122,1.123

markster at lists.digium.com markster at lists.digium.com
Sun Feb 13 10:53:52 CST 2005


Update of /usr/cvsroot/asterisk/apps
In directory mongoose.digium.com:/tmp/cvs-serv32174/apps

Modified Files:
	app_queue.c 
Log Message:
Properly differentiate between caller and agent hangups (bug #3578)


Index: app_queue.c
===================================================================
RCS file: /usr/cvsroot/asterisk/apps/app_queue.c,v
retrieving revision 1.122
retrieving revision 1.123
diff -u -d -r1.122 -r1.123
--- app_queue.c	5 Feb 2005 16:42:49 -0000	1.122
+++ app_queue.c	13 Feb 2005 16:53:29 -0000	1.123
@@ -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,6 +1570,13 @@
 						queuename, qe->chan->uniqueid, peer->name, member->interface);
 				}
 				ast_hangup(peer);
+				goto out;
+			} else if (res2) {
+				/* Caller must have hung up just before being connected*/
+				ast_log(LOG_NOTICE, "Caller was about to talk to agent on %s but the caller hungup.\n", peer->name);
+				ast_queue_log(queuename, qe->chan->uniqueid, peer->name, "ABANDON", "%d|%d|%ld", qe->pos, qe->opos, (long)time(NULL) - qe->start);
+				record_abandoned(qe);
+				ast_hangup(peer);
 				return -1;
 			}
 		}




More information about the svn-commits mailing list