[Asterisk-Dev] Re: [asterisk-commits] trunk - r8063 in /trunk:
channels/ configs/ doc/
Peng Yong
ppyy+asterisk at yaako.com
Sat Jan 14 07:30:55 MST 2006
> On 1/13/06, Kevin P. Fleming <kpfleming at digium.com> wrote:
> >
> > > + 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.
> > _______________________________________________
>
> Sorry Kevin. You're right on all fronts. I'll revert and clean this
> up before putting it back.
it's my fault. i don't completely understand the chan_agent.c code.
i see r8071 which correct the mistake i makde. thks for bweschke.
Peng Yong
More information about the asterisk-dev
mailing list