Commit Graph

527 Commits

Author SHA1 Message Date
David M. Lee 744556c01d security: Inhibit execution of privilege escalating functions
This patch allows individual dialplan functions to be marked as
'dangerous', to inhibit their execution from external sources.

A 'dangerous' function is one which results in a privilege escalation.
For example, if one were to read the channel variable SHELL(rm -rf /)
Bad Things(TM) could happen; even if the external source has only read
permissions.

Execution from external sources may be enabled by setting
'live_dangerously' to 'yes' in the [options] section of asterisk.conf.
Although doing so is not recommended.

Also, the ABI was changed to something more reasonable, since Asterisk
12 does not yet have a public release.

(closes issue ASTERISK-22905)
Review: http://reviewboard.digium.internal/r/432/
........

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

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

Merged revisions 403959 from http://svn.asterisk.org/svn/asterisk/branches/12


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@403960 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2013-12-16 19:11:51 +00:00
Kevin Harwell 2564ed26f7 app_dahdiras: Use waitpid instead of wait4.
Several places in the code were using wait4 while other places were using
waitpid.  This change makes all places use waitpid in order to make things
more consistent and since the 'rusage' object passed in/out of wait4 was
never used.

(closes issue ASTERISK-22557)
Reported by: YvesGael
Patches:
     asterisk-11.5.1-wait4.patch uploaded by hurdman (license 6537)


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@402546 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2013-11-08 14:58:13 +00:00
Jonathan Rose 4ca0f222e8 memory leaks: Memory leak cleanup patch by Corey Farrell (second set)
Also covers ast_app_parse_timelen-fail-zero-length.patch, but the patch was
replaced with one of my own.

(issue ASTERISK-22467)
Reported by: Corey Farrell
Patches:
    chan_dahdi-cleanup_push.patch uploaded by coreyfarrell (license 5909)
    clicompat-r2.patch uploaded by coreyfarrell (license 5909)
    codecs-ilbc-doCPLC.patch uploaded by coreyfarrell (license 5909)
    data-cleanup-test-registration.patch uploaded by coreyfarrell (license 5909)
    main-asterisk-kill-listener.patch uploaded by coreyfarrell (license 5909)
........

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

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

Merged revisions 401706 from http://svn.asterisk.org/svn/asterisk/branches/12


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@401707 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2013-10-24 17:00:27 +00:00
Matthew Jordan 8d7873b836 ARI: Add subscription support
This patch adds an /applications API to ARI, allowing explicit management of
Stasis applications.

 * GET /applications - list current applications
 * GET /applications/{applicationName} - get details of a specific application
 * POST /applications/{applicationName}/subscription - explicitly subscribe to
   a channel, bridge or endpoint
 * DELETE /applications/{applicationName}/subscription - explicitly unsubscribe
   from a channel, bridge or endpoint

Subscriptions work by a reference counting mechanism: if you subscript to an
event source X number of times, you must unsubscribe X number of times to stop
receiveing events for that event source.

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

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

Merged revisions 400522 from http://svn.asterisk.org/svn/asterisk/branches/12


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@400523 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2013-10-04 16:01:48 +00:00
Kevin Harwell 667fa56b1b Remote console: more output discrepancies
The remote console continued to have issues with its output.  In this case CLI
command output would either not show up (if verbose level = 0) or would contain
verbose prefixes (if verbose level > 0) once log messages were sent to the
remote console.  The fix now now adds verbose prefix data to all new lines
contained in a verbose log string.

(closes issue ASTERISK-22450)
Reported by: David Brillert
(closes issue AST-1193)
Reported by: Guenther Kelleter
Review: https://reviewboard.asterisk.org/r/2825/
........

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

Merged revisions 399268 from http://svn.asterisk.org/svn/asterisk/branches/12


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@399269 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2013-09-17 18:44:11 +00:00
Richard Mudgett 83bf017db9 Fix incorrect usages of ast_realloc().
There are several locations in the code base where this is done:
buf = ast_realloc(buf, new_size);

