Skip to content
Snippets Groups Projects
  1. Aug 30, 2013
    • David M. Lee's avatar
      ARI: Implement /recordings/stored API's · 7f547872
      David M. Lee authored
      his patch implements the ARI API's for stored recordings. While the
      original task only specified deleting a recording, it was simple
      enough to implement the GET for all recordings, and for an individual
      recording.
      
      The recording playback operation was modified to use the same code for
      accessing the recording as the REST API, so that they will behave
      consistently.
      
      There were several problems with the api-docs that were also fixed,
      bringing the ARI spec in line with the implementation. There were some
      'wishful thinking' fields on the stored recording model (duration and
      timestamp) that were removed, because I ended up not implementing a
      metadata file to go along with the recording to store such information.
      
      The GET /recordings/live operation was removed, since it's not really
      that useful to get a list of all recordings that are currently going
      on in the system. (At least, if we did that, we'd probably want to
      also list all of the current playbacks. Which seems weird.)
      
      (closes issue ASTERISK-21582)
      Review: https://reviewboard.asterisk.org/r/2693/
      ........
      
      Merged revisions 397985 from http://svn.asterisk.org/svn/asterisk/branches/12
      
      
      git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@397988 65c4cc65-6c06-0410-ace0-fbb531ad65f3
      7f547872
  2. Jul 30, 2013
    • Mark Michelson's avatar
      The large GULP->PJSIP renaming effort. · 735b30ad
      Mark Michelson authored
      The general gist is to have a clear boundary between old SIP stuff
      and new SIP stuff by having the word "SIP" for old stuff and "PJSIP"
      for new stuff. Here's a brief rundown of the changes:
      
      * The word "Gulp" in dialstrings, functions, and CLI commands is now
        "PJSIP"
      * chan_gulp.c is now chan_pjsip.c
      * Function names in chan_gulp.c that were "gulp_*" are now "chan_pjsip_*"
      * All files that were "res_sip*" are now "res_pjsip*"
      * The "res_sip" directory is now "res_pjsip"
      * Files in the "res_pjsip" directory that began with "sip_*" are now "pjsip_*"
      * The configuration file is now "pjsip.conf" instead of "res_sip.conf"
      * The module info for all PJSIP-related files now uses "PJSIP" instead of "SIP"
      * CLI and AMI commands created by Asterisk's PJSIP modules now have "pjsip" as
      the starting word instead of "sip"
      
      
      
      git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@395764 65c4cc65-6c06-0410-ace0-fbb531ad65f3
      735b30ad
  3. Jul 27, 2013
  4. Jul 03, 2013
    • David M. Lee's avatar
      ARI authentication. · 9ba976b1
      David M. Lee authored
      This patch adds authentication support to ARI.
      
      Two authentication methods are supported. The first is HTTP Basic
      authentication, as specified in RFC 2617[1]. The second is by simply
      passing the username and password as an ?api_key query parameter
      (which allows swagger-ui[2] to authenticate more easily).
      
      ARI usernames and passwords are configured in the ari.conf file
      (formerly known as stasis_http.conf). The user may be set to
      `read_only`, which will prohibit the user from issuing POST, DELETE,
      etc. Also, the user's password may be specified in either plaintext,
      or encrypted using the crypt() function.
      
      Several other notes about the patch.
      
       * A few command line commands for seeing ARI config and status were
         also added.
       * The configuration parsing grew big enough that I extracted it to
         its own file.
      
       [1]: http://www.ietf.org/rfc/rfc2617.txt [2]:
       https://github.com/wordnik/swagger-ui
      
      (closes issue ASTERISK-21277)
      Review: https://reviewboard.asterisk.org/r/2649/
      
      
      
      git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@393530 65c4cc65-6c06-0410-ace0-fbb531ad65f3
      9ba976b1
    • 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
  5. May 21, 2013
  6. May 14, 2013
    • David M. Lee's avatar
      Break res_stasis into smaller files. · e8f4ac6c
      David M. Lee authored
      When implementing playback for stasis-http, the monolithicedness of
      res_stasis really started to get in my way.
      
      This patch breaks the major components of res_stasis.c into individual
      files.
      
       * res/stasis/app.c - Stasis application tracking
       * res/stasis/control.c - Channel control objects
       * res/stasis/command.c - Channel command object
      
      This refactoring also allows res_stasis applications to be loaded as
      independent modules, such as the new res_stasis_answer module.
      
      The bulk of this patch is simply moving code from one file to another,
      adjusting names and adding accessors as necessary.
      
      Review: https://reviewboard.asterisk.org/r/2530/
      
      
      git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@388729 65c4cc65-6c06-0410-ace0-fbb531ad65f3
      e8f4ac6c
  7. Apr 25, 2013
    • Mark Michelson's avatar
      Merge the pimp_my_sip branch into trunk. · 74f23180
      Mark Michelson authored
      The pimp_my_sip branch is being merged at this point because
      it offers basic functionality, and from an API standpoint, things
      are complete.
      
      SIP work is *not* feature-complete; however, with the completion
      of the SUBSCRIBE/NOTIFY API, all APIs (except a PUBLISH API) have
      been created, and thus it is possible for developers to attempt
      to create new SIP work.
      
      API documentation can be found in the doxygen in the code, but
      usability documentation is still lacking.
      
      
      
      git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@386540 65c4cc65-6c06-0410-ace0-fbb531ad65f3
      74f23180
  8. 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
  9. Mar 12, 2013
  10. Feb 04, 2013
  11. Oct 14, 2012
  12. Sep 07, 2012
    • David M. Lee's avatar
      Fix parallel make for res_asterisk_rtp. · cab7acd2
      David M. Lee authored
      Fixes a build regression introduced in r369517 "Add support for ICE/STUN/TURN
      in res_rtp_asterisk and chan_sip." [1].
      
      [1] http://svnview.digium.com/svn/asterisk?view=revision&revision=369517
      
      When compiling asterisk in parallel like:
          $ make -j 10
      
      It's possible to get errors like the following:
      
          .pjlib-util-test-x86_64-unknown-linux-gnu.depend:120: *** missing separator.  Stop.
          make[4]: *** [depend] Error 2
          make[3]: *** [dep] Error 1
          make[2]: *** [/home/sruffell/asterisk-working/res/pjproject/pjnath/lib/libpjnath-x86_64-unknown-linux-gnu.a] Error 2
          make[3]: warning: jobserver unavailable: using -j1.  Add `+' to parent make rule.
      
      This is because the build system is trying to build each of the libraries in
      pjproject in parallel. Now the build will build pjproject in a single job and
      link the results into res_asterisk_rtp.
      
      Parallel builds, on one test system, saves ~1.5 minutes from a default Asterisk
      build:
      
      Single job:
          $ git clean -fdx >/dev/null && time ( ./configure >/dev/null 2>&1 && make >/dev/null 2>&1 )
      
          real    2m34.529s
          user    1m41.810s
          sys     0m15.970s
      
      Parallel make:
          $ git clean -fdx >/dev/null && time ( ./configure >/dev/null 2>&1 && make -j10 >/dev/null 2>&1 )
      
          real    1m2.353s
          user    2m39.120s
          sys     0m18.850s
      
      (closes issue ASTERISK-20362)
      Reported by: Shaun Ruffel
      Patches:
          0001-res_asterisk_rtp-Fix-build-error-when-using-parallel.patch uploaded by Shaun Ruffel (License #5417)
      ........
      
      Merged revisions 372609 from http://svn.asterisk.org/svn/asterisk/branches/11
      
      
      git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@372610 65c4cc65-6c06-0410-ace0-fbb531ad65f3
      cab7acd2
  13. Jul 19, 2012
  14. Jul 01, 2012
  15. May 09, 2011
  16. May 11, 2010
  17. Mar 23, 2010
    • Kevin P. Fleming's avatar
      Change per-file debug and verbose levels to be per-module, the way · ae6008ef
      Kevin P. Fleming authored
      users expect them to work.
      
      'core set debug' and 'core set verbose' can optionally change the
      level for a specific filename; however, this is actually for a
      specific source file name, not the module that source file is included
      in. With examples like chan_sip, chan_iax2, chan_misdn and others
      consisting of multiple source files, this will not lead to the
      behavior that users expect. If they want to set the debug level for
      chan_sip, they want it set for all of chan_sip, and not to have to
      also set it for reqresp_parser and other files that comprise the
      chan_sip module.
      
      This patch changes this functionality to be module-name based instead
      of file-name based.
      
      To make this work, some Makefile modifications were required to ensure
      that the AST_MODULE definition is present in each object file produced
      for each module as well.
      
      Review: https://reviewboard.asterisk.org/r/574/
      
      
      
      git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@253917 65c4cc65-6c06-0410-ace0-fbb531ad65f3
      ae6008ef
  18. Jan 25, 2010
  19. Jan 24, 2010
    • Tilghman Lesher's avatar
      Merged revisions 242520 via svnmerge from · bc9f02a6
      Tilghman Lesher authored
      https://origsvn.digium.com/svn/asterisk/branches/1.4
      
      ........
        r242520 | tilghman | 2010-01-24 00:33:01 -0600 (Sun, 24 Jan 2010) | 8 lines
        
        Only rebuild bison and flex source files on demand, if bison and flex are detected by the configure script.
        
        Changed after discussion on the -dev list about possible unnecessary build
        failures, due to checkouts/untars causing these special source files to
        possibly be newer than their resulting C files.  This should additionally
        ensure that nobody need learn about extra Makefile arguments to ensure the
        proper files get rebuilt when changes are made to these special source files.
      ........
      
      
      git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@242521 65c4cc65-6c06-0410-ace0-fbb531ad65f3
      bc9f02a6
  20. Jan 22, 2010
  21. Jul 21, 2009
    • Kevin P. Fleming's avatar
      Merged revisions 207647 via svnmerge from · 96e4e31e
      Kevin P. Fleming authored
      https://origsvn.digium.com/svn/asterisk/branches/1.4
      
      ........
        r207647 | kpfleming | 2009-07-21 08:04:44 -0500 (Tue, 21 Jul 2009) | 12 lines
        
        Ensure that user-provided CFLAGS and LDFLAGS are honored.
        
        This commit changes the build system so that user-provided flags (in ASTCFLAGS
        and ASTLDFLAGS) are supplied to the compiler/linker *after* all flags provided
        by the build system itself, so that the user can effectively override the
        build system's flags if desired. In addition, ASTCFLAGS and ASTLDFLAGS can now
        be provided *either* in the environment before running 'make', or as variable
        assignments on the 'make' command line. As a result, the use of COPTS and LDOPTS
        is no longer necessary, so they are no longer documented, but are still supported
        so as not to break existing build systems that supply them when building Asterisk.
      ........
      
      
      git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@207680 65c4cc65-6c06-0410-ace0-fbb531ad65f3
      96e4e31e
  22. Nov 28, 2008
  23. Nov 20, 2008
    • Kevin P. Fleming's avatar
      Merged revisions 157859 via svnmerge from · 8d5deb31
      Kevin P. Fleming authored
      https://origsvn.digium.com/svn/asterisk/branches/1.4
      
      ........
        r157859 | kpfleming | 2008-11-19 15:34:47 -0600 (Wed, 19 Nov 2008) | 7 lines
        
        the gcc optimizer frequently finds broken code (use of uninitalized variables, unreachable code, etc.), which is good. however, developers usually compile with the optimizer turned off, because if they need to debug the resulting code, optimized code makes that process very difficult. this means that we get code changes committed that weren't adequately checked over for these sorts of problems.
        
        with this build system change, if (and only if) --enable-dev-mode was used and DONT_OPTIMIZE is turned on, when a source file is compiled it will actually be preprocessed (into a .i or .ii file), then compiled once with optimization (with the result sent to /dev/null) and again without optimization (but only if the first compile succeeded, of course).
        
        while making these changes, i did some cleanup work in Makefile.rules to move commonly-used combinations of flag variables into their own variables, to make the file easier to read and maintain
      ........
      
      
      git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@157974 65c4cc65-6c06-0410-ace0-fbb531ad65f3
      8d5deb31
  24. Jul 13, 2008
    • Michiel van Baak's avatar
      Make all sed calls Posix sed compatible. · 0d49cdae
      Michiel van Baak authored
      To make sure nobody commits script-modified files we first make a backup
      of asterisk.tex, run the script, generate the pdf and / or html,
      and put the original asterisk.tex back.
      This will guard us for the stuff that happened before that someone committed 
      a locally modified asterisk.tex, with changes done by this script.
      
      (closes issue #13062)
      Reported by: mvanbaak
      Patches:
            sed_without-i-v3.diff uploaded by mvanbaak (license 7)
      Tested by: mvanbaak
      
      Feedback from Corydon. Thanks for taking the time to go through this.
      
      
      git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@130578 65c4cc65-6c06-0410-ace0-fbb531ad65f3
      0d49cdae
  25. Jul 01, 2008
  26. Jun 10, 2008
    • Russell Bryant's avatar
      Merge another big set of changes from team/russell/events · e9d72e0c
      Russell Bryant authored
      This commit merges in the rest of the code needed to support distributed device
      state.  There are two main parts to this commit.
      
      Core changes:
       - The device state handling in the core has been updated to understand device
         state across a cluster of Asterisk servers.  Every time the state of a device
         changes, it looks at all of the device states on each node, and determines the
         aggregate device state.  That resulting device state is what is provided to
         modules in Asterisk that take actions based on the state of a device.
      
      New module, res_ais:
       - A module has been written to facilitate the communication of events between
         nodes in a cluster of Asterisk servers.  This module uses the SAForum AIS
         (Service Availability Forum Application Interface Specification) CLM and EVT
         services (Cluster Management and Event) to handle this task.  This module
         currently supports sharing Voicemail MWI (Message Waiting Indication) and
         device state events between servers.  It has been tested with openais, though
         other implementations of the spec do exist.
      
      For more information on testing distributed device state, see the following doc:
        - doc/distributed_devstate.txt
      
      
      git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@121559 65c4cc65-6c06-0410-ace0-fbb531ad65f3
      e9d72e0c
  27. Mar 11, 2008
    • Kevin P. Fleming's avatar
      Merged revisions 107352 via svnmerge from · 79c3038e
      Kevin P. Fleming authored
      https://origsvn.digium.com/svn/asterisk/branches/1.4
      
      ........
      r107352 | kpfleming | 2008-03-11 06:04:29 -0500 (Tue, 11 Mar 2008) | 11 lines
      
      fix up various compiler warnings found with gcc-4.3:
      
      - the output of flex includes a static function called 'input' that is not used, so for the moment we'll stop having the compiler tell us about unused variables in the flex source files (a better fix would be to improve our flex post-processing to remove the unused function)
      
      - main/stdtime/localtime.c makes assumptions about signed integer overflow, and gcc-4.3's improved optimizer tries to take advantage of handling potential overflow conditions at compile time; for now, suppress these optimizations until we can fiure out if the code needs improvement
      
      - main/udptl.c has some references to uninitialized variables; in one case there was no bug, but in the other it was certainly possibly for unexpected behavior to occur
      
      - main/editline/readline.c had an unused variable
      
      
      ........
      
      
      git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@107373 65c4cc65-6c06-0410-ace0-fbb531ad65f3
      79c3038e
  28. Jan 10, 2008
  29. Jan 02, 2008
  30. Dec 17, 2007
    • Kevin P. Fleming's avatar
      Merged revisions 93180 via svnmerge from · 100ef27a
      Kevin P. Fleming authored
      https://origsvn.digium.com/svn/asterisk/branches/1.4
      
      ........
      r93180 | kpfleming | 2007-12-16 22:44:51 -0800 (Sun, 16 Dec 2007) | 23 lines
      
      In http://lists.digium.com/pipermail/asterisk-dev/2007-December/031145.html,
      rizzo brought up some issues related to the way that the metadata required
      for menuselect and the rest of the build system is extracted from the source
      files. Since I had a few hours to kill on an airplane today, I decided to
      improve this situation... so now the system caches the extracted metadata
      and uses it to build the menuselect 'tree' as much as it can. The result
      of this is that when a single source file is changed, only the metadata for
      that file needs to be extracted again, and the rest is used from the cache
      files. I also reduced the number of forked processes required to do the
      metadata extraction; it was actually possible to do most of what we needed
      in the Makefiles themselves without using any shell scripts at all! On my
      laptop, these changes resulted in an 80% decrease in the time required
      for the 'menuselect.makeopts' automatic check to occur after editing a single
      source file.
      
      While doing this work I also cleaned up a few minor things in the Makefiles,
      adding a check for 'awk' to the configure script and changed all remaining
      places we use 'grep' or 'awk' to use the ones found by the configure script,
      and changed the 'prep_tarball' script to build the menuselect metadata so
      that tarballs of Asterisk will include it and won't require the user to
      wait while it is extracted after unpacking.
      
      
      ........
      
      
      git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@93184 65c4cc65-6c06-0410-ace0-fbb531ad65f3
      100ef27a
  31. Dec 10, 2007
    • Luigi Rizzo's avatar
      Put into Makefile.moddir_rules the common instructions used to · 54908891
      Luigi Rizzo authored
      generate loadable and embedded module lists.
      
      Individual Makefiles now are a lot simpler, possibly as simple as this:
      
          -include $(ASTTOPDIR)/menuselect.makeopts $(ASTTOPDIR)/menuselect.makedeps
          MODULE_PREFIX=cdr_
          all: _all
          include $(ASTTOPDIR)/Makefile.moddir_rules
      
      and also more flexible because in a single directory we can combine
      various types of modules (app_, cdr_, func_, ... ) by simply
      listing them in the MODULE_PREFIX variable.
      
      The individual Makefiles can also create list of modules to be
      excluded by listing them in the variablel MODULE_EXCLUDE (see an
      example in channels/Makefile).
      
      With this change it becomes trivial to integrate a directory with
      locally created/modified sources into the main build.
      
      
      
      
      git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@92082 65c4cc65-6c06-0410-ace0-fbb531ad65f3
      54908891
  32. Dec 09, 2007
  33. Dec 04, 2007
Loading