Summary: | ASTERISK-05748: Manager "Agents" action reports AGENT_IDLE for agents on calls | ||
Reporter: | Alan Ferrency (ferrency) | Labels: | |
Date Opened: | 2005-11-30 13:30:37.000-0600 | Date Closed: | 2011-06-07 14:10:47 |
Priority: | Minor | Regression? | No |
Status: | Closed/Complete | Components: | Channels/chan_agent |
Versions: | Frequency of Occurrence | ||
Related Issues: | |||
Environment: | Attachments: | ||
Description: | When I send the manager interface "Action: Agents", all agents are shown with "Status: AGENT_IDLE" or "Status: AGENT_LOGGEDOFF". Agents are not shown with AGENT_ONCALL, and TalkingTo: is always "n/a", even if agents are currently on calls sent to them from the queue. If I send "Action: Command" with "Command: show agents", this correctly shows agents on calls, with the channels they're talking to. Our agents are implemented using AgentCallbackLogin. Looking in ViewCVS branch 1.2.0, I discovered: It seems to me that the changes made to channels/chan_agent.c in revision 6676 are a likely cause for this issue. The new if/else if statement structure is giving priority to the condition: f (!ast_strlen_zero(p->loginchan)) { This always sets Manager Status to "AGENT_IDLE" when the agent is logged in, before a determination is made as to whether they're on a call or not: that's done in the next "else if" clause, but only if the agent isn't logged in. The current code seems like it makes sense for non-callback agents (which the revision was meant to patch originally), since non-callback agents are likely to always be connected to a channel. But for callback agents, this is failing to report AGENT_ONCALL status and the TalkingTo fields correctly. Alan ****** ADDITIONAL INFORMATION ****** I have confirmed this bug in 1.2.0, but it was not present in 1.2-beta1. A transcript of a Manager session demonstrating the issue is available if necessary. | ||
Comments: | By: Kevin P. Fleming (kpfleming) 2005-12-12 21:43:56.000-0600 Fixed in branch-1.2, will merge over to trunk shortly. By: Alan Ferrency (ferrency) 2005-12-14 08:21:35.000-0600 The patch in revision 7457 looks great to me: it seems to change things back to exactly the way they were prior to revision 6766. However, I'm afraid you may have undone the patch applied in revision 6766, and broken what 6766 was supposed to fix. I have no good way to test this, since I do not use non-callback agents. But the logic seems equivalent: if (a) { } else if (b) { ... vs. if (b && !a) { } else if (a) { ... The only change remaining from 6766 is the channel used for loginChan in the "if p->chan" case. (This is resolved as far as I am concerned, but the original posters of the bug fixed in 6766 may not agree.) Thanks! By: Digium Subversion (svnbot) 2008-01-15 16:06:18.000-0600 Repository: asterisk Revision: 7449 U branches/1.2/channels/chan_agent.c ------------------------------------------------------------------------ r7449 | kpfleming | 2008-01-15 16:06:17 -0600 (Tue, 15 Jan 2008) | 2 lines only report AGENT_IDLE for callback mode agents when they are actually idle (issue ASTERISK-5748) ------------------------------------------------------------------------ http://svn.digium.com/view/asterisk?view=rev&revision=7449 By: Digium Subversion (svnbot) 2008-01-15 16:06:25.000-0600 Repository: asterisk Revision: 7457 _U trunk/ U trunk/app.c U trunk/apps/app_dial.c U trunk/channels/chan_agent.c U trunk/channels/chan_sip.c U trunk/pbx.c ------------------------------------------------------------------------ r7457 | kpfleming | 2008-01-15 16:06:24 -0600 (Tue, 15 Jan 2008) | 25 lines Merged revisions 7448-7449,7451,7453 via svnmerge from https://origsvn.digium.com/svn/asterisk/branches/1.2 ........ r7448 | kpfleming | 2005-12-12 22:25:14 -0600 (Mon, 12 Dec 2005) | 2 lines use the stream's current point when pausing/unpausing, instead of elapsed time (which doesn't work when the stream has been skipped forward or backward) (issue ASTERISK-5743) ........ r7449 | kpfleming | 2005-12-12 22:43:38 -0600 (Mon, 12 Dec 2005) | 2 lines only report AGENT_IDLE for callback mode agents when they are actually idle (issue ASTERISK-5748) ........ r7451 | kpfleming | 2005-12-12 23:14:27 -0600 (Mon, 12 Dec 2005) | 2 lines ensure that hangups while incoming calls are in early state are handled properly (issue ASTERISK-5764) ........ r7453 | kpfleming | 2005-12-12 23:53:00 -0600 (Mon, 12 Dec 2005) | 2 lines restore ability of caller to hangup calls that are still ringing (issue ASTERISK-5688) ........ ------------------------------------------------------------------------ http://svn.digium.com/view/asterisk?view=rev&revision=7457 By: Digium Subversion (svnbot) 2008-01-15 16:07:05.000-0600 Repository: asterisk Revision: 7501 _U team/russell/make_menuconfig/ U team/russell/make_menuconfig/app.c D team/russell/make_menuconfig/apps/app_cut.c U team/russell/make_menuconfig/apps/app_dial.c U team/russell/make_menuconfig/apps/app_macro.c U team/russell/make_menuconfig/channel.c U team/russell/make_menuconfig/channels/chan_agent.c U team/russell/make_menuconfig/channels/chan_sip.c U team/russell/make_menuconfig/configs/misdn.conf.sample U team/russell/make_menuconfig/doc/README.misdn U team/russell/make_menuconfig/doc/README.variables A team/russell/make_menuconfig/funcs/func_cut.c U team/russell/make_menuconfig/pbx.c U team/russell/make_menuconfig/utils.c ------------------------------------------------------------------------ r7501 | russell | 2008-01-15 16:07:04 -0600 (Tue, 15 Jan 2008) | 90 lines Merged revisions 7446,7457,7469,7471-7472,7481,7494,7496,7498 via svnmerge from https://origsvn.digium.com/svn/asterisk/trunk ................ r7446 | crichter | 2005-12-12 17:26:35 -0500 (Mon, 12 Dec 2005) | 1 line updated the documentation and the sample config to meet the present ................ r7457 | kpfleming | 2005-12-13 01:00:17 -0500 (Tue, 13 Dec 2005) | 25 lines Merged revisions 7448-7449,7451,7453 via svnmerge from https://origsvn.digium.com/svn/asterisk/branches/1.2 ........ r7448 | kpfleming | 2005-12-12 22:25:14 -0600 (Mon, 12 Dec 2005) | 2 lines use the stream's current point when pausing/unpausing, instead of elapsed time (which doesn't work when the stream has been skipped forward or backward) (issue ASTERISK-5743) ........ r7449 | kpfleming | 2005-12-12 22:43:38 -0600 (Mon, 12 Dec 2005) | 2 lines only report AGENT_IDLE for callback mode agents when they are actually idle (issue ASTERISK-5748) ........ r7451 | kpfleming | 2005-12-12 23:14:27 -0600 (Mon, 12 Dec 2005) | 2 lines ensure that hangups while incoming calls are in early state are handled properly (issue ASTERISK-5764) ........ r7453 | kpfleming | 2005-12-12 23:53:00 -0600 (Mon, 12 Dec 2005) | 2 lines restore ability of caller to hangup calls that are still ringing (issue ASTERISK-5688) ........ ................ r7469 | kpfleming | 2005-12-13 11:07:19 -0500 (Tue, 13 Dec 2005) | 10 lines Merged revisions 7468 via svnmerge from https://origsvn.digium.com/svn/asterisk/branches/1.2 ........ r7468 | kpfleming | 2005-12-13 10:06:27 -0600 (Tue, 13 Dec 2005) | 2 lines correct broken math in tvfix() for timestamp values over one million ........ ................ r7471 | kpfleming | 2005-12-13 13:54:41 -0500 (Tue, 13 Dec 2005) | 10 lines Merged revisions 7470 via svnmerge from https://origsvn.digium.com/svn/asterisk/branches/1.2 ........ r7470 | kpfleming | 2005-12-13 12:54:22 -0600 (Tue, 13 Dec 2005) | 2 lines clarify substring documentation ........ ................ r7472 | russell | 2005-12-13 17:03:06 -0500 (Tue, 13 Dec 2005) | 2 lines reduce some duplicated code when doing a strdup (issue ASTERISK-5830) ................ r7481 | bweschke | 2005-12-14 21:49:17 -0500 (Wed, 14 Dec 2005) | 3 lines Bug ASTERISK-5844 - Don't free the channel structure until after having sent the manager event. ................ r7494 | tilghman | 2005-12-15 12:31:52 -0500 (Thu, 15 Dec 2005) | 2 lines Make sure the functions CUT and SORT are built. ................ r7496 | tilghman | 2005-12-15 14:05:41 -0500 (Thu, 15 Dec 2005) | 2 lines Properly move these functions over to the funcs directory (since they no longer contain apps) ................ r7498 | tilghman | 2005-12-15 19:55:39 -0500 (Thu, 15 Dec 2005) | 3 lines First field was truncated. (Don't kill me; this attempted merge didn't work because the paths changed.) ................ ------------------------------------------------------------------------ http://svn.digium.com/view/asterisk?view=rev&revision=7501 By: Digium Subversion (svnbot) 2008-01-15 16:07:08.000-0600 Repository: asterisk Revision: 7504 _U team/russell/cli_originate/ U team/russell/cli_originate/app.c D team/russell/cli_originate/apps/app_cut.c U team/russell/cli_originate/apps/app_dial.c U team/russell/cli_originate/apps/app_macro.c U team/russell/cli_originate/channel.c U team/russell/cli_originate/channels/chan_agent.c U team/russell/cli_originate/channels/chan_sip.c U team/russell/cli_originate/doc/README.variables A team/russell/cli_originate/funcs/func_cut.c U team/russell/cli_originate/pbx.c U team/russell/cli_originate/utils.c ------------------------------------------------------------------------ r7504 | russell | 2008-01-15 16:07:07 -0600 (Tue, 15 Jan 2008) | 86 lines Merged revisions 7457,7469,7471-7472,7481,7494,7496,7498 via svnmerge from https://origsvn.digium.com/svn/asterisk/trunk ................ r7457 | kpfleming | 2005-12-13 01:00:17 -0500 (Tue, 13 Dec 2005) | 25 lines Merged revisions 7448-7449,7451,7453 via svnmerge from https://origsvn.digium.com/svn/asterisk/branches/1.2 ........ r7448 | kpfleming | 2005-12-12 22:25:14 -0600 (Mon, 12 Dec 2005) | 2 lines use the stream's current point when pausing/unpausing, instead of elapsed time (which doesn't work when the stream has been skipped forward or backward) (issue ASTERISK-5743) ........ r7449 | kpfleming | 2005-12-12 22:43:38 -0600 (Mon, 12 Dec 2005) | 2 lines only report AGENT_IDLE for callback mode agents when they are actually idle (issue ASTERISK-5748) ........ r7451 | kpfleming | 2005-12-12 23:14:27 -0600 (Mon, 12 Dec 2005) | 2 lines ensure that hangups while incoming calls are in early state are handled properly (issue ASTERISK-5764) ........ r7453 | kpfleming | 2005-12-12 23:53:00 -0600 (Mon, 12 Dec 2005) | 2 lines restore ability of caller to hangup calls that are still ringing (issue ASTERISK-5688) ........ ................ r7469 | kpfleming | 2005-12-13 11:07:19 -0500 (Tue, 13 Dec 2005) | 10 lines Merged revisions 7468 via svnmerge from https://origsvn.digium.com/svn/asterisk/branches/1.2 ........ r7468 | kpfleming | 2005-12-13 10:06:27 -0600 (Tue, 13 Dec 2005) | 2 lines correct broken math in tvfix() for timestamp values over one million ........ ................ r7471 | kpfleming | 2005-12-13 13:54:41 -0500 (Tue, 13 Dec 2005) | 10 lines Merged revisions 7470 via svnmerge from https://origsvn.digium.com/svn/asterisk/branches/1.2 ........ r7470 | kpfleming | 2005-12-13 12:54:22 -0600 (Tue, 13 Dec 2005) | 2 lines clarify substring documentation ........ ................ r7472 | russell | 2005-12-13 17:03:06 -0500 (Tue, 13 Dec 2005) | 2 lines reduce some duplicated code when doing a strdup (issue ASTERISK-5830) ................ r7481 | bweschke | 2005-12-14 21:49:17 -0500 (Wed, 14 Dec 2005) | 3 lines Bug ASTERISK-5844 - Don't free the channel structure until after having sent the manager event. ................ r7494 | tilghman | 2005-12-15 12:31:52 -0500 (Thu, 15 Dec 2005) | 2 lines Make sure the functions CUT and SORT are built. ................ r7496 | tilghman | 2005-12-15 14:05:41 -0500 (Thu, 15 Dec 2005) | 2 lines Properly move these functions over to the funcs directory (since they no longer contain apps) ................ r7498 | tilghman | 2005-12-15 19:55:39 -0500 (Thu, 15 Dec 2005) | 3 lines First field was truncated. (Don't kill me; this attempted merge didn't work because the paths changed.) ................ ------------------------------------------------------------------------ http://svn.digium.com/view/asterisk?view=rev&revision=7504 By: Digium Subversion (svnbot) 2008-01-15 16:07:26.000-0600 Repository: asterisk Revision: 7527 _U team/russell/ast_malloc/ U team/russell/ast_malloc/app.c U team/russell/ast_malloc/apps/app_chanspy.c D team/russell/ast_malloc/apps/app_cut.c U team/russell/ast_malloc/apps/app_dial.c U team/russell/ast_malloc/apps/app_macro.c U team/russell/ast_malloc/build_tools/make_svn_branch_name U team/russell/ast_malloc/cdr.c U team/russell/ast_malloc/channel.c U team/russell/ast_malloc/channels/chan_agent.c U team/russell/ast_malloc/channels/chan_sip.c U team/russell/ast_malloc/doc/README.ael U team/russell/ast_malloc/doc/README.variables U team/russell/ast_malloc/file.c A team/russell/ast_malloc/funcs/func_cut.c U team/russell/ast_malloc/include/asterisk/linkedlists.h U team/russell/ast_malloc/pbx.c U team/russell/ast_malloc/utils.c ------------------------------------------------------------------------ r7527 | russell | 2008-01-15 16:07:25 -0600 (Tue, 15 Jan 2008) | 160 lines Merged revisions 7457,7469,7471-7472,7481,7494,7496,7498,7509,7511-7512,7514,7516,7518,7520,7522,7524 via svnmerge from https://origsvn.digium.com/svn/asterisk/trunk ................ r7457 | kpfleming | 2005-12-13 01:00:17 -0500 (Tue, 13 Dec 2005) | 25 lines Merged revisions 7448-7449,7451,7453 via svnmerge from https://origsvn.digium.com/svn/asterisk/branches/1.2 ........ r7448 | kpfleming | 2005-12-12 22:25:14 -0600 (Mon, 12 Dec 2005) | 2 lines use the stream's current point when pausing/unpausing, instead of elapsed time (which doesn't work when the stream has been skipped forward or backward) (issue ASTERISK-5743) ........ r7449 | kpfleming | 2005-12-12 22:43:38 -0600 (Mon, 12 Dec 2005) | 2 lines only report AGENT_IDLE for callback mode agents when they are actually idle (issue ASTERISK-5748) ........ r7451 | kpfleming | 2005-12-12 23:14:27 -0600 (Mon, 12 Dec 2005) | 2 lines ensure that hangups while incoming calls are in early state are handled properly (issue ASTERISK-5764) ........ r7453 | kpfleming | 2005-12-12 23:53:00 -0600 (Mon, 12 Dec 2005) | 2 lines restore ability of caller to hangup calls that are still ringing (issue ASTERISK-5688) ........ ................ r7469 | kpfleming | 2005-12-13 11:07:19 -0500 (Tue, 13 Dec 2005) | 10 lines Merged revisions 7468 via svnmerge from https://origsvn.digium.com/svn/asterisk/branches/1.2 ........ r7468 | kpfleming | 2005-12-13 10:06:27 -0600 (Tue, 13 Dec 2005) | 2 lines correct broken math in tvfix() for timestamp values over one million ........ ................ r7471 | kpfleming | 2005-12-13 13:54:41 -0500 (Tue, 13 Dec 2005) | 10 lines Merged revisions 7470 via svnmerge from https://origsvn.digium.com/svn/asterisk/branches/1.2 ........ r7470 | kpfleming | 2005-12-13 12:54:22 -0600 (Tue, 13 Dec 2005) | 2 lines clarify substring documentation ........ ................ r7472 | russell | 2005-12-13 17:03:06 -0500 (Tue, 13 Dec 2005) | 2 lines reduce some duplicated code when doing a strdup (issue ASTERISK-5830) ................ r7481 | bweschke | 2005-12-14 21:49:17 -0500 (Wed, 14 Dec 2005) | 3 lines Bug ASTERISK-5844 - Don't free the channel structure until after having sent the manager event. ................ r7494 | tilghman | 2005-12-15 12:31:52 -0500 (Thu, 15 Dec 2005) | 2 lines Make sure the functions CUT and SORT are built. ................ r7496 | tilghman | 2005-12-15 14:05:41 -0500 (Thu, 15 Dec 2005) | 2 lines Properly move these functions over to the funcs directory (since they no longer contain apps) ................ r7498 | tilghman | 2005-12-15 19:55:39 -0500 (Thu, 15 Dec 2005) | 3 lines First field was truncated. (Don't kill me; this attempted merge didn't work because the paths changed.) ................ r7509 | tilghman | 2005-12-16 20:07:44 -0500 (Fri, 16 Dec 2005) | 3 lines Merged revisions 7508 via svnmerge from /branches/1.2 ................ r7511 | kpfleming | 2005-12-16 21:21:36 -0500 (Fri, 16 Dec 2005) | 2 lines block a commit to a module that no longer exists in trunk ................ r7512 | kpfleming | 2005-12-16 21:22:24 -0500 (Fri, 16 Dec 2005) | 10 lines Merged revision 7510 via svnmerge from https://origsvn.digium.com/svn/asterisk/branches/1.2 ........ r7510 | kpfleming | 2005-12-16 20:20:04 -0600 (Fri, 16 Dec 2005) | 2 lines fix some buglet when building team branch version strings ........ ................ r7514 | kpfleming | 2005-12-16 22:45:25 -0500 (Fri, 16 Dec 2005) | 10 lines Merged revisions 7513 via svnmerge from https://origsvn.digium.com/svn/asterisk/branches/1.2 ........ r7513 | kpfleming | 2005-12-16 21:44:30 -0600 (Fri, 16 Dec 2005) | 2 lines forcibly expire previous subscriptions from a peer when they resubscribe (keeps them from building up and waiting for expiration, and stops us sending unwanted NOTIFY messages to devices) ........ ................ r7516 | kpfleming | 2005-12-16 22:59:27 -0500 (Fri, 16 Dec 2005) | 10 lines Merged revisions 7515 via svnmerge from https://origsvn.digium.com/svn/asterisk/branches/1.2 ........ r7515 | kpfleming | 2005-12-16 21:59:05 -0600 (Fri, 16 Dec 2005) | 2 lines Max-Forwards headers must only be present on requests, not responses ........ ................ r7518 | tilghman | 2005-12-17 12:22:24 -0500 (Sat, 17 Dec 2005) | 3 lines Merged revisions 7517 via svnmerge from /branches/1.2 ................ r7520 | tilghman | 2005-12-17 13:58:57 -0500 (Sat, 17 Dec 2005) | 3 lines Merged revisions 7519 via svnmerge from /branches/1.2 ................ r7522 | tilghman | 2005-12-19 00:42:55 -0500 (Mon, 19 Dec 2005) | 3 lines Merged revisions 7521 via svnmerge from /branches/1.2 ................ r7524 | tilghman | 2005-12-19 14:08:42 -0500 (Mon, 19 Dec 2005) | 3 lines Merged revisions 7523 via svnmerge from /branches/1.2 ................ ------------------------------------------------------------------------ http://svn.digium.com/view/asterisk?view=rev&revision=7527 |