[asterisk-commits] branch 1.2 r37212 - /branches/1.2/channels/chan_agent.c

asterisk-commits at lists.digium.com asterisk-commits at lists.digium.com
Thu Jul 6 13:38:46 MST 2006


Author: bweschke
Date: Thu Jul  6 15:38:45 2006
New Revision: 37212

URL: http://svn.digium.com/view/asterisk?rev=37212&view=rev
Log:
 Don't do wierd things on a callback agent that has attempted logoff while still on the phone.


Modified:
    branches/1.2/channels/chan_agent.c

Modified: branches/1.2/channels/chan_agent.c
URL: http://svn.digium.com/view/asterisk/branches/1.2/channels/chan_agent.c?rev=37212&r1=37211&r2=37212&view=diff
==============================================================================
--- branches/1.2/channels/chan_agent.c (original)
+++ branches/1.2/channels/chan_agent.c Thu Jul  6 15:38:45 2006
@@ -795,14 +795,16 @@
 			ast_mutex_lock(&p->chan->lock);
 			ast_softhangup(p->chan, AST_SOFTHANGUP_EXPLICIT);
 			ast_mutex_unlock(&p->chan->lock);
-		} else {
+		} else if (p->loginstart) {
 			ast_mutex_lock(&p->chan->lock);
 			ast_moh_start(p->chan, p->moh);
 			ast_mutex_unlock(&p->chan->lock);
 		}
 	}
 	ast_mutex_unlock(&p->lock);
-	ast_device_state_changed("Agent/%s", p->agent);
+	/* Only register a device state change if the agent is still logged in */
+	if (p->loginstart)
+		ast_device_state_changed("Agent/%s", p->agent);
 
 	if (p->pending) {
 		ast_mutex_lock(&agentlock);



More information about the asterisk-commits mailing list