]> git.ipfire.org Git - thirdparty/asterisk.git/commit
ari: Implement 'debug all' and request/response logging 50/4750/2
authorGeorge Joseph <gjoseph@digium.com>
Thu, 19 Jan 2017 15:05:36 +0000 (08:05 -0700)
committerGeorge Joseph <gjoseph@digium.com>
Mon, 23 Jan 2017 17:03:48 +0000 (11:03 -0600)
commit6b0d734312fe4879ee989da6023d6322fed2797d
tree43a3fbf8a5ebceb2451d7ac881c34f8eeb4899e1
parentcbb05d98f23c15623650e4704a888bd2a5a5c708
ari: Implement 'debug all' and request/response logging

The 'ari set debug' command has been enhanced to accept 'all' as an
application name.  This allows dumping of all apps even if an app
hasn't registered yet.  To accomplish this, a new global_debug global
variable was added to res/stasis/app.c and new APIs were added to
set and query the value.

'ari set debug' now displays requests and responses as well as events.
This required refactoring the existing debug code.

* The implementation for 'ari set debug' was moved from stasis/cli.{c,h}
  to ari/cli.{c,h}, and stasis/cli.{c,h} were deleted.
* In order to print the body of incoming requests even if a request
  failed, the consumption of the body was moved from the ari stubs
  to ast_ari_callback in res_ari.c and the moustache templates were
  then regenerated.  The body is now passed to ast_ari_invoke and then
  on to the handlers.  This results in code savings since that template
  was inserted multiple times into all the stubs.

An additional change was made to the ao2_str_container implementation
to add partial key searching and a sort function.  The existing cli
code assumed it was already there when it wasn't so the tab completion
was never working.

Change-Id: Ief936f747ce47f1fb14035fbe61152cf766406bf
28 files changed:
CHANGES
include/asterisk/ari.h
include/asterisk/stasis_app.h
main/strings.c
res/ari/ari_websockets.c
res/ari/cli.c
res/ari/resource_events.c
res/res_ari.c
res/res_ari_applications.c
res/res_ari_asterisk.c
res/res_ari_bridges.c
res/res_ari_channels.c
res/res_ari_device_states.c
res/res_ari_endpoints.c
res/res_ari_events.c
res/res_ari_mailboxes.c
res/res_ari_playbacks.c
res/res_ari_recordings.c
res/res_ari_sounds.c
res/res_stasis.c
res/stasis/app.c
res/stasis/app.h
res/stasis/cli.c [deleted file]
res/stasis/cli.h [deleted file]
res/stasis/stasis_bridge.c
rest-api-templates/param_parsing.mustache
rest-api-templates/res_ari_resource.c.mustache
tests/test_ari.c