[asterisk-commits] russell: branch russell/events r73909 - /team/russell/events/channels/

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Sun Jul 8 09:38:24 CDT 2007


Author: russell
Date: Sun Jul  8 09:38:24 2007
New Revision: 73909

URL: http://svn.digium.com/view/asterisk?view=rev&rev=73909
Log:
Explicitly change the agent's device state to BUSY when it gets a call, and
also convert the last usage of the old function

Modified:
    team/russell/events/channels/chan_agent.c

Modified: team/russell/events/channels/chan_agent.c
URL: http://svn.digium.com/view/asterisk/team/russell/events/channels/chan_agent.c?view=diff&rev=73909&r1=73908&r2=73909
==============================================================================
--- team/russell/events/channels/chan_agent.c (original)
+++ team/russell/events/channels/chan_agent.c Sun Jul  8 09:38:24 2007
@@ -970,6 +970,7 @@
 			CRASH;
 		}
 	}
+	ast_devstate_changed(AST_DEVICE_BUSY, "Agent/%s", p->agent);
 	return tmp;
 }
 
@@ -2122,8 +2123,11 @@
 				cur_agent->logincallerid[0] = '\0';
 			if (cur_agent->loginstart == 0)
 				time(&cur_agent->loginstart);
-			/* XXX What state is the agent in here? */
-			ast_device_state_changed("Agent/%s", cur_agent->agent);	
+			
+			if(cur_agent->chan || !ast_strlen_zero(cur_agent->loginchan))
+				ast_devstate_changed(AST_DEVICE_BUSY, "Agent/%s", cur_agent->agent);
+			else
+				ast_devstate_changed(AST_DEVICE_NOT_INUSE, "Agent/%s", cur_agent->agent);
 		}
 	}
 	AST_LIST_UNLOCK(&agents);




More information about the asterisk-commits mailing list