This is going to leak the original buf contents if the realloc fails.

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

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

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

Merged revisions 398759 from http://svn.asterisk.org/svn/asterisk/branches/12


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@398760 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2013-09-10 18:05:47 +00:00
David M. Lee 2d1d5a98d5 Fix graceful shutdown crash.
The cleanup code for optional_api needs to happen after all of the optional
API users and providers have unused/unprovided. Unfortunately, regsitering the
atexit() handler at the beginning of main() isn't soon enough, since module
destructors run after that.
........

Merged revisions 398149 from http://svn.asterisk.org/svn/asterisk/branches/12


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@398150 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2013-08-30 20:58:59 +00:00
Kevin Harwell 1d3d6e0661 Check return value on fwrite
........

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

Merged revisions 398002 from http://svn.asterisk.org/svn/asterisk/branches/12


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@398003 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2013-08-30 15:39:09 +00:00
David M. Lee 9bed50db41 optional_api: Fix linking problems between modules that export global symbols
With the new work in Asterisk 12, there are some uses of the
optional_api that are prone to failure. The details are rather involved,
and captured on [the wiki][1].

This patch addresses the issue by removing almost all of the magic from
the optional API implementation. Instead of relying on weak symbol
resolution, a new optional_api.c module was added to Asterisk core.

For modules providing an optional API, the pointer to the implementation
function is registered with the core. For modules that use an optional
API, a pointer to a stub function, along with a optional_ref function
pointer are registered with the core. The optional_ref function pointers
is set to the implementation function when it's provided, or the stub
function when it's now.

