Commit Graph

79 Commits

Author SHA1 Message Date
Kevin P. Fleming 84b133bd81 clean up code to conform to coding guidelines
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@109909 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-03-19 15:41:54 +00:00
Russell Bryant f1d2a11aad Minor change to use Asterisk macros
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@109841 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-03-19 04:09:55 +00:00
Kevin P. Fleming e191b51a08 start the process of changing HTTP request dispatching to do it based on *both* URI and method, so that POST support can move into a module; move http.c's private function prototypes into _private.h
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@109762 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-03-18 22:32:26 +00:00
Terry Wilson e727d15d34 Replace minimime with superior GMime library so that the entire contents of an http post are not read into memory.
This does introduce a dependency on the GMime library for handling HTTP POSTs, but it is available in most distros.

If the library is present, then the compile flag for ENABLE_UPLOADS is enabled by default in menuselect.


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@109229 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-03-17 22:10:06 +00:00
Russell Bryant c3c56990df Make the default prefix empty, like it was in Asterisk 1.4.
(closes issue #12198, reported by bkruse, patched by me)


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@108346 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-03-12 22:49:26 +00:00
Russell Bryant 8bbef5f996 Rename ast_tcptls_server_instance to session_instance, since this pertains to
server and client usage.


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@108295 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-03-12 22:13:18 +00:00
Russell Bryant 96e04792bd add a destroy API call for a server instance
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@105804 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-03-04 22:28:03 +00:00
Russell Bryant cc55483858 More public API name changes to use an appropriate ast_ prefix
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@105785 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-03-04 22:23:21 +00:00
Russell Bryant efb1e30a38 Rename public object server_instance to ast_tcptls_server_instance
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@105773 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-03-04 22:15:18 +00:00
Russell Bryant 0036cde5f3 Rename version.h to ast_version.h. Next, I will be re-adding version.h as an
automatically generated file like it used to be.  This still needs to be there
for modules that have to check it to compile against multiple asterisk versions.


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@104244 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-02-26 20:02:14 +00:00
Russell Bryant b995c78c31 Merge changes from team/group/sip-tcptls
This set of changes introduces TCP and TLS support for chan_sip.  There are various
new options in configs/sip.conf.sample that are used to enable these features.  Also,
there is a document, doc/siptls.txt that describes some things in more detail.

This code was implemented by Brett Bryant and James Golovich.  It was reviewed
by Joshua Colp and myself.  A number of other people participated in the testing
of this code, but since it was done outside of the bug tracker, I do not have their
names.  If you were one of them, thanks a lot for the help!

(closes issue #4903, but with completely different code that what exists there.)


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@99085 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-01-18 22:04:33 +00:00
Pari Nannapaneni 0c33fdfb49 merging a comment added in 1.4
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@98514 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-01-12 05:13:04 +00:00
Russell Bryant 54bc2c20b6 Now that the version.h file was getting properly regenerated every time the svn
revision changed, every module that used the version was getting rebuilt after
every svn update.  This severly annoyed me pretty quickly, so I have improved
the situation.

Now, instead of generating version.h, main/version.c is generated.  version.c
includes the version information, as well as a couple of API calls for modules
to retrieve the version.  So now, only version.c will get rebuilt, and the main
asterisk binary relinked, which is must faster than rebuilding http.c, manager.c,
asterisk.c, relinking the asterisk binary, chan_sip.c, func_version.c, res_agi ...

The only minor change in behavior here is that the version information reported by
chan_sip, for example, is the version of the Asterisk core, and not necessarily the
Asterisk version that the chan_sip module came from.


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@96717 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-01-05 22:09:06 +00:00
Luigi Rizzo 49c0eaf803 remove some unnecessary includes
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@89542 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-11-24 13:48:48 +00:00
Luigi Rizzo e0ff5fef5c remove a bunch of useless #include "options.h"
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@89511 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-11-21 23:09:02 +00:00
Luigi Rizzo a23c055c3d move asterisk/paths.h outside asterisk.h and into those files
who really need it.



git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@89466 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-11-20 23:16:15 +00:00
Luigi Rizzo 9335ace850 another bunch of include removals (errno.h and asterisk/logger.h)
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@89425 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-11-19 19:09:03 +00:00
Luigi Rizzo 1e6489a175 trim more redundant headers
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@89384 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-11-17 16:18:53 +00:00
Luigi Rizzo fdb7f7ba3d Start untangling header inclusion in a way that does not affect
build times - tested, there is no measureable difference before and
after this commit.

In this change:

use asterisk/compat.h to include a small set of system headers:
inttypes.h, unistd.h, stddef.h, stddint.h, sys/types.h, stdarg.h,
stdlib.h, alloca.h, stdio.h

Where available, the inclusion is conditional on HAVE_FOO_H as determined
by autoconf.

Normally, source files should not include any of the above system headers,
and instead use either "asterisk.h" or "asterisk/compat.h" which does it
better. 

For the time being I have left alone second-level directories
(main/db1-ast, etc.).



git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@89333 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-11-16 20:04:58 +00:00
Jason Parker ebe4050128 Switch from AST_CLI (formerly NEW_CLI) to AST_CLI_DEFINE, since the former didn't make much sense
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@86820 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-10-22 20:05:18 +00:00
Jason Parker b0f3e6097e Convert NEW_CLI to AST_CLI.
Closes issue #11039, as suggested by seanbright.


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@86536 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-10-19 18:29:40 +00:00
Jason Parker c7a9ec1691 (issue #10724)
Reported by: eliel
Patches:
      res_features.c.patch uploaded by eliel (license 64)
      res_agi.c.patch uploaded by seanbright (license 71)
      res_musiconhold.c.patch uploaded by seanbright (license 71)
      pbx.c.patch uploaded by moy (license 222)
      logger.c.patch uploaded by moy (license 222)
      frame.c.patch uploaded by moy (license 222)
      manager.c.patch uploaded by moy (license 222)
      http.c.patch uploaded by moy (license 222)
      dnsmgr.c.patch uploaded by moy (license 222)
      res_realtime.c.patch uploaded by eliel (license 64)
      res_odbc.c.patch uploaded by seanbright (license 71)
      res_jabber.c.patch uploaded by eliel (license 64)
      chan_local.c.patch uploaded by eliel (license 64)
      chan_agent.c.patch uploaded by eliel (license 64)
      chan_alsa.c.patch uploaded by eliel (license 64)
      chan_features.c.patch uploaded by eliel (license 64)
      chan_sip.c.patch uploaded by eliel (license 64)
      RollUp.1.patch (includes all of the above patches) uploaded by seanbright (license 71)

Convert many CLI commands to the NEW_CLI format.


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@82930 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-09-18 22:43:45 +00:00
Doug Bailey 410bdaf535 Fix memory leak introduced when POST support was added.
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@82568 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-09-17 14:58:19 +00:00
Steve Murphy b5cd67adc3 This code was in team/murf/bug8684-trunk; it should fix bug 8684 in trunk. I didn't add it to 1.4 yet, because it's not entirely clear to me if this is a bug fix or an enhancement. A lot of files were affected by small changes like ast_variable_new getting an added arg, for the file name the var was defined in; ast_category_new gets added args of filename and lineno; ast_category and ast_variable structures now record file and lineno for each entry; a list of all #include and #execs in a config file (or any of its inclusions are now kept in the ast_config struct; at save time, each entry is put back into its proper file of origin, in order. #include and #exec directives are folded in properly. Headers indicating that the file was generated, are generated also for each included file. Some changes to main/manager.c to take care of file renaming, via the UpdateConfig command. Multiple inclusions of the same file are handled by exploding these into multiple include files, uniquely named. There's probably more, but I can't remember it right now.
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@81361 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-08-29 20:55:40 +00:00
Tilghman Lesher 56b9568164 Don't reload a configuration file if nothing has changed.
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@79747 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-08-16 21:09:46 +00:00
Tilghman Lesher 81bc1d7af5 Merge in ast_strftime branch, which changes timestamps to be accurate to the microsecond, instead of only to the second
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@75706 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-07-18 19:47:20 +00:00
Russell Bryant 4a6f3770f9 Fix my recent change for sending large files via the http server. This code
*must* write the file to the FILE *, and not the raw fd.  Otherwise, it breaks
TLS support.

Thanks to rizzo for catching this!


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@72738 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-06-29 21:24:40 +00:00
Russell Bryant 408dbc4304 Merge changes from team/russell/http_filetxfer
Handle transferring large files from the built-in http server.  Previously, the
code attempted to malloc a block as large as the file itself.  Now it uses the
sendfile() system call so that the file isn't copied into userspace at all if
it is available.  Otherwise, it just uses a read/write of small chunks at a time.


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@72701 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-06-29 20:35:09 +00:00
Russell Bryant 80166c6de8 Conversions to ast_debug()
(issue #9984, patches from eliel and dimas)


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@71338 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-06-24 18:51:41 +00:00
Jason Parker 37e66fd859 Revert the change made in revision 45474, since this causes other issues.
Issue 10021.


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@70493 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-06-20 20:41:06 +00:00
Russell Bryant b179e2155f Convert uses of strdup() to ast_strdup()
(issue #9983, eliel)


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@69436 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-06-14 23:01:01 +00:00
Tilghman Lesher 9d05ff8ed5 Issue 9869 - replace malloc and memset with ast_calloc, and other coding guidelines changes
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@67864 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-06-06 21:20:11 +00:00
Russell Bryant 4b3a3fb14c Add a new API call for creating detached threads. Then, go replace all of the
places in the code where the same block of code for creating detached threads
was replicated.  (patch from bbryant)


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@65968 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-05-24 18:30:19 +00:00
Russell Bryant 3181a91148 Merged revisions 62414 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4

........
r62414 | russell | 2007-04-30 10:25:31 -0500 (Mon, 30 Apr 2007) | 4 lines

When serving dynamic content, include a Cache-Control header to instruct the
browsers to not store the resulting content.  
(issue #9621, reported by Pari, patch by me)

........


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@62415 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-04-30 15:30:02 +00:00
Russell Bryant 2047feb97e Merged revisions 61407 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4

........
r61407 | russell | 2007-04-11 09:48:01 -0500 (Wed, 11 Apr 2007) | 4 lines

Add "svgz" to the mimetypes table.  (issue #9510, bkruse)

In passing, constify the elements of the mimetypes table.

........


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@61410 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-04-11 14:49:07 +00:00
Tilghman Lesher a858c92e3f Merged revisions 60712 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4

........
r60712 | tilghman | 2007-04-08 09:12:00 -0500 (Sun, 08 Apr 2007) | 2 lines

Fix --enable-dev-mode

........


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@60714 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-04-08 14:20:42 +00:00
Russell Bryant 0a9750ef9f Merged revisions 60603 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4

........
r60603 | russell | 2007-04-06 15:58:43 -0500 (Fri, 06 Apr 2007) | 13 lines

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/trunk@60604 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-04-06 21:16:38 +00:00
Russell Bryant e545f2e02f Merged revisions 60265 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4

........
r60265 | russell | 2007-04-05 10:47:17 -0500 (Thu, 05 Apr 2007) | 2 lines

Add the MIME type for gif by request from Pari

........


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@60266 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-04-05 15:48:17 +00:00
Joshua Colp 82641ec8d3 Merged revisions 59089 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4

........
r59089 | file | 2007-03-21 14:08:57 -0400 (Wed, 21 Mar 2007) | 2 lines

Add svg mimetype for pari.

........


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@59090 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-03-21 18:10:01 +00:00
Kevin P. Fleming a37ed6decb Merged revisions 58354 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4

........
r58354 | kpfleming | 2007-03-08 08:23:46 -0500 (Thu, 08 Mar 2007) | 2 lines

this change was not needed; fclose() handles closing the file descriptor already

........


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@58355 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-03-08 13:27:02 +00:00
Kevin P. Fleming 4a1a0993f2 Merged revisions 58351-58352 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4

........
r58351 | kpfleming | 2007-03-08 08:17:17 -0500 (Thu, 08 Mar 2007) | 2 lines

fix two cases where HTTP session file descriptors would not be closed

........
r58352 | kpfleming | 2007-03-08 08:17:42 -0500 (Thu, 08 Mar 2007) | 2 lines

fix a compiler warning, and overwriting 'res' value

........


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@58353 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-03-08 13:21:38 +00:00
Russell Bryant 4cbce3356e Merged revisions 55634 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4

........
r55634 | russell | 2007-02-20 14:26:06 -0600 (Tue, 20 Feb 2007) | 3 lines

Add the Asterisk version information to the Server header in HTTP
responses.  (requested by Pari)

........


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@55635 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-02-20 20:32:13 +00:00
Russell Bryant b233892198 Merged revisions 53046 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4

................
r53046 | russell | 2007-01-31 15:32:08 -0600 (Wed, 31 Jan 2007) | 11 lines

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/trunk@53047 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-01-31 21:35:15 +00:00
Olle Johansson a9849288de Doxygen updates
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@51932 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-01-24 09:31:26 +00:00
Joshua Colp b712e10a13 Convert uri_redirects list to read/write locks.
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@49027 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2006-12-28 20:05:00 +00:00
Joshua Colp 6d9273d0d8 Merged revisions 49024 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4

........
r49024 | qwell | 2006-12-28 14:52:46 -0500 (Thu, 28 Dec 2006) | 2 lines

make the uris_lock a rwlock instead of a mutex lock - needs to be forward ported to trunk

........


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@49026 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2006-12-28 20:02:41 +00:00
Kevin P. Fleming adca0ff14b Merged revisions 49006 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4

........
r49006 | kpfleming | 2006-12-27 16:06:56 -0600 (Wed, 27 Dec 2006) | 2 lines

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/trunk@49008 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2006-12-27 22:14:33 +00:00
Russell Bryant 850dd4ea61 Use spaces as a separator for the redirect option to improve readability
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@48947 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2006-12-24 21:01:02 +00:00
Russell Bryant 5d5cc243c6 Simplify the definition of http_uri_redirect such that only one allocation is
done for exactly how much memory is needed.  This was suggested by Luigi on
the asterisk-dev mailing list.  Thanks!


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@48933 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2006-12-24 03:29:42 +00:00
Russell Bryant 2c5071a006 - Convert the list of URI handlers to use the linked list macros. While doing
this, implementing locking of this list to make it thread-safe.

- Add a "redirect" option to http.conf that allows redirecting one URI to
  another.  I was inspired to do this while playing with the Asterisk GUI.  I
  got tired of typing this URL to get to the GUI:
     
     http://localhost:8088/asterisk/static/config/cfgadvanced.html

  So, now I have the following line in http.conf:

     redirect=/=/asterisk/static/config/cfgadvanced.html

  Now, I can type the following into my browser and go to the GUI:

     http://localhost:8088


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@48930 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2006-12-23 20:13:14 +00:00