Commit Graph

3938 Commits

Author SHA1 Message Date
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
Kevin Harwell 2eebab3992 Fix for segfault in __ast_rwlock_destroy with DEBUG_THREADS
If DEBUG_THREADS is enabled __ast_rwlock_destroy causes a segfault while trying
to access a possible NULL t->track object.  A NULL check has been added before
trying to access the memory.

(closes issue ASTERISK-21724)
Reported by: Corey Farrell
Fixed by: Corey Farrell
Patches:
	ast_rwlock_destroy-segv.patch uploaded by Corey Farrell (license 5909)
........

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

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@388840 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2013-05-15 15:58:56 +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
Richard Mudgett d1d1425327 Make ao2 global objects not always use the debug version of the ao2_ref() calls.
The debug versions of ao2_ref() should only be used if REF_DEBUG is
enabled so nothing is written to /tmp/refs unexpectedly.

(closes issue ASTERISK-21785)
Reported by: abelbeck
Patches:
      jira_asterisk_21785_v11.patch (license #5621) patch uploaded by rmudgett
Tested by: abelbeck
........

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@388701 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2013-05-14 19:03:26 +00:00
Michael L. Young 54424c2ee2 Fix Missing CALL-ID When Logging Through Syslog
The CALL-ID (ie [C-00000074]) is missing when logging to syslog.  This was just
an oversight when this feature was added.

* Add CALL-IDs when using syslog

(closes issue ASTERISK-21430)
Reported by: Nikola Ciprich
Tested by: Nikola Ciprich, Michael L. Young
Patches:
    asterisk-21430-syslog-callid_trunk.diff by Michael L. Young (license 5026)

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

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@388617 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2013-05-13 21:21:03 +00:00
Jonathan Rose 6a257dd534 pbx: Fix lack of cleanup on macrolock and context_table
(closes issue ASTERISK-21723)
Reported by: Corey Farrell
Patches:
    core-pbx-cleanup.patch uploaded by Correy Farrell (license 5909)
........

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

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@388579 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2013-05-13 19:29:56 +00:00
Richard Mudgett 681b50df0a Fix SendText AMI action to never return non-zero.
AMI actions must never return non-zero unless they intend to close the AMI
connection.  (Which is almost never.)

(closes issue ASTERISK-21779)
Reported by: Paul Goldbaum
........

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

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@388479 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2013-05-13 14:28:50 +00:00
David M. Lee 4666079b05 Address unload order issues for res_stasis* modules
I've noticed when doing a graceful shutdown that the res_stasis_http.so
module gets unloaded before the modules that use it, which causes some
asserts during their unload.

While r386928 was a quick hack to get it to not assert and die, this
patch increases the use counts on res_stasis.so and res_stasis_http.so
properly. It's a bigger change than I expected, hence the review instead
of just committing it.

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@388350 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2013-05-10 17:12:57 +00:00
Kinsey Moore 7ce05bfb9b Add channel events for res_stasis apps
This change adds a framework in res_stasis for handling events from
channel topics. JSON event generation and validation code is created
from event documentation in rest-api/api-docs/events.json to assist in
JSON event generation, ensure consistency, and ensure that accurate
documentation is available for ALL events that are received by
res_stasis applications.

The userevent application has been refactored along with the code that
handles userevent channel blob events to pass the headers as key/value
pairs in the JSON blob. As a side-effect, app_userevent now handles
duplicate keys by overwriting the previous value.

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@388275 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2013-05-10 13:13:06 +00:00
David M. Lee ec53d7fa87 Removed #if checks for crazy old versions of OS X.
The <arpa/nameser_compat.h> was introduced way back in OS X Panther, which
itself was end-of-lifed back in 2007. We can assume that any OS X machine
we build on will need that header file :-)

Why bother removing it? The flag we're checking (__APPLE_CC__) is actually
Apple's build number. Self-compiled versions of GCC (such as installing the
latest version of GCC from homebrew) sets the value to 0, making it useless
for this sort of compile flaggery.


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@388045 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2013-05-08 20:25:28 +00:00
David M. Lee 0eb4cf8c19 Remove required type field from channel blobs
When we first introduced the channel blob types, the JSON blobs were
self identifying by a required "type" field in the JSON object
itself. This, as it turns out, was a bad idea.

When we introduced the message router, it was useless for routing based
on the JSON type. And messages had two type fields to check: the
stasis_message_type() of the message itself, plus the type field in the
JSON blob (but only if it was a blob message).

This patch corrects that mistake by removing the required type field
from JSON blobs, and introducing first class stasis_message_type objects
for the actual message type.

