Commit Graph

145 Commits

Author SHA1 Message Date
Tilghman Lesher 123ac5fd64 Standardized routines for forking processes (keeps all the specialized code in one place).
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@114188 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-04-16 22:57:54 +00:00
Jason Parker d3355ff2ed Merged revisions 113402 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4

........
r113402 | qwell | 2008-04-08 11:56:52 -0500 (Tue, 08 Apr 2008) | 1 line

Work around some silliness caused by sys/capability.h - this should fix compile errors a number of users have been experiencing.
........


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@113403 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-04-08 17:00:55 +00:00
Dwayne M. Hubbard 5e6d84eb69 sleep long enough for the zaptel timer error message to display before exit
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@112714 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-04-04 00:57:33 +00:00
Dwayne M. Hubbard 6dafddbe39 satisfy buildbot
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@112656 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-04-03 22:19:43 +00:00
Dwayne M. Hubbard 593dcbe311 add a Zaptel timer check to verify the timer is responding when Zaptel support is compiled into Asterisk and Zaptel drivers are loaded. This will help people not waste their valuable time debugging side effects.
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@112653 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-04-03 22:13:11 +00:00
Tilghman Lesher ef4eff9a9b Add the "config reload <conffile>" command, which allows you to tell Asterisk
to reload any file that references a given configuration file.


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@111012 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-03-26 18:39:06 +00:00
Joshua Colp 358ac2f76a Merged revisions 110628 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4

........
r110628 | file | 2008-03-25 11:37:35 -0300 (Tue, 25 Mar 2008) | 4 lines

Add an option (transmit_silence) which transmits silence during both Record() and DTMF generation. The reason this is an option is that in order to transmit silence we have to setup a translation path. This may not be needed/wanted in all cases.
(closes issue #10058)
Reported by: tracinet

........


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@110629 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-03-25 14:39:45 +00:00
Terry Wilson b02bc230af Go through and fix a bunch of places where character strings were being interpreted as format strings. Most of these changes are solely to make compiling with -Wsecurity and -Wformat=2 happy, and were not
actual problems, per se.  I also added format attributes to any printf wrapper functions I found that didn't have them.  -Wsecurity and -Wmissing-format-attribute added to --enable-dev-mode.


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@109447 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-03-18 15:43:34 +00:00
Tilghman Lesher 8718878490 Merged revisions 106552 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4

........
r106552 | tilghman | 2008-03-07 00:36:33 -0600 (Fri, 07 Mar 2008) | 6 lines

Safely use the strncat() function.
(closes issue #11958)
 Reported by: norman
 Patches: 
       20080209__bug11958.diff.txt uploaded by Corydon76 (license 14)

........


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@106553 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-03-07 06:54:47 +00:00
Tilghman Lesher 8a411ccf83 Create a centralized configuration option for silencethreshold
(closes issue #11236)
 Reported by: philipps
 Patches: 
       20080218__bug11236.diff.txt uploaded by Corydon76 (license 14)
 Tested by: philipps


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@106072 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-03-05 16:23:44 +00:00
Tilghman Lesher 7007c565fe Fix minor misuses of snprintf
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@105841 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-03-04 23:10:45 +00:00
Russell Bryant 8372a9bf08 3) In addition to merging the changes below, change trunk back to a regular
LIST instead of an RWLIST.  The way this list works makes it such that
   a RWLIST provides no additional benefit.  Also, a mutex is needed for
   use with the thread condition.


Merged revisions 105563 via svnmerge from 
https://origsvn.digium.com/svn/asterisk/branches/1.4

........
r105563 | russell | 2008-03-03 09:50:43 -0600 (Mon, 03 Mar 2008) | 24 lines

Merge in some changes from team/russell/autoservice-nochans-1.4

These changes fix up some dubious code that I came across while auditing what
happens in the autoservice thread when there are no channels currently in
autoservice.

1) Change it so that autoservice thread doesn't keep looping around calling
   ast_waitfor_n() on 0 channels twice a second.  Instead, use a thread condition
   so that the thread properly goes to sleep and does not wake up until a
   channel is put into autoservice.

   This actually fixes an interesting bug, as well.  If the autoservice thread
   is already running (almost always is the case), then when the thread goes
   from having 0 channels to have 1 channel to autoservice, that channel would
   have to wait for up to 1/2 of a second to have the first frame read from it.

2) Fix up the code in ast_waitfor_nandfds() for when it gets called with no
   channels and no fds to poll() on, such as was the case with the previous code
   for the autoservice thread.  In this case, the code would call alloca(0), and
   pass the result as the first argument to poll().  In this case, the 2nd
   argument to poll() specified that there were no fds, so this invalid pointer
   shouldn't actually get dereferenced, but, this code makes it explicit and
   ensures the pointers are NULL unless we have valid data to put there.

