Commit Graph

527 Commits

Author SHA1 Message Date
Richard Mudgett 7c0b94a3e5 Remove init_framer(). It no longer does anything.
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@377246 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-12-05 02:23:10 +00:00
Richard Mudgett 83c5fac6b1 Cleanup ast_run_atexits() atexits list.
* Convert atexits list to a mutex instead of a rd/wr lock.  The lock is
only write locked.

* Move CLI verbose Asterisk ending message to where AMI message is output
in really_quit() to avoid further surprises about using stuff already
shutdown.

(issue ASTERISK-20649)
Reported by: Corey Farrell
........

Merged revisions 377165 from http://svn.asterisk.org/svn/asterisk/branches/1.8
........

Merged revisions 377166 from http://svn.asterisk.org/svn/asterisk/branches/10
........

Merged revisions 377167 from http://svn.asterisk.org/svn/asterisk/branches/11


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@377168 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-12-03 23:00:08 +00:00
Richard Mudgett 77561124b0 Cleanup core main on exit.
* Cleanup time zones on exit.

* Make exit clean/unclean report consistent for AMI and CLI in
really_quit().

(issue ASTERISK-20649)
Reported by: Corey Farrell
Patches:
      core-cleanup-1_8-10.patch (license #5909) patch uploaded by Corey Farrell
      core-cleanup-11-trunk.patch (license #5909) patch uploaded by Corey Farrell
      Modified
........

Merged revisions 377135 from http://svn.asterisk.org/svn/asterisk/branches/1.8
........

Merged revisions 377136 from http://svn.asterisk.org/svn/asterisk/branches/10
........

Merged revisions 377137 from http://svn.asterisk.org/svn/asterisk/branches/11


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@377138 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-12-03 20:46:11 +00:00
Richard Mudgett 2686dde98b Add MALLOC_DEBUG atexit unreleased malloc memory summary.
* Adds the following CLI commands to control MALLOC_DEBUG reporting of
unreleased malloc memory when Asterisk is shut down.
memory atexit list on
memory atexit list off
memory atexit summary byline
memory atexit summary byfunc
memory atexit summary byfile
memory atexit summary off

* Made check all remaining allocated region blocks atexit for fence
violations.

* Increased the allocated region hash table size by about three times.  It
still isn't large enough considering the number of malloced blocks
Asterisk uses.

* Made CLI "memory show allocations anomalies" use
regions_check_all_fences().

Review: https://reviewboard.asterisk.org/r/2196/
........

Merged revisions 376788 from http://svn.asterisk.org/svn/asterisk/branches/1.8
........

Merged revisions 376789 from http://svn.asterisk.org/svn/asterisk/branches/10
........

Merged revisions 376790 from http://svn.asterisk.org/svn/asterisk/branches/11


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@376791 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-11-29 00:48:12 +00:00
Matthew Jordan 530ce21b5d Reorder startup sequence to prevent lockups when process is sent to background
Although it is very rare and timing dependent, the potential exists for the
call to 'daemon' to cause what appears to be a deadlock in Asterisk during
startup.  This can occur when a recursive mutex is obtained prior to the
daemon call executing.  Since daemon uses fork to send the process into the
background, any threading primitives are unsafe to re-use after the call.
Implementations of pthread recursive mutexes are highly likely to store the
thread identifier of the thread that previously obtained the mutex.  If
the mutex was locked prior to the fork, a subsequent unlock operation will
potentially fail as the thread identifier is no longer valid.  Since the
mutex is still locked, all subsequent attempts to grab the mutex by other
threads will block.

This behavior exhibited itself most often when DEBUG_THREADS was enabled, as
this compile time option surrounds the mutexes in Asterisk with another
recursive mutex that protects the storage of thread related information.  This
made it much more likely that a recursive mutex would be obtained prior to
daemon and unlocked after the call.

This patch does the following:
a) It backports a patch from Asterisk 11 that prevents the spawning of the
   localtime monitoring thread.  This thread is now spawned after Asterisk has
   fully booted.
b) It re-orders the startup sequence to call daemon earlier during Asterisk
   startup.  This limits the potential of threading primitives being accessed
   by initialization calls before daemon is called.
c) It removes calls to ast_verbose/ast_log/etc. prior to daemon being called.
   Developers should send error messages directly to stderr prior to daemon,
   as calls to ast_log may access recursive mutexes that store thread related
   information.
d) It reorganizes when thread local storage is created for storing lock
   information during the creation of threads.  Prior to this patch, the
   read/write lock protecting the list of threads in ast_register_thread would
   utilize the lock in the thread local storage prior to it being initialized;
   this patch prevents that.

On a very related note, this patch will *greatly* improve the stability of the
Asterisk Test Suite.

Review: https://reviewboard.asterisk.org/r/2197

(closes issue ASTERISK-19463)
Reported by: mjordan
Tested by: mjordan
........

Merged revisions 376428 from http://svn.asterisk.org/svn/asterisk/branches/1.8
........

Merged revisions 376431 from http://svn.asterisk.org/svn/asterisk/branches/10
........

Merged revisions 376441 from http://svn.asterisk.org/svn/asterisk/branches/11


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@376447 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-11-18 20:27:45 +00:00
Richard Mudgett 3a9640b605 Add MALLOC_DEBUG enhancements.
* Makes malloc() behave like calloc().  It will return a memory block
filled with 0x55.  A nonzero value.

* Makes free() fill the released memory block and boundary fence's with
0xdeaddead.  Any pointer use after free is going to have a pointer
pointing to 0xdeaddead.  The 0xdeaddead pointer is usually an invalid
memory address so a crash is expected.

* Puts the freed memory block into a circular array so it is not reused
immediately.

* When the circular array rotates out a memory block to the heap it checks
that the memory has not been altered from 0xdeaddead.

* Made the astmm_log message wording better.

* Made crash if the DO_CRASH menuselect option is enabled and something is
found.

* Fixed a potential alignment issue on 64 bit systems.
struct ast_region.data[] should now be aligned correctly for all
platforms.

* Extracted region_check_fences() from __ast_free_region() and
handle_memory_show().

* Updated handle_memory_show() CLI usage help.

Review: https://reviewboard.asterisk.org/r/2182/
........

Merged revisions 376029 from http://svn.asterisk.org/svn/asterisk/branches/1.8
........

Merged revisions 376030 from http://svn.asterisk.org/svn/asterisk/branches/10
........

Merged revisions 376048 from http://svn.asterisk.org/svn/asterisk/branches/11


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@376049 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-11-08 17:38:31 +00:00
Andrew Latham 6c20cf2d8a Doxygen Updates - Title update
Update and extend the configuration_file group and enable linking. Commit other cleanups from multi-version Doxygen testing.  Update title that was left behind many years ago.

(issue ASTERISK-20259)


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@375182 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-10-18 14:17:40 +00:00
Matthew Jordan bfe35ee0b0 Ensure Shutdown AMI event is still fired during Asterisk shutdown
Richard pointed out that having the manager dispose of itself gracefully
during shutdown meant that the Shutdown event will no longer get fired.
This patch moves the AMI event just prior to running the atexit callbacks.
........

Merged revisions 374230 from http://svn.asterisk.org/svn/asterisk/branches/1.8
........

Merged revisions 374231 from http://svn.asterisk.org/svn/asterisk/branches/10
........

Merged revisions 374248 from http://svn.asterisk.org/svn/asterisk/branches/11


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@374259 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-10-02 21:26:27 +00:00
Matthew Jordan a094707d51 Fix a variety of ref counting issues
This patch resolves a number of ref leaks that occur primarily on Asterisk
shutdown.  It adds a variety of shutdown routines to core portions of
Asterisk such that they can reclaim resources allocate duringd initialization.

Review: https://reviewboard.asterisk.org/r/2137
........

Merged revisions 374177 from http://svn.asterisk.org/svn/asterisk/branches/1.8
........

Merged revisions 374178 from http://svn.asterisk.org/svn/asterisk/branches/10
........

Merged revisions 374196 from http://svn.asterisk.org/svn/asterisk/branches/11


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@374197 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-10-02 01:47:16 +00:00
Andrew Latham 4e228fce03 Doxygen Cleanup
Start adding configuration file linking and pages.  Add module loading doxygen block.

Breaking up commits to keep it easy to track

(issue ASTERISK-20259)


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@374167 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-10-01 23:39:45 +00:00
Andrew Latham fd98835f1f Doxygen Updates Janitor Work
* Whitespace, doc-blocks, spelling, case, missing and incorrect tags.
* Add cleanup to Makefile for the Doxygen configuration update
* Start updating Doxygen configuration for cleaner output
* Enable inclusion of configuration files into documentation
* remove mantisworkflow...
* update documentation README
* Add markup to Tilghman's email and talk with him about updating his email, he knows...
* no code changes on this commit other than the mentioned Makefile change

(issue ASTERISK-20259)


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@373384 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-09-22 20:43:30 +00:00
Andrew Latham 6f61cb50c5 Doxygen Updates - janitor work
Doxygen updates including mistakes, misspellings, missing parameters, updates for Doxygen style.  Some missing txt file links are removed but their content or essense will be included in some later updates.  A majority of the txt files were removed in the 1.6 era but never noted. The HR and EXTREF are simple changes that make the documentation more compatable with more versions of Doxygen.

Further updates coming.

(issue ASTERISK-20259)


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@373330 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-09-21 17:14:59 +00:00
Mark Michelson 8963829390 Fix inability to shutdown gracefully due to an unending channel reference.
message.c makes use of a special message queue channel that exists
in thread storage. This channel never goes away due to the fact that
the taskprocessor used by message.c does not get shut down, meaning
that it never ends the thread that stores the channel.

This patch fixes the problem by shutting down the taskprocessor when
Asterisk is shut down. In addition, the thread storage has a destructor
that will release the channel reference when the taskprocessor is destroyed.

(closes issue AST-937)
Reported by Jason Parker
Patches:
	AST-937.patch uploaded by Mark Michelson (License #5049)
Tested by Jason Parker
........

Merged revisions 372885 from http://svn.asterisk.org/svn/asterisk/branches/10
........

Merged revisions 372888 from http://svn.asterisk.org/svn/asterisk/branches/11


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@372891 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-09-11 21:17:53 +00:00
Kinsey Moore 9b16c8b0f6 Clean up and ensure proper usage of alloca()
This replaces all calls to alloca() with ast_alloca() which calls gcc's
__builtin_alloca() to avoid BSD semantics and removes all NULL checks
on memory allocated via ast_alloca() and ast_strdupa().

(closes issue ASTERISK-20125)
Review: https://reviewboard.asterisk.org/r/2032/
Patch-by: Walter Doekes (wdoekes)
........

Merged revisions 370642 from http://svn.asterisk.org/svn/asterisk/branches/1.8
........

Merged revisions 370643 from http://svn.asterisk.org/svn/asterisk/branches/10


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@370655 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-07-31 20:21:43 +00:00
Kevin P. Fleming 7d4ccea736 Enable usage of system-provided NetBSD editline library if available.
This patch changes the Asterisk configure script and build system to detect
the presence of the NetBSD editline library (libedit) on the system. If it is
found, it will be used in preference to the version included in the Asterisk
source tree.

(closes issue ASTERISK-18725)
Reported by: Jeffrey C. Ollie
Review: https://reviewboard.asterisk.org/r/1528/
Patches:
  0001-Allow-linking-building-against-an-external-editline.patch uploaded by jcollie (license #5373) (heavily modified by kpfleming)



git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@370481 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-07-25 12:21:54 +00:00
Jonathan Rose 10afdf3a2a Named ACLs: Introduces a system for creating and sharing ACLs
This patch adds Named ACL functionality to Asterisk. This allows system
administrators to define an ACL and refer to it by a unique name. Configurable
items can then refer to that name when specifying access control lists.
It also includes updates to all core supported consumers of ACLs. That includes
manager, chan_sip, and chan_iax2. This feature is based on the deluxepine-trunk
by Olle E. Johansson and provides a subset of the Named ACL functionality
implemented in that branch. For more information on this feature, see acl.conf
and/or the Asterisk wiki.

Review: https://reviewboard.asterisk.org/r/1978/


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@369959 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-07-11 18:33:36 +00:00
Matthew Jordan 9bc2127d7b Fix validation errors when producing documentation using default build script
The awk script parses out the first instance of the DOCUMENTATION tag that it
finds within a file.  If a file did not previously have a DOCUMENTATION tag
but received one due to it having an AMI event, then the XML fragment
associated with the AMI event was erroneously placed in the resulting XML
file.  Without the python scripts, these XML fragments will not validate.

This patch adds DOCUMENTATION tags at the top of those files that did
not previously have them to prevent the awk script from pulling AMI event
documentation.



git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@369910 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-07-11 02:06:05 +00:00
Matthew Jordan 2ffae5745d Add some additional documentation for core AMI events
This patch adds some basic documentation for a number of modules.  This
includes core source files in Asterisk (those in main), as well as
chan_agent, chan_dahdi, chan_local, sig_analog, and sig_pri.  The DTD
has also been updated to allow referencing of AMI commands.

git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@369905 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-07-10 22:26:27 +00:00
Kevin P. Fleming 166b4e2b30 Multiple revisions 369001-369002
........
  r369001 | kpfleming | 2012-06-15 10:56:08 -0500 (Fri, 15 Jun 2012) | 11 lines
  
  Add support-level indications to many more source files.
  
  Since we now have tools that scan through the source tree looking for files
  with specific support levels, we need to ensure that every file that is
  a component of a 'core' or 'extended' module (or the main Asterisk binary)
  is explicitly marked with its support level. This patch adds support-level
  indications to many more source files in tree, but avoids adding them to
  third-party libraries that are included in the tree and to source files
  that don't end up involved in Asterisk itself.
........
  r369002 | kpfleming | 2012-06-15 10:57:14 -0500 (Fri, 15 Jun 2012) | 3 lines
  
  Add a script to enable finding source files without support-levels defined.
........

Merged revisions 369001-369002 from http://svn.asterisk.org/svn/asterisk/branches/1.8
........

Merged revisions 369005 from http://svn.asterisk.org/svn/asterisk/branches/10


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@369013 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-06-15 16:20:16 +00:00
Mark Michelson 14a985560e Merge changes dealing with support for Digium phones.
Presence support has been added. This is accomplished by
allowing for presence hints in addition to device state
hints. A dialplan function called PRESENCE_STATE has been
added to allow for setting and reading presence. Presence
can be transmitted to Digium phones using custom XML
elements in a PIDF presence document.

Voicemail has new APIs that allow for moving, removing,
forwarding, and playing messages. Messages have had a new
unique message ID added to them so that the APIs will work
reliably. The state of a voicemail mailbox can be obtained
using an API that allows one to get a snapshot of the mailbox.
A voicemail Dialplan App called VoiceMailPlayMsg has been
added to be able to play back a specific message.

Configuration hooks have been added. Configuration hooks
allow for a piece of code to be executed when a specific
configuration file is loaded by a specific module. This is
useful for modules that are dependent on the configuration
of other modules.

chan_sip now has a public method that allows for a custom
SIP INFO request to be sent mid-dialog. Digium phones use
this in order to display progress bars when files are played.

Messaging support has been expanded a bit. The main
visible difference is the addition of an AMI action
MessageSend.

Finally, a ParkingLots manager action has been added in order
to get a list of parking lots.



git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@368435 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-06-04 20:26:12 +00:00
Terry Wilson c7f2d02ef1 Fix race condition for CEL LINKEDID_END event
This patch fixes to situations that could cause the CEL LINKEDID_END event to
be missed.

1) During a core stop gracefully, modules are unloaded when ast_active_channels
== 0. The LINKDEDID_END event fires during the channel destructor. This means
that occasionally, the cel_* module will be unloaded before the channel is
destroyed. It seemed generally useful to wait until the refcount of all
channels == 0 before unloading, so I added a channel counter and used it in the
shutdown code.

2) During a masquerade, ast_channel_change_linkedid is called. It calls
ast_cel_check_retire_linkedid which unrefs the linkedid in the linkedids
container in cel.c. It didn't ref the new linkedid. Now it does. 

