aboutsummaryrefslogtreecommitdiffstats
path: root/channels/chan_agent.c
AgeCommit message (Collapse)AuthorFilesLines
2010-01-19Fix deadlock in agent_read by removing call to agent_logoff.jpeeler1-1/+22
One must always lock the agents list lock before the agent private. agent_read locks the private immediately, so locking the agents list lock is not an option (which is what agent_logoff requires). Because agent_read already has access to the agent private all that is necessary is to do the required hanging up that agent_logoff performed. (closes issue #16321) Reported by: valon24 Patches: bug16321.patch uploaded by jpeeler (license 325) git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.4@241227 f38db490-d61c-443f-a65b-d21fe96a405b
2009-08-10AST-2009-005tilghman1-4/+4
git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.4@211528 f38db490-d61c-443f-a65b-d21fe96a405b
2009-04-18Fixed autologoff in agents.conf not working when agent logs in via ↵dvossel1-52/+63
AgentLogin app An agent logs in by calling an extension that calls the AgentLogin app. In agents.conf ackcall=always is set, so when they get a call they have the choice to either acknowledge it or ignore it. autologoff=10 is set as well, so if the agent ignores the call over 10sec one may assume that the agent should be logged out (and in this case hungup on as well), but this was not happening. (closes issue #14091) Reported by: evandro Patches: autologoff.diff uploaded by dvossel (license 671) Review: http://reviewboard.digium.com/r/225/ git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.4@189203 f38db490-d61c-443f-a65b-d21fe96a405b
2009-01-27Fix devicestate problems for "always-on" agent channelsmmichelson1-2/+5
A revision to chan_agent attempted to "inherit" the device state of the underlying channel in order to report the device state of an agent channel more accurately. The problem with the logic here is that it makes no sense to use this for always-on agents. If the agent is logged in, then to the underlying channel, the agent will always appear to be "in use," no matter if the agent is on a call or not. The reason is that to the underlying channel, the channel is currently in use on a call to the AgentLogin application. The most common cause that I found for this issue to occur was for a SIP channel to be the underlying channel type for an Agent channel. If the SIP phone re-registers, then the registration will cause the device state core to query the device state of the SIP channel. Since the SIP channel is in use, the Agent channel would also inherit this status. Once the agent channel was set to "in use" there was no way that the device state could change on that channel unless the agent logged out. The solution for this problem is a bit different in 1.4 than it is in the other branches. In 1.4, there will be a one-line fix to make sure that only callback agents will inherit device state from their underlying channel type. For the other branches of Asterisk, since callback support has been removed, there is also no need for device state inheritance in chan_agent, so I will simply be removing it from the code. In addition, the 1.4 source is getting a new comment to help the next person who edits chan_agent.c. I'm adding a comment that a agent_pvt's loginchan field may be used to determine if the agent is a callback agent or not. (closes issue #14173) Reported by: nathan Patches: 14173.patch uploaded by putnopvut (license 60) Tested by: nathan, aramirez git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.4@171689 f38db490-d61c-443f-a65b-d21fe96a405b
2009-01-14Fix a logic error I found while searching through chan_agent.cmmichelson1-3/+5
I found that the allow_multiple_logins function would never return 0 due to an incorrect comparison being used when traversing the list of agents. While I was modifying this function, I also did a little bit of coding guidelines cleanup, too. git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.4@168598 f38db490-d61c-443f-a65b-d21fe96a405b
2009-01-12(closes issue #12269)jpeeler1-19/+28
Reported by: IgorG Tested by: denisgalvao This gits rid of the notion of an owning_app allowing the request and hangup to be initiated by different threads. Originating from an active agent channel requires this. The implementation primarily changes __login_exec to wait on a condition variable rather than a lock. Review: http://reviewboard.digium.com/r/35/ git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.4@168507 f38db490-d61c-443f-a65b-d21fe96a405b
2008-12-03Only show this warning when we want to show it.qwell1-1/+2
(closes issue #13982) Reported by: coolmig Patches: chan_agent.c.patch uploaded by coolmig (license 621) git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.4@160764 f38db490-d61c-443f-a65b-d21fe96a405b
2008-11-29update dev-mode compiler flags to match the ones used by default on Ubuntu ↵kpfleming1-1/+1
Intrepid, so all developers will see the same warnings and errors since this branch already had some printf format attributes, enable checking for them and tag functions that didn't have them format attributes in a consistent way git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.4@159808 f38db490-d61c-443f-a65b-d21fe96a405b
2008-11-10Channel drivers assume that when their indicate callbackmmichelson1-3/+9
is invoked, that the channel on which the callback was called is locked. This patch corrects an instance in chan_agent where a channel's indicate callback is called directly without first locking the channel. This was leading to some observed locking issues in chan_local, but considering that all channel drivers operate under the same expectations, the generic fix in chan_agent is the right way to go. AST-126 git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.4@155861 f38db490-d61c-443f-a65b-d21fe96a405b
2008-11-05The logic of a strcasecmp call was reversedmmichelson1-1/+1
(closes issue #13841) Reported by: clegall_proformatique git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.4@154724 f38db490-d61c-443f-a65b-d21fe96a405b
2008-09-05Agent's should not try to call a channel's indicate callbackmmichelson1-1/+1
if the channel has been hung up. It will likely crash otherwise ABE-1159 git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.4@141366 f38db490-d61c-443f-a65b-d21fe96a405b
2008-08-19Reset agent_pvt variables back to the values in agents.confmmichelson1-1/+9
(from what the corresponding channel variables were set to) when the agent logs out. (closes issue #13098) Reported by: davidw Patches: 20080731__issue13098_agent_ackcall_not_reset.diff uploaded by bbryant (license 36) Tested by: davidw git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.4@138942 f38db490-d61c-443f-a65b-d21fe96a405b
2008-07-25Fix some errant device states by making the devicestate API more strict intilghman1-0/+8
terms of the device argument (only without the unique identifier appended). (closes issue #12771) Reported by: davidw Patches: 20080717__bug12771.diff.txt uploaded by Corydon76 (license 14) Tested by: davidw, jvandal, murf git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.4@133649 f38db490-d61c-443f-a65b-d21fe96a405b
2008-07-11Pass the devicestate from an underlying channel up through the Agent channel.tilghman1-1/+49
This should make the Agent always report the correct device state, even when the underlying channel is used for other purposes. (closes issue #12773) Reported by: davidw Patches: 20080710__bug12773.diff.txt uploaded by Corydon76 (license 14) Tested by: davidw git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.4@130102 f38db490-d61c-443f-a65b-d21fe96a405b
2008-07-02Fix thread-safety of some of the pbx_builtin_getvar_helper callsmmichelson1-0/+9
git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.4@127560 f38db490-d61c-443f-a65b-d21fe96a405b
2008-06-11Make calls to ast_assert() actually test something, so that the error messagetilghman1-1/+1
printed is not nonsensical (reported by mvanbaak via #asterisk-bugs). git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.4@121861 f38db490-d61c-443f-a65b-d21fe96a405b
2008-06-09A unique situation of timeouts brought forth a failure situation formmichelson1-1/+11
autologoff in chan_agent. If using AgentCallbackLogin-style agents, then if the timeout specified by the Dial() to reach the agent's phone was shorter than the timeout specified in queues.conf, then autologoff would only work if the caller hung up while the agent's phone was ringing. This patch allows autologoff to work in this situation when the call in queue transfers to the next available agent (as it would have if the timeout in queues.conf were less than the timeout in the Dial()). (closes issue #12754) Reported by: Rodrigo Patches: 12754.patch uploaded by putnopvut (license 60) Tested by: Rodrigo git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.4@121229 f38db490-d61c-443f-a65b-d21fe96a405b
2008-06-07Don't run LIST_HEAD_DESTROY on a STATIC listrussell1-1/+0
(closes issue #12807) Reported by: ys Patches: chan_agent_local.diff uploaded by ys (license 281) git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.4@121078 f38db490-d61c-443f-a65b-d21fe96a405b
2008-05-29Add some debugging code that ensures that when we do deadlock avoidance, wetilghman1-6/+2
don't lose the information about how a lock was originally acquired. git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.4@118953 f38db490-d61c-443f-a65b-d21fe96a405b
2008-05-14Add ast_assert(), which can be used to handle fatal errors. It is only compiledrussell1-1/+1
in if dev-mode is enabled, and only aborts if DO_CRASH is defined. (inspired by issue #12650) git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.4@116463 f38db490-d61c-443f-a65b-d21fe96a405b
2008-04-18Ensure that we don't ast_strdupa(NULL)russell1-1/+1
(closes issue #12476) Reported by: davidw Patch by me git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.4@114248 f38db490-d61c-443f-a65b-d21fe96a405b
2008-03-18Make sure an agent doesn't try to send dtmf to a NULL channelmmichelson1-2/+6
closes issue #12242 Reported by Yourname git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.4@109575 f38db490-d61c-443f-a65b-d21fe96a405b
2008-02-25Ensure that the channel doesn't disappear in agent_logoff(). If it does, itrussell1-2/+21
could cause a crash. (fixes the crash reported in BE-396) git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.4@104086 f38db490-d61c-443f-a65b-d21fe96a405b
2008-02-13We aren't talking to ourselves; we're talking to someone else.tilghman1-1/+5
(closes issue #11771) Reported by: msetim Patches: ami_agent_talkingto-1.4.diff uploaded by caio1982 (license 22) Tested by: caio1982, msetim git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.4@103607 f38db490-d61c-443f-a65b-d21fe96a405b
2008-01-31Add more missing locking of the agents list ...russell1-3/+11
git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.4@101433 f38db490-d61c-443f-a65b-d21fe96a405b
2008-01-31Move the locking from find_agent() into the agent dialplan function handler torussell1-2/+8
ensure that the agent doesn't disappear while we're looking at it. git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.4@101414 f38db490-d61c-443f-a65b-d21fe96a405b
2008-01-31Add missing locking to the find_agent() function.russell1-0/+2
git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.4@101413 f38db490-d61c-443f-a65b-d21fe96a405b
2008-01-22Add more dependencies on chan_local and add a note to the description of ↵oej1-0/+3
chan_local so that people don't disable it in menuselect just to clean up. git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.4@99594 f38db490-d61c-443f-a65b-d21fe96a405b
2007-10-01moved get_base_channel() code from action_redirect to ↵dhubbard1-5/+8
ast_channel_masquerade() for issue 7706 and BE-160 git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.4@84274 f38db490-d61c-443f-a65b-d21fe96a405b
2007-09-27if an Agent is redirected, the base channel should actually be redirected. ↵dhubbard1-0/+35
This was causing multiple issues, especially issue 7706 and BE-160 git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.4@84018 f38db490-d61c-443f-a65b-d21fe96a405b
2007-08-27DTMF begin frames should be ignored so that when an agent acks a call with ↵mmichelson1-0/+6
the '#' key, he doesn't cause a queue's announce file to be interrupted. Also went ahead and did the same for the '*' key and for ending a call. (closes issue #10528, reported by deskhack, patched by me) git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.4@81120 f38db490-d61c-443f-a65b-d21fe96a405b
2007-08-16Fixes a problem where agents would get stuck busy due to their wrapuptime ↵mmichelson1-0/+1
being longer than the queue's wrapuptime and ringinuse=no for the queue. (closes issue #10215, reported by Doug, repaired by me) Special thanks to fkasumovic for pointing out the source of the problem and to bweschke for helping to come up with a solution! git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.4@79748 f38db490-d61c-443f-a65b-d21fe96a405b
2007-07-23Merged revisions 76653 via svnmerge from file1-2/+2
https://origsvn.digium.com/svn/asterisk/branches/1.2 ........ r76653 | file | 2007-07-23 15:28:13 -0300 (Mon, 23 Jul 2007) | 4 lines (closes issue #5866) Reported by: tyler Do not force channel format changes when a generator is present. The generator may have changed the formats itself and changing them back would cause issues. ........ git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.4@76654 f38db490-d61c-443f-a65b-d21fe96a405b
2007-07-18Backport GCC 4.2 fixes. Without these Asterisk won't build under devmode ↵file1-2/+2
using GCC 4.2. git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.4@75712 f38db490-d61c-443f-a65b-d21fe96a405b
2007-07-12Change to my previous fix regarding agent logoff soft. Now uses deferlogoff ↵mmichelson1-4/+6
instead of loginstart since loginstart is used after logoff. Thanks to makoto for pointing this out and suggesting the fix. (closes issue #10178, reported and patched by makoto, with modification by me) git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.4@74998 f38db490-d61c-443f-a65b-d21fe96a405b
2007-07-11Merged revisions 74719 via svnmerge from mmichelson1-1/+3
https://origsvn.digium.com/svn/asterisk/branches/1.2 ........ r74719 | mmichelson | 2007-07-11 16:12:30 -0500 (Wed, 11 Jul 2007) | 5 lines The cli command "agent logoff Agent/x soft" did not work...at all. Now it does. (closes issue #10178, reported and patched by makoto, with slight modification for 1.4 and trunk by me) ........ git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.4@74722 f38db490-d61c-443f-a65b-d21fe96a405b
2007-07-10Merged revisions 74376 via svnmerge from qwell1-4/+6
https://origsvn.digium.com/svn/asterisk/branches/1.2 ........ r74376 | qwell | 2007-07-10 14:03:45 -0500 (Tue, 10 Jul 2007) | 4 lines Fix an issue with wrapuptime not working when using AgentLogin. Issue 10169, patch by makoto, with a minor mod by me to not re-break issue 9618 ........ git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.4@74379 f38db490-d61c-443f-a65b-d21fe96a405b
2007-07-06Merged revisions 73674 via svnmerge from mmichelson1-1/+1
https://origsvn.digium.com/svn/asterisk/branches/1.2 ........ r73674 | mmichelson | 2007-07-06 10:26:40 -0500 (Fri, 06 Jul 2007) | 5 lines Fixed a bug wherein agents get stuck busy. (issue 9618, reported by jiddings, patched by moi) closes issue #9618 ........ git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.4@73675 f38db490-d61c-443f-a65b-d21fe96a405b
2007-06-25Minor tweak for queueing up the unhold frame... this will teach me to do ↵file1-1/+2
bugs while half asleep. (issue #10046 reported by dimas) git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.4@71522 f38db490-d61c-443f-a65b-d21fe96a405b
2007-06-25Check to make sure the channel pointer is present before queueing up an ↵file1-1/+1
unhold frame on it. (issue #10046 reported by dimas) git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.4@71412 f38db490-d61c-443f-a65b-d21fe96a405b
2007-06-07Fix loading persistent queue members when using realtime configuration for ↵russell1-1/+1
queues. Also, remove an unneeded leading slash for the astdb family. (issue #9911, patch by atis) git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.4@68280 f38db490-d61c-443f-a65b-d21fe96a405b
2007-04-27Fix a weird problem where when a caller talking to someone sitting behind anrussell1-4/+2
agent channel sent a digit, the digit would be played to the agent for forever. This is because chan_agent always returned -1 from its send_digit_begin and _end callbacks. This non-zero return value indicates to the Asterisk core that it would like an inband DTMF generator put on the channel. However, this is the wrong thing to do. It should *always* return 0, instead. When the digit begin and end functions are called on the proxied channel, the underlying channel will indicate whether inband DTMF is needed or not, and the generator will be put on that one, and not the Agent channel. (issue #9615, #9616, reported by jiddings and BigJimmy, and fixed by me) git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.4@62218 f38db490-d61c-443f-a65b-d21fe96a405b
2007-04-09This is a big improvement over the current CDR fixes. It may still need ↵murf1-2/+2
refinement, but this won't have as many folks bothered. git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.4@60989 f38db490-d61c-443f-a65b-d21fe96a405b
2007-02-28Merged revisions 57092 via svnmerge from file1-1/+10
https://origsvn.digium.com/svn/asterisk/branches/1.2 ........ r57092 | file | 2007-02-28 13:55:45 -0500 (Wed, 28 Feb 2007) | 2 lines Fix a few more issues with the agent logoff CLI command. (issue #9123 reported by arbrandes) ........ git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.4@57093 f38db490-d61c-443f-a65b-d21fe96a405b
2007-02-20Merged revisions 55669 via svnmerge from file1-11/+18
https://origsvn.digium.com/svn/asterisk/branches/1.2 ........ r55669 | file | 2007-02-20 17:39:14 -0500 (Tue, 20 Feb 2007) | 2 lines Defer clearing callback information if channels are up until they are hung up. This ensures the hangup process goes smoothly and no channels get hung in limbo. (issue #8088 reported by kebl0155) ........ git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.4@55670 f38db490-d61c-443f-a65b-d21fe96a405b
2007-02-16Merged revisions 54999 via svnmerge from file1-1/+1
https://origsvn.digium.com/svn/asterisk/branches/1.2 ........ r54999 | file | 2007-02-16 17:13:45 -0500 (Fri, 16 Feb 2007) | 2 lines Do not send indications through ast_indicate in chan_agent but instead go directly to the technology. This way when indications are emulated they happen on the Agent channel and do not screw up formats on the channels. (issue #8439 reported by punkgode) ........ git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.4@55002 f38db490-d61c-443f-a65b-d21fe96a405b
2007-01-19Merge the changes from the /team/group/vldtmf_fixup branch.russell1-3/+3
The main bug being addressed here is a problem introduced when two SIP channels using SIP INFO dtmf have their media directly bridged. So, when a DTMF END frame comes into Asterisk from an incoming INFO message, Asterisk would try to emulate a digit of some length by first sending a DTMF BEGIN frame and sending a DTMF END later timed off of incoming audio. However, since there was no audio coming in, the DTMF_END was never generated. This caused DTMF based features to no longer work. To fix this, the core now knows when a channel doesn't care about DTMF BEGIN frames (such as a SIP channel sending INFO dtmf). If this is the case, then Asterisk will not emulate a digit of some length, and will instead just pass through the single DTMF END event. Channel drivers also now get passed the length of the digit to their digit_end callback. This improves SIP INFO support even further by enabling us to put the real digit duration in the INFO message instead of a hard coded 250ms. Also, for an incoming INFO message, the duration is read from the frame and passed into the core instead of just getting ignored. (issue #8597, maybe others...) git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.4@51311 f38db490-d61c-443f-a65b-d21fe96a405b
2007-01-05reduce stack consumption for AMI and AMI/HTTP requests by nearly 20K in most ↵kpfleming1-12/+12
cases git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.4@49676 f38db490-d61c-443f-a65b-d21fe96a405b
2006-11-07These mods are to solve the problem in bug 7506. It's a lot of rework to ↵murf1-6/+4
solve a fairly small problem... such is life. git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.4@47303 f38db490-d61c-443f-a65b-d21fe96a405b
2006-11-02Reverse change of "show" to "list" and make several other commands more ↵tilghman1-4/+4
consistent with "category verb arguments" git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.4@47051 f38db490-d61c-443f-a65b-d21fe96a405b