Skip to content
Snippets Groups Projects
  1. Nov 18, 2021
  2. Nov 15, 2021
    • Josh Soref's avatar
      res: Spelling fixes · dcf492e7
      Josh Soref authored
      Correct typos of the following word families:
      
      identifying
      structures
      actcount
      initializer
      attributes
      statement
      enough
      locking
      declaration
      userevent
      provides
      unregister
      session
      execute
      searches
      verification
      suppressed
      prepared
      passwords
      recipients
      event
      because
      brief
      unidentified
      redundancy
      character
      the
      module
      reload
      operation
      backslashes
      accurate
      incorrect
      collision
      initializing
      instance
      interpreted
      buddies
      omitted
      manually
      requires
      queries
      generator
      scheduler
      configuration has
      owner
      resource
      performed
      masquerade
      apparently
      routable
      
      ASTERISK-29714
      
      Change-Id: I88485116d2c59b776aa2e1f8b4ce8239a21decda
      dcf492e7
  3. Aug 20, 2019
    • George Joseph's avatar
      res_ari.c: Prefer exact handler match over wildcard · 8da4e28a
      George Joseph authored
      Given the following request path and 2 handler paths...
      Request: /channels/externalMedia
      Handler: /channels/{channelId}      "wildcard"
      Handler: /channels/externalmedia    "non-wildcard"
      
      ...if /channels/externalMedia was registered as a handler after
      /channels/{channelId} as shown above, the request would automatically
      match the wildcard handler and attempt to parse "externalMedia" into
      the channelId variable which isn't what was intended.  It'd work
      if the non-wildard entry was defined in rest-api/api-docs/channels.json
      before the wildcard entry but that makes the json files
      order-dependent which isn't a good thing.
      
      To combat this issue, the search loop saves any wildcard match but
      continues looking for exact matches at the same level.  If it finds
      one, it's used.  If it hasn't found an exact match at the end of
      the current level, the wildcard is used.  Regardless, after
      searching the current level, the wildcard is cleared so it won't
      accidentally match for a different object or a higher level.
      
      BTW, it's currently not possible for more than 1 wildcard entry
      to be defined for a level.  For instance, there couldn't be:
      Handler: /channels/{channelId}
      Handler: /channels/{channelName}
      We wouldn't know which one to match.
      
      Change-Id: I574aa3cbe4249c92c30f74b9b40e750e9002f925
      8da4e28a
  4. May 03, 2018
    • Joshua Colp's avatar
      res_ari: Remove requirement that body exists when debug is on. · de3ca9ba
      Joshua Colp authored
      The "ari set debug" code for incoming requests incorrectly assumed
      that all requests would contain a body. If one did not exist the
      request would be incorrectly rejected. The response that was sent
      was also incomplete as an incorrect function was used to construct
      the response.
      
      The code has now been changed to no longer require a request to have
      a body and the response updated to use the correct function.
      
      ASTERISK-27801
      
      Change-Id: I4eef036ad54550a4368118cc348765ecac25e0f8
      de3ca9ba
  5. Mar 14, 2018
    • Corey Farrell's avatar
      loader: Convert reload_classes to built-in modules. · 572a508e
      Corey Farrell authored
      * acl (named_acl.c)
      * cdr
      * cel
      * ccss
      * dnsmgr
      * dsp
      * enum
      * extconfig (config.c)
      * features
      * http
      * indications
      * logger
      * manager
      * plc
      * sounds
      * udptl
      
      These modules are now loaded at appropriate time by the module loader.
      Unlike loadable modules these use AST_MODULE_LOAD_FAILURE on error so
      the module loader will abort startup on failure of these modules.
      
      Some of these modules are still initialized or shutdown from outside the
      module loader.  logger.c is initialized very early and shutdown very
      late, manager.c is initialized by the module loader but is shutdown by
      the Asterisk core (too much uses it without holding references).
      
      Change-Id: I371a9a45064f20026c492623ea8062d02a1ab97f
      572a508e
  6. 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
  7. 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
  8. Nov 03, 2017
  9. Nov 02, 2017
  10. Oct 09, 2017
  11. Apr 12, 2017
    • 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
  12. 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
  13. Nov 14, 2016
    • Sebastien Duthil's avatar
      res_ari: Add support for channel variables in ARI events. · c6d755de
      Sebastien Duthil authored
      This works the same as for AMI manager variables. Set
      "channelvars=foo,bar" in your ari.conf general section, and then the
      channel variables "foo" and "bar" (along with their values), will
      appear in every Stasis websocket channel event.
      
      ASTERISK-26492 #close
      patches:
        ari_vars.diff submitted by Mark Michelson
      
      Change-Id: I5609ba239259577c0948645df776d7f3bc864229
      c6d755de
  14. 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
  15. Aug 19, 2016
    • Torrey Searle's avatar
      res_ari: Add http prefix to generated docs · c1b6a796
      Torrey Searle authored
      updated the uri handler to include the url prefix of the http server
      this enables res_ari to add it to the uris when generating docs
      
      Change-Id: I279335a2625261a8492206c37219698f42591c2e
      (cherry picked from commit 6f448f32)
      c1b6a796
  16. 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
  17. May 14, 2016
    • Sean Bright's avatar
      res_ari: Correct Location headers returned by some ARI resources · 14938184
      Sean Bright authored
      The Location headers returned by:
      
       * /bridges/{bridgeId}/play
       * /bridges/{bridgeId}/record
       * /channels/{channelId}/play
       * /channels/{channelId}/record
      
      Did not have the '/ari' prefix, and in the case of the 'play' resources, were
      using 'playback' instead of 'playbacks.'
      
      Change-Id: I957c58a3a1471bf477dae7c67faa1b74fcd9241c
      14938184
  18. Aug 18, 2015
  19. Jul 14, 2015
  20. May 13, 2015
  21. 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
  22. Jul 25, 2014
  23. Jul 03, 2014
  24. Jun 26, 2014
    • Matthew Jordan's avatar
      res_http_websocket: Close websocket correctly and use careful fwrite · 365ae752
      Matthew Jordan authored
      When a client takes a long time to process information received from Asterisk,
      a write operation using fwrite may fail to write all information. This causes
      the underlying file stream to be in an unknown state, such that the socket
      must be disconnected. Unfortunately, there are two problems with this in
      Asterisk's existing websocket code:
      1. Periodically, during the read loop, Asterisk must write to the connected
         websocket to respond to pings. As such, Asterisk maintains a reference to
         the session during the loop. When ast_http_websocket_write fails, it may
         cause the session to decrement its ref count, but this in and of itself
         does not break the read loop. The read loop's write, on the other hand,
         does not break the loop if it fails. This causes the socket to get in a
         'stuck' state, preventing the client from reconnecting to the server.
      2. More importantly, however, is that the fwrite in ast_http_websocket_write
         fails with a large volume of data when the client takes awhile to process
         the information. When it does fail, it fails writing only a portion of
         the bytes. With some debugging, it was shown that this was failing in a
         similar fashion to ASTERISK-12767. Switching this over to ast_careful_fwrite
         with a long enough timeout solved the problem.
      
      Note that this version of the patch, unlike r417310 in Asterisk 11, exposes
      configuration options beyond just chan_sip's sip.conf. Configuration options
      to configure the write timeout have also been added to pjsip.conf and ari.conf.
      
      #ASTERISK-23917 #close
      Reported by: Matt Jordan
      
      Review: https://reviewboard.asterisk.org/r/3624/
      ........
      
      Merged revisions 417310 from http://svn.asterisk.org/svn/asterisk/branches/11
      ........
      
      Merged revisions 417311 from http://svn.asterisk.org/svn/asterisk/branches/12
      
      
      git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@417317 65c4cc65-6c06-0410-ace0-fbb531ad65f3
      365ae752
  25. Apr 18, 2014
  26. Apr 15, 2014
  27. Mar 19, 2014
  28. Mar 18, 2014
  29. Feb 26, 2014
  30. Jan 12, 2014
  31. 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
  32. Nov 08, 2013
  33. Oct 21, 2013
  34. Oct 02, 2013
  35. Aug 30, 2013
    • David M. Lee's avatar
      optional_api: Fix linking problems between modules that export global symbols · 9bed50db
      David M. Lee authored
      With the new work in Asterisk 12, there are some uses of the
      optional_api that are prone to failure. The details are rather involved,
      and captured on [the wiki][1].
      
      This patch addresses the issue by removing almost all of the magic from
      the optional API implementation. Instead of relying on weak symbol
      resolution, a new optional_api.c module was added to Asterisk core.
      
      For modules providing an optional API, the pointer to the implementation
      function is registered with the core. For modules that use an optional
      API, a pointer to a stub function, along with a optional_ref function
      pointer are registered with the core. The optional_ref function pointers
      is set to the implementation function when it's provided, or the stub
      function when it's now.
      
      Since the implementation no longer relies on magic, it is now supported
      on all platforms. In the spirit of choice, an OPTIONAL_API flag was
      added, so we can disable the optional_api if needed (maybe it's buggy on
      some bizarre platform I haven't tested on)
      
      The AST_OPTIONAL_API*() macros themselves remained unchanged, so
      existing code could remain unchanged. But to help with debugging the
      optional_api, the patch limits the #include of optional API's to just
      the modules using the API. This also reduces resource waste maintaining
      optional_ref pointers that aren't used.
      
      Other changes made as a part of this patch:
       * The stubs for http_websocket that wrap system calls set errno to
         ENOSYS.
      
       * res_http_websocket now properly increments module use count.
      
       * In loader.c, the while() wrappers around dlclose() were removed. The
         while(!dlclose()) is actually an anti-pattern, which can lead to
         infinite loops if the module you're attempting to unload exports a
         symbol that was directly linked to.
      
       * The special handling of nonoptreq on systems without weak symbol
         support was removed, since we no longer rely on weak symbols for
         optional_api.
      
       [1]: https://wiki.asterisk.org/wiki/x/wACUAQ
      
      (closes issue ASTERISK-22296)
      Reported by: Matt Jordan
      Review: https://reviewboard.asterisk.org/r/2797/
      ........
      
      Merged revisions 397989 from http://svn.asterisk.org/svn/asterisk/branches/12
      
      
      git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@397990 65c4cc65-6c06-0410-ace0-fbb531ad65f3
      9bed50db
  36. Jul 27, 2013
  37. Jul 23, 2013
  38. Jul 15, 2013
  39. Jul 12, 2013
Loading