Review: https://reviewboard.asterisk.org/r/1900/
........

Merged revisions 367292 from http://svn.asterisk.org/svn/asterisk/branches/1.8
........

Merged revisions 367299 from http://svn.asterisk.org/svn/asterisk/branches/10


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@367309 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-05-22 17:29:12 +00:00
Jonathan Rose 8227f70cd7 Coverity Report: Fix issues for error type CHECKED_RETURN for core
(issue ASTERISK-19658)
Reported by: Matt Jordan
Review: https://reviewboard.asterisk.org/r/1905/
........

Merged revisions 366094 from http://svn.asterisk.org/svn/asterisk/branches/1.8
........

Merged revisions 366106 from http://svn.asterisk.org/svn/asterisk/branches/10


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@366126 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-05-10 18:35:14 +00:00
Terry Wilson 49a49a51ef Add more constness to the end_buf pointer in the netconsole
issue ASTERISK-18308
Review: https://reviewboard.asterisk.org/r/1876/
........

Merged revisions 364046 from http://svn.asterisk.org/svn/asterisk/branches/1.8
........

Merged revisions 364047 from http://svn.asterisk.org/svn/asterisk/branches/10


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@364048 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-04-26 19:33:49 +00:00
Olle Johansson 7aa0c3c64b Make it possible to change the minimum DTMF duration in asterisk.conf
Asterisk has a setting for the minimum allowed DTMF. If we get shorter
DTMF tones, these will be changed to the minimum on the outbound call
leg. 

(closes issue ASTERISK-19772)

Review: https://reviewboard.asterisk.org/r/1882/
Reported by: oej
Tested by: oej
Patches by: oej

Thanks to the reviewers.

1.8 branch for this patch: agave-dtmf-duration-asterisk-conf-1.8



git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@363558 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-04-25 09:32:21 +00:00
Terry Wilson 18045c9a07 OpenBSD doesn't have rawmemchr, use strchr
(closes issue ASTERISK-19758)
Reported by: Barry Miller
Tested by: Terry Wilson
Patches: 
  362758-diff uploaded by Barry Miller (license 5434)
........

Merged revisions 362868 from http://svn.asterisk.org/svn/asterisk/branches/1.8
........

Merged revisions 362869 from http://svn.asterisk.org/svn/asterisk/branches/10


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@363335 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-04-24 17:52:26 +00:00
Terry Wilson 772ad8a641 Handle multiple commands per connection via netconsole
Asterisk would accept multiple NULL-delimited CLI commands via the
netconsole socket, but would occasionally miss a command due to the
command not being completely read into the buffer. This patch ensures
that any partial commands get moved to the front of the read buffer,
appended to, and properly sent.

(closes issue ASTERISK-18308)
Review: https://reviewboard.asterisk.org/r/1876/
........

Merged revisions 362536 from http://svn.asterisk.org/svn/asterisk/branches/1.8
........

Merged revisions 362537 from http://svn.asterisk.org/svn/asterisk/branches/10


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@362538 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-04-19 14:35:56 +00:00
Matthew Jordan f78290068a Fix a variety of potential buffer overflows
* chan_mobile: Fixed an overrun where the cind_state buffer (an integer array
  of size 16) would be overrun due to improper bounds checking. At worst, the
  buffer can be overrun by a total of 48 bytes (assuming 4-byte integers),
  which would still leave it within the allocated memory of struct hfp.  This
  would corrupt other elements in that struct but not necessarily cause any
  further issues.

* app_sms: The array imsg is of size 250, while the array (ud) that the data
  is copied into is of size 160.  If the size of the inbound message is 
  greater then 160, up to 90 bytes could be overrun in ud.  This would corrupt
  the user data header (array udh) adjacent to ud.

* chan_unistim: A number of invalid memmoves are corrected.  These would move
  data (which may or may not be valid) into the ends of these buffers.

* asterisk: ast_console_toggle_loglevel does not check that the console log
  level being set is less then or equal to the allowed log levels of 32.

* format_pref: In ast_codec_pref_prepend, if any occurrence of the specified
  codec is not found, the value used to index into the array pref->order
  would be one greater then the maximum size of the array.

* jitterbuf: If the element being placed into the jitter buffer lands in the
  last available slot in the jitter history buffer, the insertion sort attempts
  to move the last entry in the buffer into one slot past the maximum length
  of the buffer.  Note that this occurred for both the min and max jitter
  history buffers.

* tdd: If a read from fsk_serial returns a character that is greater then 32,
  an attempt to read past one of the statically defined arrays containing the
  values that character maps to would occur.

* localtime: struct ast_time and tm are not the same size - ast_time is larger,
  although it contains the elements of tm within it in the same layout.  Hence,
  when using memcpy to copy the contents of tm into ast_time, the size of tm
  should be used, as opposed to the size of ast_time.

* extconf: this treats ast_timing's minmask array as if it had a length of 48,
  when it has defined the size of the array as 24.  pbx.h defines minmask as
  having a size of 48.

(issue ASTERISK-19668)
Reported by: Matt Jordan
........

Merged revisions 362485 from http://svn.asterisk.org/svn/asterisk/branches/1.8
........

Merged revisions 362496 from http://svn.asterisk.org/svn/asterisk/branches/10



git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@362497 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-04-19 02:40:55 +00:00
Matthew Jordan 3934b0478d Fix places in main where a negative return value could impact execution
This patch addresses a number of modules in main that did not handle the
negative return value from function calls adequately, or were not sufficiently
clear that the conditions leading to improper handling of the return values
could not occur.  This includes:

* asterisk.c: A negative return value from the read function would be used
directly as an index into a buffer.  We now check for success of the read
function prior to using its result as an index.

* manager.c: Check for failures in mkstemp and lseek when handling the
temporary file created for processing data returned from a CLI command in
action_command.  Also check that the result of an lseek is sanitized prior
to using it as the size of a memory map to allocate.

(issue ASTERISK-19655)
Reported by: Matt Jordan

Review: https://reviewboard.asterisk.org/r/1863/
........

Merged revisions 362359 from http://svn.asterisk.org/svn/asterisk/branches/1.8
........

Merged revisions 362360 from http://svn.asterisk.org/svn/asterisk/branches/10


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@362361 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-04-17 21:08:05 +00:00
Walter Doekes fc63e07135 Avoid cppcheck warnings; removing unused vars and a bit of cleanup.
Patch by: junky
Review: https://reviewboard.asterisk.org/r/1743/


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@362307 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-04-17 18:57:40 +00:00
Richard Mudgett a35c7ba8e7 Add option to invoke the extensions.conf stdexten using the legacy macro method.
ASTERISK-18809 eliminated the legacy macro invocation of the stdexten in
favor of the Gosub method without a means of backwards compatibility.

(issue ASTERISK-18809)
(closes issue ASTERISK-19457)
Reported by: Matt Jordan
Tested by: rmudgett

