[Asterisk-Dev] Re: [asterisk-commits] trunk - r8063 in /trunk: channels/ configs/ doc/

Kevin P. Fleming kpfleming at digium.com
Fri Jan 13 14:55:18 MST 2006


> +				status = pbx_builtin_getvar_helper(p->chan, "CHANLOCALSTATUS");
> +				if (autologoffunavail && status && !strcasecmp(status, "CHANUNAVAIL")) {
> +					char agent[AST_MAX_AGENT] = "";
> +					long logintime = time(NULL) - p->loginstart;
> +					p->loginstart = 0;
> +					ast_log(LOG_NOTICE, "Agent read: '%s' is not available now, auto logoff\n", p->name);
> +					manager_event(EVENT_FLAG_AGENT, "Agentcallbacklogoff",
> +						      "Agent: %s\r\n"
> +						      "Loginchan: %s\r\n"
> +						      "Logintime: %ld\r\n"
> +						      "Reason: Chanunavail\r\n"
> +						      "Uniqueid: %s\r\n",
> +						      p->agent, p->loginchan, logintime, ast->uniqueid);
> +					snprintf(agent, sizeof(agent), "Agent/%s", p->agent);
> +					ast_queue_log("NONE", ast->uniqueid, agent, "AGENTCALLBACKLOGOFF", "%s|%ld|%s", p->loginchan, logintime, "Chanunavail");
> +					set_agentbycallerid(p->logincallerid, NULL);
> +					p->loginchan[0] = '\0';
> +					p->logincallerid[0] = '\0';
> +				}

First, this patch adds two more copies of the identical callback-logoff 
code. This is very clearly the wrong thing to do. There are now at least 
5 or 6 places in the code that construct and send the identical manager 
event, the log entry, and other bits.

Second, it does _not_ include the recent changes to the 
callback-autologoff code to send a device state update and to dump agent 
persistence information if it is enabled.

In summary, this commit should _not_ have been made in this form. I will 
not go back into the bug to see who reviewed and approved it; you should 
know who you are.



More information about the asterisk-dev mailing list