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

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


Author: russell
Date: Sun Jul  8 09:03:00 2007
New Revision: 73889

URL: http://svn.digium.com/view/asterisk?view=rev&rev=73889
Log:
Convert (all but one spot) the places that indicate that the state of an agent
has changed to include the state it has changed to.  Thanks to mmichelson for
the help.

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=73889&r1=73888&r2=73889
==============================================================================
--- team/russell/events/channels/chan_agent.c (original)
+++ team/russell/events/channels/chan_agent.c Sun Jul  8 09:03:00 2007
@@ -773,7 +773,7 @@
 		if (persistent_agents)
 			dump_agents();
 	} else {
-		ast_device_state_changed("Agent/%s", p->agent);
+		ast_devstate_changed(AST_DEVICE_NOT_INUSE, "Agent/%s", p->agent);
 	}
 
 	if (p->pending) {
@@ -1447,7 +1447,7 @@
 	set_agentbycallerid(p->logincallerid, NULL);
 	p->loginchan[0] ='\0';
 	p->logincallerid[0] = '\0';
-	ast_device_state_changed("Agent/%s", p->agent);
+	ast_devstate_changed(AST_DEVICE_UNAVAILABLE, "Agent/%s", p->agent);
 	if (persistent_agents)
 		dump_agents();	
 
@@ -1896,7 +1896,7 @@
 							check_availability(p, 0);
 						ast_mutex_unlock(&p->lock);
 						AST_LIST_UNLOCK(&agents);
-						ast_device_state_changed("Agent/%s", p->agent);
+						ast_devstate_changed(AST_DEVICE_NOT_INUSE, "Agent/%s", p->agent);
 						while (res >= 0) {
 							ast_mutex_lock(&p->lock);
 							if (p->chan != chan)
@@ -1960,7 +1960,7 @@
 						if (option_verbose > 1)
 							ast_verbose(VERBOSE_PREFIX_2 "Agent '%s' logged out\n", p->agent);
 						/* If there is no owner, go ahead and kill it now */
-						ast_device_state_changed("Agent/%s", p->agent);
+						ast_devstate_changed(AST_DEVICE_UNAVAILABLE, "Agent/%s", p->agent);
 						if (p->dead && !p->owner) {
 							ast_mutex_destroy(&p->lock);
 							ast_mutex_destroy(&p->app_lock);
@@ -2122,6 +2122,7 @@
 				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);	
 		}
 	}




More information about the asterisk-commits mailing list