Commit Graph

125 Commits

Author SHA1 Message Date
Luigi Rizzo 3e2a2bfd7e simplify authority_to_str() using ast_build_string()
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@45351 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2006-10-17 18:08:51 +00:00
Luigi Rizzo 3abf04cc26 Improve the XML formatting of responses coming from web interface.
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: https://origsvn.digium.com/svn/asterisk/trunk@45334 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2006-10-17 17:51:34 +00:00
Luigi Rizzo f2d12f4d06 open a temporary file to receive the output from cli commands
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: https://origsvn.digium.com/svn/asterisk/trunk@45330 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2006-10-17 17:41:59 +00:00
Luigi Rizzo 0c7e8f99a4 document xml_copy_escape() and add an extra function, namely
replace non-alphanum chars with underscore.
This is useful when building field names in xml formatting.



git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@45325 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2006-10-17 17:19:31 +00:00
Luigi Rizzo 5f395bf38f + comment some unclear fields of struct mansession;
+ 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: https://origsvn.digium.com/svn/asterisk/trunk@45219 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2006-10-16 14:00:53 +00:00
Luigi Rizzo 5fda2a874a + comment some unclear requirements for master_eventq
+ 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: https://origsvn.digium.com/svn/asterisk/trunk@45185 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2006-10-16 11:29:22 +00:00
Luigi Rizzo 6d10a245b6 protect access to first_action with actionlock.
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: https://origsvn.digium.com/svn/asterisk/trunk@45177 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2006-10-16 09:33:00 +00:00
Russell Bryant 43f1054d07 Merged revisions 44945 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4

........
r44945 | russell | 2006-10-12 12:56:32 -0400 (Thu, 12 Oct 2006) | 2 lines

fix a silly typo in a comment that I saw while reading the commit list

........


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@44946 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2006-10-12 16:57:36 +00:00
Nadi Sarrar 0752be2ec0 Merged revisions 44921 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4

........
r44921 | nadi | 2006-10-12 14:55:25 +0200 (Do, 12 Okt 2006) | 2 lines

append_event must be called while holding the session lock

........


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@44922 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2006-10-12 13:04:03 +00:00
Luigi Rizzo 684d1f1698 basically fix indentation of a large function after previous
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: https://origsvn.digium.com/svn/asterisk/trunk@44626 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2006-10-06 21:04:43 +00:00
Luigi Rizzo 35cada23f0 s cannot be null here, so remove the useless test and error-handling block.
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@44617 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2006-10-06 20:34:11 +00:00
Luigi Rizzo acd1073909 simplify logic in preparation to reduce indentation
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@44616 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2006-10-06 20:16:13 +00:00
Luigi Rizzo 3f641c6048 make sure sockets are blocking when they should be blocking.
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@44568 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2006-10-06 15:59:57 +00:00
Kevin P. Fleming 3c876af5cf Merged revisions 44378 via svnmerge from
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: https://origsvn.digium.com/svn/asterisk/trunk@44379 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2006-10-04 19:51:38 +00:00
Matt O'Gorman ae8cc3e18b bug #8076 check option_debug before printing to debug channel.
patch provided in bugnote, with minor changes.


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@44253 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2006-10-03 15:53:07 +00:00
Tilghman Lesher 2b55678e1f Remove deprecated CLI apps from the core
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@43449 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2006-09-21 21:17:39 +00:00
Tilghman Lesher 4a58847fe2 Remove 1.4 changes from UPGRADE.txt, remove deprecated callerid field, remove deprecated SetGlobalVar app
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@43444 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2006-09-21 20:01:54 +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