Since we now will have a proliferation of message types, I introduced a
few macros to help reduce the amount of boilerplate necessary to set
them up.

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@388005 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2013-05-08 18:34:50 +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
David M. Lee dd87bea808 Minor fixups to Doxygen comments.
The \example tags marks an entire file as an example, not a code snippet.
........

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@387824 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2013-05-07 18:30:55 +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
Joshua Colp 40074542bf Add support for observers and JSON objectset creation to sorcery.
This change adds the ability for modules to add themselves as observers
to sorcery object types. Observers can be notified when objects are
created, updated, or deleted as well as when the object type is loaded or
reloaded. Observer notifications are done using a thread pool in a serialized
fashion so the caller of the sorcery API calls is minimally impacted.

This also adds the ability to create JSON changesets of a sorcery object.

Tests are also present to confirm all of the above functionality.

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@387662 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2013-05-06 13:04:08 +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
Richard Mudgett 3232e23ca7 Remove the ABI compatability ast_channel_alloc(). It is no longer needed.
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@387482 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2013-05-02 19:06:53 +00:00
Jonathan Rose 02961601cd Putting all event defs and names back for now due to res_corosync dependency
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@387420 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2013-05-02 16:39:28 +00:00
Alec L Davis 0b87695460 Add Asterisk Version to core show locks
Assist with reporting 'core show locks' when submitting bug reports.

Example below:

===========================
== SVN-branch-1.8-...
== Currently Held Locks
===========================


(closes issue ASTERISK-21743)

Reported by: alecdavis
Tested by: alecdavis
alecdavis (license 585)
........

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

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@387296 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2013-05-02 06:47:16 +00:00
Richard Mudgett 073e0e215a Make mod_load_cmp() not as klunky.
There is a reason the heap comparison functions like qsort(), and other
comparison functions specify <0, >0, and =0 for the return values.


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@387209 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2013-05-01 20:35:25 +00:00
Matthew Jordan e51b6a37e9 Fix CDR not being created during an externally initiated blind transfer
Way back when in the dark days of Asterisk 1.8.9, blind transferring a call
in a context that included the 'h' extension would inadvertently execute the
hangup code logic on the transferred channel. This was a "bad thing". The fix
was to properly check for the softhangup flags on the channel and only execute
the 'h' extension logic (and, in later versions, hangup handler logic) if the
channel was well and truly dead (Jim).

Unfortunately, CDRs are fickle. Setting the softhangup flag when we detected
that the channel was leaving the bridge (but not to die) caused some crucial
snippet of CDR code, lying in ambush in the middle of the bridging code, to
not get executed. This had the effect of blowing away one of the CDRs that is
typically created during a blind transfer.

While we live and die by the adage "don't touch CDRs in release branches", this
was our bad. The attached patch restores the CDR behavior, and still manages to
not run the 'h' extension during a blind transfer (at least not when it's
supposed to).

Thanks to Steve Davies for diagnosing this and providing a fix.

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

(closes issue ASTERISK-21394)
Reported by: Ishfaq Malik
Tested by: Ishfaq Malik, mjordan
patches:
  fix_missing_blindXfer_cdr2 uploaded by one47 (License 5012)
........

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

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@387039 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2013-04-30 22:50:40 +00:00
Jonathan Rose 8e257fe819 Stasis Core: Refactor ACL Change events to go out over the stasis core msg bus
(issue ASTERISK-21103)
Reported by: Matt Jordan
Review: https://reviewboard.asterisk.org/r/2481/


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@387037 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2013-04-30 22:37:24 +00:00
Jonathan Rose 6f5733388a Add forgotten event types to event_names array
........

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@387035 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2013-04-30 22:20:55 +00:00
Joshua Colp 02be50b1ac Add support for a realtime sorcery module.
This change does the following:

1. Adds the sorcery realtime module
2. Adds unit tests for the sorcery realtime module
3. Changes the realtime core to use an ast_variable list instead of variadic arguments
4. Changes all realtime drivers to accept an ast_variable list

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@386731 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2013-04-27 12:01:29 +00:00
Matthew Jordan 2d1cbb4311 Clean up memory leak in config file on off nominal paths when glob is allowed
If a system allows for its usage, Asterisk will use glob to help parse
Asterisk .conf files. The config file loading routine was leaking the memory
allocated by the glob() routine when the config file was in an unmodified
or invalid state.

This patch properly calls globfree in those off nominal paths.

(closes issue ASTERISK-21412)
Reported by: Corey Farrell
patches:
  config_glob_leak.patch uploaded by Corey Farrell (license 5909)
........

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

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@386685 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2013-04-26 21:34:16 +00:00
David M. Lee 562d0b4d18 By popular demand, putting the about-to-load-module printf back.
But now it only prints during the initial startup, and prints at verbose 1
level.


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@386684 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2013-04-26 21:31:39 +00:00
Matthew Jordan b3e3dfa51c Clean up resources in features on exit
This patch cleans up two things features:
* It properly unregisters the CLI commands that features registered
* It cancels and performs a pthread_join on the created parking thread. This
  not only properly joins a non-detached thread, but also prevents disposing
  of the parking lots prior to the parking thread completely exiting.

