Skip to content
Snippets Groups Projects
  1. Mar 26, 2016
  2. Mar 25, 2016
  3. Mar 24, 2016
    • Mark Michelson's avatar
      Restrict CLI/AMI commands on shutdown. · 89e94e88
      Mark Michelson authored
      During stress testing, we have frequently seen crashes occur because a
      CLI or AMI command attempts to access information that is in the process
      of being destroyed.
      
      When addressing how to fix this issue, we initially considered fixing
      individual crashes we observed. However, the changes required to fix
      those problems would introduce considerable overhead to the nominal
      case. This is not reasonable in order to prevent a crash from occurring
      while Asterisk is already shutting down.
      
      Instead, this change makes it so AMI and CLI commands cannot be executed
      if Asterisk is being shut down. For AMI, this is absolute. For CLI,
      though, certain commands can be registered so that they may be run
      during Asterisk shutdown.
      
      ASTERISK-25825 #close
      
      Change-Id: I8887e215ac352fadf7f4c1e082da9089b1421990
      89e94e88
    • Gianluca Merlo's avatar
      config: fix flags in uint option handler · 894071ea
      Gianluca Merlo authored
      The configuration unsigned integer option handler sets flags for the
      parser as if the option should be a signed integer (PARSE_INT32),
      leading to errors on "out of range" values. Fix flags (PARSE_UINT32).
      
      A fix to res_pjsip is also present which stops invalid flags from
      being passed when registering sorcery object fields for qualify
      status.
      
      ASTERISK-25612 #close
      
      Change-Id: I96b539336275e0e72a8e8033487d2c3344debd3e
      894071ea
    • Walter Doekes's avatar
      musiconhold: Only warn if music class is not found in memory and database. · 13cdf3e8
      Walter Doekes authored
      The log message when a MusicOnHold music class was not found was changed
      from debug level to WARNING level in Asterisk 11.19 and 13.5.  For those
      using realtime musiconhold, this message is wrong because it warns
      before checking the database.
      
      This changeset delays the warning until after the database has been
      checked.
      
      Reported-by: Conrad de Wet
      ASTERISK-25444 #close
      
      Change-Id: I6cfb2db2f9cfbd2bb3d30566ecae361c4abf6dbf
      13cdf3e8
    • Walter Doekes's avatar
      core/logging: Fix broken syslog levels on older glibc. · 87c9ab97
      Walter Doekes authored
      The fix to ASTERISK-25407 introduced the usage of LOG_MAKEPRI. However
      this macro is broken in older glibc (< 2.17); it would left-shift the
      facility a second time, causing the resultant priority to become
      invalid.
      
      The syslog manpage mentions nothing about LOG_MAKEPRI and suggests this:
      
          The priority argument is formed by ORing the facility and the level
          values [...].
      
      ASTERISK-25510 #close
      Reported by: Michael Newton
      
      Change-Id: Ia89debe7fac5ad090c7ef595c0707f31bb1e3d03
      87c9ab97
    • Joshua Colp's avatar
      tests/test_http_media_cache: Fix file descriptor leak in test. · a72f3b5b
      Joshua Colp authored
      Change-Id: Ie8a9ae3d13bdeaacafc8d28271adc6707f633a5f
      a72f3b5b
  4. Mar 23, 2016
    • Joshua Colp's avatar
    • Joshua Colp's avatar
    • zuul's avatar
    • zuul's avatar
    • zuul's avatar
    • zuul's avatar
    • Matt Jordan's avatar
      main/app: Only look to end of file if ':end' is specified, and not just ':' · 13efea24
      Matt Jordan authored
      There is a little known feature in app_controlplayback that will cause the
      specified offset to be used relative to the end of a file if a ':end' is
      detected within the filename.
      
      This feature is pretty bad, but okay.
      
      However, a bug exists in this code where a ':' detected in the filename
      will cause the end pointer to be non-NULL, even if the full ':end' isn't
      specified. This causes us to treat an unspecified offset (0) as being
      "start playing from the end of the file", resulting in no file playback
      occurring.
      
      This patch fixes this bug by resetting the end pointer if ':end' is not
      found in the filename.
      
      Change-Id: Ib4c7b1b45283e4effd622a970055c51146892f35
      13efea24
    • Matt Jordan's avatar
      main/file: Add the ability to play media in the media cache · ca14b99e
      Matt Jordan authored
      This patch allows applications/APIs that access media through the core file
      APIs to play media in the media cache. Prior to determining if a 'filename'
      exists, the filename is passed to the media cache's retrieve API call. If
      that call succeeds, the local file specified passed back by the API is
      opened for streaming. When used in this fashion, the 'filename' is actually
      a URI that the media cache process and understand.
      
      ASTERISK-25654 #close
      
      Change-Id: I73b6e2e90c3e91b8500581c45cdf9c0dc785f5f0
      ca14b99e
    • Matt Jordan's avatar
      tests/test_http_media_cache: Add unit tests for res_http_media_cache · 01962a39
      Matt Jordan authored
      This patch adds unit tests for res_http_media cache, that covers nominal
      creation and retrieval - and through them as well, staleness and deletion
      checks. In addition, this patch adds tests that covers the interaction of
      various HTTP headers, including Expires, Etag, and Cache-Control.
      
      ASTERISK-25654
      
      Change-Id: I2db101e307c863857fe416d6f5bf4cace9ac7cf5
      01962a39
    • Matthew Jordan's avatar
      res/res_http_media_cache: Add an HTTP(S) backend for the core media cache · 22e23408
      Matthew Jordan authored
      This patch adds a bucket backend for the core media cache that interfaces to a
      remote HTTP server. When a media item is requested in the cache, the cache will
      query its bucket backends to see if they can provide the media item. If that
      media item has a scheme of HTTP or HTTPS, this backend will be invoked.
      
      The backend provides callbacks for the following:
       * create - this will always retrieve the URI specified by the provided
                  bucket_file, and store it in the file specified by the object.
       * retrieve - this will pull the URI specified and store it in a temporary
                    file. It is then up to the media cache to move/rename this file
                    if desired.
       * delete - destroys the file associated with the bucket_file.
       * stale - if the bucket_file has expired, based on received HTTP headers from
                 the remote server, or if the ETag on the server no longer matches
                 the ETag stored on the bucket_file, the resource is determined to be
                 stale.
      
      Note that the backend respects the ETag, Expires, and Cache-Control headers
      provided by the HTTP server it is querying.
      
      ASTERISK-25654
      
      Change-Id: Ie201c2b34cafc0c90a7ee18d7c8359afaccc5250
      22e23408
    • Matt Jordan's avatar
      main/media_cache: Provide an extension on the local file associated with a URI · 791b4c9f
      Matt Jordan authored
      This patch does the following:
      
      First, it addresses file extension handling in the media cache. The media core
      in Asterisk is a bit interesting in that it wants:
       * A file to have an extension on it. That extension is used to associate the
         file with a defined format module.
       * The filename passed to the core to not have an extension on it. This allows
         the core to match the available file formats with the format a channel
         is capable of handling.
      
      Unfortunately, this makes the current implementation a bit lacking in the media
      cache. By default, we do not store the extension of a retrieved URI on the
      local file that is created. As a result, the media core does not know what
      format the file is, and the file is ignored. Modifying the file outside of the
      media core is bad, as we would not be able to update the internal
      ast_bucket_file's path.
      
      At the same time, we do not want to pass the extension out in the file_path
      parameter in ast_media_cache_retrieve. This parameter is intended to be fed
      into the media core; if we passed the extension, all callers would have to
      strip it off.
      
      Thus, this patch does the following:
      * If there is an extension specified in the URL, we append it to the local
        file name (if a preferred file name isn't specified), and we store that
        in the local file path.
      * The extension, however, is stripped off of the file_path parameter passed
        back out of ast_media_cache_retrieve.
      
      Second, this patch causes stale items to be completely removed from the system.
      Prior to this patch, sound files could be orphaned due to the bucket
      referencing the file being deleted, but the file itself not being removed. This
      is now addressed by explicitly calling ast_bucket_file_delete on the
      bucket_file when it is deemed to be stale. Note that this only happen when we
      know we will attempt to retrieve the resource again.
      
      Finally, this patch changes the AO2 container holding media items to just use
      a regular mutex. The usage for this container already assumed it was a plain
      mutex, and - given that retrieval of an item can cause it to be replaced in
      the container - a mutex makes more sense than a read/write lock.
      
      Change-Id: I51667fff86ae8d2e4a663555dfa85b11e935fe0f
      791b4c9f
    • Matthew Jordan's avatar
      funcs/func_curl: Add the ability for CURL to download and store files · 6bbcfb34
      Matthew Jordan authored
      This patch adds a write option to the CURL dialplan function, allowing it to
      CURL files and store them locally. The value 'written' to the CURL URL
      specifies the location on disk to store the file. As an example:
      
      same => n,Set(CURL(http://1.1.1.1/foo.wav)=/tmp/foo.wav)
      
      Would retrieve the file foo.wav from the remote server and store it in the
      /tmp directory.
      
      Due to the potentially dangerous nature of this function call, APIs are
      forbidden from using the write functionality unless live_dangerously is set
      to True in asterisk.conf.
      
      ASTERISK-25652 #close
      
      Change-Id: I44f4ad823d7d20f04ceaad3698c5c7f653c41b0d
      6bbcfb34
    • George Joseph's avatar
      pjproject-bundled: Cleanups for reported issues · 392341ba
      George Joseph authored
      PortAudio should no longer be required
      PJSIP_MAX_PKT_LEN is now 6000
      Older autoconf issue fixed. (CentOS 6)
      
      Change-Id: I463fa9586cbe7c6b3b603289f535bd8e361611dd
      392341ba
  5. Mar 22, 2016
  6. Mar 21, 2016
  7. Mar 19, 2016
  8. Mar 18, 2016
    • Kevin Harwell's avatar
      chan_pjsip: ref leak when checking direct_media_glare · a3c9a74a
      Kevin Harwell authored
      Fix the reference leak introduced in the following commit:
      
      c534bd58
      
      ASTERISK-25849
      
      Change-Id: I5cfefd5ee6c1c3a1715c050330aaa10e4d2a5e85
      a3c9a74a
    • zuul's avatar
    • Kevin Harwell's avatar
      chan_pjsip: transfers with direct media reinvite has wrong address/port · c534bd58
      Kevin Harwell authored
      During a transfer involving direct media a race occurs between when the
      transferer channel is swapped out, initiating rtp changes/updates, and the
      subsequent reinvites.
      
      When Alice, after speaking with Charlie (Bob is on hold), connects Bob and
      Charlie invites are sent to each in order to establish the call between them.
      Bob is taken off hold and Charlie is told to have his media flow through
      Asterisk. However, if before those invites go out the bridge updates Bob's
      and/or Charlie's rtp information with direct media data (i.e. address, port)
      then the invite(s) will contain the remote data in the SDP instead of the
      Asterisk data.
      
      The race occurs in the native bridge glue code when updating the peer. The
      direct_media_address can get set twice before sending out the first invite
      during call connection. This can happen because the checking/setting of the
      direct_media_address happened in one thread while the sending of the invite(s)
      happened in another thread.
      
      This fix removes the race condition by moving the checking/setting of the
      direct_media_address to be in the same thread as the sending of the invites(s).
      This serializes the checking/setting and sending so they can no longer happen
      out of order.
      
      ASTERISK-25849 #close
      
      Change-Id: Idfea590175e74f401929a601dba0c91ca1a7f873
      c534bd58
  9. Mar 17, 2016
    • Sergio Medina Toledo's avatar
      res_pjsip_refer.c: Fix seg fault in process of Refer-to header. · bdccb811
      Sergio Medina Toledo authored
      The "Refer-to" header of an incoming REFER request is parsed by
      pjsip_parse_uri().  That function requires the URI parameter to be NULL
      terminated.  Unfortunately, the previous code added the NULL terminator by
      overwriting memory that may not be safe.  The overwritten memory results
      could be benign, memory corruption, or a segmentation fault.  Now the URI
      is NULL terminated safely by copying the URI to a new chunk of memory with
      the correct size to be NULL terminated.
      
      ASTERISK-25814 #close
      
      Change-Id: I32565496684a5a49c3278fce06474b8c94b37342
      bdccb811
    • Joshua Colp's avatar
      f5578433
    • Joshua Colp's avatar
    • Leif Madsen's avatar
      Add initial support to build Docker images · 0da36fca
      Leif Madsen authored
      This work-in-progress is the first step to being able to reliably
      build Asterisk containers from the Asterisk source. I'm submitting
      this based on feedback gained at AstriDevCon 2015.
      
      Information about how to use this is provided in contrib/docker/README.md
      and will result in a local Asterisk container being built right from
      your source. I believe this can eventually be automated via
      hub.docker.com.
      
      Change-Id: Ifa070706d40e56755797097b6ed72c1e243bd0d1
      0da36fca
  10. Mar 16, 2016
    • Richard Mudgett's avatar
      chan_sip.c: Fix mwi resub deadlock potential. · 810f92c9
      Richard Mudgett authored
      This patch is part of a series to resolve deadlocks in chan_sip.c.
      
      Stopping a scheduled event can result in a deadlock if the scheduled event
      is running when you try to stop the event.  If you hold a lock needed by
      the scheduled event while trying to stop the scheduled event then a
      deadlock can happen.  The general strategy for resolving the deadlock
      potential is to push the actual starting and stopping of the scheduled
      events off onto the scheduler/do_monitor() thread by scheduling an
      immediate one shot scheduled event.  Some restructuring may be needed
      because the code may assume that the start/stop of the scheduled events is
      immediate.
      
      ASTERISK-25023 #close
      
      Change-Id: I96d429c57a48861fd8bde63dd93db4e92dc3adb6
      810f92c9
Loading