[asterisk-commits] mmichelson: trunk r74999 - in /trunk: ./ channels/chan_agent.c

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Thu Jul 12 18:02:33 CDT 2007


Author: mmichelson
Date: Thu Jul 12 18:02:33 2007
New Revision: 74999

URL: http://svn.digium.com/view/asterisk?view=rev&rev=74999
Log:
Merged revisions 74997 via svnmerge from 
https://origsvn.digium.com/svn/asterisk/branches/1.4

........
........

Modified:
    trunk/   (props changed)
    trunk/channels/chan_agent.c

Propchange: trunk/
------------------------------------------------------------------------------
Binary property 'branch-1.4-merged' - no diff available.

Modified: trunk/channels/chan_agent.c
URL: http://svn.digium.com/view/asterisk/trunk/channels/chan_agent.c?view=diff&rev=74999&r1=74998&r2=74999
==============================================================================
--- trunk/channels/chan_agent.c (original)
+++ trunk/channels/chan_agent.c Thu Jul 12 18:02:33 2007
@@ -1465,18 +1465,18 @@
 		if (!strcasecmp(p->agent, agent)) {
 			ret = 0;
 			if (p->owner || p->chan) {
-				p->deferlogoff = 1;
 				if (!soft) {
 					if (p->owner)
 						ast_softhangup(p->owner, AST_SOFTHANGUP_EXPLICIT);
 					if (p->chan)
 						ast_softhangup(p->chan, AST_SOFTHANGUP_EXPLICIT);
-				}
+				} else
+					p->deferlogoff = 1;
 			} else {
 				logintime = time(NULL) - p->loginstart;
+				p->loginstart = 0;
 				agent_logoff_maintenance(p, p->loginchan, logintime, NULL, "CommandLogoff");
 			}
-			p->loginstart = 0;
 			break;
 		}
 	}
@@ -1901,8 +1901,10 @@
 						ast_device_state_changed("Agent/%s", p->agent);
 						while (res >= 0) {
 							ast_mutex_lock(&p->lock);
-							if (!p->loginstart && p->chan)
+							if (p->deferlogoff && p->chan) {
 								ast_softhangup(p->chan, AST_SOFTHANGUP_EXPLICIT);
+								p->deferlogoff = 0;
+							}
 							if (p->chan != chan)
 								res = -1;
 							ast_mutex_unlock(&p->lock);




More information about the asterisk-commits mailing list