Skip to content
Snippets Groups Projects
  1. Nov 18, 2021
  2. Jan 24, 2018
    • Corey Farrell's avatar
      Remove redundant module checks and references. · 527cf5a5
      Corey Farrell authored
      This removes references that are no longer needed due to automatic
      references created by module dependencies.
      
      In addition this removes most calls to ast_module_check as they were
      checking modules which are listed as dependencies.
      
      Change-Id: I332a6e8383d4c72c8e89d988a184ab8320c4872e
      527cf5a5
  3. Jan 22, 2018
    • Corey Farrell's avatar
      Add missing OPTIONAL_API and ARI dependences. · 679fa5fb
      Corey Farrell authored
      I've audited all modules that include any header which includes
      asterisk/optional_api.h.  All modules which use OPTIONAL_API now declare
      those dependencies in AST_MODULE_INFO using requires or optional_modules
      as appropriate.
      
      In addition ARI dependency declarations have been reworked.  Instead of
      declaring additional required modules in res/ari/resource_*.c we now add
      them to an optional array "requiresModules" in api-docs for each module.
      This allows the AST_MODULE_INFO dependencies to include those missing
      modules.
      
      Change-Id: Ia0c70571f5566784f63605e78e1ceccb4f79c606
      679fa5fb
  4. Jan 15, 2018
    • Corey Farrell's avatar
      loader: Add dependency fields to module structures. · 9cfdb81e
      Corey Farrell authored
      * Declare 'requires' and 'enhances' text fields on module info structure.
      * Rename 'nonoptreq' to 'optional_modules'.
      * Update doxygen comments.
      
      Still need to investigate dependencies among modules I cannot compile.
      
      Change-Id: I3ad9547a0a6442409ff4e352a6d897bef2cc04bf
      9cfdb81e
  5. Jun 16, 2017
    • George Joseph's avatar
      res_ari: Add "module loaded" check to ari stubs · 1ac00965
      George Joseph authored
      The recent change to make the use of LOAD_DECLINE more consistent
      caused res_ari to unload itself before declining if the ari.conf
      file wasn't found.  The ari stubs though still tried to use the
      configuration resulting in segfaults.
      
      This patch creates a new CHECK_ARI_MODULE_LOADED macro which tests
      to see if res_ari is actually loaded and causes the stubs to also
      decline if it isn't.  The macro was then added to the mustache
      template's "load_module" function.
      
      ASTERISK-27026 #close
      Reported-by: Ronald Raikes
      
      Change-Id: I263d56efa628ee3c411bdcd16d49af6260c6c91d
      1ac00965
  6. Apr 17, 2017
    • George Joseph's avatar
      make ari-stubs so doc periodic jobs can run · b55d21ad
      George Joseph authored
      The periodic doc job does a make ari-stubs and checks that
      there are no changes before generating the docs.  Since I changed
      the mustache template (and the generated code directly) recently
      and forgot to regenerate the stubs, the doc job thinks they're out
      of date.
      
      Change-Id: I94b97035311eccf52b0101b8590223265a7881d4
      b55d21ad
  7. Jan 23, 2017
    • George Joseph's avatar
      ari: Implement 'debug all' and request/response logging · 66916067
      George Joseph authored
      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
      (cherry picked from commit 1d890874)
      66916067
  8. Oct 27, 2016
    • Corey Farrell's avatar
      Remove ASTERISK_REGISTER_FILE. · a6e5bae3
      Corey Farrell authored
      ASTERISK_REGISTER_FILE no longer has any purpose so this commit removes
      all traces of it.
      
      Previously exported symbols removed:
      * __ast_register_file
      * __ast_unregister_file
      * ast_complete_source_filename
      
      This also removes the mtx_prof static variable that was declared when
      MTX_PROFILE was enabled.  This variable was only used in lock.c so it
      is now initialized in that file only.
      
      ASTERISK-26480 #close
      
      Change-Id: I1074af07d71f9e159c48ef36631aa432c86f9966
      a6e5bae3
  9. Aug 18, 2016
    • Kevin Harwell's avatar
      rest-api: Swagger scripts were not replacing format variable in file brief · 7ea133f2
      Kevin Harwell authored
      Given resource paths did not have 'json' substituted in for the '{format}'. For
      some auto generated documentation/comment strings it resulted in something like
      the following:
      
      "... REST handler for /api-docs/sounds.{format}"
      
      This patch makes sure the resource api's path is properly substituted.
      
      ASTERISK-25472 #close
      
      Change-Id: Ie3e950a35db4043e284019d6c9061f3b03922e23
      7ea133f2
  10. May 13, 2015
  11. Apr 29, 2015
    • Corey Farrell's avatar
      ARI: Fix missing dependencies. · f226bd6f
      Corey Farrell authored
      ARI modules that are generated by 'make ari-stubs' are all dependent on
      res_ari_model.  Additionally some of the same modules depend on one or more
      res_stasis_* modules.
      
      ASTERISK-25027 #close
      Reported by: Corey Farrell
      
      Change-Id: I8e07fe7e81fedacb87232f2b6f8b5f47927b4153
      f226bd6f
  12. Apr 13, 2015
    • Matt Jordan's avatar
      git migration: Refactor the ASTERISK_FILE_VERSION macro · 4a582616
      Matt Jordan authored
      Git does not support the ability to replace a token with a version
      string during check-in. While it does have support for replacing a
      token on clone, this is somewhat sub-optimal: the token is replaced
      with the object hash, which is not particularly easy for human
      consumption. What's more, in practice, the source file version was often
      not terribly useful. Generally, when triaging bugs, the overall version
      of Asterisk is far more useful than an individual SVN version of a file. As a
      result, this patch removes Asterisk's support for showing source file
      versions.
      
      Specifically, it does the following:
      
      * Rename ASTERISK_FILE_VERSION macro to ASTERISK_REGISTER_FILE, and
        remove passing the version in with the macro. Other facilities
        than 'core show file version' make use of the file names, such as
        setting a debug level only on a specific file. As such, the act of
        registering source files with the Asterisk core still has use. The
        macro rename now reflects the new macro purpose.
      
      * main/asterisk:
        - Refactor the file_version structure to reflect that it no longer
          tracks a version field.
        - Remove the "core show file version" CLI command. Without the file
          version, it is no longer useful.
        - Remove the ast_file_version_find function. The file version is no
          longer tracked.
        - Rename ast_register_file_version/ast_unregister_file_version to
          ast_register_file/ast_unregister_file, respectively.
      
      * main/manager: Remove value from the Version key of the ModuleCheck
        Action. The actual key itself has not been removed, as doing so would
        absolutely constitute a backwards incompatible change. However, since
        the file version is no longer tracked, there is no need to attempt to
        include it in the Version key.
      
      * UPGRADE: Add notes for:
        - Modification to the ModuleCheck AMI Action
        - Removal of the "core show file version" CLI command
      
      Change-Id: I6cf0ff280e1668bf4957dc21f32a5ff43444a40e
      4a582616
  13. Jul 25, 2014
  14. Jan 21, 2014
  15. Nov 27, 2013
    • David M. Lee's avatar
      ari:Add application/json parameter support · fccb427c
      David M. Lee authored
      The patch allows ARI to parse request parameters from an incoming JSON
      request body, instead of requiring the request to come in as query
      parameters (which is just weird for POST and DELETE) or form
      parameters (which is okay, but a bit asymmetric given that all of our
      responses are JSON).
      
      For any operation that does _not_ have a parameter defined of type
      body (i.e. "paramType": "body" in the API declaration), if a request
      provides a request body with a Content type of "application/json", the
      provided JSON document is parsed and searched for parameters.
      
      The expected fields in the provided JSON document should match the
      query parameters defined for the operation. If the parameter has
      'allowMultiple' set, then the field in the JSON document may
      optionally be an array of values.
      
      (closes issue ASTERISK-22685)
      Review: https://reviewboard.asterisk.org/r/2994/
      
      
      git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@403177 65c4cc65-6c06-0410-ace0-fbb531ad65f3
      fccb427c
  16. Nov 23, 2013
    • Kevin Harwell's avatar
      ARI: Implement device state API · ed483779
      Kevin Harwell authored
      Created a data model and implemented functionality for an ARI device state
      resource.  The following operations have been added that allow a user to
      manipulate an ARI controlled device:
      
      Create/Change the state of an ARI controlled device
      PUT    /deviceStates/{deviceName}&{deviceState}
      
      Retrieve all ARI controlled devices
      GET    /deviceStates
      
      Retrieve the current state of a device
      GET    /deviceStates/{deviceName}
      
      Destroy a device-state controlled by ARI
      DELETE /deviceStates/{deviceName}
      
      The ARI controlled device must begin with 'Stasis:'.  An example controlled
      device name would be Stasis:Example.  A 'DeviceStateChanged' event has also
      been added so that an application can subscribe and receive device change
      events.  Any device state, ARI controlled or not, can be subscribed to.
      
      While adding the event, the underlying subscription control mechanism was
      refactored so that all current and future resource subscriptions would be
      the same.  Each event resource must now register itself in order to be able
      to properly handle [un]subscribes.
      
      (issue ASTERISK-22838)
      Reported by: Matt Jordan
      Review: https://reviewboard.asterisk.org/r/3025/
      ........
      
      Merged revisions 403134 from http://svn.asterisk.org/svn/asterisk/branches/12
      
      
      git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@403135 65c4cc65-6c06-0410-ace0-fbb531ad65f3
      ed483779
  17. Nov 08, 2013
  18. Nov 07, 2013
    • David M. Lee's avatar
      ari: User better nicknames for ARI operations · 7d0d1a1e
      David M. Lee authored
      While working on building client libraries from the Swagger API, I
      noticed a problem with the nicknames.
      
          channel.deleteChannel()
          channel.answerChannel()
          channel.muteChannel()
      
      Etc. We put the object name in the nickname (since we were generating C
      code), but it makes OO generators redundant.
      
      This patch makes the nicknames more OO friendly. This resulted in a lot
      of name changing within the res_ari_*.so modules, but not much else.
      
      There were a couple of other fixed I made in the process.
      
       * When reversible operations (POST /hold, POST /unhold) were made more
         RESTful (POST /hold, DELETE /unhold), the path for the second operation
         was left in the API declaration. This worked, but really the two
         operations should have been on the same API.
       * The POST /unmute operation had still not been REST-ified.
      
      Review: https://reviewboard.asterisk.org/r/2940/
      ........
      
      Merged revisions 402528 from http://svn.asterisk.org/svn/asterisk/branches/12
      
      
      git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@402529 65c4cc65-6c06-0410-ace0-fbb531ad65f3
      7d0d1a1e
  19. Oct 29, 2013
  20. Oct 11, 2013
    • David M. Lee's avatar
      Multiple revisions 400508,400842-400843,400848 · 9234804a
      David M. Lee authored
      ........
        r400508 | dlee | 2013-10-03 23:54:51 -0500 (Thu, 03 Oct 2013) | 1 line
        
        Corrected response class for stopPlayback
      ........
        r400842 | dlee | 2013-10-10 14:23:24 -0500 (Thu, 10 Oct 2013) | 1 line
        
        Correct some ARI wiki rendering errors
      ........
        r400843 | dlee | 2013-10-10 14:26:19 -0500 (Thu, 10 Oct 2013) | 1 line
        
        Updated /play resource docs. The playback of http: resources isn't implemented... yet
      ........
        r400848 | dlee | 2013-10-11 11:18:46 -0500 (Fri, 11 Oct 2013) | 5 lines
        
        Fix a stupid copy/paste error in ARI docs.
        
        Patches:
            ari-doc-patch.txt uploaded by jbigelow (license 5091)
      ........
      
      Merged revisions 400508,400842-400843,400848 from http://svn.asterisk.org/svn/asterisk/branches/12
      
      
      git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@400852 65c4cc65-6c06-0410-ace0-fbb531ad65f3
      9234804a
  21. Aug 02, 2013
    • David M. Lee's avatar
      ARI - implement allowMultiple for parameters · 537ecebd
      David M. Lee authored
      Swagger allows parameters to be specified as 'allowMultiple', meaning
      that the parameter may be specified as a comma separated list of
      values.
      
      I had written some of the API docs using that, but promptly forgot
      about implementing it. This patch finally fills in that gap.
      
      The codegen template was updated to represent 'allowMultiple' fields
      as array/size fields in the _args structs. It also parses the comma
      separated list using ast_app_separate_args(), so quoted strings in the
      argument will be handled properly.
      
      Review: https://reviewboard.asterisk.org/r/2698/
      
      
      git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@396122 65c4cc65-6c06-0410-ace0-fbb531ad65f3
      537ecebd
  22. Jul 27, 2013
  23. Jul 23, 2013
  24. Jul 19, 2013
    • Jonathan Rose's avatar
      ARI: Bridge Playback, Bridge Record · 17c54617
      Jonathan Rose authored
      Adds a new channel driver for creating channels for specific purposes
      in bridges, primarily to act as either recorders or announcers. Adds
      ARI commands for playing announcements to ever participant in a bridge
      as well as for recording a bridge. This patch also includes some
      documentation/reponse fixes to related ARI models such as playback
      controls.
      
      (closes issue ASTERISK-21592)
      Reported by: Matt Jordan
      
      (closes issue ASTERISK-21593)
      Reported by: Matt Jordan
      
      Review: https://reviewboard.asterisk.org/r/2670/
      
      
      git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@394809 65c4cc65-6c06-0410-ace0-fbb531ad65f3
      17c54617
  25. Jul 03, 2013
    • David M. Lee's avatar
      Update events to use Swagger 1.3 subtyping, and related aftermath · c9a3d456
      David M. Lee authored
      This patch started with the simple idea of changing the /events data
      model to be more sane. The original model would send out events like:
      
          { "stasis_start": { "args": [], "channel": { ... } } }
      
      The event discriminator was the field name instead of being a value in
      the object, due to limitations in how Swagger 1.1 could model objects.
      While technically sufficient in communicating event information, it was
      really difficult to deal with in terms of client side JSON handling.
      
      This patch takes advantage of a proposed extension[1] to Swagger which
      allows type variance through the use of a discriminator field. This had
      a domino effect that made this a surprisingly large patch.
      
       [1]: https://groups.google.com/d/msg/wordnik-api/EC3rGajE0os/ey_5dBI_jWcJ
      
      In changing the models, I also had to change the swagger_model.py
      processor so it can handle the type discriminator and subtyping. I took
      that a big step forward, and using that information to generate an
      ari_model module, which can validate a JSON object against the Swagger
      model.
      
      The REST and WebSocket generators were changed to take advantage of the
      validators. If compiled with AST_DEVMODE enabled, JSON objects that
      don't match their corresponding models will not be sent out. For REST
      API calls, a 500 Internal Server response is sent. For WebSockets, the
      invalid JSON message is replaced with an error message.
      
      Since this took over about half of the job of the existing JSON
      generators, and the .to_json virtual function on messages took over the
      other half, I reluctantly removed the generators.
      
      The validators turned up all sorts of errors and inconsistencies in our
      data models, and the code. These were cleaned up, with checks in the
      code generator avoid some of the consistency problems in the future.
      
       * The model for a channel snapshot was trimmed down to match the
         information sent via AMI. Many of the field being sent were not
         useful in the general case.
       * The model for a bridge snapshot was updated to be more consistent
         with the other ARI models.
      
      Another impact of introducing subtyping was that the swagger-codegen
      documentation generator was insufficient (at least until it catches up
      with Swagger 1.2). I wanted it to be easier to generate docs for the API
      anyways, so I ported the wiki pages to use the Asterisk Swagger
      generator. In the process, I was able to clean up many of the model
      links, which would occasionally give inconsistent results on the wiki. I
      also added error responses to the wiki docs, making the wiki
      documentation more complete.
      
      Finally, since Stasis-HTTP will now be named Asterisk REST Interface
      (ARI), any new functions and files I created carry the ari_ prefix. I
      changed a few stasis_http references to ari where it was non-intrusive
      and made sense.
      
      (closes issue ASTERISK-21885)
      Review: https://reviewboard.asterisk.org/r/2639/
      
      
      
      git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@393529 65c4cc65-6c06-0410-ace0-fbb531ad65f3
      c9a3d456
    • David M. Lee's avatar
      Shuffle RESTful URL's around. · dcf03554
      David M. Lee authored
      This patch moves the RESTful URL's around to more appropriate
      locations for release.
      
      The /stasis URL's are moved to /ari, since Asterisk REST Interface was
      a more appropriate name than Stasis-HTTP. (Most of the code still has
      stasis_http references, but they will be cleaned up after there are no
      more outstanding branches that would have merge conflicts with such a
      change).
      
      A larger change was moving the ARI events WebSocket off of the shared
      /ws URL to its permanent home on /ari/events. The Swagger code
      generator was extended to handle "upgrade: websocket" and
      "websocketProtocol:" attributes on an operation.
      
      The WebSocket module was modified to better handle WebSocket servers
      that have a single registered protocol handler. If a client
      connections does not specify the Sec-WebSocket-Protocol header, and
      the server has a single protocol handler registered, the WebSocket
      server will go ahead and accept the client for that subprotocol.
      
      (closes issue ASTERISK-21857)
      Review: https://reviewboard.asterisk.org/r/2621/
      
      
      
      git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@393528 65c4cc65-6c06-0410-ace0-fbb531ad65f3
      dcf03554
  26. Jun 24, 2013
  27. May 10, 2013
  28. Apr 22, 2013
    • David M. Lee's avatar
      This patch adds a RESTful HTTP interface to Asterisk. · 1c21b857
      David M. Lee authored
      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
      1c21b857
Loading