aboutsummaryrefslogtreecommitdiffstats
path: root/main/manager.c
AgeCommit message (Collapse)AuthorFilesLines
2008-08-29After working on the ao2_containers branch, I noticedmmichelson1-1/+1
something a bit strange. In all cases where we provide a callback function to ao2_container_alloc, the callback function would only return 0 or CMP_MATCH. After inspecting the ao2_callback() code carefully, I found that if you're only looking for one specific item, then you should return CMP_MATCH | CMP_STOP. Otherwise, astobj2 will continue traversing the current bucket until the end searching for more matches. In cases like chan_iax2 where in 1.4, all the peers are shoved into a single bucket, this makes for potentially terrible performance since the entire bucket will be traversed even if the peer is one of the first ones come across in the bucket. All the changes I have made were for cases where the callback function defined was passed to ao2_container_alloc so that calls to ao2_find could find a unique instance of whatever object was being stored in the container. git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.4@140488 f38db490-d61c-443f-a65b-d21fe96a405b
2008-08-25Fix a typo I made. Lesson learned, apply the patch if one exists.jpeeler1-1/+1
git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.4@139927 f38db490-d61c-443f-a65b-d21fe96a405b
2008-08-22(closes issue #13359)jpeeler1-1/+1
Reported by: Laureano Patches: originate_channel_check.patch uploaded by Laureano (license 265) git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.4@139621 f38db490-d61c-443f-a65b-d21fe96a405b
2008-07-31Specify codecs in callfiles and manager, to allow video calls to be set uptilghman1-4/+12
from callfiles and AMI. (closes issue #9531) Reported by: Geisj Patches: 20080715__bug9531__1.4.diff.txt uploaded by Corydon76 (license 14) 20080715__bug9531__1.6.0.diff.txt uploaded by Corydon76 (license 14) Tested by: Corydon76 git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.4@134976 f38db490-d61c-443f-a65b-d21fe96a405b
2008-07-15astman_send_error does not need a newline appended -- the API takes care oftilghman1-6/+6
that for us. (closes issue #13068) Reported by: gknispel_proformatique Patches: asterisk_1_4_astman_send.patch uploaded by gknispel (license 261) asterisk_trunk_astman_send.patch uploaded by gknispel (license 261) git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.4@130959 f38db490-d61c-443f-a65b-d21fe96a405b
2008-07-13fix memory leak when originate from manager cannot create a threadmvanbaak1-0/+1
(closes issue #13069) Reported by: gknispel_proformatique Patches: asterisk_trunk_action_originate.patch uploaded by gknispel (license 261) Tested by: gknispel_proformatique, mvanbaak git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.4@130573 f38db490-d61c-443f-a65b-d21fe96a405b
2008-06-03When listing the manager users, managers in users.conf are not shown, eventilghman1-1/+66
though they are allowed to connect. (closes issue #12594) Reported by: bkruse Patches: 12594-managerusers-2.diff uploaded by qwell (license 4) Tested by: bkruse git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.4@120061 f38db490-d61c-443f-a65b-d21fe96a405b
2008-06-02Improve CLI command blacklist checking for the command manager action. ↵russell1-9/+50
Previously, it did not handle case or whitespace properly. This made it possible for blacklisted commands to get executed anyway. (closes issue #12765) git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.4@119742 f38db490-d61c-443f-a65b-d21fe96a405b
2008-04-23Store the manager session ID explicitly as 4 byte ID instead of a ulong. Therussell1-7/+7
mansession_id cookie is coded to be limited to 8 characters of hex, and this could break logins from 64-bit machines in some cases. (inspired by AST-20) git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.4@114591 f38db490-d61c-443f-a65b-d21fe96a405b
2008-04-18Don't destroy a manager session if poll() returns an error of EAGAIN.russell1-1/+1
git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.4@114284 f38db490-d61c-443f-a65b-d21fe96a405b
2008-04-02Fix a race condition in the manager. It is possible that a new manager eventmmichelson1-0/+13
could be appended during a brief time when the manager is not waiting for input. If an event comes during this period, we need to set an indicator that there is an event pending so that the manager doesn't attempt to wait forever for an event that already happened. (closes issue #12354) Reported by: bamby Patches: manager_race_condition.diff uploaded by bamby (license 430) (comments added by me) git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.4@112468 f38db490-d61c-443f-a65b-d21fe96a405b
2008-03-07Safely use the strncat() function.tilghman1-2/+2
(closes issue #11958) Reported by: norman Patches: 20080209__bug11958.diff.txt uploaded by Corydon76 (license 14) git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.4@106552 f38db490-d61c-443f-a65b-d21fe96a405b
2008-02-27Ensure the session ID can't be 0.tilghman1-1/+6
git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.4@104704 f38db490-d61c-443f-a65b-d21fe96a405b
2008-02-21reduce the likelihood that HTTP Manager session ids will consist of ↵kpfleming1-1/+1
primarily '1' bits git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.4@104015 f38db490-d61c-443f-a65b-d21fe96a405b
2008-01-17missed that one while revertingpari1-1/+1
git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.4@99010 f38db490-d61c-443f-a65b-d21fe96a405b
2008-01-17reverting 99001 - We need the Max-Age for extending the life of cookie ↵pari1-6/+2
mansession_id git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.4@99007 f38db490-d61c-443f-a65b-d21fe96a405b
2008-01-17we should only send the Set-Cookie header to the browser on the first ↵kpfleming1-2/+6
response after creating a manager session, not on every response (doing so causes the browser to clear any local cookies it may have associated with the session) git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.4@99001 f38db490-d61c-443f-a65b-d21fe96a405b
2007-12-27make this comment explain the situation in an even more explicit fashionkpfleming1-5/+11
git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.4@94824 f38db490-d61c-443f-a65b-d21fe96a405b
2007-12-26Workaround for what is probably a glibc bug (but we'll see this crop up againtilghman1-0/+8
and again, if we don't add the workaround). Reported by: rolek Patch by: tilghman (Closes issue #11601, closes issue #11426) git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.4@94808 f38db490-d61c-443f-a65b-d21fe96a405b
2007-11-30Change the behavior of ao2_link(). Previously, in inherited a reference.russell1-2/+0
Now, it automatically increases the reference count to reflect the reference that is now held by the container. This was done to be more consistent with ao2_unlink(), which automatically releases the reference held by the container. It also makes it so it is no longer possible for a pointer to be invalid after ao2_link() returns. git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.4@90348 f38db490-d61c-443f-a65b-d21fe96a405b
2007-11-28it is impossible to set permissions for manager accounts created by ↵kpfleming1-2/+9
users.conf (reported internally, patched by me) git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.4@90098 f38db490-d61c-443f-a65b-d21fe96a405b
2007-11-23Up until this point, the XML output of the manager has been technicallytilghman1-3/+71
invalid, due to the repetition of certain parameters in a single event. This caused various issues for XML parsers, some of which refused to parse at all, given the invalidity of the rendered XML. So this commit fixes the XML output, ensuring that each entity parameter has a unique name, thus ensuring valid XML. Reported by: msetim Patch by: tilghman (Closes issue #10220) git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.4@89536 f38db490-d61c-443f-a65b-d21fe96a405b
2007-11-15Undoing previous commit since I realize it was wrongmmichelson1-1/+0
git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.4@89288 f38db490-d61c-443f-a65b-d21fe96a405b
2007-11-15Adding a missing mutex unlock.mmichelson1-0/+1
(closes issue 11256, reported and patched by ys) git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.4@89286 f38db490-d61c-443f-a65b-d21fe96a405b
2007-11-07Fixing a segfault in the manager "core show channels concise" command.mmichelson1-1/+1
(closes issue #11183, reported by arnd and patched by ys) git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.4@89085 f38db490-d61c-443f-a65b-d21fe96a405b
2007-10-05Fix a copy/paste error in the description of UpdateConfig that was pointedrussell1-2/+2
out by JerJer on #asterisk-dev git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.4@84742 f38db490-d61c-443f-a65b-d21fe96a405b
2007-10-01moved get_base_channel() code from action_redirect to ↵dhubbard1-17/+1
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-1/+17
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-09-19Fix up another potential race condition. Do the loop decrementing use countrussell1-2/+1
on events with the eventq protected from being changed. (reported on IRC by Ivan) git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.4@83121 f38db490-d61c-443f-a65b-d21fe96a405b
2007-09-18Corrected patch applied in revision r82887. dbailey1-10/+7
git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.4@82913 f38db490-d61c-443f-a65b-d21fe96a405b
2007-09-18Fixed a bug where http manager sessions prevented the eventq from being ↵dbailey1-10/+16
cleaned out because http manager sessions do not have a valid file descriptor. git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.4@82887 f38db490-d61c-443f-a65b-d21fe96a405b
2007-09-18Fix a memory leak that can occur on systems under higher load. The issue isrussell1-7/+5
that when events are appended to the master event queue, they use the number of active sessions as a use count so it will know when all active sessions at the time the event happened have consumed it. However, the handling of the number of sessions was not properly synchronized, so the use count was not always correct, causing an event to disappear early, or get stuck in the event queue for forever. (closes issue #9238, reported by bweschke, patch from Ivan, modified by me) git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.4@82867 f38db490-d61c-443f-a65b-d21fe96a405b
2007-07-20Eliminate a compiler warning with gcc 4.2 by constifying a char *qwell1-2/+2
git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.4@76176 f38db490-d61c-443f-a65b-d21fe96a405b
2007-07-02Remove a bogus comment and add proper locking to the handler function for therussell1-1/+2
CLI command to show information on manager actions. git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.4@72926 f38db490-d61c-443f-a65b-d21fe96a405b
2007-06-29Issue 10055 - Change memory allocation to use the heap for a command, since ↵tilghman1-8/+17
the output has the potential to overflow the stack (as it did here) git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.4@72556 f38db490-d61c-443f-a65b-d21fe96a405b
2007-06-24Merged revisions 71288 via svnmerge from tilghman1-6/+1
https://origsvn.digium.com/svn/asterisk/branches/1.2 ........ r71288 | tilghman | 2007-06-24 12:32:21 -0500 (Sun, 24 Jun 2007) | 2 lines Issue 10043 - There is a legitimate need to be able to set variables to the empty string. ........ git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.4@71289 f38db490-d61c-443f-a65b-d21fe96a405b
2007-05-24Add the ability to blacklist certain commands from being executed using the ↵file1-1/+13
Command AMI action. (issue #9240 reported by junky) git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.4@65902 f38db490-d61c-443f-a65b-d21fe96a405b
2007-05-11Hide manager password from "manager show user foo".qwell1-1/+1
I realize that there are other ways to get this, but we really don't need to just show it in plain text so easily. Issue 9273, patch by junky git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.4@63982 f38db490-d61c-443f-a65b-d21fe96a405b
2007-05-11When MD5 authentication is not possible because there is no challenge present,russell1-0/+5
either because the Challenge action was never issued, or some other reason, give a proper error message and return an error instead of claiming that the user wasn't found. (reported by jsmith on IRC) git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.4@63886 f38db490-d61c-443f-a65b-d21fe96a405b
2007-05-10Strip terminal escape sequences from CLI command output that is going to berussell1-3/+7
sent out over the manager interface. (issue #9659, reported by pari, fixed by me) git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.4@63804 f38db490-d61c-443f-a65b-d21fe96a405b
2007-05-02Backport the change that only went in to trunk that fixes the command managerrussell1-1/+14
action over http. (reported internally by pari and bkruse) git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.4@62739 f38db490-d61c-443f-a65b-d21fe96a405b
2007-04-27Issue #9608 - fix some annoying DEBUG messages not controlled by ↵oej1-1/+2
option_debug (DEA). Thanks! git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.4@62095 f38db490-d61c-443f-a65b-d21fe96a405b
2007-04-24Merged revisions 61786 via svnmerge from russell1-1/+2
https://origsvn.digium.com/svn/asterisk/branches/1.2 ........ r61786 | russell | 2007-04-24 16:33:59 -0500 (Tue, 24 Apr 2007) | 4 lines Don't crash if a manager connection provides a username that exists in manager.conf but does not have a password, and also requests MD5 authentication. (ASA-2007-012) ........ git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.4@61787 f38db490-d61c-443f-a65b-d21fe96a405b
2007-04-20Fix the UpdateConfig manager action to properly treat "variables" and "objects"russell1-2/+8
differently (a=b versus a=>b). (issue #9568, reported by pari, patch by me) git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.4@61690 f38db490-d61c-443f-a65b-d21fe96a405b
2007-04-19Bug 9557 - simple reason why reading a function always returned NULLtilghman1-1/+2
git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.4@61683 f38db490-d61c-443f-a65b-d21fe96a405b
2007-04-06To be able to achieve the things that we would like to achieve with therussell1-0/+37
Asterisk GUI project, we need a fully functional HTTP interface with access to the Asterisk manager interface. One of the things that was intended to be a part of this system, but was never actually implemented, was the ability for the GUI to be able to upload files to Asterisk. So, this commit adds this in the most minimally invasive way that we could come up with. A lot of work on minimime was done by Steve Murphy. He fixed a lot of bugs in the parser, and updated it to be thread-safe. The ability to check permissions of active manager sessions was added by Dwayne Hubbard. Then, hacking this all together and do doing the modifications necessary to the HTTP interface was done by me. git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.4@60603 f38db490-d61c-443f-a65b-d21fe96a405b
2007-04-04Merged revisions 60134 via svnmerge from russell1-2/+2
https://origsvn.digium.com/svn/asterisk/branches/1.2 ........ r60134 | russell | 2007-04-04 12:38:47 -0500 (Wed, 04 Apr 2007) | 6 lines It is valid to redirect channels via the manager interface that are not in the UP state. Instead of checking for that to prevent to ensure a dead channel doesn't get redirected, just use the ast_check_hangup() API call. (issue #9457, reported by Callmewind, patch by me) (related to issue #8977) ........ git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.4@60137 f38db490-d61c-443f-a65b-d21fe96a405b
2007-03-07Merged revisions 58164 via svnmerge from russell1-0/+11
https://origsvn.digium.com/svn/asterisk/branches/1.2 ........ r58164 | russell | 2007-03-06 18:20:13 -0600 (Tue, 06 Mar 2007) | 4 lines If the channels acquired using the manager Redirect action are not up, then don't attempt to do anything with them. It could lead to weird behavior, including crashes. (issue #8977) ........ git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.4@58165 f38db490-d61c-443f-a65b-d21fe96a405b
2007-02-06Merged revisions 53245 via svnmerge from tilghman1-1/+1
https://origsvn.digium.com/svn/asterisk/branches/1.2 ........ r53245 | tilghman | 2007-02-06 00:58:28 -0600 (Tue, 06 Feb 2007) | 2 lines Issue 8987 - Status could return two responses (mnicholson) ........ git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.4@53246 f38db490-d61c-443f-a65b-d21fe96a405b
2007-01-31Merged revisions 53045 via svnmerge from russell1-0/+1
https://origsvn.digium.com/svn/asterisk/branches/1.2 ........ r53045 | russell | 2007-01-31 15:25:11 -0600 (Wed, 31 Jan 2007) | 3 lines Fix a bunch of places where pthread_attr_init() was called, but pthread_attr_destroy() was not. ........ git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.4@53046 f38db490-d61c-443f-a65b-d21fe96a405b