summaryrefslogtreecommitdiff
path: root/main
AgeCommit message (Collapse)Author
2006-10-25Merged revisions 46154 via svnmerge from Kevin P. Fleming
https://origsvn.digium.com/svn/asterisk/branches/1.4 ........ r46154 | kpfleming | 2006-10-24 19:26:17 -0500 (Tue, 24 Oct 2006) | 2 lines add passthrough and file format support for G.722 16KHz audio (issue #5084, original patch by andrew, updated by mithraen) ........ git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@46155 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2006-10-24i really think it is safe to commit this version, thatLuigi Rizzo
simplifies the manager queue handling as described in the comment, and will make a lot easier to make further work on this code. git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@46120 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2006-10-24Merged revisions 46078 via svnmerge from Tilghman Lesher
https://origsvn.digium.com/svn/asterisk/branches/1.4 ........ r46078 | tilghman | 2006-10-23 22:01:00 -0500 (Mon, 23 Oct 2006) | 3 lines Pass through a frame if we don't know what it is, rather than trying to pass a NULL, which will segfault a channel driver (Bug 8149) ........ git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@46079 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2006-10-23use autodetected support for gethostbyname_rLuigi Rizzo
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@45989 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2006-10-22Fix a few issues in the previous (disabled) HTTPS code,Luigi Rizzo
and support linux as well (using fopencookie(), which should be available in glibc). Update configure.ac to check for funopen (BSD) and fopencookie(glibc), and while we are at it also for gethostbyname_r (the generated files need to be updated, or you need to run bootstrap.sh yourself). Document the new options in http.conf.sample (names are only tentative, better ones are welcome). At this point we can safely enable the option. Anyone willing to try this on Sun and Apple platforms ? git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@45892 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2006-10-22Implement https support.Luigi Rizzo
The changes are not large. Most of the diff comes from putting the global variables describing an accept session into a structure, so we can reuse the existing code for running multiple accept threads on different ports. Once this is done, and if your system has the funopen() library function (and ssl, of course), it is just a matter of calling the appropriate functions to set up the ssl connection on the existing socket, and everything works on the secure channel now. At the moment, the code is disabled because i have not implemented yet the autoconf code to detect the presence of funopen(), and add -lssl to main/Makefile if ssl libraries are present. And a bit of documentation on the http.conf arguments, too. If you want to manually enable https support, that is very simple (step 0 1 2 will be eventually detected by ./configure, the rest is something you will have to do anyways). 0. make sure your system has funopen(3). FreeBSD does, linux probably does too, not sure about other systems. 1. uncomment the following line in main/http.c // #define DO_SSL /* comment in/out if you want to support ssl */ 2. add -lssl to AST_LIBS in main/Makefile 3. add the following options to http.conf sslenable=yes sslbindport=4433 ; pick one you like sslcert=/tmp/foo.pem ; path to your certificate file. 4. generate a suitable certificate e.g. (example from mini_httpd's Makefile: openssl req -new -x509 -days 365 -nodes -out /tmp/foo.pem -keyout /tmp/foo.pem and here you go: https://localhost:4433/asterisk/manager now works. git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@45869 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2006-10-22it is useless and possibly wrong to use ast_cli() to send theLuigi Rizzo
reply back to http clients. Use fprintf/fwrite instead, since we are already using a FILE * to read the input. If you wonder why, this is because it makes it trivial to implement https support (as long as your system has funopen()). And this is what i am going to put in with the next few commits... git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@45858 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2006-10-22Let's have build.h created a bit earlier so that func_version can use it and ↵Joshua Colp
not stop the build on a fresh machine that has never had Asterisk installed on it before... git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@45847 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2006-10-21the default port number was erroneously stored in host order,Luigi Rizzo
and reading from the config file used ntohs instead of htons. this ought to be merged to 1.4 as well. git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@45836 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2006-10-21Merged revisions 45817 via svnmerge from Joshua Colp
https://origsvn.digium.com/svn/asterisk/branches/1.4 ........ r45817 | file | 2006-10-21 14:48:58 -0400 (Sat, 21 Oct 2006) | 2 lines Don't use promotion on Darwin because it doesn't seem to work quite right in all cases, this should solve the unresolved symbol issue people have been seeing. ........ git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@45820 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2006-10-20minor comment changes, code rearrangement and field renamingLuigi Rizzo
to minimize diffs with future modifications. The current implementation is problematic for the following reasons: + all insertions are O(N) because the event list does not have a tail pointer; + there is only a single lock protecting both session and users queues. + the implementation of the queue itself is not documented. I think i have figured it out, more or less, but am unclear on whether there is proper locking in place The rewrite (which i have working locally) uses a tailq so insertions are O(1), separate locks for the event and session queues, and has a documented implementation so hopefully we can figure out if/where bug exist. git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@45753 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2006-10-20Doxygen correctionsOlle Johansson
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@45742 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2006-10-19more fixes to comments and very minor code rearrangement.Luigi Rizzo
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@45696 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2006-10-19implement proper XML/HTML formatting of multiple messagesLuigi Rizzo
(e.g. the result of waitevent). Also fix some comments. git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@45690 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2006-10-19more documentation of data structure and functions.Luigi Rizzo
Of interest: + ast_get_manager_by_name_locked() is now without the ast_ prefix as it is a local function; + unuse_eventqent() renamed to unref_event(), and returns the pointer to the next entry. + marked with XXX a couple of usages of unref_event() because i suspect we are addressing the wrong entry. git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@45648 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2006-10-19Extend the thread storage API such that a custom initialization function canRussell Bryant
be called for each thread specific object after they are allocated. Note that there was already the ability to define a custom cleanup function. Also, if the custom cleanup function is used, it *MUST* call free on the thread specific object at the end. There is no way to have this magically done that I can think of because the cleanup function registered with the pthread implementation will only call the function back with a pointer to the thread specific object, not the parent ast_threadstorage object. git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@45623 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2006-10-18silent warning from a debugging message (which will go awayLuigi Rizzo
soon, anyways) git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@45611 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2006-10-18remove trailing whitespaceLuigi Rizzo
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@45599 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2006-10-18ouch! remember to unlink temporary files once done with them.Luigi Rizzo
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@45598 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2006-10-18+ move output_format variables in the http section of the file;Luigi Rizzo
+ more comments on struct mansession and global variables; + small improvements to the session matching code so it supports multiple sessions from the same IP git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@45597 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2006-10-18Merged revisions 45595 via svnmerge from Joshua Colp
https://origsvn.digium.com/svn/asterisk/branches/1.4 ........ r45595 | file | 2006-10-18 17:03:34 -0400 (Wed, 18 Oct 2006) | 2 lines Don't modify things if we are using vfork as this is very bad and may cause unexpected behavior (issue #7970 reported by Nick Gavrikov) ........ git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@45596 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2006-10-18another bunch of comments on the data structures.Luigi Rizzo
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@45583 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2006-10-18despite the large changes, this commit only moves functionsLuigi Rizzo
around so that functions belonging to the same group are close to each other. At the beginning of each group i have added a bit of documentation to explain what the group does and what is the typical flow - basically, all i have learned by code inspection over the past few days should be documented for you to read. I have not put many doxygen annotations just because i am not sure what are the proper ones. Hopefully some doxygen experts will jump in. Next on the plate: try to figure out how "struct eventqent" are supposed to work. git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@45582 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2006-10-18more comment and formatting fixes, small simplificationsLuigi Rizzo
to functions get_input() and session_do() git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@45572 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2006-10-18rizzo compile then commit, maybe even run it too ^_^Matt O'Gorman
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@45571 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2006-10-18comment and cleanup the main thread.Luigi Rizzo
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: https://origsvn.digium.com/svn/asterisk/trunk@45561 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2006-10-18create a new (internal, for the time being) function astman_start_ack()Luigi Rizzo
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: https://origsvn.digium.com/svn/asterisk/trunk@45551 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2006-10-18more indentation cleanup from previous commits,Luigi Rizzo
and remove the "busy" field from struct mansession as it was not used correctly anyways. git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@45541 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2006-10-18create proper handlers for "Challenge" and "Login" actions,Luigi Rizzo
rather than use inline code for them. Things are more readable this way, and also error processing is more consistent. git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@45540 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2006-10-18fix indentation from a commit of a couple of days agoLuigi Rizzo
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@45530 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2006-10-18another batch of simplifications to authenticate()Luigi Rizzo
(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: https://origsvn.digium.com/svn/asterisk/trunk@45529 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2006-10-18remove unused fields and unimplemented options.Luigi Rizzo
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@45518 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2006-10-18first pass as simplifying authenticate(), avoiding whitespace changesLuigi Rizzo
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@45516 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2006-10-18more code simplificationsLuigi Rizzo
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@45515 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2006-10-18simplify ast_strings_to_maskLuigi Rizzo
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@45505 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2006-10-18add a comment to remember that a block of code isLuigi Rizzo
completely redundant. git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@45495 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2006-10-18+ move the enum declaration for output formats near the headLuigi Rizzo
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: https://origsvn.digium.com/svn/asterisk/trunk@45485 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2006-10-18merge xml_translate() and html_translate() into one function sinceLuigi Rizzo
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: https://origsvn.digium.com/svn/asterisk/trunk@45475 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2006-10-18introduce uri_decode() so that '+' are translated into ' 'Luigi Rizzo
(e.g. browsers do this when they encode input strings from a form). git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@45474 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2006-10-18various code simplifications to reduce nesting depth,Luigi Rizzo
minor optimizations to avoid extra calls of strlen(), and some variable localization. One feature worth backporting is the move of ast_variables_destroy() to a different place in handle_uri() to avoid leaking memory in case a uri is not found. git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@45463 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2006-10-18Merged revisions 45452 via svnmerge from Joshua Colp
https://origsvn.digium.com/svn/asterisk/branches/1.4 ........ r45452 | file | 2006-10-17 23:02:08 -0400 (Tue, 17 Oct 2006) | 2 lines Don't segfault if you're using a channel driver that doesn't turn RTCP on ........ git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@45453 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2006-10-18Merged revisions 45441 via svnmerge from Russell Bryant
https://origsvn.digium.com/svn/asterisk/branches/1.4 ........ r45441 | russell | 2006-10-17 22:41:36 -0400 (Tue, 17 Oct 2006) | 7 lines Don't attempt to access private data members of the pthread_mutex_t object, because this does not work on all linux systems. Instead, just access the reentrancy field in the ast_mutex_info struct when DEBUG_THREADS is enabled. If DEBUG_CHANNEL_LOCKS is enabled, the developer probably has DEBUG_THREADS on as well. (issue #8139, me) ........ git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@45442 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2006-10-17Merged revisions 45408 via svnmerge from Kevin P. Fleming
https://origsvn.digium.com/svn/asterisk/branches/1.4 ........ r45408 | kpfleming | 2006-10-17 17:24:10 -0500 (Tue, 17 Oct 2006) | 3 lines optimize the 'quick response' code a bit more... no more malloc() or memset() for each response expand stringfields API a bit to allow reusing the stringfield pool on a structure when needed, and remove some unnecessary code when the structure was being freed ........ git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@45409 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2006-10-17Warning be gone!Joshua Colp
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@45398 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2006-10-17simplify authority_to_str() using ast_build_string()Luigi Rizzo
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@45351 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2006-10-17Improve the XML formatting of responses coming from web interface.Luigi Rizzo
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-17open a temporary file to receive the output from cli commandsLuigi Rizzo
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-17document xml_copy_escape() and add an extra function, namelyLuigi Rizzo
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-16+ comment some unclear fields of struct mansession;Luigi Rizzo
+ 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+ comment some unclear requirements for master_eventqLuigi Rizzo
+ 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