Commit Graph

64 Commits

Author SHA1 Message Date
Tilghman Lesher
273afe2080 Don't print the terminating NUL. (Closes issue #12589)
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@115415 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-05-06 19:31:39 +00:00
Tilghman Lesher
869b7b2b4d Separate verbose output from CLI output, by using a preamble.
(closes issue #12402)
 Reported by: Corydon76
 Patches: 
       20080410__no_verbose_in_rx_output.diff.txt uploaded by Corydon76 (license 14)
       20080501__no_verbose_in_rx_output__1.4.diff.txt uploaded by Corydon76 (license 14)


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@115333 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-05-05 22:50:31 +00:00
Jason Parker
6ba9909eda 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/branches/1.4@113402 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-04-08 16:56:52 +00:00
Joshua Colp
27da06a930 One thing at a time... let's get 1.4 building.
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@112709 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-04-04 00:48:01 +00:00
Dwayne M. Hubbard
0f7c06dc26 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/branches/1.4@112689 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-04-03 23:57:44 +00:00
Joshua Colp
be84adc952 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/branches/1.4@110628 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-03-25 14:37:35 +00:00
Tilghman Lesher
56e908b787 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/branches/1.4@106552 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-03-07 06:36:33 +00:00
Russell Bryant
547ac9f501 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/branches/1.4@105563 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-03-03 15:50:43 +00:00
Joshua Colp
ba72af8c11 Backport fix from issue #9325.
(closes issue #11980)
Reported by: rbrunka


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@103768 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-02-18 16:11:51 +00:00
Jason Parker
335e583040 revert accidental change from last commit. oops
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@103504 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-02-12 22:24:03 +00:00
Jason Parker
3bc94a27ca Remove condition that was impossible.
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@103503 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-02-12 22:22:54 +00:00
Tilghman Lesher
0dafcac660 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/branches/1.4@102323 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-02-04 21:06:09 +00:00
Russell Bryant
8f27d3ce7c Update main Asterisk copyright info to 2008
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@100164 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-01-24 17:22:09 +00:00
Russell Bryant
45f3890926 Backport the ability to set the ToS bits on Linux when not running as root.
Normally, we would not backport features into 1.4, but, I was convinced by the
justification supplied by the supplier of this patch.  He pointed out that this
patch removes a requirement for running as root, thus reducing the potential
impacts of security issues.

(closes issue #11742)
Reported by: paravoid
Patches:
      libcap.diff uploaded by paravoid (license 200)


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@98265 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-01-11 18:25:30 +00:00
Tilghman Lesher
1b289c2998 Apply multiple crash fixes, found in issue #11386, but not completely
closing that issue.


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@97077 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-01-08 18:02:13 +00:00
Tilghman Lesher
2f24e1b1bf Fix for restart-as-user problem reported via the -dev list
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@94418 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-12-21 15:07:42 +00:00
Tilghman Lesher
d2c10c49fa When runuser/rungroup is specified, a remote console could only be attained by root
(Closes issue #9999)


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@86066 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-10-17 15:23:51 +00:00
Russell Bryant
39f5611898 Make sure remote consoles unmute themselves again after reconnecting.
(closes issue #10847)
Reported by: atis
Patches: 
      console_unmute_on_reconnect.patch uploaded by atis (license 242)


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@85545 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-10-15 13:05:45 +00:00
Russell Bryant
bad30446a6 Fix an issue with console verbosity when running asterisk -rx to execute a command
and retrieve its output.  The issue was that there was no way for the main Asterisk
process to know that the remote console was connecting in the -rx mode.  The way that
James has fixed this is to have all remote consoles muted by default.  Then, regular
remote consoles automatically execute a CLI command to unmute themselves when they
first start up.

(closes issue #10847)
Reported by: atis
Patches: 
      asterisk-consolemute.diff.txt uploaded by jamesgolovich (license 176)


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@85533 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-10-13 05:48:10 +00:00
Russell Bryant
6c18b111b9 Properly handle the case where read() may return the text for more than one
CLI command at once for a remote console.

(closes issue #10888)
Reported by: jamesgolovich
Patches: 
      asterisk-climultiple.diff.txt uploaded by jamesgolovich (license 176)


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@85532 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-10-13 05:24:33 +00:00
Russell Bryant
578c1d0c8a When daemonizing, don't change working directory to "/". It makes it not be
able to do a core dump when not running as uid=root.
(closes issue #10766, xrg)


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@83348 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-09-20 21:16:48 +00:00
Russell Bryant
c8dd4e7430 Only compile in tracking astobj2 statistics if dev-mode is enabled. Also, when
dev mode is enabled, register the CLI command that can be used to run the astobj2
test and print out statistics.


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@82337 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-09-13 18:45:59 +00:00
Russell Bryant
ef740deceb Clean up the output of "asterisk -h". This tweaks the wording and wraps lines
at 80 characters.
(closes issue #10699, seanbright)


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@82280 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-09-12 15:16:49 +00:00
Russell Bryant
827ca97872 Fix a small memory leak. ast_unregister_atexit() did not free the entry it removed.
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@81997 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-09-08 18:41:32 +00:00
Brett Bryant
7c5fef5e74 Merged revisions 72373 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.2

........
r72373 | bbryant | 2007-06-27 18:22:13 -0500 (Wed, 27 Jun 2007) | 3 lines

Reinstating patch. This actually fixes the problem, however I was running a development branch without it and mistakenly thought it wasn't fixed. 
Fixes issue #10010, and #9654: 100% CPU usage caused by an asterisk console losing it's controlling terminal.

........


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@72383 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-06-27 23:29:14 +00:00
Brett Bryant
a241f406da Merged revisions 72333 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.2

........
r72333 | bbryant | 2007-06-27 17:58:53 -0500 (Wed, 27 Jun 2007) | 2 lines

Reverted changes for earlier revisions 72259 to 72261. Issue #9654, #10010

........


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@72335 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-06-27 23:03:01 +00:00
Brett Bryant
b2cc514f08 Merged revisions 72259 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.2

........
r72259 | bbryant | 2007-06-27 15:43:53 -0500 (Wed, 27 Jun 2007) | 4 lines

Fixes 100% load when controlling terminal disappears.

Issue #9654, #10010

........


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@72260 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-06-27 20:46:12 +00:00
Russell Bryant
b52d259c91 Merged revisions 71358 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.2

........
r71358 | russell | 2007-06-24 15:04:21 -0500 (Sun, 24 Jun 2007) | 2 lines

Revert the patch from issue 9654 due to an unexpected side effect

........


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@71362 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-06-24 20:06:31 +00:00
Brett Bryant
a835f994ec Merged revisions 71064 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.2

........
r71064 | bbryant | 2007-06-22 09:39:34 -0500 (Fri, 22 Jun 2007) | 10 lines

Fixed infinite loop when controlling terminal was lost
and return value of input function wasn't checked for
errors. This would cause 100% cpu to be taken up.

(closes issue #9654, issue #10010)
Reported by: mnicholson, and eserra

Idea for the patch from mnicholson, patched by me


........


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@71066 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-06-22 14:53:08 +00:00
Kevin P. Fleming
ae82d97c6d use ast_localtime() in every place localtime_r() was being used
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@69392 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-06-14 21:50:40 +00:00
Russell Bryant
d5fd0cff73 When shutting down "gracefully", go through and run the unload() callbacks for
all of the modules.  "stop now" is considered a non-graceful shutdown and will
not go through this process.
(issue #9804, reported by chrisost, patch by me)


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@67308 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-06-05 15:51:53 +00:00
Joshua Colp
5c35c59bb4 Merged revisions 62368 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.2

........
r62368 | file | 2007-04-30 11:34:07 -0300 (Mon, 30 Apr 2007) | 2 lines

Update copyright notice. It's now the year 2007!

........


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@62369 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-04-30 14:36:11 +00:00
Tilghman Lesher
a5872f439b Merged revisions 60849 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.2

........
r60849 | tilghman | 2007-04-08 21:49:06 -0500 (Sun, 08 Apr 2007) | 2 lines

Don't check for error when lowering priority (according to the manpage, it should never happen anyway).  It might could happen, though, if another thread messed with the priority, so safeguard against that (reported via -dev list).

........


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@60850 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-04-09 03:01:12 +00:00
Joshua Colp
693cdc775e Allow both of the show version files and core show file versions CLI commands to work. (issue #9135 reported by mvanbaak)
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@56783 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-02-26 16:36:08 +00:00
Russell Bryant
2020191f67 Merged revisions 56504 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.2

........
r56504 | russell | 2007-02-23 17:20:55 -0600 (Fri, 23 Feb 2007) | 8 lines

Fix up a couple more signal handlers to not do bad things that could cause
various undesirable results.  The other day, I made Asterisk deadlock by
hitting Control-C because of a bad signal handler.  Now, signal handlers
just set a flag and write to an alert pipe for the flag to be handled.  Then,
there is another thread that is monitoring for these flags.  If being run in
console mode, it is just the main thread.  If Asterisk is in the background,
a thread is created to do it.

........


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@56505 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-02-23 23:24:18 +00:00
Jason Parker
84d057c5a5 Clarify a restart message. It's silly, but the reporter had a very valid point.
Issue 9079


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@54886 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-02-16 17:25:21 +00:00
Joshua Colp
9e90d55a78 Add missing 'F' letter to getopt so it magically becomes a valid option. (issue #8960 reported by tzafrir)
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@53072 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-02-01 19:33:33 +00:00
Russell Bryant
083a9198ea Merged revisions 52903 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.2

........
r52903 | russell | 2007-01-30 11:12:04 -0600 (Tue, 30 Jan 2007) | 9 lines

The SIGHUP handler was implemented to allow admins to send SIGHUP to a running
Asterisk process to reload the configuration.  However, doing the actual reload
in the signal handler itself is a very bad thing to do, because the reload
process includes calling non-reentrant functions such as malloc/calloc/etc.
If Asterisk is running in the background, then the reload will happen
immediately.  However, if running in console mode, the reload doesn't work
until something is typed at the console.  That sort of defeats the purpose,
but I don't see an easy way to get around it at this point.

........


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@52904 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-01-30 17:19:39 +00:00
Russell Bryant
879a71e921 Merged revisions 51300 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.2

........
r51300 | russell | 2007-01-19 10:44:09 -0600 (Fri, 19 Jan 2007) | 4 lines

Fix a memory leak on command line tab completion.  The container for the
matches was freed, but the individual matches themselves were not.
(issue #8851, arkadia)

........


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@51302 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-01-19 16:56:17 +00:00
Jason Parker
9d49164921 re-add deprecated "show version" CLI command.
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@50921 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-01-15 18:23:21 +00:00
Kevin P. Fleming
46d91e71c5 add support for tracking thread-local-storage objects that exist via 'threadstorage' CLI commands
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@49553 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-01-04 22:51:01 +00:00
Kevin P. Fleming
a299485952 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/branches/1.4@49006 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2006-12-27 22:06:56 +00:00
Kevin P. Fleming
3307ae060a move extern declaration for this option to a header file where it belongs
provide an initial value for 'languageprefix' option, instead of relying on randomness to provide a useful value


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@48998 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2006-12-27 21:08:30 +00:00
Russell Bryant
9009cfcf79 revert the previous change, which actually modified the deprecated command,
"show profile".  Now, actually apply the change to "core show profile".


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@47370 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2006-11-09 16:14:23 +00:00
Russell Bryant
38be3e38e2 Fix argument parsing for the "core show profile" CLI command
(fixed by rizzo in his branch, team/rizzo/astobj2)


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@47369 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2006-11-09 16:04:38 +00:00
Russell Bryant
15ba13f1ec fix "core show version" to reflect the new number of arguments for this
CLI command (issue #8316, kshumard)


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@47352 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2006-11-09 06:31:37 +00:00
Russell Bryant
789234df2d Really fix the "core set debug" and "core set verbose" CLI commands.
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@47195 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2006-11-04 17:59:39 +00:00
Tilghman Lesher
e05a2752e8 Reverse change of "show" to "list" and make several other commands more consistent with "category verb arguments"
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@47051 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2006-11-02 23:00:20 +00:00
Olle Johansson
86c973f71f Issue #8246 - Doxygen fixes from kshumard.
An extra big thankyou is given to everyone that contributes to doxygen!

		THANK YOU!



git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@46433 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2006-10-30 16:27:34 +00:00
Russell Bryant
d7f9b5f912 We should always be using _exit() after a fork() or vfork() instead of exit().
This is because exit() does some extra cleanup which in some implementations
of vfork(), for example, can actually modify the state of the parent process,
causing very weird bugs or crashes.  (issue #7971, Nick Gavrikov)


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@46363 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2006-10-27 17:39:31 +00:00