Skip to content
Snippets Groups Projects
  1. Mar 23, 2016
    • 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
  2. Mar 19, 2016
    • Gianluca Merlo's avatar
      func_aes: fix misuse of strlen on binary data · 8f94f947
      Gianluca Merlo authored
      The encryption code for AES_ENCRYPT evaluates the length of the data to
      be encoded in base64 using strlen. The data is binary, thus the length
      of it can be underestimated at the first NULL character.
      Reuse the write pointer offset to evaluate it, instead.
      
      ASTERISK-25857 #close
      
      Change-Id: If686b5d570473eb926693c73461177b35b13b186
      8f94f947
  3. Mar 02, 2016
  4. Feb 11, 2016
  5. Jan 22, 2016
    • Mark Michelson's avatar
      res_odbc: Remove connection management · 9714da7a
      Mark Michelson authored
      Asterisk by default will create a single database connection and share
      it among all threads that attempt to access the database. In previous
      versions of Asterisk, this was tolerable, because the most used channel
      driver, chan_sip, mostly accessed the database from a single thread.
      With PJSIP, however, many threads may be attempting to perform database
      operations, and there is the potential for many more database accesses,
      meaning the concurrency is a horrible bottleneck if only one connection
      is shared.
      
      Asterisk has a connection pooling facility built into it, but the
      implementation has flaws. For one, there is a strict limit on the number
      of simultaneous connections that could be made to the database. Anything
      beyond the maximum would result in a failed operation. Attempting to
      predict what the maximum should be is nearly impossible even for someone
      intimately familiar with Asterisk's threading model. In addition, use of
      transactions in the dialplan can cause some severe bugs if connection
      pooling is enabled.
      
      This commit seeks to fix the concurrency problem by removing all
      connection management code from Asterisk and leaving that to the
      underlying unixODBC code instead. Now, Asterisk does not share a single
      connection, nor does it try to maintain a connection pool. Instead, all
      Asterisk ever does is request a connection from unixODBC and allow
      unixODBC to either allocate those connections or retrieve them from a
      pool.
      
      Doing this has a bit of a ripple effect. For one, since connections are
      not long-lived objects, several of the safeguards that previously
      existed have been removed. We don't have to worry about trying to use a
      connection that has gone stale. In every case, when we request a
      connection, it has just been made and we don't need to perform any
      sanity checks to be sure it's still active.
      
      Another major player affected by this change is transactions.
      Transactions and their respective connections were so tightly coupled
      that it was almost pornographic. This code change moves
      transaction-related code to its own file separate from the core ODBC
      functionality. This way, the core of ODBC does not even have to know
      that transactions exist.
      
      In making this large change, I had to look at a lot of code and
      understand it. When making this change, I discovered several places
      where the behavior is definitely not ideal, but it seemed outside the
      scope of this change to be fixing it. Instead, any place where I saw
      some sort of room for improvement has had a XXX comment added explaining
      what could be altered to improve it.
      
      Change-Id: I37a84def5ea4ddf93868ce8105f39de078297fbf
      9714da7a
  6. Jan 20, 2016
    • Matt Jordan's avatar
      funcs/func_cdr: Correctly report high precision values for duration and billsec · 3b9cba42
      Matt Jordan authored
      When CDRs were refactored, func_cdr's ability to report high precision values
      for duration and billsec (the 'f' option) was broken. This was due to func_cdr
      incorrectly interpreting the duration/billsec values provided by the CDR engine
      in milliseconds, as opposed to seconds. Since the CDR engine only provides
      duration and billsec in seconds, and does not expose either attribute with
      sufficient precision to merely pass back the underlying value, this patch fixes
      the bug by re-calculating duration and billsec with microsecond precision based
      on the start/answer/end times on the CDR.
      
      ASTERISK-25179 #close
      
      Change-Id: I8bc63822b496537a5bf80baf6102c06206bee841
      3b9cba42
  7. Jan 14, 2016
  8. Nov 09, 2015
  9. Nov 06, 2015
    • Walter Doekes's avatar
      func_callerid: Document that CALLERID(pres) is available. · 7dd8f89a
      Walter Doekes authored
      CALLERPRES() says that it's deprecated in favor of CALLERID(num-pres)
      and CALLERID(name-pres).  But for channel driver that don't make a
      distinction between the two (e.g. SIP), it makes more sense to get/set
      both at once.  This change reveals the availability of CALLERID(pres),
      CONNECTEDLINE(pres), REDIRECTING(orig-pres), REDIRECTING(to-pres) and
      REDIRECTING(from-pres).
      
      ASTERISK-25373 #close
      
      Change-Id: I5614ae4ab7d3bbe9c791c1adf147e10de8698d7a
      7dd8f89a
  10. Oct 21, 2015
    • Matt Jordan's avatar
      funcs/func_holdintercept: Actually add the HOLD_INTERCEPT function · 7be6194d
      Matt Jordan authored
      When ab803ec3 was committed, it accidentally forgot to actually *add* the
      HOLD_INTERCEPT function. This highlights two interesting points:
      * Gerrit forces you to put the patch as it is going to into the repo up for
        review, which Review Board did not. Yay Gerrit.
      * No one apparently bothered to use this feature, or else they don't know about
        it. I'm going to go with the latter explanation.
      
      ASTERISK-24922
      
      Change-Id: Ida38278f259dd07c334a36f9b7d5475b5db72396
      7be6194d
  11. Oct 07, 2015
  12. Jul 20, 2015
    • Rusty Newton's avatar
      Documentation: A couple of trivial fixes in sip.conf.sample and func_cdr.c · d0219644
      Rusty Newton authored
       * In sip.conf.sample fix sentence where we said that WS or WSS are supported
         transports for use in an outbound register definition. They are not
         supported in that case.
       * In func_cdr.c made it clear that the Disable option for CDR_PROP can be used
         to enable CDR on a channel.
      
      ASTERISK-24867 #close
      Reported by: Rusty Newton
      
      ASTERISK-24853 #close
      Reported by: PSDK
      
      Change-Id: I3d698bc6302b9d00a0a995b5c4ad9a42d69b48ca
      d0219644
  13. Jun 15, 2015
  14. May 14, 2015
    • Corey Farrell's avatar
      Fix potential crash after unload of func_periodic_hook or test_message. · 0a46d43b
      Corey Farrell authored
      These modules save a pointer to the context they create on load, and
      use that pointer to destroy the context at unload.  It is not safe
      to save this pointer, it is replaced during load of pbx_config,
      pbx_lua or pbx_ael.
      
      This change causes the modules to pass NULL to ast_context_destroy,
      a safer way to perform the unregistration since it does not use
      a pointer that could become invalid.
      
      ASTERISK-25085 #close
      Reported by: Corey Farrell
      
      Change-Id: I6a00ec8e38046058f97dc703e1adcde9bf517835
      0a46d43b
  15. May 13, 2015
  16. Apr 20, 2015
    • George Joseph's avatar
      pjsip_options: Fix non-qualified contacts showing as unavailable · 298faf7c
      George Joseph authored
      The "Add qualify_timeout processing and eventing" patch introduced
      an issue where contacts that had qualify_frequency set to 0 were
      showing Unavailable instead Unknown.  This patch checks for
      qualify_frequency=0 and create an "Unknown"  contact_status
      with an RTT = 0.
      
      Previously, the lack of contact_status implied Unknown but since
      we're now changing endpoint state based on contact_status, I've
      had to add new UNKNOWN status so that changes could trigger the
      appropriate contact_status observers.
      
      ASTERISK-24977: #close
      
      Change-Id: Ifcbc01533ce57f0e4e584b89a395326e098b8fe7
      298faf7c
  17. Apr 17, 2015
    • Mark Michelson's avatar
      Detect potential forwarding loops based on count. · aae45acb
      Mark Michelson authored
      A potential problem that can arise is the following:
      
      * Bob's phone is programmed to automatically forward to Carol.
      * Carol's phone is programmed to automatically forward to Bob.
      * Alice calls Bob.
      
      If left unchecked, this results in an endless loops of call forwards
      that would eventually result in some sort of fiery crash.
      
      Asterisk's method of solving this issue was to track which interfaces
      had been dialed. If a destination were dialed a second time, then
      the attempt to call that destination would fail since a loop was
      detected.
      
      The problem with this method is that call forwarding has evolved. Some
      SIP phones allow for a user to manually forward an incoming call to an
      ad-hoc destination. This can mean that:
      
      * There are legitimate use cases where a device may be dialed multiple
      times, or
      * There can be human error when forwarding calls.
      
      This change removes the old method of detecting forwarding loops in
      favor of keeping a count of the number of destinations a channel has
      dialed on a particular branch of a call. If the number exceeds the
      set number of max forwards, then the call fails. This approach has
      the following advantages over the old:
      
      * It is much simpler.
      * It can detect loops involving local channels.
      * It is user configurable.
      
      The only disadvantage it has is that in the case where there is a
      legitimate forwarding loop present, it takes longer to detect it.
      However, the forwarding loop is still properly detected and the
      call is cleaned up as it should be.
      
      Address review feedback on gerrit.
      
      * Correct "mfgium" to "Digium"
      * Decrement max forwards by one in the case where allocation of the
        max forwards datastore is required.
      * Remove irrelevant code change from pjsip_global_headers.c
      
      ASTERISK-24958 #close
      
      Change-Id: Ia7e4b7cd3bccfbd34d9a859838356931bba56c23
      aae45acb
  18. 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
  19. Apr 09, 2015
    • Matthew Jordan's avatar
      clang compiler warnings: Fix autological comparisons · ea009872
      Matthew Jordan authored
      This fixes autological comparison warnings in the following:
       * chan_skinny: letohl may return a signed or unsigned value, depending on the
         macro chosen
       * func_curl: Provide a specific cast to CURLoption to prevent mismatch
       * cel: Fix enum comparisons where the enum can never be negative
       * enum: Fix comparison of return result of dn_expand, which returns a signed
         int value
       * event: Fix enum comparisons where the enum can never be negative
       * indications: tone_data.freq1 and freq2 are unsigned, and hence can never be
         negative
       * presencestate: Use the actual enum value for INVALID state
       * security_events: Fix enum comparisons where the enum can never be negative
       * udptl: Don't bother to check if the return value from encode_length is less
         than 0, as it returns an unsigned int
       * translate: Since the parameters are unsigned int, don't bother checking
         to see if they are negative. The cast to unsigned int would already blow
         past the matrix bounds.
       * res_pjsip_exten_state: Use a temporary value to cache the return of
         ast_hint_presence_state
       * res_stasis_playback: Fix enum comparisons where the enum can never be
         negative
       * res_stasis_recording: Add an enum value for the case where the recording
         operation is in error; fix enum comparisons
       * resource_bridges: Use enum value as opposed to -1
       * resource_channels: Use enum value as opposed to -1
      
      Review: https://reviewboard.asterisk.org/r/4533
      ASTERISK-24917
      Reported by: dkdegroot
      patches:
        rb4533.patch submitted by dkdegroot (License 6600)
      ........
      
      Merged revisions 434469 from http://svn.asterisk.org/svn/asterisk/branches/11
      ........
      
      Merged revisions 434470 from http://svn.asterisk.org/svn/asterisk/branches/13
      
      
      git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@434471 65c4cc65-6c06-0410-ace0-fbb531ad65f3
      ea009872
  20. Apr 07, 2015
  21. Mar 28, 2015
  22. Mar 23, 2015
  23. Mar 19, 2015
    • Matthew Jordan's avatar
      funcs/func_env: Fix regression caused in FILE read operation · 627cc16a
      Matthew Jordan authored
      When r432935 was merged, it did correctly fix a situation where a FILE read
      operation on the middle of a file buffer would not read the requested length
      in the parameters passed to the FILE function. Unfortunately, it would also
      allow the FILE function to append more bytes than what was available in the
      buffer if the length exceeded the end of the buffer length.
      
      This patch takes the minimum of the remaining bytes in the buffer along with
      the calculated length to append provided by the original patch, and uses
      that as the length to append in the return result. This patch also updates
      the unit tests with the scenarios that were originally pointed out in
      ASTERISK-21765 that the original implementation treated incorrectly.
      
      ASTERISK-21765
      ........
      
      Merged revisions 433173 from http://svn.asterisk.org/svn/asterisk/branches/11
      ........
      
      Merged revisions 433174 from http://svn.asterisk.org/svn/asterisk/branches/13
      
      
      git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@433175 65c4cc65-6c06-0410-ace0-fbb531ad65f3
      627cc16a
  24. Mar 14, 2015
  25. Jan 28, 2015
  26. Jan 26, 2015
    • David M. Lee's avatar
      Various fixes for OS X · 965777cc
      David M. Lee authored
      This patch addresses compilation errors on OS X. It's been a while, so
      there's quite a few things.
      
       * Fixed __attribute__ decls in route.h to be portable.
       * Fixed htonll and ntohll to work when they are defined as macros.
       * Replaced sem_t usage with our ast_sem wrapper.
       * Added ast_sem_timedwait to our ast_sem wrapper.
       * Fixed some GCC 4.9 warnings using sig*set() functions.
       * Fixed some format strings for portability.
       * Fixed compilation issues with res_timing_kqueue (although tests still fail
         on OS X).
       * Fixed menuconfig /sbin/launchd detection, which disables res_timing_kqueue
         on OS X).
      
      ASTERISK-24539 #close
      Reported by: George Joseph
      
      ASTERISK-24544 #close
      Reported by: George Joseph
      
      Review: https://reviewboard.asterisk.org/r/4327/
      ........
      
      Merged revisions 431092 from http://svn.asterisk.org/svn/asterisk/branches/13
      
      
      git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@431093 65c4cc65-6c06-0410-ace0-fbb531ad65f3
      965777cc
  27. Jan 23, 2015
  28. Jan 20, 2015
  29. Jan 12, 2015
  30. Jan 07, 2015
  31. Jan 05, 2015
  32. Nov 20, 2014
  33. Nov 04, 2014
  34. Oct 28, 2014
  35. Oct 03, 2014
  36. Sep 26, 2014
  37. Sep 09, 2014
  38. Sep 05, 2014
    • Richard Mudgett's avatar
      func_channel.c: Add missing locking to some CHANNEL() requests. · 025bd1bf
      Richard Mudgett authored
      * The CHANNEL() audionativeformat, videonativeformat, audioreadformat, and
      audiowriteformat now need locking since the media format rework when
      accessing the channel's format pointers.
      
      * Increased the buffer size for CHANNEL() audionativeformat and
      videonativeformat output strings since the allow=all can be a lengthy
      list.
      
      * Tweaked the CHANNEL() XML documentation for secure_bridge_signaling,
      secure_bridge_media, and state.
      
      * Ensured the output buffer is initialized for secure_bridge_signaling and
      secure_bridge_media.
      
      * Made use the locked_copy_string() macro instead of inlining it for trace
      and checkhangup.
      ........
      
      Merged revisions 422700 from http://svn.asterisk.org/svn/asterisk/branches/13
      
      
      git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@422701 65c4cc65-6c06-0410-ace0-fbb531ad65f3
      025bd1bf
  39. Aug 18, 2014
Loading