(closes issue ASTERISK-21407)
Reported by: Corey Farrell
patches:
  features_shutdown-r2.patch uploaded by Corey Farrell (License 5909)
........

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

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@386676 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2013-04-26 21:27:24 +00:00
David M. Lee 79b2edea8f Removing stray printf from r386540
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@386640 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2013-04-26 21:00:45 +00:00
Mark Michelson 09af343789 Add an \extref doxygen pointer for libuuid.
Thanks to Olle Johansson for suggesting this.



git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@386638 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2013-04-26 20:32:11 +00:00
Mark Michelson 74f2318051 Merge the pimp_my_sip branch into trunk.
The pimp_my_sip branch is being merged at this point because
it offers basic functionality, and from an API standpoint, things
are complete.

SIP work is *not* feature-complete; however, with the completion
of the SUBSCRIBE/NOTIFY API, all APIs (except a PUBLISH API) have
been created, and thus it is possible for developers to attempt
to create new SIP work.

API documentation can be found in the doxygen in the code, but
usability documentation is still lacking.



git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@386540 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2013-04-25 18:25:31 +00:00
Richard Mudgett c137d12111 Fix crash when AMI redirect action redirects two channels out of a bridge.
The two party bridging loops were changing the bridge peer pointers
without the channel locks held.  Thus when ast_channel_massquerade()
tested and used the pointer there is a small window of opportunity for the
pointers to become NULL even though the masquerade code has the channels
locked.