Since the implementation no longer relies on magic, it is now supported
on all platforms. In the spirit of choice, an OPTIONAL_API flag was
added, so we can disable the optional_api if needed (maybe it's buggy on
some bizarre platform I haven't tested on)

The AST_OPTIONAL_API*() macros themselves remained unchanged, so
existing code could remain unchanged. But to help with debugging the
optional_api, the patch limits the #include of optional API's to just
the modules using the API. This also reduces resource waste maintaining
optional_ref pointers that aren't used.

Other changes made as a part of this patch:
 * The stubs for http_websocket that wrap system calls set errno to
   ENOSYS.

 * res_http_websocket now properly increments module use count.

 * In loader.c, the while() wrappers around dlclose() were removed. The
   while(!dlclose()) is actually an anti-pattern, which can lead to
   infinite loops if the module you're attempting to unload exports a
   symbol that was directly linked to.

 * The special handling of nonoptreq on systems without weak symbol
   support was removed, since we no longer rely on weak symbols for
   optional_api.

 [1]: https://wiki.asterisk.org/wiki/x/wACUAQ

(closes issue ASTERISK-22296)
Reported by: Matt Jordan
Review: https://reviewboard.asterisk.org/r/2797/
........

Merged revisions 397989 from http://svn.asterisk.org/svn/asterisk/branches/12


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@397990 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2013-08-30 13:40:27 +00:00
Kevin Harwell d7b9a702d8 Verbose logging discrepancies
Refactored cases where a combination of ast_verbose/options_verbose were
present.  Also in general tried to eliminate, in as many places as possible,
where the options_verbose global variable was being used.  Refactored the way
local and remote consoles handle verbose message logging in an attempt to
solve the various discrepancies that sometimes would show between the two.

(closes issue AST-1193)
Reported by: Guenther Kelleter
Review: https://reviewboard.asterisk.org/r/2798/
........

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

Merged revisions 397958 from http://svn.asterisk.org/svn/asterisk/branches/12


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@397959 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2013-08-29 22:49:24 +00:00
Kevin Harwell e1cfc18a78 Memory leaks fix
(closes ASTERISK-22376)
Reported by: John Hardin
Patches:
     memleak.patch uploaded by jhardin (license 6512)
     memleak2.patch uploaded by jhardin (license 6512)
........

Merged revisions 397946 from http://svn.asterisk.org/svn/asterisk/branches/12


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@397947 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2013-08-29 21:37:29 +00:00
Joshua Colp dd33217762 Add the bucket API.
Bucket is a URI based API for the creation, retrieval, updating, and deletion
of "buckets" and files contained within them.

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@397600 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2013-08-23 21:49:47 +00:00
Walter Doekes 28e9d3afc9 Don't store repeated commands in the editline history buffer.
The equivalent of bash HISTCONTROL=ignoredups.

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@397415 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2013-08-22 12:28:33 +00:00
Kinsey Moore d7f1f31270 Refactor CEL to avoid using the event system core
This removes usage of the event system for CEL backend data
distribution and strips unused pieces out of the event system.

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@396888 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2013-08-17 14:46:44 +00:00
Kinsey Moore bd352e0827 Remove leading spaces from the CLI command before parsing
If you've mistakenly put a space before typing in a command, the
leading space will be included as part of the command, and the command
parser will not find the corresponding command. This patch rectifies
that situation by stripping the leading spaces on commands.

Review: https://reviewboard.asterisk.org/r/2709/
Patch-by: Tilghman Lesher
........

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

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@396747 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2013-08-15 16:37:06 +00:00
David M. Lee 357b275239 Fix res_ari_asterisk load issue
The new res_ari_asterisk.so module presents several config options
from asterisk main. Unfortunately, they aren't exported, so the module
won't load on Linux.

This patch renames the variables, adding the ast_ prefix so they will
be exported.

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@396166 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2013-08-05 14:35:00 +00:00
Matthew Jordan 38236e54a8 Remove dead code from features.c; refactor pickup code into pickup.c
This patch does the following:
 * It moves the pickup code out of features.c and into pickup.c
 * It removes the vast majority of dead code out of features.c. In particular,
   this includes the parking code.

(issue ASTERISK-22134)



git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@396060 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2013-08-02 02:32:44 +00:00
Matthew Jordan 715d894d48 Update copyright year to 2013 in asterisk.c; some whitespace fixes
(closes issue ASTERISK-22179)
Reported by: Malcolm Davenport
........

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

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@395034 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2013-07-22 13:52:10 +00:00
Kinsey Moore c3b8939be8 Add CEL local optimization record type
This adds a new CEL event type, AST_CEL_LOCAL_OPTIMIZE, to represent
local channel optimizations. Local channel optimizations were one of
several things conveyed by the now defunct BRIDGE_UPDATE event type.
This also adds a unit test to test generation of this new CEL event.

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@394870 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2013-07-20 13:25:05 +00:00
Jason Parker 7422581b6d Move channel driver Registry manager events to core.
This also shuffles the stasis system topic and related handling.

(closes issue ASTERISK-21488)

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@393804 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2013-07-08 14:42:57 +00:00
Matthew Jordan d0a55fa52d Refactor RTCP events over to Stasis; associate with channels
This patch does the following:

* It merges Jaco Kroon's patch from ASTERISK-20754, which provides channel
  information in the RTCP events. Because Stasis provides a cache, Jaco's
  patch was modified to pass the channel uniqueid to the RTP layer as
  opposed to a pointer to the channel. This has the following benefits:
  (1) It keeps the RTP engine 'clean' of references back to channels
  (2) It prevents circular dependencies and other potential ref counting issues
* The RTP engine now allows any RTP implementation to raise RTCP messages.
  Potentially, other implementations (such as res_rtp_multicast) could also
  raise RTCP information. The engine provides structs to represent RTCP headers
  and RTCP SR/RR reports.
* Some general refactoring in res_rtp_asterisk was done to try and tame the
  RTCP code. It isn't perfect - that's *way* beyond the scope of this work -
  but it does feel marginally better.
* A few random bugs were fixed in the RTCP statistics. (Example: performing an
  assignment of a = a is probably not correct)
* We now raise RTCP events for each SR/RR sent/received. Previously we wouldn't
  raise an event when we sent a RR report.

Note that this work will be of use to others who want to monitor call quality
or build modules that report call quality statistics. Since the events are now
moving across the Stasis message bus, this is far easier to accomplish. It is
also a first step (though by no means the last step) towards getting Olle's
pinefrog work incorporated.

Again: note that the patch by Jaco Kroon was modified slightly for this work;
however, he did all of the hard work in finding the right places to set the
channel in the RTP engine across the channel drivers. Much thanks goes to Jaco
for his hard work here.

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

(closes issue ASTERISK-20574)
Reported by: Jaco Kroon
patches:
  asterisk-rtcp-channel.patch uploaded by jkroon (License 5671)

(closes issue ASTERISK-21471)
Reported by: Matt Jordan



git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@393740 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2013-07-05 17:33:33 +00:00
David M. Lee a75fd32212 ARI - channel recording support
This patch is the first step in adding recording support to the
Asterisk REST Interface.

Recordings are stored in /var/spool/recording. Since recordings may be
destructive (overwriting existing files), the API rejects attempts to
escape the recording directory (avoiding issues if someone attempts to
record to ../../lib/sounds/greeting, for example).

(closes issue ASTERISK-21594)
(closes issue ASTERISK-21581)
Review: https://reviewboard.asterisk.org/r/2612/


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@393550 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2013-07-03 17:58:45 +00:00
David M. Lee c4adaf9106 Configuration for Stasis threadpool
The appropriate settings for the Stasis threadpool is very system
specific, depending upon both workload and system configuration.

This patch adds a stasis.conf file which can be used to configure the
key attributes of the threadpool for the Stasis message bus.

(closes issue ASTERISK-21280)
Review: https://reviewboard.asterisk.org/r/2651/


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@393542 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2013-07-03 17:20:43 +00:00
Matthew Jordan 6cc03db642 Better handle parking in CDRs
Parking typically occurs when a channel is transferred to a parking extension.
When this occurs, the channel never actually hits the dialplan if the extension
it was transferred to was a "parking extension", that is, the extension in
the first priority calls the Park application. Instead, the channel is
immediately sent into the holding bridge acting as the parking bridge.

This is problematic.

Because we never go out to the dialplan, the CDRs won't transition properly
and the application field will not be set to "Park". CDRs typically swallow
holding bridges, so the CDR itself won't even be generated.

This patch handles this by pulling out the holding bridge handling into its
own CDR state. CDRs now have an explicit parking state that accounts for this
specific subclass of the holding bridge. In addition, we handle the parking
stasis message to set application specific data on the CDR such that the
last known application for the CDR properly reflects "Park".

This is a bit sad since we're working around the odd internal implementation
of parking that exists in Asterisk (and that we had to maintain in order to
continue to meet some odd use cases of parking), but at least the code to
handle that is where it belongs: in CDRs as opposed to sprinkled liberally
throughout the codebase.

This patch also properly clears the OUTBOUND channel flag from a channel when
it leaves a bridge, and tweaks up dialing handling to properly compare the
correct CDR with the channel calling/being dialed.




git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@393130 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2013-06-28 15:50:56 +00:00
Kinsey Moore a0b7a49a4a Index installed sounds and implement ARI sounds queries
This adds support for stasis/sounds and stasis/sounds/{ID} queries via
the Asterisk RESTful Interface (ARI, formerly Stasis-HTTP).

The following changes have been made to accomplish this:
* A modular indexer was created for local media.
* A new function to get an ast_format associated with a file extension
  was added.  
* Modifications were made to the built-in HTTP server so that URI
  decoding could be deferred to the URI handler when necessary.
* The Stasis-HTTP sounds JSON documentation was modified to handle
  cases where multiple languages are installed in different formats.
* Register and Unregister events for formats were added to the system
  topic.

(closes issue ASTERISK-21584)
(closes issue ASTERISK-21585)
Review: https://reviewboard.asterisk.org/r/2507/


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@392700 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2013-06-24 13:49:20 +00:00
Matthew Jordan 6258bbe7bd Update Asterisk's CDRs for the new bridging framework
This patch is the initial push to update Asterisk's CDR engine for the new
bridging framework. This patch guts the existing CDR engine and builds the new
on top of messages coming across Stasis. As changes in channel state and bridge
state are detected, CDRs are built and dispatched accordingly. This
fundamentally changes CDRs in a few ways.
(1) CDRs are now *very* reflective of the actual state of channels and bridges.
    This means CDRs track well with what an actual channel is doing - which
    is useful in transfer scenarios (which were previously difficult to pin
    down). It does, however, mean that CDRs cannot be 'fooled'. Previous
    behavior in Asterisk allowed for CDR applications, channels, and other
    properties to be spoofed in parts of the code - this no longer works.
(2) CDRs have defined behavior in multi-party scenarios. This behavior will not
    be what everyone wants, but it is a defined behavior and as such, it is
    predictable.
(3) The CDR manipulation functions and applications have been overhauled. Major
    changes have been made to ResetCDR and ForkCDR in particular. Many of the
    options for these two applications no longer made any sense with the new
    framework and the (slightly) more immutable nature of CDRs.

There are a plethora of other changes. For a full description of CDR behavior,
see the CDR specification on the Asterisk wiki.

(closes issue ASTERISK-21196)

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



git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@391947 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2013-06-17 03:00:38 +00:00
Kinsey Moore b51b437bf3 Refactor CEL bridge events on top of Stasis-Core
This pulls bridge-related CEL event triggers out of the code in which
they were residing and pulls them into cel.c where they are now
triggered by changes in bridge snapshots. To get access to the
Stasis-Core parking topic in cel.c, the Stasis-Core portions of parking
init have been pulled into core Asterisk init.

This also adds a new CEL event (AST_CEL_BRIDGE_TO_CONF) that indicates
a two-party bridge has transitioned to a multi-party conference. The
reverse cannot occur in CEL terms even though it may occur in actuality
and two party bridges which receive a AST_CEL_BRIDGE_TO_CONF will be
treated as multi-party conferences for the duration of the bridge.

Review: https://reviewboard.asterisk.org/r/2563/
(closes issue ASTERISK-21564)


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@391643 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2013-06-13 13:46:40 +00:00
Kinsey Moore 4f84e48028 Refactor CEL channel events on top of Stasis-Core
This uses the channel state change events from Stasis-Core to determine
when channel-related CEL events should be raised. Those refactored in
this patch are:
* AST_CEL_CHANNEL_START
* AST_CEL_ANSWER
* AST_CEL_APP_START
* AST_CEL_APP_END
* AST_CEL_HANGUP
* AST_CEL_CHANNEL_END

Retirement of Linked IDs is also refactored.

CEL configuration has been refactored to use the config framework.

Note: Some HANGUP events are not generated correctly because the bridge
layer does not propagate hangupcause/hangupsource information yet.

Review: https://reviewboard.asterisk.org/r/2544/
(closes issue ASTERISK-21563)


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@391622 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2013-06-13 13:15:56 +00:00
Jason Parker a1494300c9 Replace ast_manager_publish_message() with a more useful version.
It's much easier to just create a blob of the message.  Convert some AMI events
to use it.

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@390268 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2013-05-31 14:36:08 +00:00
David M. Lee d81c846724 Avoid unnecessary cleanups during immediate shutdown
This patch addresses issues during immediate shutdowns, where modules
are not unloaded, but Asterisk atexit handlers are run.

In the typical case, this usually isn't a big deal. But the
introduction of the Stasis message bus makes it much more likely for
asynchronous activity to be happening off in some thread during
shutdown.

During an immediate shutdown, Asterisk skips unloading modules. But
while it is processing the atexit handlers, there is a window of time
where some of the core message types have been cleaned up, but the
message bus is still running. Specifically, it's still running
module subscriptions that might be using the core message types. If a
message is received by that subscription in that window, it will
attempt to use a message type that has been cleaned up.

To solve this problem, this patch introduces ast_register_cleanup().
This function operates identically to ast_register_atexit(), except
that cleanup calls are not invoked on an immediate shutdown. All of
the core message type and topic cleanup was moved from atexit handlers
to cleanup handlers.

This ensures that core type and topic cleanup only happens if the
modules that used them are first unloaded.

This patch also changes the ast_assert() when accessing a cleaned up
or uninitialized message type to an error log message. Message type
functions are actually NULL safe across the board, so the assert was a
bit heavy handed. Especially for anyone with DO_CRASH enabled.

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@390122 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2013-05-30 17:05:53 +00:00
Matthew Jordan fe3ca5401f Fix a variety of memory corruption/assertion errors
* Initialize a Stasis-Core message type prior to initializing a caching topic.
  The caching topic will attempt to use the message type.
* Don't attempt to publish Stasis-Core messages from remote console connections.
  They aren't the main process; they shouldn't attempt to behave as it (they also
  don't have the infrastructure to do so)
* Don't treat a JSON object as an ao2 object (whoops)
* In asterisk.c, ref bump the JSON even package that is distributed with the
  event meta data. The callers assume that they own the reference, and the packing
  routine steals references.


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@389785 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2013-05-26 04:47:17 +00:00
Matthew Jordan 97c6062dfc Restore initialization of security topics
During a merge the security topic initialization got blown away.
This patch restores it.

git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@389770 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2013-05-25 17:41:25 +00:00
Matthew Jordan 06be8463b6 Migrate a large number of AMI events over to Stasis-Core
This patch moves a number of AMI events over to the Stasis-Core message bus.
This includes:
 * ChanSpyStart/Stop
 * MonitorStart/Stop
 * MusicOnHoldStart/Stop
 * FullyBooted/Reload
 * All Voicemail/MWI related events

In addition, it adds some Stasis-Core and AMI support for generic AMI messages,
refactors the message router in AMI to use a single router with topic
forwarding for the topics that AMI cares about, and refactors MWI message
types and topics to be more name compliant.

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

(closes issue ASTERISK-21462)



git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@389733 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2013-05-24 20:44:07 +00:00
Richard Mudgett 3d63833bd6 Merge in the bridge_construction branch to make the system use the Bridging API.
Breaks many things until they can be reworked.  A partial list:
chan_agent
chan_dahdi, chan_misdn, chan_iax2 native bridging
app_queue
COLP updates
DTMF attended transfers
Protocol attended transfers


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@389378 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2013-05-21 18:00:22 +00:00
Jonathan Rose b90bba7a30 Stasis: Update security events to use Stasis
Also moves ACL messages to the security topic and gets rid of the
ACL topic

(closes issue ASTERISK-21103)
Reported by: Matt Jordan
Review: https://reviewboard.asterisk.org/r/2496/



git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@388975 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2013-05-17 17:36:10 +00:00
David M. Lee 9648e258c7 Refactored the rest of the message types to use the STASIS_MESSAGE_TYPE_*
macros.


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@388751 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2013-05-15 02:37:22 +00:00
David M. Lee e06e519a90 Initial support for endpoints.
An endpoint is an external device/system that may offer/accept
channels to/from Asterisk. While this is a very useful concept for end
users, it is surprisingly not a core concept within Asterisk itself.

This patch defines ast_endpoint as a separate object, which channel
drivers may use to expose their concept of an endpoint. As the channel
driver creates channels, it can use ast_endpoint_add_channel() to
associate channels to the endpoint. This updated the endpoint
appropriately, and forwards all of the channel's events to the
endpoint's topic.

In order to avoid excessive locking on the endpoint object itself, the
mutable state is not accessible via getters. Instead, you can create a
snapshot using ast_endpoint_snapshot_create() to get a consistent
snapshot of the internal state.

This patch also includes a set of topics and messages associated with
endpoints, and implementations of the endpoint-related RESTful
API. chan_sip was updated to create endpoints with SIP peers, but the
state of the endpoints is not updated with the state of the peer.

Along for the ride in this patch is a Stasis test API. This is a
stasis_message_sink object, which can be subscribed to a Stasis
topic. It has functions for blocking while waiting for conditions in
the message sink to be fulfilled.

(closes issue ASTERISK-21421)
Review: https://reviewboard.asterisk.org/r/2492/



git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@387932 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2013-05-08 13:39:08 +00:00
Jason Parker 6b4da0959b Fix building with LOW_MEMORY defined.
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@387738 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2013-05-06 17:01:41 +00:00
Matthew Jordan 6e2fe0c9ab Clean up documentation; prevent ref leak on exit
This patch:
 * Cleans up some doxygen
 * Prevents leaking the system level Stasis topics and messages
   on exit (users of valgrind will be happier)


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@387633 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2013-05-04 16:00:46 +00:00
Jonathan Rose 1eac5a7988 Stasis: Convert network change events into network change stasis messages
(issue ASTERISK-21103)
Review: https://reviewboard.asterisk.org/r/2490/


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@387594 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2013-05-03 18:03:26 +00:00
Kinsey Moore 191cf99ae1 Move device state distribution to Stasis-core
In the move from Asterisk's event system to Stasis, this makes
distributed device state aggregation always-on, removes unnecessary
task processors where possible, and collapses aggregate and
non-aggregate states into a single cache for ease of retrieval. This
also removes an intermediary step in device state aggregation.

Review: https://reviewboard.asterisk.org/r/2389/
(closes issue ASTERISK-21101)
Patch-by: Kinsey Moore <kmoore@digium.com>


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@385860 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2013-04-16 15:33:59 +00:00
David M. Lee cfd2b244f7 Corrected some module issues introduced by r383579.
When I moved res_json.c to json.c, I left the MODULE_INFO stuff in there,
which was interesting if you ran module show. I also forgot to call what
was in module_load() from asterisk main().


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@383611 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2013-03-22 19:26:37 +00:00
Kinsey Moore 99aa02d17f Transition MWI to Stasis-core
Remove MWI's dependency on the event system by moving it to
Stasis-core. This also introduces forwarding topic pools in Stasis-core
which aggregate many dynamically allocated topics into a single primary
topic.

Review: https://reviewboard.asterisk.org/r/2368/
(closes issue ASTERISK-21097)
Patch-by: Kinsey Moore


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@383284 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2013-03-16 15:45:58 +00:00
David M. Lee 4edd8be35c This patch adds a new message bus API to Asterisk.
For the initial use of this bus, I took some work kmoore did creating
channel snapshots. So rather than create AMI events directly in the
channel code, this patch generates Stasis events, which manager.c uses
to then publish the AMI event.

This message bus provides a generic publish/subscribe mechanism within
Asterisk. This message bus is:

 - Loosely coupled; new message types can be added in seperate modules.
 - Easy to use; publishing and subscribing are straightforward
   operations.

In addition to basic publish/subscribe, the patch also provides
mechanisms for message forwarding, and for message caching.

(issue ASTERISK-20887)
(closes issue ASTERISK-20959)
Review: https://reviewboard.asterisk.org/r/2339/


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@382685 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2013-03-08 15:15:13 +00:00
Matthew Jordan d04ab3c645 Add CLI configuration documentation
This patch allows a module to define its configuration in XML in source, such
that it can be parsed by the XML documentation engine. Documentation is
generated in a two-pass approach:

1. The documentation is first generated from the XML pulled from the source
2. The documentation is then enhanced by the registration of configuration
   options that use the configuration framework

This patch include configuration documentation for the following modules:
 * chan_motif
 * res_xmpp
 * app_confbridge
 * app_skel
 * udptl

Two new CLI commands have been added:
 * config show help - show configuration help by module, category, and item
 * xmldoc dump - dump the in-memory representation of the XML documentation to
   a new XML file.

Review: https://reviewboard.asterisk.org/r/2278
Review: https://reviewboard.asterisk.org/r/2058

patches:
  on review 2058 uploaded by twilson



git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@381527 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2013-02-15 13:38:12 +00:00
Kinsey Moore 2e1e0735fe Revamp of terminal color codes
The core module related to coloring terminal output was old and needed
some love.  The main thing here was an attempt to get rid of the
obscene number of stack-local buffers that were allocated for no other
reason than to colorize some output.  Instead, this uses a simple trick
to allocate several buffers within threadlocal storage, then
automatically rotates between them, so that you can make multiple calls
to the colorization routine within one function and not need to
allocate multiple buffers.

Review: https://reviewboard.asterisk.org/r/2241/
Patches:
    bug.patch uploaded by Tilghman Lesher


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@381448 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2013-02-14 18:47:56 +00:00
Joshua Colp 3fa4278a31 Merge the sorcery data access layer API.
Sorcery is a unifying data access layer which provides a pluggable mechanism to allow
object creation, retrieval, updating, and deletion using different backends (or wizards).

This is a fancy way of saying "one interface to rule them all" where them is configuration,
realtime, and anything else that comes along.

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@380069 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2013-01-25 14:01:04 +00:00
Matthew Jordan a3e7a77a82 Update init.d scripts to handle stderr; readd splash screen for remote consoles
When r376428 was commited to re-order start up sequences to be more tolerant of
forking with thread primitives, a few items were changed that caused changes
in behavior on some distros. This includes:
 * Not displaying the splash screen on a remote console.
 * Displaying an error message on stderr when a remote console cannot connect
   to a running instance of Asterisk.

In the first case, the splash screen was re-added (thanks to Michael L. Young).
In the second case, the various init.d scripts were modified to pipe stderr
to /dev/null, as the error message is useful - if you execute a remote
console or a remote console command execution and it fail, it should tell
you. Note that the error message was always present, it just failed to be
printed prior to r376428.

Much thanks to the folks who quickly reported this problem, provided solutions,
and promptly tested the various init.d scripts on a variety of distros.

(closes issue ASTERISK-20945)
Reported by: Warren Selby
Tested by: Michael L. Young, Jamuel Starkey, kaldemar, Danny Nicholas, mjordan
patches:
  asterisk-20945-remote-intro-msg.diff uploaded by elguero (license 5026)
  ASTERISK-20945-1.8-mjordan.diff uploaded by mjordan (license 6283)
........

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

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

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@379791 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2013-01-21 20:41:12 +00:00
Matthew Jordan 01763fd41b Fix astcanary startup problem due to wrong pid value from before daemon call
When Asterisk forks itself into the background via a call to daemon, it must
re-set the pid value of the new process. Otherwise, astcanary gets the pid
value of the process before the fork, which prevents it from running. Asterisk
eventually starts lowering its priority, as it can no longer communicate
with the proverbial canary in the coal mine.

This patch ensures that the correct process identifier is used by astcanary.

Note that this is getting committed to 10 as a regression fix.

(closes issue ASTERISK-20947)
Reported by: Jakob Hirsch
Tested by: mjordan
patches:
  asterisk-10.12.0.astcanary_ppid.diff uploaded by Jakob Hirsch (license 6113)
........

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

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

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@379518 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2013-01-19 00:19:19 +00:00
Mark Michelson 8cb156bfc1 Add UUID support to Asterisk.
This provides a common API for dealing with unique identifiers.
The API provides methods to create, parse, copy, and stringify UUIDs.

An accompanying unit test is provided that tests all operations.

(closes issue ASTERISK-20726)
reported by Matt Jordan

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



git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@377846 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-12-11 21:04:45 +00:00
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