Review: https://reviewboard.asterisk.org/r/1855/


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@361998 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-04-12 16:29:52 +00:00
Kinsey Moore c5b3db1956 Kill off red blobs in most of main/*
Everything still compiled after making these changes, so I assume these
whitespace-only changes didn't break anything (and shouldn't have).


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@360190 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-03-22 19:51:16 +00:00
Tilghman Lesher a93fbe2ad5 Non-verbose output should always go to the remote console, regardless of the previous level.
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@355749 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-02-17 19:56:58 +00:00
Tilghman Lesher a78b0af5ea Re-commit the verbose branch.
This change permits each verbose destination (consoles, logger) to have its
own concept of what the verbosity level is.  The big feature here is that
the logger will now be able to capture a particular verbosity level without
condemning each console to need to suffer that level of verbosity.
Additionally, a stray 'core set verbose' will no longer change what will go
to the log.

Review:  https://reviewboard.asterisk.org/r/1599/


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@355413 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-02-14 20:27:16 +00:00
Walter Doekes ef0de1358d Allow only one thread at a time to do asterisk cleanup/shutdown.
Add locking around the really-really-quit part of the core stop/restart
part. Previously more than one thread could be called to do cleanup,
causing atexit handlers to be run multiple times, in turn causing
segfaults.

(issue ASTERISK-18883)
Reviewed by: Terry Wilson
Review: https://reviewboard.asterisk.org/r/1662/
Review: https://reviewboard.asterisk.org/r/1658/
........

Merged revisions 350888 from http://svn.asterisk.org/svn/asterisk/branches/1.8
........

Merged revisions 350889 from http://svn.asterisk.org/svn/asterisk/branches/10


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@350890 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-01-15 20:16:08 +00:00
Kinsey Moore 76888b5990 Make sure asterisk builds on OpenBSD
OpenBSD defines SO_PEERCRED, but it returns a 'struct sockpeercred', not
'struct ucred', which causes compilation of main/asterisk.c to fail in
read_credentials().  This allows configure to check for sockpeercred and
asterisk to deal with it properly.

(closes issue ASTERISK-18929)
Reported-by: Barry Miller
Patch-by: Barry Miller
........

Merged revisions 350730 from http://svn.asterisk.org/svn/asterisk/branches/1.8
........

Merged revisions 350731 from http://svn.asterisk.org/svn/asterisk/branches/10


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@350732 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-01-13 21:42:12 +00:00
Richard Mudgett 70b246f338 Make Asterisk -x command line parameter imply -r parameter presence.
The Asterisk -x command line parameter is documented inconsistently.

* Made the -x documentation and behavior consistent.

* Since this is also a new year, updated the copyright notices while here.

(closes issue ASTERISK-19094)
Reported by: Eugene
Patches:
      issueA19094_correct_asterisk_option_x.patch (license #5674) patch uploaded by Walter Doekes (modified)
Tested by: Eugene
........

Merged revisions 350075 from http://svn.asterisk.org/svn/asterisk/branches/1.8
........

Merged revisions 350076 from http://svn.asterisk.org/svn/asterisk/branches/10


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@350077 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-01-09 17:06:30 +00:00
Jonathan Rose ebf40f1129 Ensures Asterisk closes when receiving terminal signals in 'no fork' mode.
When catching a signal, in no fork mode the console thread is identical to the thread
responsible for catching the signal and closing Asterisk, which requires it to first
dispense with the console thread. Prior to this patch, if these threads were identical,
upon receiving a killing signal, the thread will send an URG signal to itself, which
we also catch and then promptly do nothing with. Obviously this isn't useful behavior.

(closes issue ASTERISK-19127)
Reported By: Bryon Clark
Patches:
	quit_on_signals.patch uploaded by Bryon Clark (license 6157)
........

Merged revisions 349672 from http://svn.asterisk.org/svn/asterisk/branches/1.8
........

Merged revisions 349673 from http://svn.asterisk.org/svn/asterisk/branches/10


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@349674 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-01-05 16:16:51 +00:00
Matthew Jordan 9057aa20b6 Backed out core changes from r346391
During testing, it was discovered that there were a number of side effects
introduced by r346391 and subsequent check-ins related to it (r346429,
r346617, and r346655).  This included the /main/stdtime/ test 'hanging',
as well as the remote console option failing to receive the appropriate output
after a period of time.

I only backed out the changes to main/ and utils/, as this was adequate
to reverse the behavior experienced.

(issue ASTERISK-18974)

git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@347997 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2011-12-12 19:35:08 +00:00
Terry Wilson 980ab2d018 Add ASTSBINDIR to the list of configurable paths
This patch also makes astdb2sqlite3 and astcanary use the configured
directory instead of relying on $PATH.

(closes issue ASTERISK-18959)
Review: https://reviewboard.asterisk.org/r/1613/
........

Merged revisions 347344 from http://svn.asterisk.org/svn/asterisk/branches/10


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@347345 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2011-12-07 20:15:29 +00:00
Tilghman Lesher 3106f64eac Fix edge case for overflow buffer.
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@346617 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2011-11-30 22:40:23 +00:00
Tilghman Lesher 77b670c4ab Allow each logging destination and console to have its own notion of the verbosity level.
Review: https://reviewboard.asterisk.org/r/1599


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@346391 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2011-11-29 18:43:16 +00:00
Tzafrir Cohen 57a8b5a781 do parse defaultlanguage from asterisk.conf
Do parse the option "defaultlanguage" from the [options] section of
asterisk.conf, as in the sample config file. Otherwise the build-time
default language (normally "en") is always the default one.

Review: https://reviewboard.asterisk.org/r/1342/
Signed-off-by: Tzafrir Cohen (License #5035) <tzafrir.cohen@xorcom.com>
Original-Commit: http://svn.digium.com/svn/asterisk/branches/1.8@335716
Original-Commit: http://svn.digium.com/svn/asterisk/branches/10@335717

git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@335718 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2011-09-13 21:40:56 +00:00
Richard Mudgett 3ad6dccac8 Merged revisions 332101 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/10

................
  r332101 | rmudgett | 2011-08-16 12:17:28 -0500 (Tue, 16 Aug 2011) | 140 lines
  
  Merged revisions 332100 via svnmerge from 
  https://origsvn.digium.com/svn/asterisk/branches/1.8
  
  ........
    r332100 | rmudgett | 2011-08-16 11:31:36 -0500 (Tue, 16 Aug 2011) | 133 lines
    
    Fix multiple parking issues.
    
    JIRA ASTERISK-17183
    Multi-parkinglot directs calls to wrong parkinglot.
    JIRA ASTERISK-17870
    Cannot retrieve parked calls.
    JIRA ASTERISK-17430
    ParkedCall() with no extension should pickup first available call and does not.
    JIRA AST-576
    Issues with parking lots
    
    * Removed searching for parking lots by extension.  Parking lots can only
    be found by the parking lot name since parking lot access extensions and
    spaces are not guaranteed to be unique.
    
    * Added parking_lot_name option to the Park and ParkedCall applications.
    Updated documentation for Park and ParkedCall applications.
    
    * Add parkext_exclusive configuration option to make parking entry
    extensions specify which parking lot they access.
    
    (closes issue ASTERISK-17183)
    Reported by: David Cabrejos
    Tested by: rmudgett, David Cabrejos
    
    (closes issue ASTERISK-17870)
    Reported by: Remi Quezada
    
    (closes issue ASTERISK-17430)
    Reported by: Philippe Lindheimer
    
    
    JIRA ASTERISK-17452
    Parking_offset not used
    JIRA AST-624
    'next' setting for findslot does nothing
    
    * Reimplemented since findslot feature option broken by -r114655.
    
    (closes issue ASTERISK-17452)
    Reported by: David Woolley
    Tested by: rmudgett
    
    
    JIRA ASTERISK-15792
    Dialplan continues execution after transfer to park.
    
    This happens for DTMF attended transfer, DTMF blind transfer, and DTMF
    one-touch-parking if the party initiating these features also initiated
    the call.
    
    * Fixed the return code from the affected builtin features when parking a
    call.
    
    (closes issue ASTERISK-15792)
    Reported by: Mat Murdock
    Tested by: rmudgett, twilson
    
    
    JIRA AST-607
    The courtesytone is not playing to the expected call when picking up a
    parked call.
    
    This is mostly a documentation problem.  However, the option is not reset
    to the default when features.conf is reloaded.
    
    * Updated features.conf.sample documentation for courtesytone and
    parkedplay options.
    
    * Reset the parkedplay option to default when features.conf is reloaded.
    
    
    JIRA AST-615
    AMI Park action followed by features reload results in orphaned channels
    in parking lot.
    
    * Reloading features.conf will not touch parking lots that have calls
    still parked in them.  Reload again at a later time.
    
    
    Misc additional fixes:
    
    * Added unit test for parking lot dialplan usage checking.
    
    * Made update connected line when a parked call is retrieved from a
    parking lot.
    
    * Made retrieved parked call stop ringing or MOH depending upon how the
    call was waiting in the parking lot.
    
    * Made CLI "features show" indicate if the parking lot is enabled for use.
    
    * Added PARKINGDYNEXTEN channel variable to allow dynamic parking lots to
    specify the parking lot access extension.
    
    * Made AMI ParkedCalls action ParkedCall events have a Parkinglot header.
    
    * Made AMI ParkedCalls action ParkedCallsComplete event have a Total
    header.
    
    * Fixed potential deadlock from AMI Park action holding channel locks
    while calling masq_park_call().
    
    * Fixed several places where ast_strdupa() were used inside of loops.
    (Mostly fixed by refactoring the loop body into its own function.)
    
    * Fixed copy_parkinglot() copying too much from the source parking lot.
    Extracted the parking lot configuration settings into struct
    parkinglot_cfg.
    
    * Refactored courtesytone playing code to put the channel not playing the
    tone in autoservice.
    
    * Fix when pbx-parkingfailed is played that the other channel is put in
    autoservice if it exists.
    
    * Fixed parkinglot reference leak in parked_call_exec() error paths.
    
    * Fixed parkinglot_unref() use of parkinglot after it was unreffed.
    
    * Made destroy the struct ast_parkinglot parkings lock when done.
    
    * Refactored the features.conf parking lot configuration code to eliminate
    redundancy.
    
    * Fixed feature reload to better protect parking lots.
    
    * Fixed parking lot container reference leak in handle_parkedcalls().
    
    * Fixed the total count in handle_parkedcalls().
    
    Review: https://reviewboard.asterisk.org/r/1358/
  ........
................


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@332117 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2011-08-16 17:23:08 +00:00
Mark Murawki 23140a044e Merged revisions 328609 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.10

................
  r328609 | markm | 2011-07-18 08:37:53 -0400 (Mon, 18 Jul 2011) | 15 lines
  
  Merged revisions 328593 via svnmerge from 
  https://origsvn.digium.com/svn/asterisk/branches/1.8
  
  ........
    r328593 | markm | 2011-07-18 08:06:50 -0400 (Mon, 18 Jul 2011) | 8 lines
    
    Fixed invalid read and null pointer deref on asterisk shutdown.
    
    In some cases when starting asterisk with -c and hitting control-c to shutdown, there will be an invalid read and null pointer deref causing a crash.
    
    (closes issue ASTERISK-17927)
    Reported by: Mark Murawski
    Tested by: Mark Murawski, Kinsey Moore, Tilghman Lesher
  ........
................


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@328610 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2011-07-18 12:54:29 +00:00
Terry Wilson efd040cd11 Replace Berkeley DB with SQLite 3
There were some bugs in the very ancient version of Berkeley DB that Asterisk
used. Instead of spending the time tracking down the bugs in the Berkeley code
we move to the much better documented SQLite 3.

Conversion of the old astdb happens at runtime by running the included
astdb2sqlite3 utility. The ast_db API with SQLite 3 backend should behave
identically to the old Berkeley backend, but in the future we could offer a
much more robust interface.

We do not include the SQLite 3 library in the source tree, but instead rely
upon the distribution-provided libraries. SQLite is so ubiquitous that this
should not place undue burden on administrators.


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@326589 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2011-07-06 20:58:12 +00:00
Tilghman Lesher db15b0010c Merged revisions 324955 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.8

........
  r324955 | tilghman | 2011-06-27 11:30:50 -0500 (Mon, 27 Jun 2011) | 5 lines
  
  Save and restore errno from within signal handlers.
  
  This is recommended by the POSIX standard, as well as by the sigaction(2) manpage
  for various platforms that we support (e.g. Mac OS X).
........


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@324961 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2011-06-27 16:32:19 +00:00
Jonathan Rose 4ab3825fe4 Merged revisions 322069 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.8

........
  r322069 | jrose | 2011-06-06 14:07:56 -0500 (Mon, 06 Jun 2011) | 8 lines
  
  Fixes level toggling for logger set levels since it was reversed
   
  (closes issue ASTERISK-17850)
  Reported by: Luke H
  Tested by: jrose, Luke H
    
  Review: https://reviewboard.asterisk.org/r/1244/
........


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@322070 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2011-06-06 19:15:10 +00:00
Russell Bryant 3f4d0e8743 Support routing text messages outside of a call.
Asterisk now has protocol independent support for processing text messages
outside of a call.  Messages are routed through the Asterisk dialplan.
SIP MESSAGE and XMPP are currently supported.  There are options in sip.conf
and jabber.conf that enable these features.

There is a new application, MessageSend().  There are two new functions,
MESSAGE() and MESSAGE_DATA().  Documentation will be available on
the project wiki, wiki.asterisk.org.

Thanks to Terry Wilson for the assistance with development and to David Vossel
for helping with some additional testing.

Review: https://reviewboard.asterisk.org/r/1042/


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@321546 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2011-06-01 21:31:40 +00:00
Sean Bright d508a921bf Add some new editline bindings by default, and allow for user specified configuration.
I excluded the part of this patch that used the HOME environment variable since
the built-in editline library goes to great lengths to disallow that.  Instead
only settings the EDITRC environment variable will use a user specified file.

Also, the default environment variable use to determine the edit more is
AST_EDITMODE instead of AST_EDITOR (although the latter is still supported).

(closes issue #15929)
Reported by: kkm
Patches:
      astcli-editrc-v2.diff uploaded by kkm (license 888)
      015929-astcli-editrc-trunk.240324.diff uploaded by kkm (license 888)
Tested by: seanbright


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@317395 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2011-05-05 21:20:00 +00:00
Russell Bryant 37aa52fd78 Merged revisions 316265 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.8

........
  r316265 | russell | 2011-05-03 14:55:49 -0500 (Tue, 03 May 2011) | 5 lines
  
  Fix a bunch of compiler warnings generated by gcc 4.6.0.
  
  Most of these are -Wunused-but-set-variable, but there were a few others
  mixed in here, as well.
........


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@316293 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2011-05-03 20:45:32 +00:00
Russell Bryant 98f94daf88 Merged revisions 315810 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.8

........
  r315810 | russell | 2011-04-27 10:55:48 -0500 (Wed, 27 Apr 2011) | 2 lines
  
  Set the copyright year to 2011 in the startup message.
........


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@315811 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2011-04-27 15:56:44 +00:00
Tilghman Lesher 3731fd9ccc Merged revisions 312286,312288 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.8

................
  r312286 | tilghman | 2011-04-01 05:44:33 -0500 (Fri, 01 Apr 2011) | 2 lines
  
  Reload must react correctly against a possibly changed table, so dropping the conditional reload flag.
................
  r312288 | tilghman | 2011-04-01 05:58:45 -0500 (Fri, 01 Apr 2011) | 21 lines
  
  Merged revisions 312287 via svnmerge from 
  https://origsvn.digium.com/svn/asterisk/branches/1.6.2
  
  ................
    r312287 | tilghman | 2011-04-01 05:51:24 -0500 (Fri, 01 Apr 2011) | 14 lines
    
    Merged revisions 312285 via svnmerge from 
    https://origsvn.digium.com/svn/asterisk/branches/1.4
    
    ........
      r312285 | tilghman | 2011-04-01 05:36:42 -0500 (Fri, 01 Apr 2011) | 7 lines
      
      Found some leaking file descriptors while looking at ast_FD_SETSIZE dead code.
      
      (issue #18969)
       Reported by: oej
       Patches: 
             20110315__issue18969__14.diff.txt uploaded by tilghman (license 14)
    ........
  ................
................


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@312289 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2011-04-01 10:59:32 +00:00
Tilghman Lesher 798212c828 Merged revisions 309678 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.8

................
  r309678 | tilghman | 2011-03-05 04:29:30 -0600 (Sat, 05 Mar 2011) | 14 lines
  
  Merged revisions 309677 via svnmerge from 
  https://origsvn.digium.com/svn/asterisk/branches/1.6.2
  
  ........
    r309677 | tilghman | 2011-03-05 04:28:24 -0600 (Sat, 05 Mar 2011) | 7 lines
    
    Missed part of the conversion when we started passing ppid to astcanary.
    
    (closes issue #18850)
     Reported by: viraptor
     Patches: 
           canary_ppid.patch uploaded by viraptor (license 543)
  ........
................


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@309679 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2011-03-05 10:30:28 +00:00
David Vossel d760e81f37 Media Project Phase2: SILK 8khz-24khz, SLINEAR 8khz-192khz, SPEEX 32khz, hd audio ConfBridge, and other stuff
-Functional changes
1. Dynamic global format list build by codecs defined in codecs.conf
2. SILK 8khz, 12khz, 16khz, and 24khz with custom attributes defined in codecs.conf
3. Negotiation of SILK attributes in chan_sip.
4. SPEEX 32khz with translation
5. SLINEAR 8khz, 12khz, 24khz, 32khz, 44.1khz, 48khz, 96khz, 192khz with translation
   using codec_resample.c
6. Various changes to RTP code required to properly handle the dynamic format list
   and formats with attributes.
7. ConfBridge now dynamically jumps to the best possible sample rate.  This allows
   for conferences to take advantage of HD audio (Which sounds awesome)
8. Audiohooks are no longer limited to 8khz audio, and most effects have been
   updated to take advantage of this such as Volume, DENOISE, PITCH_SHIFT.
9. codec_resample now uses its own code rather than depending on libresample.

-Organizational changes
Global format list is moved from frame.c to format.c
Various format specific functions moved from frame.c to format.c

Review: https://reviewboard.asterisk.org/r/1104/


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@308582 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2011-02-22 23:04:49 +00:00
Jason Parker 96cbd4ffcd Merged revisions 307536 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.8

................
  r307536 | qwell | 2011-02-10 16:39:30 -0600 (Thu, 10 Feb 2011) | 22 lines
  
  Merged revisions 307535 via svnmerge from 
  https://origsvn.digium.com/svn/asterisk/branches/1.6.2
  
  ................
    r307535 | qwell | 2011-02-10 16:35:49 -0600 (Thu, 10 Feb 2011) | 15 lines
    
    Merged revisions 307534 via svnmerge from 
    https://origsvn.digium.com/svn/asterisk/branches/1.4
    
    ........
      r307534 | qwell | 2011-02-10 16:33:09 -0600 (Thu, 10 Feb 2011) | 8 lines
      
      Remove color when executing commands via a remote console.
      
      Essentially this makes '-x' imply '-n' on rasterisk.  This was done in a
      different and incomplete way previously, which I'm reverting here.
      
      (issue #18776)
      Reported by: alecdavis
    ........
  ................
................


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@307537 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2011-02-10 22:43:51 +00:00
David Vossel c26c190711 Asterisk media architecture conversion - no more format bitfields
This patch is the foundation of an entire new way of looking at media in Asterisk.
The code present in this patch is everything required to complete phase1 of my
Media Architecture proposal.  For more information about this project visit the link below.
https://wiki.asterisk.org/wiki/display/AST/Media+Architecture+Proposal

The primary function of this patch is to convert all the usages of format
bitfields in Asterisk to use the new format and format_cap APIs.  Functionally
no change in behavior should be present in this patch.  Thanks to twilson
and russell for all the time they spent reviewing these changes.

Review: https://reviewboard.asterisk.org/r/1083/



git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@306010 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2011-02-03 16:22:10 +00:00
Sean Bright 036bef072f Remove some trailing whitespace and steal revision 300000.
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@300000 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2010-12-29 22:19:26 +00:00
Jeff Peeler 78bd0de1a9 Add support for several platforms to obtain the real thread ID.
Already had the pthread ID which is not the same.  The most obvious enhancement
is in the "core show threads" output. As stated in the utils header, if the
platform isn't supported -1 is reported (instead of the process ID previously).


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@298137 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2010-12-12 03:58:33 +00:00
Stefan Schmidt 1482ba3057 move devices from hints into an ao2_container
by splitting up devices from hints into an own ao2_container the callback to
get these devices for statechange handling is faster.
with this changes the length of a device used in a hint isnt longer restricted
to 80 characters.

Tests showed that calling handle_statechange is 40 times faster if no hints
are used and 25 times faster if there are any hints.

(closes issue #17928)
Reported by: mdu113
Tested by: schmidts

Review: https://reviewboard.asterisk.org/r/1003/



git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@296752 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2010-11-30 09:49:25 +00:00
Tilghman Lesher 22cca55597 Merged revisions 296534 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.8

................
  r296534 | tilghman | 2010-11-29 01:28:44 -0600 (Mon, 29 Nov 2010) | 20 lines
  
  Merged revisions 296533 via svnmerge from 
  https://origsvn.digium.com/svn/asterisk/branches/1.6.2
  
  ........
    r296533 | tilghman | 2010-11-29 01:27:09 -0600 (Mon, 29 Nov 2010) | 13 lines
    
    I love standards.  There are so many to choose from.  Except when there isn't one.
    
    Linux and *BSD disagree on the elements within the ucred structure.  Detect
    which one is in use on the system.
    
    (closes issue #18384)
     Reported by: bjm
     Patches: 
           cred-diffs uploaded by bjm (license 473)
           20101127__issue18384__1.6.2.diff.txt uploaded by tilghman (license 14)
           20101127__issue18384__1.8.diff.txt uploaded by tilghman (license 14)
     Tested by: tilghman, bjm
  ........
................


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@296535 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2010-11-29 07:30:09 +00:00
Jeff Peeler 3d801ab964 Merged revisions 290864 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.8

................
  r290864 | jpeeler | 2010-10-07 21:56:24 -0500 (Thu, 07 Oct 2010) | 23 lines
  
  Merged revisions 290863 via svnmerge from 
  https://origsvn.digium.com/svn/asterisk/branches/1.6.2
  
  ................
    r290863 | jpeeler | 2010-10-07 21:45:44 -0500 (Thu, 07 Oct 2010) | 16 lines
    
    Merged revisions 290862 via svnmerge from 
    https://origsvn.digium.com/svn/asterisk/branches/1.4
    
    ........
      r290862 | jpeeler | 2010-10-07 21:35:29 -0500 (Thu, 07 Oct 2010) | 9 lines
      
      Ensure editline cleanup occurs when Ctrl-C is pressed at control console.
      
      A recent change was made to avoid a race condition on shutdown which only called
      the end functions from the console thread. However, when pressing Ctrl-C the
      quit handler is called from the signal handler thread.
      
      (closes issue #17698)
      Reported by: jmls
    ........
  ................
................


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@290865 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2010-10-08 03:00:40 +00:00
Russell Bryant cbabf4c6f7 Merged revisions 288341 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.8

................
  r288341 | russell | 2010-09-22 11:45:18 -0500 (Wed, 22 Sep 2010) | 25 lines
  
  Merged revisions 288340 via svnmerge from 
  https://origsvn.digium.com/svn/asterisk/branches/1.6.2
  
  ................
    r288340 | russell | 2010-09-22 11:44:13 -0500 (Wed, 22 Sep 2010) | 18 lines
    
    Merged revisions 288339 via svnmerge from 
    https://origsvn.digium.com/svn/asterisk/branches/1.4
    
    ........
      r288339 | russell | 2010-09-22 11:39:16 -0500 (Wed, 22 Sep 2010) | 11 lines
      
      Fix a 100% CPU consumption problem when setting console=yes in asterisk.conf.
      
      The handling of -c and console=yes should be the same, but they were not.
      When you specify -c, it sets both a flag for console module and for asterisk
      not to fork() off into the background.  The handling of console=yes only set
      console mode, so you would end up with a background process() trying to run
      the Asterisk console and freaking out since it didn't have anything to read
      input from.
      
      Thanks to beagles for reporting and helping debug the problem!
    ........
  ................
................


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@288342 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2010-09-22 16:46:20 +00:00
Tilghman Lesher a24ffd93e9 Merged revisions 287935 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.8

................
  r287935 | tilghman | 2010-09-21 14:08:36 -0500 (Tue, 21 Sep 2010) | 16 lines
  
  Merged revisions 287934 via svnmerge from 
  https://origsvn.digium.com/svn/asterisk/branches/1.6.2
  
  ................
    r287934 | tilghman | 2010-09-21 14:07:53 -0500 (Tue, 21 Sep 2010) | 9 lines
    
    Merged revisions 287933 via svnmerge from 
    https://origsvn.digium.com/svn/asterisk/branches/1.4
    
    ........
      r287933 | tilghman | 2010-09-21 14:07:07 -0500 (Tue, 21 Sep 2010) | 2 lines
      
      Less than zero is an error, not any non-zero value.
    ........
  ................
................


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@287936 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2010-09-21 19:09:15 +00:00
Tilghman Lesher 5eae9f44f7 Merged revisions 284597 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.8

................
  r284597 | tilghman | 2010-09-02 00:00:34 -0500 (Thu, 02 Sep 2010) | 29 lines
  
  Merged revisions 284593,284595 via svnmerge from 
  https://origsvn.digium.com/svn/asterisk/branches/1.6.2
  
  ................
    r284593 | tilghman | 2010-09-01 17:59:50 -0500 (Wed, 01 Sep 2010) | 18 lines
    
    Merged revisions 284478 via svnmerge from 
    https://origsvn.digium.com/svn/asterisk/branches/1.4
    
    ........
      r284478 | tilghman | 2010-09-01 13:49:11 -0500 (Wed, 01 Sep 2010) | 11 lines
      
      Ensure that all areas that previously used select(2) now use poll(2), with implementations that need poll(2) implemented with select(2) safe against 1024-bit overflows.
      
      This is a followup to the fix for the pthread timer in 1.6.2 and beyond, fixing
      a potential crash bug in all supported releases.
      
      (closes issue #17678)
       Reported by: russell
      Branch: https://origsvn.digium.com/svn/asterisk/team/tilghman/ast_select 
      
      Review: https://reviewboard.asterisk.org/r/824/
    ........
  ................
    r284595 | tilghman | 2010-09-01 22:57:43 -0500 (Wed, 01 Sep 2010) | 2 lines
    
    Failed to rerun bootstrap.sh after last commit
  ................
................


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@284598 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2010-09-02 05:02:54 +00:00
Tilghman Lesher ec482eac9c Merged revisions 278981 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4

........
  r278981 | tilghman | 2010-07-23 11:42:25 -0500 (Fri, 23 Jul 2010) | 8 lines
  
  Avoid race with consolethread on shutdown (on parallel processors).
  
  (closes issue #17080)
   Reported by: sybasesql
   Patches: 
         20100721__issue17080.diff.txt uploaded by tilghman (license 14)
   Tested by: sybasesql
........


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@278982 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2010-07-23 16:43:34 +00:00
Tilghman Lesher b4e18d5660 Add load priority order, such that preload becomes unnecessary in most cases
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@278132 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2010-07-20 19:35:02 +00:00
Tilghman Lesher 1555c082e3 Merged revisions 272925 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4

........
  r272925 | tilghman | 2010-06-28 16:50:02 -0500 (Mon, 28 Jun 2010) | 8 lines
  
  Don't change ownership/group/permissions on run directory, if it already exists.
  
  (closes issue #17076)
   Reported by: stuarth
   Patches: 
         20100324__issue17076.diff.txt uploaded by tilghman (license 14)
   Tested by: stuarth
........


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@272926 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2010-06-28 21:50:57 +00:00
Tilghman Lesher 5d313f51b9 Merged revisions 269635 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4

........
  r269635 | tilghman | 2010-06-10 02:52:34 -0500 (Thu, 10 Jun 2010) | 9 lines
  
  Ensure restartable system calls can restart (BSD signal semantics).
  
  This eliminates the annoying <beep> on the console.
  
  (closes issue #17477)
   Reported by: jvandal
   Patches: 
         20100610__issue17477.diff.txt uploaded by tilghman (license 14)
........


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@269636 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2010-06-10 08:15:45 +00:00
Richard Mudgett afd4454c44 Generic Advice of Charge.
Asterisk Generic AOC Representation
- Generic AOC encode/decode routines.
  (Generic AOC must be encoded to be passed on the wire in the AST_CONTROL_AOC frame)
- AST_CONTROL_AOC frame type to represent generic encoded AOC data
- Manager events for AOC-S, AOC-D, and AOC-E messages

Asterisk App Support
- app_dial AOC-S pass-through support on call setup
- app_queue AOC-S pass-through support on call setup

AOC Unit Tests
- AOC Unit Tests for encode/decode routines
- AOC Unit Test for manager event representation.

SIP AOC Support
- Pass-through of generic AOC-D and AOC-E messages to snom phones via the
  snom AOC specification.
- Creation of chan_sip page3 flags for the addition of the new
  'snom_aoc_enabled' sip.conf option.

IAX AOC Support
- Natively supports AOC pass-through through the use of the new
  AST_CONTROL_AOC frame type

DAHDI AOC Support
- ETSI PRI full AOC Pass-through support
- 'aoc_enable' chan_dahdi.conf option for independently enabling
  pass-through of AOC-S, AOC-D, AOC-E.
- 'aoce_delayhangup' option for retrieving AOC-E on disconnect.
- DAHDI A() dial string option for requesting AOC services.
  example usage:
  ;requests AOC-S, AOC-D, and AOC-E on call setup
  exten=>1111,1,Dial(DAHDI/g1/1112/A(s,d,e))

Review:	https://reviewboard.asterisk.org/r/552/


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@267096 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2010-06-02 18:10:15 +00:00
Tilghman Lesher dd26c53707 Merged revisions 266585 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4

........
  r266585 | tilghman | 2010-06-01 10:17:46 -0500 (Tue, 01 Jun 2010) | 11 lines
  
  Prevent CLI prompt from distorting output of lines shorter than the prompt.
  
  Uses the VT100 method of clearing the line from the cursor position to the
  end of the line:  Esc-0K
  
  (closes issue #17160)
   Reported by: coolmig
   Patches: 
         20100531__issue17160.diff.txt uploaded by tilghman (license 14)
   Tested by: coolmig
........


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@266592 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2010-06-01 15:18:59 +00:00
Tilghman Lesher 2da88f1977 Setup environment variables for the benefit of child processes and disallow changing them.
(closes issue #14899)
 Reported by: jmls
 Patches: 
       20090916__issue14899.diff.txt uploaded by tilghman (license 14)
 Tested by: jmls


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@266385 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2010-05-28 22:50:06 +00:00
Tilghman Lesher 7e204048fc Only report swap on platforms which can examine those statistics
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@266337 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2010-05-28 20:53:04 +00:00
Tilghman Lesher fb80119b87 Merged revisions 266142 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4

........
  r266142 | tilghman | 2010-05-26 16:11:44 -0500 (Wed, 26 May 2010) | 14 lines
  
  Use sigaction for signals which should persist past the initial trigger, not signal.
  
  If you call signal() in a Solaris signal handler, instead of just resetting
  the signal handler, it causes the signal to refire, because the signal is not
  marked as handled prior to the signal handler being called.  This effectively
  causes Solaris to immediately exceed the threadstack in recursive signal
  handlers and crash.
  
  (closes issue #17000)
   Reported by: rmcgilvr
   Patches: 
         20100526__issue17000.diff.txt uploaded by tilghman (license 14)
   Tested by: rmcgilvr
........


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@266146 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2010-05-26 21:17:46 +00:00
Terry Wilson 0390dae08d Merge the rest of the FullyBooted patch
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@265467 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2010-05-24 22:21:58 +00:00
Tilghman Lesher 6f998f06af On systems with a LOT of RAM, a signed integer sometimes printed negative.
(closes issue #16837)
 Reported by: jlpedrosa
 Patches: 
       20100504__issue16837.diff.txt uploaded by tilghman (license 14)


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@265316 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2010-05-24 18:19:08 +00:00
Mark Michelson 6bb45831eb Fix transcode_via_sln option with SIP calls and improve PLC usage.
From reviewboard:
The problem here is a bit complex, so try to bear with me...

It was noticed by a Digium customer that generic PLC (as configured in
codecs.conf) did not appear to actually be having any sort of benefit when
packet loss was introduced on an RTP stream. I reproduced this issue myself
by streaming a file across an RTP stream and dropping approx. 5% of the
RTP packets. I saw no real difference between when PLC was enabled or disabled
when using wireshark to analyze the RTP streams.

After analyzing what was going on, it became clear that one of the problems
faced was that when running my tests, the translation paths were being set
up in such a way that PLC could not possibly work as expected. To illustrate,
if packets are lost on channel A's read stream, then we expect that PLC will
be applied to channel B's write stream. The problem is that generic PLC can
only be done when there is a translation path that moves from some codec to
SLINEAR. When I would run my tests, I found that every single time, read
and write translation paths would be set up on channel A instead of channel
B. There appeared to be no real way to predict which channel the translation
paths would be set up on.

This is where Kevin swooped in to let me know about the transcode_via_sln
option in asterisk.conf. It is supposed to work by placing a read translation
path on both channels from the channel's rawreadformat to SLINEAR. It also
will place a write translation path on both channels from SLINEAR to the
channel's rawwriteformat. Using this option allows one to predictably set up
translation paths on all channels. There are two problems with this, though.
First and foremost, the transcode_via_sln option did not appear to be working
properly when I was placing a SIP call between two endpoints which did not
share any common formats. Second, even if this option were to work, for PLC
to be applied, there had to be a write translation path that would go from
some format to SLINEAR. It would not work properly if the starting format
of translation was SLINEAR.

The one-line change presented in this review request in chan_sip.c fixed the
first issue for me. The problem was that in sip_request_call, the
jointcapability of the outbound channel was being set to the format passed to
sip_request_call. This is nativeformats of the inbound channel. Because of this,
when ast_channel_make_compatible was called by app_dial, both channels already
had compatibly read and write formats. Thus, no translation path was set up at
the time. My change is to set the jointcapability of the sip_pvt created during
sip_request_call to the intersection of the inbound channel's nativeformats and
the configured peer capability that we determined during the earlier call to
create_addr. Doing this got the translation paths set up as expected when using
transcode_via_sln.

The changes presented in channel.c fixed the second issue for me. First and
foremost, when Asterisk is started, we'll read codecs.conf to see the value of
the genericplc option. If this option is set, and ast_write is called for a
frame with no data, then we will attempt to fill in the missing samples for
the frame. The implementation uses a channel datastore for maintaining the
PLC state and for creating a buffer to store PLC samples in. Even when we
receive a frame with data, we'll call plc_rx so that the PLC state will have
knowledge of the previous voice frame, which it can use as a basis for when
it comes time to actually do a PLC fill-in.

So, reviewers, now I ask for your help. First off, there's the one line change
in chan_sip that I have put in. Is it right? By my logic it seems correct, but
I'm sure someone can tell me why it is not going to work. This is probably the
change I'm least concerned about, though. What concerns me much more is the
set of changes in channel.c. First off, am I even doing it right? When I run
tests, I can clearly see that when PLC is activated, I see a significant increase
in RTP traffic where I would expect it to be. However, in my humble opinion, the
audio sounds kind of crappy whenever the PLC fill-in is done. It sounds worse to
me than when no PLC is used at all. I need someone to review the logic I have used
to be sure that I'm not misusing anything. As far as I can see my pointer arithmetic
is correct, and my use of AST_FRIENDLY_OFFSET should be correct as well, but I'm
sure someone can point out somewhere where I've done something incorrectly.

As I was writing this review request up, I decided to give the code a test run under
valgrind, and I find that for some reason, calls to plc_rx are causing some invalid
reads. Apparently I'm reading past the end of a buffer somehow. I'll have to dig around
a bit to see why that is the case. If it's obvious to someone reviewing, speak up!

Finally, I have one other proposal that is not reflected in my code review. Since
without transcode_via_sln set, one cannot predict or control where a translation
path will be up, it seems to me that the current practice of using PLC only when
transcoding to SLINEAR is not useful. I recommend that once it has been determined
that the method used in this code review is correct and works as expected, then
the code in translate.c that invokes PLC should be removed.

Review: https://reviewboard.asterisk.org/r/622/



git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@264452 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2010-05-19 21:29:08 +00:00
Eliel C. Sardanons a753e8878b Asterisk data retrieval API.
This module implements an abstraction for retrieving and exporting
asterisk data.
Developed by:
	Brett Bryant <brettbryant@gmail.com>
	Eliel C. Sardanons (LU1ALY) <eliels@gmail.com>
For the Google Summer of code 2009 Project.
Documentation can be found in doxygen format and inside the
header include/asterisk/data.h

Review: https://reviewboard.asterisk.org/r/275/



git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@258517 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2010-04-22 18:07:02 +00:00
Mark Michelson e24661fd18 Merge Call completion support into trunk.
From Reviewboard:
CCSS stands for Call Completion Supplementary Services. An admittedly out-of-date
overview of the architecture can be found in the file doc/CCSS_architecture.pdf
in the CCSS branch. Off the top of my head, the big differences between what is
implemented and what is in the document are as follows:

1. We did not end up modifying the Hangup application at all.
2. The document states that a single call completion monitor may be used across
   multiple calls to the same device. This proved to not be such a good idea
   when implementing protocol-specific monitors, and so we ended up using one
   monitor per-device per-call.
3. There are some configuration options which were conceived after the document
   was written. These are documented in the ccss.conf.sample that is on this
   review request.
		      
For some basic understanding of terminology used throughout this code, see the
ccss.tex document that is on this review.

This implements CCBS and CCNR in several flavors.

First up is a "generic" implementation, which can work over any channel technology
provided that the channel technology can accurately report device state. Call
completion is requested using the dialplan application CallCompletionRequest and can
be canceled using CallCompletionCancel. Device state subscriptions are used in order
to monitor the state of called parties.

Next, there is a SIP-specific implementation of call completion. This method uses the
methods outlined in draft-ietf-bliss-call-completion-06 to implement call completion
using SIP signaling. There are a few things to note here:

* The agent/monitor terminology used throughout Asterisk sometimes is the reverse of
  what is defined in the referenced draft.

* Implementation of the draft required support for SIP PUBLISH. I attempted to write
  this in a generic-enough fashion such that if someone were to want to write PUBLISH
  support for other event packages, such as dialog-state or presence, most of the effort
  would be in writing callbacks specific to the event package.

* A subportion of supporting PUBLISH reception was that we had to implement a PIDF
  parser. The PIDF support added is a bit minimal. I first wrote a validation
  routine to ensure that the PIDF document is formatted properly. The rest of the
  PIDF reading is done in-line in the call-completion-specific PUBLISH-handling
  code. In other words, while there is PIDF support here, it is not in any state
  where it could easily be applied to other event packages as is.

Finally, there are a variety of ISDN-related call completion protocols supported. These
were written by Richard Mudgett, and as such I can't really say much about their
implementation. There are notes in the CHANGES file that indicate the ISDN protocols
over which call completion is supported.

Review: https://reviewboard.asterisk.org/r/523


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@256528 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2010-04-09 15:31:32 +00:00
Tilghman Lesher 3c6c879681 Pass the PID of the Asterisk process, not the PID of the canary.
(closes issue #17065)
 Reported by: globalnetinc
 Patches: 
       astcanary.patch uploaded by makoto (license 38)
 Tested by: frawd, globalnetinc


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@255952 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2010-04-02 20:19:01 +00:00
Tzafrir Cohen 5a5599a764 make 'core show settings' should show all settable directories
(closes issue #17086)
Reported by: tzafrir
Patches:
      asterisk_extra_settings_dirs.diff uploaded by tzafrir (license 46)


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@254162 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2010-03-23 22:48:03 +00:00
Mark Michelson f9e4d024c9 Initialize channels prior to loading "preload" modules.
We can have bad results when a module, upon being loaded, attempts
to reference the channels container if the container hasn't yet
been initialized. I saw this happen by trying to preload pbx_config.so
and having a hint defined which referenced a non-existent SIP peer.



git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@253872 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2010-03-22 20:32:15 +00:00
Russell Bryant 32a649c3b9 Update comment to reflect new timeout value.
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@253378 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2010-03-18 18:23:07 +00:00
Russell Bryant d6ca5ac86e Increase CLI command output timeout for asterisk -rx to 60 seconds.
(closes issue #17049)
Reported by: russell
Tested by: russell

Review: https://reviewboard.asterisk.org/r/573/


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@253357 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2010-03-18 18:18:43 +00:00
Tilghman Lesher 4c8f14b7cf Merged revisions 252361 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4

........
  r252361 | tilghman | 2010-03-14 20:33:50 -0500 (Sun, 14 Mar 2010) | 4 lines
  
  Launch Asterisk on Mac OS X with launchd.
  
  Reviewboard: https://reviewboard.asterisk.org/r/551/
........


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@252362 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2010-03-15 01:37:04 +00:00
Tilghman Lesher a0af2cff0e Merged revisions 248859 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4

........
  r248859 | tilghman | 2010-02-25 15:21:05 -0600 (Thu, 25 Feb 2010) | 15 lines
  
  Some platforms clear /var/run at boot, which makes connecting a remote console... difficult.
  
  Previously, we only created the default /var/run/asterisk directory at install
  time.  While we could create it in the init script, that would not work for
  those who start asterisk manually from the command line.  So the safest thing
  to do is to create it as part of the Asterisk boot process.  This also changes
  the ownership of the directory, because the pid and ctl files are created after
  we setuid/setgid.
  
  (closes issue #16802)
   Reported by: Brian
   Patches: 
         20100224__issue16802.diff.txt uploaded by tilghman (license 14)
   Tested by: tzafrir
........


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@248861 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2010-02-25 21:22:39 +00:00
Sean Bright acdb1bd82f Merged revisions 244926 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4

........
  r244926 | seanbright | 2010-02-05 12:03:35 -0500 (Fri, 05 Feb 2010) | 1 line
  
  Update main copyright date.
........


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@244927 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2010-02-05 17:05:32 +00:00
Jeff Peeler a170cd28e0 Add new option to asterisk.conf (lockconfdir) to protect conf dir during reloads
(closes issue #16358)
Reported by: raarts
Patches: 
      lockconfdir.diff uploaded by raarts (license 937)
      modified by me


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@243551 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2010-01-27 18:29:49 +00:00
Tilghman Lesher 6c1e69370e Err, oops, it was already the way I intended.
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@240629 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2010-01-15 23:50:47 +00:00
Tilghman Lesher 8037982fa6 The previous attempt at using a pipe to guarantee astcanary shutdown did not work.
We're revisiting the previous patch, albeit with a method that overcomes the
prior criticism that it was not POSIX-compliant.
(closes issue #16602)
 Reported by: frawd
 Patches: 
       20100114__issue16602.diff.txt uploaded by tilghman (license 14)
 Tested by: frawd


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@240499 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2010-01-15 21:40:14 +00:00
Tilghman Lesher 5e0762370c It's been long enough -- make the behavior introduced in 1.6 the default.
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@239000 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2010-01-10 06:56:36 +00:00
David Vossel 73cb2d507b Unit Test Framework API
The Unit Test Framework is a new API that manages registration and
execution of unit tests in Asterisk with the purpose of verifying the
operation of C functions.  The Framework consists of a single test
manager accompanied by a list of registered test functions defined
within the code.  A test is defined, registered, and unregistered
from the framework using a set of macros which allow the test code
to only be compiled within asterisk when the TEST_FRAMEWORK flag is
enabled in menuselect.  This allows the test code to exist in the
same file as the C functions it intends to verify.  Registered tests
may be viewed and executed via a set of new CLI commands.  CLI commands
are also present for generating and exporting test results into xml
and txt formats.

For more information and use cases please refer to the documentation
provided at the beginning of the test.h file.

Review: https://reviewboard.asterisk.org/r/447/


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@236027 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-12-22 16:09:11 +00:00
Joshua Colp d0e431ce3d Add an 'X' option to the asterisk application which enables #exec for configuration files.
This option can be used to enable #exec support in the asterisk.conf configuration file.

(closes issue #16260)
Reported by: atis
Patches:
      exec_includes.patch uploaded by atis (license 242)


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@232510 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-12-02 20:10:07 +00:00
Tilghman Lesher 23b4a700f4 Reorder option flags. Change guidelines so that example code is consistent with guidelines
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@231369 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-11-26 02:09:58 +00:00
Olle Johansson 75c015bfff Add the capability to require a module to be loaded, or else Asterisk exits.
Review: https://reviewboard.asterisk.org/r/426/


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@229819 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-11-13 08:52:28 +00:00
Russell Bryant 844a01b27e Add an "Asterisk Architecture Overview" section to the doxygen documentation.
This is a side project I've been poking at this week.  The intent is to discuss
Asterisk architecture in a top down fashion to help new developers understand how
Asterisk is put together.  There is a ton of stuff to write about, so this will
just continue to evolve over time.


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@226606 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-10-30 04:08:39 +00:00
Tilghman Lesher 8c7b3cf738 Merged revisions 221776 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4

........
  r221776 | tilghman | 2009-10-01 18:53:12 -0500 (Thu, 01 Oct 2009) | 2 lines
  
  Fix a bunch of off-by-one errors
........


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@221777 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-10-01 23:59:15 +00:00
Tilghman Lesher 17180120bf Change the default behavior of Set, AGI, and pbx_realtime to 1.6 behavior by default (starting in 1.6.3).
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@220417 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-09-24 22:53:23 +00:00
Tilghman Lesher 642bec4d6f AST-2009-005
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@211539 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-08-10 19:20:57 +00:00
Russell Bryant 0e8c630224 Move OpenSSL initialization to a single place, make library usage thread-safe.
While doing some reading about OpenSSL, I noticed a couple of things that
needed to be improved with our usage of OpenSSL.

1) We had initialization of the library done in multiple modules.  This has now
   been moved to a core function that gets executed during Asterisk startup.
   We already link OpenSSL into the core for TCP/TLS functionality, so this
   was the most logical place to do it.

2) OpenSSL is not thread-safe by default.  However, making it thread safe is
   very easy.  We just have to provide a couple of callbacks.  One callback
   returns a thread ID.  The other handles locking.  For more information,
   start with the "Is OpenSSL thread-safe?" question on the FAQ page of
   openssl.org.


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@205120 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-07-08 15:17:19 +00:00
Russell Bryant 0264eef115 Merge the new Channel Event Logging (CEL) subsystem.
CEL is the new system for logging channel events.  This was inspired after
facing many problems trying to represent what is possible to happen to a call
in Asterisk using CDR records.  For more information on CEL, see the built in
HTML or PDF documentation generated from the files in doc/tex/.

Many thanks to Steve Murphy (murf) and Brian Degenhardt (bmd) for their hard
work developing this code.  Also, thanks to Matt Nicholson (mnicholson) and
Sean Bright (seanbright) for their assistance in the final push to get this
code ready for Asterisk trunk.

Review: https://reviewboard.asterisk.org/r/239/


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@203638 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-06-26 15:28:53 +00:00
David Vossel dcfe69ec64 fixes some memory leaks and redundant conditions
(closes issue #15269)
Reported by: contactmayankjain
Patches:
      patch.txt uploaded by contactmayankjain (license 740)
      memory_leak_stuff.trunk.diff uploaded by dvossel (license 671)
Tested by: contactmayankjain, dvossel




git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@201678 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-06-18 16:37:42 +00:00
Sean Bright befad10893 Merged revisions 199022 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4

........
  r199022 | seanbright | 2009-06-04 10:14:57 -0400 (Thu, 04 Jun 2009) | 40 lines
  
  Safely handle AMI connections/reload requests that occur during startup.
  
  During asterisk startup, a lock on the list of modules is obtained by the
  primary thread while each module is initialized.  Issue 13778 pointed out a
  problem with this approach, however.  Because the AMI is loaded before other
  modules, it is possible for a module reload to be issued by a connected client
  (via Action: Command), causing a deadlock.
  
  The resolution for 13778 was to move initialization of the manager to happen
  after the other modules had already been lodaded.  While this fixed this
  particular issue, it caused a problem for users (like FreePBX) who call AMI
  scripts via an #exec in a configuration file (See issue 15189).
  
  The solution I have come up with is to defer any reload requests that come in
  until after the server is fully booted.  When a call comes in to
  ast_module_reload (from wherever) before we are fully booted, the request is
  added to a queue of pending requests.  Once we are done booting up, we then
  execute these deferred requests in turn.
  
  Note that I have tried to make this a bit more intelligent in that it will not
  queue up more than 1 request for the same module to be reloaded, and if a
  general reload request comes in ('module reload') the queue is flushed and we
  only issue a single deferred reload for the entire system.
  
  As for how this will impact existing installations - Before 13778, a reload
  issued before module initialization was completed would result in a deadlock.
  After 13778, you simply couldn't connect to the manager during startup (which
  causes problems with #exec-that-calls-AMI configuration files).  I believe this
  is a good general purpose solution that won't negatively impact existing
  installations.
  
  (closes issue #15189)
  (closes issue #13778)
  Reported by: p_lindheimer
  Patches:
        06032009_15189_deferred_reloads.diff uploaded by seanbright (license 71)
  Tested by: p_lindheimer, seanbright
  
  Review: https://reviewboard.asterisk.org/r/272/
........


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@199051 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-06-04 14:31:24 +00:00
Sean Bright 3982b8c71b Call ast_stun_init() when we're initializing to get the 'stun debug set'
commands.


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@196417 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-05-22 21:11:03 +00:00
Kevin P. Fleming e6b2e9a750 Const-ify the world (or at least a good part of it)
This patch adds 'const' tags to a number of Asterisk APIs where they are appropriate (where the API already demanded that the function argument not be modified, but the compiler was not informed of that fact). The list includes:

- CLI command handlers
- CLI command handler arguments
- AGI command handlers
- AGI command handler arguments
- Dialplan application handler arguments
- Speech engine API function arguments

In addition, various file-scope and function-scope constant arrays got 'const' and/or 'static' qualifiers where they were missing.

Review: https://reviewboard.asterisk.org/r/251/



git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@196072 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-05-21 21:13:09 +00:00
Tilghman Lesher 92ace48782 Move the spawn of astcanary down, until after the call to daemon(3).
This avoids possible conflicts with the internal implementation of
daemon(3).
(closes issue #15093)
 Reported by: tzafrir
 Patches: 
       20090513__issue15093__2.diff.txt uploaded by tilghman (license 14)
 Tested by: tzafrir


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@195320 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-05-18 19:17:15 +00:00
Sean Bright f2d26b3ddb Update copyright year to 2009
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@191700 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-05-02 15:45:07 +00:00
Tilghman Lesher 91dde03ba8 Detect eaccess (or euidaccess) before using it.
Reported by Andrew Lindh via the -dev list.


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@191367 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-04-30 17:40:58 +00:00
Tilghman Lesher 4cbe6b1afe Change working directory to / under certain conditions.
If backgrounding and no core will be produced, then changing the directory
won't break anything; likewise, if the CWD isn't accessible by the current
user, then a core wasn't possible anyway.
(closes issue #14831)
 Reported by: chris-mac
 Patches: 
       20090428__bug14831.diff.txt uploaded by tilghman (license 14)
       20090430__bug14831.diff.txt uploaded by tilghman (license 14)
 Tested by: chris-mac


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@191283 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-04-30 06:47:13 +00:00
Sean Bright 7a7f17ce4d Fix copy/paste error with 'transmit silence' flag.
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@189077 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-04-17 19:36:38 +00:00
Tilghman Lesher 8f28bfc63e Merged revisions 187300-187301 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4

........
  r187300 | tilghman | 2009-04-08 23:31:38 -0500 (Wed, 08 Apr 2009) | 3 lines
  
  Add debugging mode for diagnosing file descriptor leaks.
  (Related to issue #14625)
........
  r187301 | tilghman | 2009-04-08 23:32:40 -0500 (Wed, 08 Apr 2009) | 2 lines
  
  Oops, missed this file in the last commit.
........


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@187302 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-04-09 04:59:05 +00:00
Russell Bryant 2cb0018fa1 Start splitting up miscellaneous doxygen documentation into separate files.
doxyref.h was created to hold miscellaneous documentation that was not specific
to a part of the code.  This file has grown quite a bit so I decided to start
splitting parts of it out into new files.  Now, you can drop a new file into
include/asterisk/doxygen/ and it will be processed by doxygen.


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@186953 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-04-08 13:24:48 +00:00
Joshua Colp 63de834395 Merge in the RTP engine API.
This API provides a generic way for multiple RTP stacks to be
integrated into Asterisk. Right now there is only one present, res_rtp_asterisk,
which is the existing Asterisk RTP stack. Functionality wise this commit
performs the same as previously. API documentation can be viewed in the
rtp_engine.h header file.

Review: http://reviewboard.digium.com/r/209/


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@186078 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-04-02 17:20:52 +00:00
Russell Bryant b564b2105f Change g_eid to ast_eid_default.
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@184630 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-03-27 14:00:18 +00:00
Russell Bryant ee77b475f2 Improve performance of the ast_event cache functionality.
This code comes from svn/asterisk/team/russell/event_performance/.

Here is a summary of the changes that have been made, in order of both
invasiveness and performance impact, from smallest to largest.

1) Asterisk 1.6.1 introduces some additional logic to be able to handle
   distributed device state.  This functionality comes at a cost.
   One relatively minor change in this patch is that the extra processing
   required for distributed device state is now completely bypassed if
   it's not needed.

2) One of the things that I noticed when profiling this code was that a
   _lot_ of time was spent doing string comparisons.  I changed the way
   strings are represented in an event to include a hash value at the front.
   So, before doing a string comparison, we do an integer comparison on the
   hash.

3) Finally, the code that handles the event cache has been re-written.
   I tried to do this in a such a way that it had minimal impact on the API.
   I did have to change one API call, though - ast_event_queue_and_cache().
   However, the way it works now is nicer, IMO.  Each type of event that
   can be cached (MWI, device state) has its own hash table and rules for
   hashing and comparing objects.  This by far made the biggest impact on
   performance.

For additional details regarding this code and how it was tested, please see the
review request.

(closes issue #14738)
Reported by: russell

Review: http://reviewboard.digium.com/r/205/


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@184339 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-03-25 21:57:19 +00:00
Eliel C. Sardanons 79ec90b3b2 Merged revisions 184188 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4

........
  r184188 | eliel | 2009-03-25 10:12:54 -0400 (Wed, 25 Mar 2009) | 13 lines
  
  Avoid destroying the CLI line when moving the cursor backward and trying to autocomplete.
  
  When moving the cursor backward and pressing TAB to autocomplete, a NULL is put
  in the line and we are loosing what we have already wrote after the actual
  cursor position.
  
  (closes issue #14373)
  Reported by: eliel
  Patches:
        asterisk.c.patch uploaded by eliel (license 64)
        Tested by: lmadsen
........


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@184220 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-03-25 14:38:19 +00:00
Russell Bryant 0bdd99ad64 Merged revisions 182810 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4

........
r182810 | russell | 2009-03-17 21:09:13 -0500 (Tue, 17 Mar 2009) | 44 lines

Fix cases where the internal poll() was not being used when it needed to be.

We have seen a number of problems caused by poll() not working properly on 
Mac OSX.  If you search around, you'll find a number of references to using 
select() instead of poll() to work around these issues.  In Asterisk, we've 
had poll.c which implements poll() using select() internally.  However, we 
were still getting reports of problems.

vadim investigated a bit and realized that at least on his system, even 
though we were compiling in poll.o, the system poll() was still being used.  
So, the primary purpose of this patch is to ensure that we're using the 
internal poll() when we want it to be used.

The changes are:

1) Remove logic for when internal poll should be used from the Makefile.  
   Instead, put it in the configure script.  The logic in the configure 
   script is the same as it was in the Makefile.  Ideally, we would have 
   a functionality test for the problem, but that's not actually possible, 
   since we would have to be able to run an application on the _target_ 
   system to test poll() behavior.

2) Always include poll.o in the build, but it will be empty if AST_POLL_COMPAT
   is not defined.

3) Change uses of poll() throughout the source tree to ast_poll().  I feel 
   that it is good practice to give the API call a new name when we are 
   changing its behavior and not using the system version directly in all cases.
   So, normally, ast_poll() is just redefined to poll().  On systems where 
   AST_POLL_COMPAT is defined, ast_poll() is redefined to ast_internal_poll().

4) Change poll() in main/poll.c to be ast_internal_poll().

It's worth noting that any code that still uses poll() directly will work fine 
(if they worked fine before).  So, for example, out of tree modules that are 
using poll() will not stop working or anything.  However, for modules to work 
properly on Mac OSX, ast_poll() needs to be used.

(closes issue #13404)
Reported by: agalbraith
Tested by: russell, vadim

http://reviewboard.digium.com/r/198/

........


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@182847 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-03-18 02:28:55 +00:00
Russell Bryant a300f82035 Merged revisions 178508 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4

........
r178508 | russell | 2009-02-25 06:43:36 -0600 (Wed, 25 Feb 2009) | 2 lines

Update the copyright year for the main page of the doxygen documentation.

........


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@178509 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-02-25 12:45:30 +00:00
Tilghman Lesher de3d9f829a Apparently, a void cast doesn't override warn_unused_result.
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@178381 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-02-24 20:52:44 +00:00
Tilghman Lesher a8630432c9 The 3 possible errors with pipe(2) are all impossible in this situation.
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@178375 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-02-24 20:40:02 +00:00
Tilghman Lesher 97830cc9cb Use a SIGPIPE to kill the process, instead of depending upon the astcanary process being inherited by init.
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@178342 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-02-24 20:06:48 +00:00
Michiel van Baak 787811d815 add extra check for sysinfo/sysctl
(closes issue #14513)
Reported by: snuffy
Patches:
      bug14513_fixsysinfo.diff uploaded by snuffy (license 35)


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@177913 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-02-21 14:37:04 +00:00
Russell Bryant 4ec301360c Merge a large set of updates to the Asterisk indications API.
This patch includes a number of changes to the indications API.  The primary
motivation for this work was to improve stability.  The object management
in this API was significantly flawed, and a number of trivial situations could
cause crashes.

The changes included are:

1) Remove the module res_indications.  This included the critical functionality
   that actually loaded the indications configuration.  I have seen many people
   have Asterisk problems because they accidentally did not have an
   indications.conf present and loaded.  Now, this code is in the core,
   and Asterisk will fail to start without indications configuration.

   There was one part of res_indications, the dialplan applications, which did
   belong in a module, and have been moved to a new module, app_playtones.

2) Object management has been significantly changed.  Tone zones are now
   managed using astobj2, and it is no longer possible to crash Asterisk by
   issuing a reload that destroys tone zones while they are in use.

3) The API documentation has been filled out.

4) The API has been updated to follow our naming conventions.

5) Various bits of code throughout the tree have been updated to account
   for the API update.

6) Configuration parsing has been mostly re-written.

7) "Code cleanup"

The code is from svn/asterisk/team/russell/indications/.

Review: http://reviewboard.digium.com/r/149/


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@176627 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-02-17 20:41:24 +00:00
Tilghman Lesher 80f91f6ab7 Merged revisions 172438 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4

........
  r172438 | tilghman | 2009-01-29 16:54:29 -0600 (Thu, 29 Jan 2009) | 9 lines
  
  Lose the CAP_NET_ADMIN at every fork, instead of at startup.  Otherwise, if
  Asterisk runs as a non-root user and the administrator does a 'restart now',
  Asterisk loses the ability to set QOS on packets.
  (closes issue #14004)
   Reported by: nemo
   Patches: 
         20090105__bug14004.diff.txt uploaded by Corydon76 (license 14)
   Tested by: Corydon76
........


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@172441 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-01-29 23:15:40 +00:00
Tilghman Lesher 02094f7fb9 Merged revisions 169722 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4

........
  r169722 | tilghman | 2009-01-21 15:02:32 -0600 (Wed, 21 Jan 2009) | 8 lines
  
  Extra NULLs in the output cause some terminal types to abort in the middle of
  a color code, causing terminal weirdness.
  (closes issue #14130)
   Reported by: coolmig
   Patches: 
         20090121__bug14130.diff.txt uploaded by Corydon76 (license 14)
   Tested by: Corydon76, coolmig
........


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@169723 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-01-21 21:03:40 +00:00
Michiel van Baak fae3ba7421 fix assignment in swapmode plug.
Spotted and fix provided by ys

(closes issue #14129)
Reported by: ys
Tested by: ys


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@169369 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-01-19 20:14:27 +00:00
Michiel van Baak ffb3f301af Make asterisk compile on non-amd64 versions of OpenBSD.
The HW_PHYSMEM64 is only available in latest OpenBSD and/or amd64 versions of OpenBSD.
Use HW_PHYSMEM when HW_PHYSMEM64 is not available.

(closes issue #14129)
Reported by: ys
Patches:
      2009011600_physmem64.diff.txt uploaded by mvanbaak (license 7)
Tested by: mvanbaak, jtodd


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@169327 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-01-19 18:36:24 +00:00
Michiel van Baak d7eaa9c6aa Fix compilation on FreeBSD and OSX
This started as work to fix the 'core show sysinfo'
CLI command but while working on it oej
pointed out that read_credentials did not compile neither.
So while being there, fix that as well.

Thanks for all the testing oej!

(closes issue #14129)
Reported by: ys
Tested by: oej, mvanbaak


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@168609 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-01-14 19:36:57 +00:00
Terry Wilson 7c6d9c7235 Add option to hide console connect messages
(closes issue #14222)
Reported by: jamesgolovich
Patches: 
      asterisk-hideconnect.diff.txt uploaded by jamesgolovich (license 176)
Tested by: otherwiseguy


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@168585 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-01-13 23:00:27 +00:00
Olle Johansson 0bad5fd12e Don't include swap.h unless we have swapctl
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@168479 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-01-12 14:35:09 +00:00
Jeff Peeler 334a89f754 When parsing environment variable ASTERISK_PROMPT, make sure to proceed to the next character when a non format specifier is used (no %). Otherwise, the while loop looking for the null byte will never exit.
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@167125 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-01-03 20:29:54 +00:00
Russell Bryant 53f788c6b5 Fix build issues on Linux after sysinfo related changes
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@164821 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-12-16 20:49:25 +00:00
Michiel van Baak d2d96b10ac introduce 'core show sysinfo' for systems that dont have the Linux-ish sysinfo stuff but do have sysctl.
(closes issue #13433)
Reported by: mvanbaak
Patches:
      2008121300_sysinfosysctl.diff.txt uploaded by mvanbaak (license 7)
	  with two free calls replaced with ast_free based on feedback on reviewboard
Review:
      http://reviewboard.digium.com/r/91/


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@164802 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-12-16 20:08:34 +00:00
Tilghman Lesher c8223fc957 Merge ast_str_opaque branch (discontinue usage of ast_str internals)
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@163991 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-12-13 08:36:35 +00:00
Tilghman Lesher 5e034d9f0b Merged revisions 163761 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4

........
  r163761 | tilghman | 2008-12-12 16:03:10 -0600 (Fri, 12 Dec 2008) | 7 lines
  
  Simple fix for Ctrl-C not immediately exiting Asterisk, but also add a
  pointer inside editline to look back to asterisk.c, so others don't spend
  as much time as I did looking (in the wrong place) for the appropriate
  function.
  Reported by: ZX81, via the #asterisk-users channel
  Fixed by: me (license 14)
........


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@163762 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-12-12 22:04:26 +00:00
Tilghman Lesher 592cab8202 Merged revisions 163383 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4

........
  r163383 | tilghman | 2008-12-11 17:35:55 -0600 (Thu, 11 Dec 2008) | 9 lines
  
  When a Ctrl-C or Ctrl-D ends a remote console, on certain shells, the terminal
  is messed up.  By intercepting those events with a signal handler in the remote
  console, we can avoid those issues.
  (closes issue #13464)
   Reported by: tzafrir
   Patches: 
         20081110__bug13464.diff.txt uploaded by Corydon76 (license 14)
   Tested by: blitzrage
........


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@163384 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-12-11 23:38:56 +00:00
Michiel van Baak c8c8995b70 add tab completion for 'core set debug X filename.c'
(closes issue #13969)
Reported by: jtodd
Patches:
      20081205__bug13969.diff.txt uploaded by Corydon76 (license 14)
Tested by: mvanbaak, eliel


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@162687 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-12-10 17:09:15 +00:00
Russell Bryant d0bc22b3e8 Add some additional Asterisk project developer documentation.
After the nightly update of the documentation on asterisk.org, I'll post 
an update to asterisk-dev with a pointer to the changes.  This covers some
release branch and commit policy information.  None of this should be a
surprise, since it's just documenting what we have already been doing.


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@162418 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-12-09 22:38:41 +00:00
Russell Bryant 179667088b Merged revisions 162413 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4

........
r162413 | russell | 2008-12-09 16:17:39 -0600 (Tue, 09 Dec 2008) | 8 lines

Remove the test_for_thread_safety() function completely.

The test is not valid.  Besides, if we actually suspected that recursive
mutexes were not working, we would get a ton of LOG_ERROR messages when
DEBUG_THREADS is turned on.

(inspired by a discussion on the asterisk-dev list)

........


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@162414 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-12-09 22:25:06 +00:00
Eliel C. Sardanons 1e8e12efcf Janitor, use ARRAY_LEN() when possible.
(closes issue #13990)
Reported by: eliel
Patches:
      array_len.diff uploaded by eliel (license 64)



git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@161218 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-12-05 10:31:25 +00:00
Eliel C. Sardanons 033bffd32f Introduce CLI permissions.
Based on cli_permissions.conf configuration file, we are able to permit or deny
cli commands based on some patterns and the local user and group running rasterisk.

(Sorry if I missed some of the testers).

Reviewboard: http://reviewboard.digium.com/r/11/

(closes issue #11123)
Reported by: eliel
Tested by: eliel, IgorG, Laureano, otherwiseguy, mvanbaak



git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@160062 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-12-01 18:52:14 +00:00
Russell Bryant e2133648f9 Merged revisions 156164 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4

........
r156164 | russell | 2008-11-12 11:29:52 -0600 (Wed, 12 Nov 2008) | 7 lines

Move the sanity check that makes sure "always fork" is not set along with the 
console option to be after the code that reads options from asterisk.conf.  
This resolves a situation where Asterisk can start taking up 100% when
misconfigured.
(Thanks to Bryce Porter (x86 on IRC) for letting me log in to his system to
 figure out what was causing the 100% CPU problem.)

........


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@156166 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-11-12 17:38:20 +00:00
Michiel van Baak 86f900b201 This commit does two things:
- Add CLI aliases module to asterisk.
- Remove all deprecated CLI commands from the code

Initial work done by file.
Junk-Y and lmadsen did a lot of work and testing to
get the list of deprecated commands into the configuration file.

Deprecated CLI commands are now handled by this new module,
see cli_aliases.conf for more info about that.

ok russellb@ via reviewboard

(closes issue #13735)
Reported by: mvanbaak


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@156120 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-11-12 06:46:04 +00:00
Eliel C. Sardanons 23adb8e509 Move all the XML documentation API from pbx.c to xmldoc.c.
Export the XML documentation API:
   ast_xmldoc_build_synopsis()
   ast_xmldoc_build_syntax()
   ast_xmldoc_build_description()
   ast_xmldoc_build_seealso()
   ast_xmldoc_build_arguments()
   ast_xmldoc_printable()
   ast_xmldoc_load_documentation()



git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@155711 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-11-10 13:53:23 +00:00
Tilghman Lesher 81fb7597e5 Don't read history on -rx commands.
(Closes issue #13571)
Reported by: tzafrir
Patch '0001-no-need-for-history-on-asterisk-rx.patch' uploaded by tzafrir.


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@154922 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-11-05 22:19:18 +00:00
Kevin P. Fleming bd4eb070f3 bring over all the fixes for the warnings found by gcc 4.3.x from the 1.4 branch, and add the ones needed for all the new code here too
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@153616 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-11-02 18:52:13 +00:00
Russell Bryant 5b168ee34b Merge changes from team/group/appdocsxml
This commit introduces the first phase of an effort to manage documentation of the
interfaces in Asterisk in an XML format.  Currently, a new format is available for
applications and dialplan functions.  A good number of conversions to the new format
are also included.

For more information, see the following message to asterisk-dev:

http://lists.digium.com/pipermail/asterisk-dev/2008-October/034968.html


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@153365 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-11-01 21:10:07 +00:00
Kevin P. Fleming 10d36d9f34 fix a few small things found by using sparse
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@152809 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-10-30 16:49:02 +00:00
Russell Bryant 316f3897a8 Merged revisions 151905 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4

........
r151905 | russell | 2008-10-25 05:59:02 -0500 (Sat, 25 Oct 2008) | 8 lines

Move AMI initialization to occur after loading modules.  This prevents a
deadlock when someone tries to initiate a module reload from the AMI just
as Asterisk is starting.

(closes issue #13778)
Reported by: hotsblanc
Fix suggested by hotsblanc

........


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@151906 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-10-25 11:02:11 +00:00
Tilghman Lesher 9335b3ad34 Allow people to select the old console behavior of white text on a black
background, by using the startup flag '-B'.


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@147262 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-10-07 17:44:32 +00:00
Sean Bright 6855b63d44 Fix a bug with the last item in CLI history getting duplicated when
read from the .asterisk_history file (and subsequently being duplicated
when written).  We weren't checking the result of fgets() which meant
that we read the same line twice before feof() actually returned non-
zero.

Also, stop writing out an extra blank line between each item in the
history file, fix a minor off-by-one error, and use symbolic constants
rather than a hardcoded integer.


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@146359 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-10-04 16:20:31 +00:00
Tilghman Lesher 08af5bb312 Create a new config file status, CONFIG_STATUS_FILEINVALID for differentiating
when a file is invalid from when a file is missing.  This is most important when
we have two configuration files.  Consider the following example:

Old system:
sip.conf     users.conf     Old result               New result
========     ==========     ==========               ==========
Missing      Missing        SIP doesn't load         SIP doesn't load
Missing      OK             SIP doesn't load         SIP doesn't load
Missing      Invalid        SIP doesn't load         SIP doesn't load
OK           Missing        SIP loads                SIP loads
OK           OK             SIP loads                SIP loads
OK           Invalid        SIP loads incompletely   SIP doesn't load
Invalid      Missing        SIP doesn't load         SIP doesn't load
Invalid      OK             SIP doesn't load         SIP doesn't load
Invalid      Invalid        SIP doesn't load         SIP doesn't load

So in the case when users.conf doesn't load because there's a typo that
disrupts the syntax, we may only partially load users, instead of failing with
an error, which may cause some calls not to get processed.  Worse yet, the old
system would do this with no indication that anything was even wrong.

(closes issue #10690)
 Reported by: dtyoo
 Patches: 
       20080716__bug10690.diff.txt uploaded by Corydon76 (license 14)


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@142992 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-09-12 23:30:03 +00:00
Tilghman Lesher 6dd5b8609f Optional light colored background, for those who use black on white terminals.
(closes issue #13306)
 Reported by: Corydon76
 Patches: 
       20080814__bug13306__3.diff.txt uploaded by Corydon76 (license 14)
 Tested by: Corydon76, pkempgen


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@139981 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-08-25 23:13:32 +00:00
Sean Bright 790fde68d9 Another batch of files from RSW. The remaining apps and a few more
files from main/


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@137089 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-08-10 20:23:50 +00:00
Sean Bright b69c8e6ab5 Another big chunk of changes from the RSW branch. Bunch of stuff from main/
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@137082 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-08-10 19:35:50 +00:00
Tilghman Lesher d86fc7fcc1 Add %u and %g to the ASTERISK_PROMPT settings, for username and group,
respectively.  Also, take the opportunity to clean up the CLI prompt
generation code.
(closes issue #13175)
 Reported by: eliel
 Patches: 
       cliprompt.patch uploaded by eliel (license 64)


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@134353 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-07-30 15:30:18 +00:00
Mark Michelson 06d951f585 merging the zap_and_dahdi_trunk branch up to trunk
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@134050 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-07-28 16:00:19 +00:00
Russell Bryant 63fb8d794b Modify the main page of the doxygen documentation to link to a new page dedicated
to Asterisk licensing information.  The licensing page includes the Asterisk license,
as well as a (not yet complete) list of 3rd party libraries that may be used, as well
as what license we receive them under.

Help filling out this list in the format that I have started in doxyref.h would be
much appreciated.  :)


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@133575 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-07-25 14:57:11 +00:00
Mark Michelson ed6323cb73 Merged revisions 133169 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4

........
r133169 | mmichelson | 2008-07-23 14:39:47 -0500 (Wed, 23 Jul 2008) | 12 lines

As suggested by seanbright, the PSEUDO_CHAN_LEN in 
app_chanspy should be set at load time, not at compile
time, since dahdi_chan_name is determined at load time.

Also changed the next_unique_id_to_use to have the 
static qualifier.

Also added the dahdi_chan_name_len variable so that
strlen(dahdi_chan_name) isn't necessary. Thanks to
seanbright for the suggestion.


........


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@133171 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-07-23 19:48:03 +00:00
Brett Bryant 35e5f434aa Fixes an issue with "core show sysinfo" that used the wrong operator to
calculate the number of bytes from a sysinfo structure.
unsigned long.

(closes issue #13057)
Reported by: eliel
Patches:
      asterisk.c.patch uploaded by eliel (license 64)


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@131445 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-07-16 21:24:18 +00:00
Mark Michelson 88718801b3 Fix a memory leak in the case that /dev/null cannot be
opened when running startup commands from cli.conf

(closes issue #13066)
Reported by: eliel
Patches:
      asterisk.c.patch uploaded by eliel (license 64)



git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@130854 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-07-14 22:22:57 +00:00
Brett Bryant 5b7933fe5e Janitor patch to change uses of sizeof to ARRAY_LEN
(closes issue #13054)
Reported by: pabelanger
Patches:
      ARRAY_LEN.patch2 uploaded by pabelanger (license 224)
Tested by: seanbright


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@130129 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-07-11 18:09:35 +00:00
Tilghman Lesher 675f3ec348 Reduce length of time that 'asterisk -rx' waits.
(closes issue #13001)
 Reported by: eliel
 Patches: 
       20080708__bug13001.diff.txt uploaded by Corydon76 (license 14)
       20080708__bug13001.diff.txt.fixed uploaded by eliel (license 64)
 Tested by: Corydon76, eliel


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@129114 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-07-08 20:17:08 +00:00
Kevin P. Fleming fd4a60c459 Merged revisions 125132 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4

........
r125132 | kpfleming | 2008-06-25 17:21:30 -0500 (Wed, 25 Jun 2008) | 10 lines

allow tonezone to live in a different place than DAHDI/Zaptel, since dahdi-tools and dahdi-linux are now separate packages and can be installed in different places

don't include tonezone.h in dahdi_compat.h, because only a couple of modules need it

get app_rpt building again after the DAHDI changes

(closes issue #12911)
Reported by: tzafrir


........


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@125138 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-06-25 23:05:28 +00:00
Tilghman Lesher 284ae601c3 Merged revisions 123869 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4

........
r123869 | tilghman | 2008-06-19 11:07:23 -0500 (Thu, 19 Jun 2008) | 6 lines

The RDTSC instruction was introduced on the Pentium line of microprocessors,
and is not compatible with certain 586 clones, like Cyrix.  Hence, asking for
i386 compatibility was always incorrect. See http://en.wikipedia.org/wiki/RDTSC
(Closes issue #12886)
Reported by tecnoxarxa

........


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@123870 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-06-19 16:08:29 +00:00
Russell Bryant 96ea12126e Add a "timing test" CLI command. It opens a timer and configures it for
50 ticks per second, and then counts to see how many ticks it actually
gets in a second.


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@122926 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-06-16 13:03:40 +00:00
Russell Bryant b6457ecf4c Merge changes from timing branch
- Convert chan_iax2 to use the timing API
 - Convert usage of timing in the core to use the timing API instead of
   using DAHDI directly
 - Make a change to the timing API to add the set_rate() function
 - change the timing core to use a rwlock
 - merge a timing implementation, res_timing_dahdi

Basic testing was successful using res_timing_dahdi


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@122523 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-06-13 12:45:50 +00:00
Jeff Peeler ef3b214728 Goodbye Zaptel, hello DAHDI. Removes Zaptel driver support with DAHDI. Configuration file and dialplan backwards compatability has been put in place where appropiate. Release announcement to follow.
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@122234 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-06-12 17:27:55 +00:00
Russell Bryant f4a8062e93 Merge another change from team/russell/events ...
DUNDi uses a concept called the Entity ID for unique server identifiers.  I have
pulled out the handling of EIDs and made it something available to all of Asterisk.
There is now a global Entity ID that can be used for other purposes as well, such
as code providing distributed device state, which is why I did this.  The global
Entity ID is set automatically, just like it was done in DUNDi, but it can also be
set in asterisk.conf.  DUNDi will now use this global EID unless one is specified
in dundi.conf.

The current EID for the system can be seen in the "core show settings" CLI command.
It is also available in the dialplan via the ENTITYID variable.


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@121439 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-06-10 12:48:50 +00:00
Tilghman Lesher 76506b7baa Move compatibility options into asterisk.conf, default them to on for upgrades,
and off for new installations.  This includes the translation from pipes to commas
for pbx_realtime and the EXEC command for AGI, as well as the change to the Set
application not to support multiple variables at once.


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@120171 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-06-03 22:05:16 +00:00
Brett Bryant 5b8e1963c5 Adds support for changing logger settingss on remote consoles with a
new command "logger set level". 

i.e. "logger set level debug off"

(closes issue #10891)


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@119126 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-05-29 21:30:37 +00:00
Tilghman Lesher 4169ea891c Merged revisions 118465 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4

........
r118465 | tilghman | 2008-05-27 13:58:09 -0500 (Tue, 27 May 2008) | 8 lines

NULL character should terminate only commands back to the core, not log
messages to the console.
(closes issue #12731)
 Reported by: seanbright
 Patches: 
       20080527__bug12731.diff.txt uploaded by Corydon76 (license 14)
 Tested by: seanbright

........


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@118466 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-05-27 18:59:06 +00:00
Tilghman Lesher 3e8269359f Merged revisions 117899 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4

........
r117899 | tilghman | 2008-05-22 13:53:53 -0500 (Thu, 22 May 2008) | 2 lines

Also remove preamble from asynchronous events (reported by jsmith on #asterisk-dev)

........


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@117900 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-05-22 18:54:41 +00:00
Russell Bryant 415516af1c Store build-time options as a string in AST_BUILDOPTS in buildopts.h. Also,
display this information in the "core show settings" CLI command.  This is
useful if you want to verify that you're running a build with DONT_OPTIMIZE,
DEBUG_THREADS, etc.


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@117756 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-05-22 13:40:52 +00:00
Tilghman Lesher 7a2413e904 Merged revisions 117519 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4

........
r117519 | tilghman | 2008-05-21 13:40:14 -0500 (Wed, 21 May 2008) | 3 lines

Strip the preamble from the output also when -rx is not being used
(Related to issue #12702)

........


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@117520 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-05-21 18:43:26 +00:00
Russell Bryant e64aaf24b0 Merged revisions 117514 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4

........
r117514 | russell | 2008-05-21 13:28:46 -0500 (Wed, 21 May 2008) | 4 lines

Don't filter the magic character in the network verboser.  It gets filtered
once it reaches the client.
(related to issue #12702, pointed out by tilghman)

........


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@117515 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-05-21 18:29:05 +00:00
Russell Bryant 457dbc1b4f Merged revisions 117507 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4

........
r117507 | russell | 2008-05-21 13:19:34 -0500 (Wed, 21 May 2008) | 7 lines

1) Don't print the verbose marker in front of every message from ast_verbose()
   being sent to remote consoles.

2) Fix pbx_gtkconsole to filter out the verbose marker.

(related to issue #12702)

........


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@117508 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-05-21 18:20:11 +00:00
Russell Bryant 467b4746ab Merged revisions 117479 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4

........
r117479 | russell | 2008-05-21 13:11:51 -0500 (Wed, 21 May 2008) | 6 lines

Don't display the verbose marker for calls to ast_verbose() that do not include
a VERBOSE_PREFIX in front of the message.
(closes issue #12702)
Reported by: johnlange
Patched by me

........


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@117481 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-05-21 18:12:19 +00:00
Tilghman Lesher 99cad5bf49 Merged revisions 115884 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4

........
r115884 | tilghman | 2008-05-13 13:36:13 -0500 (Tue, 13 May 2008) | 3 lines

If the socket dies (read returns 0=EOF), return immediately.
(Closes issue #12637)

........


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@115886 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-05-13 18:38:11 +00:00
Tilghman Lesher ff01792e50 Merged revisions 115415 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4

........
r115415 | tilghman | 2008-05-06 14:31:39 -0500 (Tue, 06 May 2008) | 2 lines

Don't print the terminating NUL.  (Closes issue #12589)

........


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@115416 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-05-06 19:32:29 +00:00
Tilghman Lesher e82b7365b7 Merged revisions 115333 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4

........
r115333 | tilghman | 2008-05-05 17:50:31 -0500 (Mon, 05 May 2008) | 7 lines

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/trunk@115334 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-05-05 23:00:31 +00:00
Dwayne M. Hubbard b0b72e89a8 A taskprocessor is an object that has a name, a task queue, and an event processing thread. Modules reference a taskprocessor, push tasks into the taskprocessor as needed, and unreference the taskprocessor when the taskprocessor is no longer needed.
A task wraps a callback function pointer and a data pointer and is managed internal to the taskprocessor subsystem.  The callback function is responsible for releasing task data.

Taskprocessor API
 * ast_taskprocessor_get(..) - returns a reference to a taskprocessor
 * ast_taskprocessor_unreference(..) - releases reference to a taskprocessor
 * ast_taskprocessor_push(..) - push a task into a taskprocessor queue

Check doxygen for more details


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@115268 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-05-03 03:40:32 +00:00
Tilghman Lesher b11854445b Add attributes to various API calls, to help track down bugs (and remove a deprecated function)
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@115157 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-05-02 02:33:04 +00:00
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
Russell Bryant 56879bf978 Merged revisions 85532 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4

........
r85532 | russell | 2007-10-13 00:24:33 -0500 (Sat, 13 Oct 2007) | 8 lines

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/trunk@86585 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-10-21 22:52:20 +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
Tilghman Lesher 616ec5d340 Merged revisions 86066 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4

........
r86066 | tilghman | 2007-10-17 10:23:51 -0500 (Wed, 17 Oct 2007) | 3 lines

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/trunk@86079 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-10-17 15:39:24 +00:00
Russell Bryant 27031927cf Merged revisions 85545 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4

........
r85545 | russell | 2007-10-15 08:05:45 -0500 (Mon, 15 Oct 2007) | 7 lines

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/trunk@85546 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-10-15 13:07:48 +00:00
Russell Bryant eec3f78368 Merged revisions 85533 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4

........
r85533 | russell | 2007-10-13 01:48:10 -0400 (Sat, 13 Oct 2007) | 12 lines

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/trunk@85534 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-10-13 05:53:19 +00:00
Russell Bryant e97a723cf1 Merge a ton of NEW_CLI conversions. Thanks to everyone that helped out! :)
(closes issue #10724)
Reported by: eliel
Patches: 
      chan_skinny.c.patch uploaded by eliel (license 64)
      chan_oss.c.patch uploaded by eliel (license 64)
      chan_mgcp.c.patch2 uploaded by eliel (license 64)
      pbx_config.c.patch uploaded by seanbright (license 71)
      iax2-provision.c.patch uploaded by eliel (license 64)
      chan_gtalk.c.patch uploaded by eliel (license 64)
      pbx_ael.c.patch uploaded by seanbright (license 71)
      file.c.patch uploaded by seanbright (license 71)
      image.c.patch uploaded by seanbright (license 71)
      cli.c.patch uploaded by moy (license 222)
      astobj2.c.patch uploaded by moy (license 222)
      asterisk.c.patch uploaded by moy (license 222)
      res_limit.c.patch uploaded by seanbright (license 71)
      res_convert.c.patch uploaded by seanbright (license 71)
      res_crypto.c.patch uploaded by seanbright (license 71)
      app_osplookup.c.patch uploaded by seanbright (license 71)
      app_rpt.c.patch uploaded by seanbright (license 71)
      app_mixmonitor.c.patch uploaded by seanbright (license 71)
      channel.c.patch uploaded by seanbright (license 71)
      translate.c.patch uploaded by seanbright (license 71)
      udptl.c.patch uploaded by seanbright (license 71)
      threadstorage.c.patch uploaded by seanbright (license 71)
      db.c.patch uploaded by seanbright (license 71)
      cdr.c.patch uploaded by moy (license 222)
      pbd_dundi.c.patch uploaded by moy (license 222)
      app_osplookup-rev83558.patch uploaded by moy (license 222)
      res_clioriginate.c.patch uploaded by moy (license 222)


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@85460 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-10-11 19:03:06 +00:00
Russell Bryant d78463be1e Corydon posted this janitor project to the bug tracker and mvanbaak provided
a patch for it.  It replaces a bunch of simple calls to snprintf with ast_copy_string

(closes issue #10843)
Reported by: Corydon76
Patches: 
      2007092900_10843.diff uploaded by mvanbaak (license 7)


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@84173 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-10-01 15:23:19 +00:00
Tilghman Lesher ddc6f8100e Permit custom locations for astdb and the keys directory (though default to the current locations) (Closes issue #10267)
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@83726 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-09-24 22:06:19 +00:00
Russell Bryant 5cbdfc9925 Merged revisions 83348 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4

........
r83348 | russell | 2007-09-20 16:16:48 -0500 (Thu, 20 Sep 2007) | 4 lines

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/trunk@83349 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-09-20 21:17:39 +00:00
Russell Bryant 06fd2e1a05 trivial formatting change
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@83297 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-09-20 19:42:33 +00:00
Russell Bryant 2fde4885db trivial formatting change
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@83293 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-09-20 19:11:31 +00:00
Russell Bryant 6aa1638d8a Don't start the event processing thread until after forking.
(reported by Simon on the -dev list, thanks!)


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@83233 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-09-20 16:27:07 +00:00
Russell Bryant 79d79ac840 Merged revisions 82337 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4

........
r82337 | russell | 2007-09-13 13:45:59 -0500 (Thu, 13 Sep 2007) | 4 lines

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/trunk@82338 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-09-13 18:52:35 +00:00
Mark Michelson 3a6e79ad80 Fixes Solaris build warnings
(closes issue #10698, reported and patched by snuffy)



git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@82283 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-09-12 16:24:45 +00:00
Russell Bryant 7e19df05b9 Merged revisions 82280 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4

........
r82280 | russell | 2007-09-12 10:16:49 -0500 (Wed, 12 Sep 2007) | 4 lines

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/trunk@82281 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-09-12 15:19:11 +00:00
Russell Bryant 9dba50322d Merged revisions 81997 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4

........
r81997 | russell | 2007-09-08 13:41:32 -0500 (Sat, 08 Sep 2007) | 2 lines

Fix a small memory leak.  ast_unregister_atexit() did not free the entry it removed.

........


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@81998 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-09-08 18:45:51 +00:00
Russell Bryant 43e9b0f67c (closes issue #7852)
Reported by: nic_bellamy
Patches:
      2006-10-03_svn_44249_voicemail_lockmode_v3.patch uploaded by nic_bellamy (license 213)

Add support for configurable file locking methods.  The default is "lockfile",
which is the old behavior.  There is an additional option, "flock", which is
intended for use in situations where the lockfile method will not work, such as
with SMB/CIFS mounts.


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