(related to issue #12116)

........


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@105564 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-03-03 15:59:50 +00:00
Russell Bryant b0ba749ca1 I swear I compiled this ... *cough*
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@104270 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-02-26 20:33:08 +00:00
Michiel van Baak f7370d4831 make the output of 'core show settings' a bit nicer.
(closes issue #12020)
Reported by: seanbright
Patches:
      asterisk.c.patch uploaded by seanbright (license 71)


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@103783 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-02-18 19:47:40 +00:00
Russell Bryant e29680ed66 Remove development version notice.
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@103388 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-02-12 15:39:44 +00:00
Joshua Colp c81350d6f6 Just some minor coding style cleanup...
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@103318 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-02-11 18:27:47 +00:00
Russell Bryant 1ec8cb41a8 Merge changes from team/mvanbaak/cli-command-audit
(closes issue #8925)

About a year ago, as Leif Madsen and Jim van Meggelen were going over the CLI
commands in Asterisk 1.4 for the next version of their book, they documented
a lot of inconsistencies.  This set of changes addresses all of these issues
and has been reviewed by Leif.

While this does introduce even more changes to the CLI command structure, it
makes everything consistent, which is the most important thing.

Thanks to all that helped with this one!


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@103171 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-02-08 21:26:32 +00:00
Tilghman Lesher 1dc86caf30 Merged revisions 102323 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4

........
r102323 | tilghman | 2008-02-04 15:06:09 -0600 (Mon, 04 Feb 2008) | 7 lines

Cross-platform fix:  OS X now deprecates the use of the daemon(3) API.
(closes issue #11908)
 Reported by: oej
 Patches: 
       20080204__bug11908.diff.txt uploaded by Corydon76 (license 14)
 Tested by: Corydon76

........


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@102329 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-02-04 21:15:18 +00:00
Russell Bryant ccdd466fab Merged revisions 100164 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4

........
r100164 | russell | 2008-01-24 11:22:09 -0600 (Thu, 24 Jan 2008) | 2 lines

Update main Asterisk copyright info to 2008

........


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@100169 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-01-24 17:24:08 +00:00
Jason Parker 3bd33214b9 Move code from res_features into (new file) main/features.c
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@100039 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-01-23 23:09:11 +00:00
Russell Bryant 90bc08362e Make sure the command is not just present but is also configured to be executed
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@99645 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-01-22 20:41:05 +00:00
Russell Bryant d1ba37f1c9 Change the Asterisk CLI startup commands feature to read commands to run from cli.conf
after a discussion on the -dev list.


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@99642 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-01-22 20:33:16 +00:00
Russell Bryant 8a5e93d766 Add support for an easy way to automatically execute some Asterisk CLI commands
immediately at startup.  Any commands in the startup_commands file in the Asterisk
config diretory will get executed.

(closes issue #11781)
Reported by: jamesgolovich
Patches:
      asterisk-startupcmds.diff.txt uploaded by jamesgolovich (license 176)
	    -- With some changes by me.


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@98986 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-01-17 00:05:13 +00:00
Tilghman Lesher 9b903da621 New option in trunk, needs strdupa to be safe, too
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@97365 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-01-09 00:58:22 +00:00
Tilghman Lesher 3ad9a66e0f Merged revisions 97077 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4

........
r97077 | tilghman | 2008-01-08 12:02:13 -0600 (Tue, 08 Jan 2008) | 3 lines

Apply multiple crash fixes, found in issue #11386, but not completely
closing that issue.

........


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@97125 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-01-08 19:06:27 +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
Tilghman Lesher 77ecc4a46a Compatibility fix for OpenBSD
Report and fix by: mvanbaak
(Closes issue #11669)


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@96147 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-01-03 01:59:27 +00:00
Jason Parker 03f68a8a3a Fix -s socket option, and document it as well.
Closes issue #11645, patch by Laureano.


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@95070 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-12-27 23:28:01 +00:00
Tilghman Lesher bca1033817 Merged revisions 94418 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4

........
r94418 | tilghman | 2007-12-21 09:07:42 -0600 (Fri, 21 Dec 2007) | 2 lines

Fix for restart-as-user problem reported via the -dev list

........


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@94419 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-12-21 15:14:52 +00:00
Luigi Rizzo 5e24835995 modify http://svn.digium.com/view/asterisk?view=rev&rev=93603
so that paths and filename are writable by asterisk.c without
causing segfaults.

This involves defining the variables as const char *,
and having them point to as static, writable buffer
defined in asterisk.c

On passing, fix some errors in using these variables
in some files in utils/ , and in res/snmp/agent.c
which was redefining a variable without using paths.h

(not applicable to 1.4)



git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@94168 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-12-20 09:55:05 +00:00
Olle Johansson 489a648d5d Add option for starting remote Asterisk by naming the actual runtime socket instead of pointing
to configuration file with -C

Reported by: sobomax
Patches: 
      asterisk.c.diff.trunk uploaded by sobomax (license 359)
      doc changes by committer
(closes issue #11598)



git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@93854 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-12-19 07:01:40 +00:00
Tilghman Lesher 8ea611a9ad Making the canary error message a little more obvious.
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@93805 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-12-18 23:38:30 +00:00
Tilghman Lesher 53436f42f4 Add a canary process, for high priority mode (asterisk -p) to ensure that if
Asterisk goes into a busy loop, the machine will be recoverable.  We'd still
need to do a restart to put Asterisk back into high priority mode, but at
least a reboot won't be required. (Closes issue #11559)


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@93804 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-12-18 23:06:05 +00:00
Luigi Rizzo 10f70a8321 make configuration variable const so they are not accidentally
modified.
This requires casting the strings in asterisk.c when writing to
them, so we do it through a macro to do it consistently.



git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@93603 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-12-18 10:24:58 +00:00
Luigi Rizzo fd88390af7 remove unnecessary (char *) casts for ast_config_AST_* variables.
There are some left in the .flex files, left to the maintainer...



git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@93582 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-12-18 09:46:18 +00:00
Luigi Rizzo 3ff440bd37 Rename the macros in defaults.h - they are not meant to be
globally visible.

Document the fact that DEFAULT_TMP_DIR cannot be overridden
from the default configuration (this needs to be fixed, as you
could have a totally different spooldir configured at runtime,
and yet DEFAULT_TMP_DIR keeps the compile-time default).

Remove two unused entries for sounds and images.



git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@93581 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-12-18 09:26:03 +00:00
Olle Johansson 5279d712d4 Don't drop the first character randomly in long listings in the CLI.
Reported by: slavon
Patches: 
      asterisk-consolerefresh2.diff.txt uploaded by jamesgolovich (license 176)
Tested by: eliel
(closes issue #9325)


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@93161 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-12-16 09:37:41 +00:00
Tilghman Lesher d5b454bf8d Convert ast_verbose to ast_verb.
Reported by: snuffy
Patch by: snuffy
(Closes issue #11547)


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@92913 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-12-14 14:48:38 +00:00
Tilghman Lesher 7adf8b6070 Correctly handle possible memory allocation failure
Reported by: eliel
Patch by: eliel
(Closes issue #11512)


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@92507 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-12-12 17:15:56 +00:00
Olle Johansson 5ac0f923b3 A few more "moremanager" fixes
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@89772 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-11-27 21:10:50 +00:00
Olle Johansson a30972ee65 More "moremanager" fixes. Manager commands to check module status.
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@89771 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-11-27 21:04:29 +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 915b97d300 move internal function declarations to include/asterisk/_private.h
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@89465 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-11-20 22:18:21 +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 a0f06d0dd5 start using asterisk/network.h for network related headers.
Also remove some unnecessary includes.



git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@89380 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-11-17 14:11:53 +00:00
Luigi Rizzo 5490960453 remove a bunch of duplicate includes
Reproduce with

grep -r #include . | grep -v .svn | grep -v Binary | sort | uniq -c | sort -nr 



git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@89348 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-11-16 23:54:45 +00:00
Luigi Rizzo 04497db215 remove duplicate headers.
Properly check for netdb.h (there is actually tens of places to fix)



git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@89335 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-11-16 20:28:19 +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
Kevin P. Fleming edc78d6023 improve linked-list macros in two ways:
- the *_CURRENT macros no longer need the list head pointer argument
  - add AST_LIST_MOVE_CURRENT to encapsulate the remove/add operation when moving entries between lists


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@89106 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-11-08 05:28:47 +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