Commit Graph

44 Commits

Author SHA1 Message Date
Tilghman Lesher
6ffbaa32f3 Issue 10055 - Change memory allocation to use the heap for a command, since the output has the potential to overflow the stack (as it did here)
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@72556 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-06-29 04:47:11 +00:00
Tilghman Lesher
2e702c85eb Merged revisions 71288 via svnmerge from
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: https://origsvn.digium.com/svn/asterisk/branches/1.4@71289 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-06-24 17:39:34 +00:00
Joshua Colp
533144b170 Add the ability to blacklist certain commands from being executed using the Command AMI action. (issue #9240 reported by junky)
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@65902 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-05-24 15:27:23 +00:00
Jason Parker
e0cac0c477 Hide manager password from "manager show user foo".
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: https://origsvn.digium.com/svn/asterisk/branches/1.4@63982 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-05-11 20:16:17 +00:00
Russell Bryant
7d478ee342 When MD5 authentication is not possible because there is no challenge present,
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: https://origsvn.digium.com/svn/asterisk/branches/1.4@63886 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-05-11 16:05:43 +00:00
Russell Bryant
2465ea2cfa Strip terminal escape sequences from CLI command output that is going to be
sent out over the manager interface.
(issue #9659, reported by pari, fixed by me)


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@63804 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-05-10 22:23:42 +00:00
Russell Bryant
ae7a38d87b Backport the change that only went in to trunk that fixes the command manager
action over http.  (reported internally by pari and bkruse)


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@62739 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-05-02 20:55:00 +00:00
Olle Johansson
b0121ca8a3 Issue #9608 - fix some annoying DEBUG messages not controlled by option_debug (DEA). Thanks!
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@62095 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-04-27 08:10:43 +00:00
Russell Bryant
5bee74171d Merged revisions 61786 via svnmerge from
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: https://origsvn.digium.com/svn/asterisk/branches/1.4@61787 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-04-24 21:34:53 +00:00
Russell Bryant
70eb19121e Fix the UpdateConfig manager action to properly treat "variables" and "objects"
differently (a=b versus a=>b).
(issue #9568, reported by pari, patch by me)


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@61690 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-04-20 18:19:18 +00:00
Tilghman Lesher
6db075dd98 Bug 9557 - simple reason why reading a function always returned NULL
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@61683 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-04-19 04:36:20 +00:00
Russell Bryant
06ff84b549 To be able to achieve the things that we would like to achieve with the
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: https://origsvn.digium.com/svn/asterisk/branches/1.4@60603 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-04-06 20:58:43 +00:00
Russell Bryant
ab5c3cd84e Merged revisions 60134 via svnmerge from
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: https://origsvn.digium.com/svn/asterisk/branches/1.4@60137 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-04-04 17:40:10 +00:00
Russell Bryant
97fe798e7e Merged revisions 58164 via svnmerge from
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: https://origsvn.digium.com/svn/asterisk/branches/1.4@58165 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-03-07 00:25:19 +00:00
Tilghman Lesher
f2decd2446 Merged revisions 53245 via svnmerge from
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: https://origsvn.digium.com/svn/asterisk/branches/1.4@53246 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-02-06 07:00:52 +00:00
Russell Bryant
9aab046002 Merged revisions 53045 via svnmerge from
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: https://origsvn.digium.com/svn/asterisk/branches/1.4@53046 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-01-31 21:32:08 +00:00
Russell Bryant
771be23a9c Remove a recursive lock of the manager session. This was pointed out by
zandbelt in issue #8711.


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@52688 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-01-29 22:55:41 +00:00
Russell Bryant
ce753cf0d9 The session lock can not be held while calling action callbacks. If so, then
when the WaitEvent callback gets called, then no event can happen because the
session can't be locked by another thread.  Also, the session needs to be
locked in the HTTP callback when it reads out the output string.  This fixes
the deadlock reported in both 8711 and 8934.
Regarding issue 8711, there still may be an issue.  If there is a second action
requested before the processing of the first action is finished, there could
still be some corruption of the output string buffer used to build the result.
(issue #8711, #8934)


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@52611 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-01-29 20:39:20 +00:00
Joshua Colp
9c289fe01b Have the manager interface send back an "Already logged in" message instead of "Invalid/Unknown Command" when the client authenticates for a second time. (issue #8509 reported by pari)
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@52373 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-01-27 00:44:51 +00:00
Russell Bryant
2a37a53c57 Fix some bugs in process_message(). The manager session lock needs to be held
when sending some sort of response, or calling one of the manager action
callbacks.  This resolves an issue where people using the GUI would get random
crashes when they start clicking around a lot.
(issue #8711, reported and debugged by zandbelt)


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@51781 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-01-23 22:04:01 +00:00
Russell Bryant
3d5e9fa43c When traversing the list of manager actions, the iterator needs to be
initialized to the list head *after* locking the list.  Also, lock the actions
list in one place it is being accessed where it was not being done.


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@51750 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-01-23 21:33:15 +00:00
Russell Bryant
c5a3194042 Make the "hasmanager" option in users.conf actually have an effect.
(issue #8740, LnxPrgr3)


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@51233 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-01-18 17:18:43 +00:00
Joshua Colp
caa099357b Move event processing into do_message so that it gets executed again when events are tripped.
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@50895 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-01-15 16:36:07 +00:00
Joshua Colp
5fe88c5f88 We need to check for res being 0 in do_message itself, otherwise our headers will get lost.
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@50602 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-01-12 16:42:33 +00:00
Kevin P. Fleming
d2d50d7a8e ast_func_read() needs a writable copy of the function name to be passed
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@49710 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-01-05 23:31:38 +00:00
Kevin P. Fleming
c56f17425c don't 'consume' the params list before we try to use it again
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@49680 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-01-05 22:52:37 +00:00
Kevin P. Fleming
444adcb477 reduce stack consumption for AMI and AMI/HTTP requests by nearly 20K in most cases
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@49676 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-01-05 22:16:33 +00:00
Kevin P. Fleming
a299485952 since these variables all have static duration, none of them need initializers (they default to zero anyway)
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@49006 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2006-12-27 22:06:56 +00:00
Steve Murphy
0ab411f2ed Here lies the fixes that killed bug 8423 -- OriginateSuccess and OriginateError incomplete channel name. May it rest in peace.
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@48349 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2006-12-07 15:33:32 +00:00
Russell Bryant
a569bfd1f2 Remove a couple of unused variables (issue #8380, casper)
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@48046 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2006-11-27 17:17:40 +00:00
Tilghman Lesher
e05a2752e8 Reverse change of "show" to "list" and make several other commands more consistent with "category verb arguments"
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@47051 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2006-11-02 23:00:20 +00:00
Mark Spencer
72146fab32 Fix config comment code preservation code (thanks murf!)
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@46287 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2006-10-26 01:37:40 +00:00
Russell Bryant
def01ced3d fix a silly typo in a comment that I saw while reading the commit list
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@44945 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2006-10-12 16:56:32 +00:00
Nadi Sarrar
8adb217804 append_event must be called while holding the session lock
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@44921 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2006-10-12 12:55:25 +00:00
Luigi Rizzo
f24ec459b2 make sure sockets are blocking when they should be blocking.
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@44567 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2006-10-06 15:59:23 +00:00
Kevin P. Fleming
ff05bf15c8 update thread creation code a bit
reduce standard thread stack size slightly to allow the pthreads library to allocate the stack+data and not overflow a power-of-2 allocation in the kernel and waste memory/address space
add a new stack size for 'background' threads (those that don't handle PBX calls) when LOW_MEMORY is defined


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@44378 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2006-10-04 19:47:22 +00:00
Tilghman Lesher
70af28270d Constify the result of a config retrieval function, to avoid mutilation (issue 7983).
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@43364 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2006-09-20 20:40:39 +00:00
Jason Parker
4c2874b994 Commit the changes from issue #5240.
Original patch by junky, modified by anthonyl, modified again by jcolp (with minor modifications by me)


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@43300 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2006-09-19 22:01:23 +00:00
Jason Parker
fc60c151d3 After discussing this with other people, we decided we'd like to try to do this a little differently.
Stay tuned.


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@43290 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2006-09-19 19:58:09 +00:00
Anthony LaMantia
3f3402d69e 5240 update
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@43289 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2006-09-19 19:28:57 +00:00
Kevin P. Fleming
fcb999c01c merge qwell's CLI verbification work
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@43212 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2006-09-18 19:54:18 +00:00
Kevin P. Fleming
c2c4f86c72 merge markster's usersconf branch with some slight changes
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@43052 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2006-09-16 23:53:58 +00:00
Russell Bryant
283bcf4c9f - simplify and improve astmm by using thread storage instead of a dynamic
allocation and free on every call of the function for preparing the string
  that will be appended.  Then, use the ast_dynamic_str() code instead of the
  open coded version that is appended to when waiting for it to be delivered.
- use for loops for list traversals
- convert the manager sessions list to use list macros
- use atomic operations for num_sessions and usecounts
- convert some defines to the equivalent enum


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@40783 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2006-08-21 19:42:29 +00:00
Kevin P. Fleming
0a27d8bfe5 merge new_loader_completion branch, including (at least):
- restructured build tree and makefiles to eliminate recursion problems
  - support for embedded modules
  - support for static builds
  - simpler cross-compilation support
  - simpler module/loader interface (no exported symbols)



git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@40722 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2006-08-21 02:11:39 +00:00