Skip to content
Snippets Groups Projects
  1. Mar 08, 2021
    • Sean Bright's avatar
      res_musiconhold.c: Plug ref leak caused by ao2_replace() misuse. · df37b818
      Sean Bright authored
      ao2_replace() bumps the reference count of the object that is doing the
      replacing, which is not what we want. We just want to drop the old ref
      on the old object and update the pointer to point to the new object.
      
      Pointed out by George Joseph in #asterisk-dev
      
      Change-Id: Ie8167ed3d4b52b9d1ea2d785f885e8c27206743d
      df37b818
  2. Jan 25, 2021
  3. Dec 16, 2020
  4. Sep 30, 2020
  5. Sep 28, 2020
  6. Sep 23, 2020
  7. Aug 25, 2020
    • Sean Bright's avatar
      res_musiconhold.c: Use ast_file_read_dir to scan MoH directory · 057fda46
      Sean Bright authored
      Two changes of note in this patch:
      
      * Use ast_file_read_dir instead of opendir/readdir/closedir
      
      * If the files list should be sorted, do that at the end rather than as
        we go which improves performance for large lists
      
      Change-Id: Ic7e9c913c0f85754c99c74c9cf6dd3514b1b941f
      057fda46
  8. Aug 11, 2020
    • Sean Bright's avatar
      res_musiconhold.c: Prevent crash with realtime MoH · b7c22054
      Sean Bright authored
      The MoH class internal file vector is potentially being manipulated by
      multiple threads at the same time without sufficient locking. Switch to
      a reference counted list and operate on copies where necessary.
      
      ASTERISK-28927 #close
      
      Change-Id: I479c5dcf88db670956e8cac177b5826c986b0217
      b7c22054
  9. May 20, 2020
    • Nicholas John Koch's avatar
      res_musiconhold: Added check for dot character in path of playlist entries to avoid warnings · fef97a9a
      Nicholas John Koch authored
      A warning was triggered that there may be a problem regarding file
      extension (which is correct and should not be set anyway). The warning
      also appeared if there was dot within the path itself.
      
      E.g.
      [sales-queue-hold]
      mode=playlist
      entry=/var/www/domain.tld/moh/funky_music
      
      The music played correctly but you get a warning message.
      
      Now there will be a check if the position of a potential dot character
      is after the last position of a slash character. This dot charachter
      will be treated as a extension naming. Dots within the path then ignored.
      
      ASTERISK-28892
      Reported-By: Nicholas John Koch
      
      Change-Id: I2ec35a613413affbf5fcc01c8c181eba24865b9e
      fef97a9a
  10. Feb 11, 2020
  11. Sep 25, 2019
    • Sean Bright's avatar
      res_musiconhold: Add new 'playlist' mode · 966488ab
      Sean Bright authored
      Allow the list of files to be played to be provided explicitly in the
      music class's configuration. The primary driver for this change is to
      allow URLs to be used for MoH.
      
      Change-Id: I9f43b80b43880980b18b2bee26ec09429d0b92fa
      966488ab
  12. Sep 10, 2019
    • sungtae kim's avatar
      res_musiconhold: Added unregister realtime moh class · cf364cd0
      sungtae kim authored
      This fix allows a realtime moh class to be unregistered from the command
      line. This is useful when the contents of a directory referenced by a
      realtime moh class have changed.
      The realtime moh class is then reloaded on the next request and uses the
      new directory contents.
      
      ASTERISK-17808
      
      Change-Id: Ibc4c6834592257c4bb90601ee299682d15befbce
      cf364cd0
  13. Aug 01, 2019
  14. Jul 29, 2019
  15. Mar 08, 2019
  16. Oct 19, 2018
    • Corey Farrell's avatar
      astobj2: Eliminate legacy container allocation macros. · 687ab7ae
      Corey Farrell authored
      These macros have been documented as legacy for a long time but are
      still used in new code because they exist.  Remove all references to:
      * ao2_container_alloc_options
      * ao2_t_container_alloc_options
      * ao2_t_container_alloc
      
      These macro's are also removed.  Only ao2_container_alloc remains due to
      it's use in over 100 places.
      
      Change-Id: I1a26258b5bf3deb081aaeed11a0baa175c933c7a
      687ab7ae
  17. Sep 07, 2018
    • Frederic LE FOLL's avatar
      res_musiconhold.c: Restart MOH if previous hold just reached end-of-file · 35e02d6f
      Frederic LE FOLL authored
      On MOH activation, moh_files_readframe() is called while the current
      stream attached to the channel is NULL and it calls ast_moh_files_next()
      immediately.  However, it won't call ast_moh_files_next() again if sample
      reading fails.  The failure may occur because res_musiconhold retains the
      last sample reading position in the channel data and MOH during the
      previous hold/retrieve just reached EOF.  Obviously, a bit of bad luck is
      required here.
      
      * Restructured moh_files_readframe() to try a second time to start MOH if
      there was no stream setup and the saved position was at EOF.  Also added
      comments describing what is going on for each step.
      
      ASTERISK-28029
      
      Change-Id: I1508cf2c094f8feca22d6f76deaa9fdfa9944860
      35e02d6f
  18. May 11, 2018
    • Corey Farrell's avatar
      Fix GCC 8 build issues. · b5914d90
      Corey Farrell authored
      This fixes build warnings found by GCC 8.  In some cases format
      truncation is intentional so the warning is just suppressed.
      
      ASTERISK-27824 #close
      
      Change-Id: I724f146cbddba8b86619d4c4a9931ee877995c84
      b5914d90
  19. Apr 13, 2018
    • Ben Ford's avatar
      res_musiconhold: Don't restart MOH from beginning after announcement. · 4aeec610
      Ben Ford authored
      This reverts a problem introduced by the fix for ASTERISK_24329.
      Now, when an announcement is played while waiting in a queue, music on
      hold will not restart from the beginning of the sound file and will
      instead pick up where it left off. However, the incorrect behavior in
      ASTERISK_24329 is now present again; if an announcement X seconds
      long is played when music on hold starts, music on hold will start X
      seconds into the file.
      
      ASTERISK-27774 #close
      Reported by: lvl
      
      Change-Id: I86b2885ee7063268f9b9747eddb788336ade989b
      4aeec610
  20. Dec 22, 2017
  21. Dec 14, 2017
    • Sean Bright's avatar
      res_musiconhold: Start playlist after initial announcement · c387beb4
      Sean Bright authored
      Reset the samples counter to zero when we are done playing an
      announcement so that we don't skip into the middle of the first file in
      the playlist.
      
      Also add the selected annoucement to the output of 'moh show classes.'
      
      ASTERISK-24329 #close
      Reported by: Thomas Frederiksen
      
      Change-Id: I2a5f986a31279c981592f49391409ebf38d6f6d0
      c387beb4
  22. Dec 08, 2017
    • Sean Bright's avatar
      utils: Add convenience function for setting fd flags · 2ffe52a1
      Sean Bright authored
      There are many places in the code base where we ignore the return value
      of fcntl() when getting/setting file descriptior flags. This patch
      introduces a convenience function that allows setting or clearing file
      descriptor flags and will also log an error on failure for later
      analysis.
      
      Change-Id: I8b81901e1b1bd537ca632567cdb408931c6eded7
      2ffe52a1
  23. Jul 11, 2017
    • George Joseph's avatar
      res_musiconhold: Add kill_escalation_delay, kill_method to class · b7a87577
      George Joseph authored
      By default, when res_musiconhold reloads or unloads, it sends a HUP
      signal to custom applications (and all descendants), waits 100ms,
      then sends a TERM signal, waits 100ms, then finally sends a KILL
      signal.  An application which is interacting with an external
      device and/or spawns children of its own may not be able to exit
      cleanly in the default times, expecially if sent a KILL signal, or
      if it's children are getting signals directly from
      res_musiconhoild.
      
      * To allow extra time, the 'kill_escalation_delay'
        class option can be used to set the number of milliseconds
        res_musiconhold waits before escalating kill signals, with the
        default being the current 100ms.
      
      * To control to whom the signals are sent, the "kill_method" class
        option can be set to "process_group" (the default, existing
        behavior), which sends signals to the application and its
        descendants directly, or "process" which sends signals only to the
        application itself.
      
      Change-Id: Iff70a1a9405685a9021a68416830c0db5158603b
      b7a87577
  24. May 16, 2017
    • Joshua Colp's avatar
      asterisk: Audit locking of channel when manipulating flags. · 5a7af00e
      Joshua Colp authored
      When manipulating flags on a channel the channel has to be
      locked to guarantee that nothing else is also manipulating
      the flags. This change introduces locking where necessary to
      guarantee this. It also adds helper functions that manipulate
      channel flags and lock to reduce repeated code.
      
      ASTERISK-26789
      
      Change-Id: I489280662dba0f4c50981bfc5b5a7073fef2db10
      5a7af00e
  25. Apr 03, 2017
  26. Mar 27, 2017
    • Sean Bright's avatar
      res_musiconhold: Don't chdir() when scanning MoH files · d22c6789
      Sean Bright authored
      There doesn't appear to be any reason that we are chdir'ing in
      moh_scan_files, and in the event of an Asterisk crash, the core files
      may not get written because we have changed into a read-only directory.
      
      ASTERISK-23996 #close
      Reported by: Walter Doekes
      
      Change-Id: Iac806dce01b3335963fbd62d4b4da9a65c614354
      d22c6789
  27. Mar 09, 2017
  28. Jan 24, 2017
  29. 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
  30. Jun 08, 2016
    • Timo Teräs's avatar
      Fixes to include signal.h · 39b69ab5
      Timo Teräs authored
      POSIX defines signal.h. sys/signal.h should not be used as it is
      c-library internal header which may or may not exist. Notably with
      musl it generates warning of being incorrect.
      
      Change-Id: Ia56b0aa1d84b5c590114867b1b384a624f39a6fc
      39b69ab5
  31. Mar 24, 2016
    • 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
  32. Jan 13, 2016
    • Sean Bright's avatar
      res_musiconhold: Prevent multiple simultaneous reloads. · 79a7321a
      Sean Bright authored
      There are two ways in which the reload() function in res_musiconhold can be
      called from the CLI:
      
        * module reload res_musiconhold.so
        * moh reload
      
      In the former case, the module loader holds a lock that prevents multiple
      concurrent calls, but in the latter there is no such protection.
      
      This patch changes the 'moh reload' CLI command to invoke the module loader
      directly, rather than call reload() explicitly.
      
      ASTERISK-25687 #close
      
      Change-Id: I408968b4c8932864411b7f9ad88cfdc7b9ba711c
      79a7321a
  33. Jul 19, 2015
  34. Apr 27, 2015
    • Corey Farrell's avatar
      Astobj2: Allow reference debugging to be enabled/disabled by config. · 5c1d07ba
      Corey Farrell authored
      * The REF_DEBUG compiler flag no longer has any effect on code that uses
        Astobj2.  It is used to determine if reference debugging is enabled by
        default.  Reference debugging can be enabled or disabled in asterisk.conf.
      * Caller information is provided in logger errors for ao2 bad magic numbers.
      * Optimizes AO2 by merging internal functions with the public counterpart.
        This was possible now that we no longer require a dual ABI.
      
      ASTERISK-24974 #close
      Reported by: Corey Farrell
      
      Change-Id: Icf3552721fe999365ba8a8cf00a965aa6b897cc1
      5c1d07ba
  35. 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
  36. Sep 25, 2014
  37. Sep 14, 2014
  38. Aug 25, 2014
  39. Aug 21, 2014
Loading