Carlos G Mendioroz
2007-Sep-19 08:43 UTC
[asterisk-users] AgentCalbackLogin not loging in race condition ?
Previous mail did not go through. Following up... Carlos G Mendioroz @ 16/09/2007 13:27 -0300 dixit:> Hi, > I'm seeing a problem using AgentCallbackLogin (Asterisk 1.2.16) where > a call in queue while an agent is logging in results in the agent > getting the call without properly being logged in. > > This seems to be a race, although I've not (yet) pinpointed the code at > fault. And I'm not able to reproduce it 100% of the time. > > The perceived anomaly is that teh agent is logged of w/o request, but > it seems it never got logged in. > > This only happens when logging in with calls already in queue. > Any hints ? > I'm going to make AgentCallbackLogin set the initial state to wrap to > see if that patches the problem by the time being. > > Any hints are welcome.I did not find a way to go wrap on login, cause the logic is distributed between Queue and Agent, but I did find this comment at chan_agent.c: /* Ensure we can't be gotten until we're done */ gettimeofday(&p->lastdisc, NULL); p->lastdisc.tv_sec++; It seems that the time it takes for the "login ok" message is more than one second, and is creating the trouble window. I changed that to allow 10 seconds of unavailability and the problem seems to be gone. -Carlos -- Carlos G Mendioroz <tron at acm.org>
Atis Lezdins
2007-Sep-19 09:05 UTC
[asterisk-users] AgentCalbackLogin not loging in race condition ?
On Wednesday 19 September 2007 11:43:39 Carlos G Mendioroz wrote:> Previous mail did not go through. Following up... > > Carlos G Mendioroz @ 16/09/2007 13:27 -0300 dixit: > > Hi, > > I'm seeing a problem using AgentCallbackLogin (Asterisk 1.2.16) where > > a call in queue while an agent is logging in results in the agent > > getting the call without properly being logged in. > > > > This seems to be a race, although I've not (yet) pinpointed the code at > > fault. And I'm not able to reproduce it 100% of the time. > > > > The perceived anomaly is that teh agent is logged of w/o request, but > > it seems it never got logged in. > > > > This only happens when logging in with calls already in queue. > > Any hints ? > > I'm going to make AgentCallbackLogin set the initial state to wrap to > > see if that patches the problem by the time being. > > > > Any hints are welcome. > > I did not find a way to go wrap on login, cause the logic is distributed > between Queue and Agent, but I did find this comment at chan_agent.c: > > /* Ensure we can't be gotten until we're done */ > gettimeofday(&p->lastdisc, NULL); > p->lastdisc.tv_sec++; > > It seems that the time it takes for the "login ok" message is more than > one second, and is creating the trouble window. I changed that to allow > 10 seconds of unavailability and the problem seems to be gone. > > -CarlosShouldn't wrapuptime be used in this case? Regards, Atis -- Atis Lezdins VoIP Developer, IQ Labs Inc. atis at iq-labs.net Skype: atis.lezdins Cell Phone: +371 28806004 Work phone: +1 800 7502835