Skip to content
Snippets Groups Projects
  1. Aug 02, 2021
  2. Jul 21, 2020
  3. Oct 24, 2019
    • Joshua Colp's avatar
      res_ari_events: Add module reference when a WebSocket is open. · 360936ea
      Joshua Colp authored
      This change ensures that the module isn't unloaded when a
      WebSocket is open. Previously it was possible to unload the
      module manually or during shutdown which could cause a crash
      when any active WebSockets were terminated.
      
      ASTERISK-28585
      
      Change-Id: I85c71ab112f99875b586419a34c08c8b34c14c5c
      360936ea
  4. Jul 29, 2019
  5. Feb 25, 2019
    • Kevin Harwell's avatar
      rest-api-templates/asterisk_processor - replace http line breaks with line feed · 574128de
      Kevin Harwell authored
      Including line breaks (<br>, <br/>, <br />) in certain parts of the rest-api
      json definition (e.g. summary, notes) displays them correctly in swagger.
      However, when the field gets converted to the wiki format those breaks get
      escaped and show up in the text as the actual string literal "<br>" etc...
      
      This patch makes it so when converting to the wiki format it replaces all line
      break values (<br>, etc...) with line feeds ('\n').
      
      Change-Id: Ie1c9faa0d1c5d622804cc0a21ce769095b08aa3d
      574128de
  6. Sep 12, 2018
    • Walter Doekes's avatar
      optional_api: Remove unused nonoptreq fields · bc8cdcef
      Walter Doekes authored
      As they're not actively used, they only grow stale. The moduleinfo field itself
      is kept in Asterisk 13/15 for ABI compatibility.
      
      ASTERISK-28046 #close
      
      Change-Id: I8df66a7007f807840414bb348511a8c14c05a9fc
      bc8cdcef
  7. Jul 18, 2018
  8. Apr 09, 2018
    • Corey Farrell's avatar
      Build System: Enable python3 compatibility. · 879e592b
      Corey Farrell authored
      * Consistently use spaces in rest-api-templates/asterisk_processor.py.
      * Exclude third-party from docs/full-en_US.xml.
      * Add docs/full-en_US.xml to .gitignore.
      * Use list() to convert python3 view.
      * Use python3 print function.
      * Replace cmp() with equivalent equation.
      * Replace reference to out of scope subtype variable with name
        parameter.
      * Use unescaping triple bracket notation in mustache templates where
        needed.  This causes behavior of Python2 to be maintained when using
        Python3.
      * Fix references to has_websocket / is_websocket in
        res_ari_resource.c.mustache.
      * Update calculation of has_websocket to use any().
      * Use unicode mode for writing output file in transform.py.
      * Replace 'from swagger_model import *' with explicit import of required
        symbols.
      
      I have not tested spandspflow2pcap.py or voicemailpwcheck.py, only the
      print syntax has been fixed.
      
      Change-Id: If5c5b556a2800d41a3e2cfef080ac2e151178c33
      879e592b
  9. 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
  10. 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
  11. 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
  12. Dec 22, 2017
  13. Jul 21, 2017
  14. 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
  15. Apr 12, 2017
    • George Joseph's avatar
      modules: change module LOAD_FAILUREs to LOAD_DECLINES (14) · 6db0939b
      George Joseph authored
      Change-Id: If99e3b4fc2d7e86fc3e61182aa6c835b407ed49e
      6db0939b
    • George Joseph's avatar
      modules: change module LOAD_FAILUREs to LOAD_DECLINES · 747beb1e
      George Joseph authored
      In all non-pbx modules, AST_MODULE_LOAD_FAILURE has been changed
      to AST_MODULE_LOAD_DECLINE.  This prevents asterisk from exiting
      if a module can't be loaded.  If the user wishes to retain the
      FAILURE behavior for a specific module, they can use the "require"
      or "preload-require" keyword in modules.conf.
      
      A new API was added to logger: ast_is_logger_initialized().  This
      allows asterisk.c/check_init() to print to the error log once the
      logger subsystem is ready instead of just to stdout.  If something
      does fail before the logger is initialized, we now print to stderr
      instead of stdout.
      
      Change-Id: I5f4b50623d9b5a6cb7c5624a8c5c1274c13b2b25
      747beb1e
  16. 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
  17. Dec 21, 2016
  18. 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
  19. 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
  20. Aug 16, 2016
  21. May 20, 2016
    • Matt Jordan's avatar
      ARI: Add the ability to download the media associated with a stored recording · e773e3a9
      Matt Jordan authored
      This patch adds a new feature to ARI that allows a client to download
      the media associated with a stored recording. The new route is
      /recordings/stored/{name}/file, and transmits the underlying binary file
      using Asterisk's HTTP server's underlying file transfer facilities.
      
      Because this REST route returns non-JSON, a few small enhancements had
      to be made to the Python Swagger generation code, as well as the
      mustache templates that generate the ARI bindings.
      
      ASTERISK-26042 #close
      
      Change-Id: I49ec5c4afdec30bb665d9c977ab423b5387e0181
      e773e3a9
  22. Oct 21, 2015
    • Matt Jordan's avatar
      rest-api-templates: Wikify error code response reasons · b425850f
      Matt Jordan authored
      Error response code descriptions may contain wiki markup that need to be
      escaped. Without this patch, Confluence will reject the document being sent
      and the responsible script will raise an exception.
      
      Change-Id: I21fcb66fee7f6332381f2b99b1b0195dff215ee5
      b425850f
  23. Oct 17, 2015
  24. Sep 21, 2015
    • Matt Jordan's avatar
      ARI: Add events for Contact and Peer Status changes · 5206aa9d
      Matt Jordan authored
      This patch adds support for receiving events regarding Peer status changes
      and Contact status changes. This is particularly useful in scenarios where
      we are subscribed to all endpoints and channels, where we often want to know
      more about the state of channel technology specific items than a single
      endpoint's state.
      
      ASTERISK-24870
      
      Change-Id: I6137459cdc25ce27efc134ad58abf065653da4e9
      5206aa9d
  25. Aug 18, 2015
  26. Jul 31, 2015
    • Ashley Sanders's avatar
      ARI: Channels added to Stasis application during WebSocket creation ... · fe804b09
      Ashley Sanders authored
      Prior to ASTERISK-24988, the WebSocket handshake was resolved before Stasis
      applications were registered. This was done such that the WebSocket would be
      ready when an application is registered. However, by creating the WebSocket
      first, the client had the ability to make requests for the Stasis application
      it thought had been created with the initial handshake request. The inevitable
      conclusion of this scenario was the cart being put before the horse.
      
      ASTERISK-24988 resolved half of the problem by ensuring that the applications
      were created and registered with Stasis prior to completing the handshake
      with the client. While this meant that Stasis was ready when the client
      received the green-light from Asterisk, it also meant that the WebSocket was
      not yet ready for Stasis to dispatch messages.
      
      This patch introduces a message queuing mechanism for delaying messages from
      Stasis applications while the WebSocket is being constructed. When the ARI
      event processor receives the message from the WebSocket that it is being
      created, the event processor instantiates an event session which contains a
      message queue. It then tries to create and register the requested applications
      with Stasis. Messages that are dispatched from Stasis between this point and
      the point at which the event processor is notified the WebSocket is ready, are
      stashed in the queue. Once the WebSocket has been built, the queue's messages
      are dispatched in the order in which they were originally received and the
      queue is concurrently cleared.
      
      ASTERISK-25181 #close
      Reported By: Matt Jordan
      
      Change-Id: Iafef7b85a2e0bf78c114db4c87ffc3d16d671a17
      fe804b09
  27. May 22, 2015
    • Matt Jordan's avatar
      res/ari: Register Stasis application on WebSocket attempt · 9cffcca5
      Matt Jordan authored
      Prior to this patch, when a WebSocket connection is made, ARI would not
      be informed of the connection until after the WebSocket layer had
      accepted the connection. This created a brief race condition where the
      ARI client would be notified that it was connected, a channel would be
      sent into the Stasis dialplan application, but ARI would not yet have
      registered the Stasis application presented in the HTTP request that
      established the WebSocket.
      
      This patch resolves this issue by doing the following:
       * When a WebSocket attempt is made, a callback is made into the ARI
         application layer, which verifies and registers the apps presented in
         the HTTP request. Because we do not yet have a WebSocket, we cannot
         have an event session for the corresponding applications. Some
         defensive checks were thus added to make the application objects
         tolerant to a NULL event session.
       * When a WebSocket connection is made, the registered application is
         updated with the newly created event session that wraps the WebSocket
         connection.
      
      ASTERISK-24988 #close
      Reported by: Joshua Colp
      
      Change-Id: Ia5dc60dc2b6bee76cd5aff0f69dd53b36e83f636
      9cffcca5
  28. May 13, 2015
  29. 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
    • Corey Farrell's avatar
      Git Conversion: Switch Non-C files to ASTERISK_REGISTER_FILE. · 55a780d2
      Corey Farrell authored
      This switches files used to generate other sources to use the new
      ASTERISK_REGISTER_FILE macro.
      
      ASTERISK-25026 #close
      Reported by: Corey Farrell
      
      Change-Id: Ieb2537b83421cad07c8955e5f90c405ccf079740
      55a780d2
  30. Apr 14, 2015
    • Corey Farrell's avatar
      Build System: Create Makefile macro MOD_ADD_SOURCE. · 62508d68
      Corey Farrell authored
      This new macro allows a single line to add all additional
      sources to a module.  This helps prevent modules from
      missing steps, and makes future changes easier since
      they can be made in a single place.
      
      ASTERISK-24960 #close
      Reported by: Corey Farrell
      
      Change-Id: I38f12d8b72c5e7bb37a879b2fb51761a2855eb4b
      62508d68
  31. Jan 27, 2015
    • Matthew Jordan's avatar
      ARI: Improve wiki documentation · fb8a2e03
      Matthew Jordan authored
      This patch improves the documentation of ARI on the wiki. Specifically, it
      addresses the following:
      * Allowed values and allowed ranges weren't documented. This was particularly
        frustrating, as Asterisk would reject query parameters with disallowed values
        - but we didn't tell anyone what the allowed values were.
      * The /play/id operation on /channels and /bridges failed to document all of
        the added media resource types.
      * Documentation for creating a channel into a Stasis application failed to
        note when it occurred, and that creating a channel into Stasis conflicts with
        creating a channel into the dialplan.
      * Some other minor tweaks in the mustache templates, including italicizing the
        parameter type, putting the default value on its own sub-bullet, and some
        other nicities.
      
      Review: https://reviewboard.asterisk.org/r/4351
      ........
      
      Merged revisions 431145 from http://svn.asterisk.org/svn/asterisk/branches/13
      
      
      git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@431148 65c4cc65-6c06-0410-ace0-fbb531ad65f3
      fb8a2e03
  32. Jan 23, 2015
  33. Aug 08, 2014
  34. Jul 03, 2014
  35. Jul 02, 2014
  36. Jan 21, 2014
  37. 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
Loading