[asterisk-dev] [Code Review] Move Newexten and UserEvent AMI events to Stasis; adding JSON messages to stasis-core

David Lee reviewboard at asterisk.org
Mon Mar 11 14:58:56 CDT 2013


-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviewboard.asterisk.org/r/2381/
-----------------------------------------------------------

Review request for Asterisk Developers.


Summary
-------

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.


Diffs
-----

  /trunk/pbx/pbx_realtime.c 382805 
  /trunk/res/res_json.c 382805 
  /trunk/main/pbx.c 382805 
  /trunk/configure UNKNOWN 
  /trunk/configure.ac 382805 
  /trunk/include/asterisk/autoconfig.h.in 382805 
  /trunk/include/asterisk/channel.h 382805 
  /trunk/include/asterisk/manager.h 382805 
  /trunk/include/asterisk/pbx.h 382805 
  /trunk/main/channel.c 382805 
  /trunk/main/manager.c 382805 
  /trunk/apps/app_userevent.c 382805 
  /trunk/res/res_json.exports.in 382805 
  /trunk/tests/test_json.c 382805 

Diff: https://reviewboard.asterisk.org/r/2381/diff


Testing
-------

Ran bouncing testsuite tests 10 times without failure.


Thanks,

David

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.digium.com/pipermail/asterisk-dev/attachments/20130311/e1dae7fd/attachment.htm>


More information about the asterisk-dev mailing list