(closes issue ASTERISK-21356)
Reported by: William luke
Patches:
      jira_asterisk_21356_v11.patch (license #5621) patch uploaded by rmudgett
Tested by: William luke
........

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

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@386289 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2013-04-22 16:44:21 +00:00
David M. Lee 1c21b8575b This patch adds a RESTful HTTP interface to Asterisk.
The API itself is documented using Swagger, a lightweight mechanism for
documenting RESTful API's using JSON. This allows us to use swagger-ui
to provide executable documentation for the API, generate client
bindings in different languages, and generate a lot of the boilerplate
code for implementing the RESTful bindings. The API docs live in the
rest-api/ directory.

The RESTful bindings are generated from the Swagger API docs using a set
of Mustache templates.  The code generator is written in Python, and
uses Pystache. Pystache has no dependencies, and be installed easily
using pip. Code generation code lives in rest-api-templates/.

The generated code reduces a lot of boilerplate when it comes to
handling HTTP requests. It also helps us have greater consistency in the
REST API.

(closes issue ASTERISK-20891)
Review: https://reviewboard.asterisk.org/r/2376/

git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@386232 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2013-04-22 14:58:53 +00:00
David M. Lee e61cc22404 cli.c: Properly initialize debug_modules and verbose_modules.
This avoids some lock errors on the core set {debug,verbose} commands.
........

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

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@386054 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2013-04-19 05:20:02 +00:00
David M. Lee aff127a737 Fix lock errors on startup.
In messages.c, there are several places in the code where we create a
tmp_tech_holder and pass that into an ao2_find call. Unfortunately, we
weren't initializing the rwlock on the tmp_tech_holder, which the hash
function was locking. It's apparently harmless, but still not the best
code.

This patch extracts all that copy/pasted code into two functions,
msg_find_by_tech and msg_find_by_tech_name, which properly initialize
and destroy the rwlock on the tmp_tech_holder.

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

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@386019 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2013-04-18 17:26:29 +00:00
Kinsey Moore 71a01725b8 Move presence state distribution to Stasis-core
Convert presence state events to Stasis-core messages and remove
redundant serializers where possible.

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@385862 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2013-04-16 15:48:16 +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 c599aca553 Moved core logic from app_stasis to res_stasis
After some discussion on asterisk-dev, it was decided that the bulk of
the logic in app_stasis actually belongs in a resource module instead
of the application module.

This patch does that, leaves the app specific stuff in app_stasis, and
fixes up everything else to be consistent with that change.

 * Renamed test_app_stasis to test_res_stasis
 * Renamed app_stasis.h to stasis_app.h
   * This is still stasis application support, even though it's no
     longer in an app_ module. The name should never have been tied to
     the type of module, anyways.
 * Now that json isn't a resource module anymore, moved the
   ast_channel_snapshot_to_json function to main/stasis_channels.c,
   where it makes more sense.

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@385742 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2013-04-15 16:43:47 +00:00
David M. Lee 2450722f52 DTMF events are now published on a channel's stasis_topic. AMI was
refactored to use these events rather than producing the events directly
in channel.c. Finally, the code was added to app_stasis to produce
DTMF events on the WebSocket.

The AMI events are completely backward compatible, including sending
events on transmitted DTMF, and sending DTMF start events.

The Stasis-HTTP events are somewhat simplified. Since DTMF start and
DTMF send events are generally less useful, Stasis-HTTP will only send
events on received DTMF end.

(closes issue ASTERISK-21282)
(closes issue ASTERISK-21359)
Review: https://reviewboard.asterisk.org/r/2439


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@385734 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2013-04-15 16:22:03 +00:00
Kinsey Moore 7f885dc31d Expose channel snapshot manager blob generation
These functions are already used in one branch (jrose's parking branch)
and will soon be used in other branches as well.


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@385522 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2013-04-12 21:11:02 +00:00
Richard Mudgett 3afeac5e3b Eliminated dial_features_destroy() since it is equivalent to ast_free_ptr()
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@385278 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2013-04-10 23:08:02 +00:00
Richard Mudgett eb2d144195 * Fix unlocked accesses to feature_list. The feature_list is now also
protected by the features_lock.

* Made all calls to ast_find_call_feature() have the features_lock held.

* Fixed set_config_flags() to actually use find_group() to look for
feature groups in DYNAMIC_FEATURES.  The code originally assumed all
feature groups were listed in DYNAMIC_FEATURES.

* Make everyone use ast_rdlock_call_features(),
ast_unlock_call_features(), and new ast_wrlock_call_features() instead of
directly calling the rwlock API on features_lock.


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@385277 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2013-04-10 23:03:30 +00:00
David M. Lee ff7ecd3dbf Fixed manager channelvars support.
For the events that have been ported to Stasis, this was broken in
r384910, when a couple of lines of code was lost in a merge.


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@385236 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2013-04-10 15:34:47 +00:00
Richard Mudgett d09eeaa8eb Rename struct feature_ds to struct feature_datastore.
Because "struct feature_ds *feature_ds" is not a good thing.


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@385142 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2013-04-09 19:58:35 +00:00
Russell Bryant ee05bdec92 Add inheritance support to FEATURE()/FEATUREMAP().
The settings saved on the channel for FEATURE()/FEATUREMAP() were only
for that channel.  This patch adds the ability to have these settings
inherited to child channels if you set FEATURE(inherit)=yes.

Closes issue ASTERISK-21306.

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@385088 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2013-04-09 06:16:42 +00:00
Matthew Jordan b8d4e573f1 Add multi-channel Stasis messages; refactor Dial AMI events to Stasis
This patch does the following:
 * A new Stasis payload has been defined for multi-channel messages. This
   payload can store multiple ast_channel_snapshot objects along with a single
   JSON blob. The payload object itself is opaque; the snapshots are stored
   in a container keyed by roles. APIs have been provided to query for and
   retrieve the snapshots from the payload object.
 * The Dial AMI events have been refactored onto Stasis. This includes dial
   messages in app_dial, as well as the core dialing framework. The AMI events
   have been modified to send out a DialBegin/DialEnd events, as opposed to
   the subevent type that was previously used.
 * Stasis messages, types, and other objects related to channels have been
   placed in their own file, stasis_channels. Unit tests for some of these
   objects/messages have also been written.



git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@384910 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2013-04-08 14:26:37 +00:00
David M. Lee a2a53cc306 Stasis application WebSocket support
This is the API that binds the Stasis dialplan application to external
Stasis applications. It also adds the beginnings of WebSocket
application support.

This module registers a dialplan function named Stasis, which is used
to put a channel into the named Stasis app. As a channel enters and
leaves the Stasis diaplan application, the Stasis app receives a
'stasis-start' and 'stasis-end' events.

Stasis apps register themselves using the stasis_app_register and
stasis_app_unregister functions. Messages are sent to an application
using stasis_app_send.

Finally, Stasis apps control channels through the use of the
stasis_app_control object, and the family of stasis_app_control_*
functions.

Other changes along for the ride are:
 * An ast_frame_dtor function that's RAII_VAR safe
 * Some common JSON encoders for name/number, timeval, and
   context/extension/priority

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@384879 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2013-04-08 13:27:45 +00:00
Richard Mudgett b8e5189456 Separate some event struct definitions from instantiation.
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@384760 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2013-04-04 18:15:34 +00:00
Richard Mudgett b9962ee26a astobj2: Fix rbtree duplicate handling.
OBJ_PARTIAL_KEY searching a rbtree did not find all possible matches if
the container did not accept duplicates.

Added matching node bias to indicate which matching node is being searched
for: first, last, any.


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@384616 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2013-04-03 16:01:51 +00:00
Joshua Colp 56313ee068 Pass the object type name to the configuration framework.
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@384518 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2013-04-02 12:18:50 +00:00