On passing, fix a bug: close the socket if the allocation
of a structure for the new session fails.
(the bugfix is a candidate for 1.4)
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@45561 f38db490-d61c-443f-a65b-d21fe96a405b
to start manager responses that need further lines.
This removes a lot of duplicate code from the various handlers
that at the moment build an ActionID string themselves.
Once settled, the function should move to manager.h so
it can be used by other files (chan_agent, chan_iax2, chan_sip,
chan_zap, res_jabber and app_queue).
I am not totally clear if there is a preferred position for
the ActionID: line in a message. Some instances put it at
the end, but one would argue that it is preferable to have
it at the beginning.
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@45551 f38db490-d61c-443f-a65b-d21fe96a405b
and remove the "busy" field from struct mansession
as it was not used correctly anyways.
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@45541 f38db490-d61c-443f-a65b-d21fe96a405b
rather than use inline code for them.
Things are more readable this way, and also error processing
is more consistent.
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@45540 f38db490-d61c-443f-a65b-d21fe96a405b
(they are committed a bit at a time so it is easier to
revert them in case we find a bug at a later time).
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@45529 f38db490-d61c-443f-a65b-d21fe96a405b
of the file, so it can be used from more places;
+ make the declaration of contenttype[] more robust;
+ remove the wrappers around __xml_translate(), since they were
used only in one place, and rename to xml_translate().
This allows for a bit of simplifications.
+ document the output produced by the above function.
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@45485 f38db490-d61c-443f-a65b-d21fe96a405b
they do similar things.
Add a small form on top of the html output so request like
http://foo:8088/asterisk/manager will suggest you what to do.
Note: i suspect there is still a bug somewhere in the session matching
code, as sometimes you have to login twice in order for the following
commands to be recognised.
Apart from this, the cli now is basically usable from a web form!
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@45475 f38db490-d61c-443f-a65b-d21fe96a405b
Normal responses are sequences of lines of the form "Name: value",
with \r\n as line terminators and an empty line as a response
terminator.
Generi CLI commands, however, do not have such a clean formatting,
and the existing code failed to generate valid XML for them.
Obviously we can only use heuristics here, and we do the following:
- accept either \r or \n as a line terminator, trimming trailing whitespace;
- if a line does not have a ":" in it, assume that from this point on
we have unformatted data, and use "Opaque-data:" as a name;
- if a line does have a ":" in it, the Name field is not always
a legal identifier, so replace non-alphanum characters with underscores;
All the above is to be refined as we improve the formatting of
responses from the CLI.
And, all the above ought to go as a comment in the code rather than
just in a commit message...
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@45334 f38db490-d61c-443f-a65b-d21fe96a405b
invoked through the http interface.
It is not terribly efficient but better than no output at all.
Todo: use a configurable /tmp directory instead of a hardwired one.
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@45330 f38db490-d61c-443f-a65b-d21fe96a405b
replace non-alphanum chars with underscore.
This is useful when building field names in xml formatting.
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@45325 f38db490-d61c-443f-a65b-d21fe96a405b
+ let some commands (Challenge, Login) be processed even if
already authenticated, as it doesn't harm and prevents some
incorrect error messages
+ remove custom code for Logoff - the existing handler was ok.
Some indentation fixes may be necessary
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@45219 f38db490-d61c-443f-a65b-d21fe96a405b
+ remove the need for an snprintf in astman_get_header()
+ fix comment for manager list eventq
+ localize one variable and minor code simplifications.
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@45185 f38db490-d61c-443f-a65b-d21fe96a405b
Mark with XXX one place (during command execution) where
navigation should be protected with actionlock, but is not
because it would block requests for a long time.
To solve this properly we need to put reference counts in
the struct manager_action.
A suboptimal fix is to copy the record on a search and then
unlock the list while we work on the copy.
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@45177 f38db490-d61c-443f-a65b-d21fe96a405b
simplifications. On passing, use a single exit point.
(once done with the cleanup i will merge the changes into 1.4,
if applicable)
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@44626 f38db490-d61c-443f-a65b-d21fe96a405b
https://origsvn.digium.com/svn/asterisk/branches/1.4
........
r44378 | kpfleming | 2006-10-04 14:47:22 -0500 (Wed, 04 Oct 2006) | 4 lines
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: http://svn.digium.com/svn/asterisk/trunk@44379 f38db490-d61c-443f-a65b-d21fe96a405b
Original patch by junky, modified by anthonyl, modified again by jcolp (with minor modifications by me)
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@43300 f38db490-d61c-443f-a65b-d21fe96a405b
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: http://svn.digium.com/svn/asterisk/trunk@40783 f38db490-d61c-443f-a65b-d21fe96a405b
- 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: http://svn.digium.com/svn/asterisk/trunk@40722 f38db490-d61c-443f-a65b-d21fe96a405b