Move more channel events to Stasis; move res_json.c to main/json.c.
authorDavid M. Lee <dlee@digium.com>
Fri, 22 Mar 2013 14:06:46 +0000 (14:06 +0000)
committerDavid M. Lee <dlee@digium.com>
Fri, 22 Mar 2013 14:06:46 +0000 (14:06 +0000)
commitcf9324b25eb8a7dc5cef77f54e12758dfbcd6645
tree67492a4753d03498d3b842939d1c4c9256efa013
parent401f7c188038a327ed40a7bff30a28f03b69f8a1
Move more channel events to Stasis; move res_json.c to main/json.c.

This patch started out simply as fixing the bouncing tests introduced
in r382685, but required some other changes to give it a decent
implementation.

To fix the bouncing tests, the UserEvent and Newexten AMI events
needed to be refactored to dispatch via Stasis. Dispatching directly
to AMI resulted in those events sometimes getting ahead of the
associated Newchannel events, which would understandably confuse anyone.

I found that instead of creating a zillion different message types and
structures associated with them, it would be preferable to define a
message type that has a channel snapshot and a blob of structured data
with a small bit of additional information. The JSON object model
provides a very nice way of representing structured data, so I went
with that.

 * Move JSON support from res_json.c to main/json.c
   * Made libjansson-dev a required dependency
 * Added an ast_channel_blob message type, which has a channel
   snapshot and JSON blob of data.
 * Changed UserEvent and Newexten events so that they are dispatched
   via ast_channel_blob messages on the channel's topic.
 * Got rid of the ast_channel_varset message; used ast_channel_blob
   instead.
 * Extracted the manager functions converting Stasis channel events to
   AMI events into manager_channel.c.

(issue ASTERISK-21096)
Review: https://reviewboard.asterisk.org/r/2381/

git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@383579 65c4cc65-6c06-0410-ace0-fbb531ad65f3
15 files changed:
CHANGES
apps/app_userevent.c
configure
configure.ac
include/asterisk/autoconfig.h.in
include/asterisk/channel.h
include/asterisk/manager.h
main/channel.c
main/json.c [moved from res/res_json.c with 100% similarity]
main/manager.c
main/manager_channels.c [new file with mode: 0644]
main/pbx.c
pbx/pbx_realtime.c
res/res_json.exports.in [deleted file]
tests/test_json.c