Skip to content
Snippets Groups Projects
  1. Nov 15, 2017
    • Richard Mudgett's avatar
      audiohook.c: Fix freeing a frame and still using it. · b7b800b6
      Richard Mudgett authored
      Memory corruption happened to the media frame caches when an audio hook
      freed a frame when it shouldn't.  I think the freed frame was because a
      jitter buffer interpolated a missing frame and the audio hook
      unconditionally freed it.
      
      * Made audiohook.c:audio_audiohook_write_list() not free an interpolated
      frame if it is the same frame as what was passed into the routine.
      
      * Made plc.c:normalise_history() use memmove() instead of memcpy() on a
      memory block that could overlap.  Found by valgrind investigating this
      issue.
      
      ASTERISK-27238
      ASTERISK-27412
      
      Change-Id: I548d86894281fc4529aefeb9f161f2131ecc6fde
      b7b800b6
  2. Apr 26, 2017
    • Joshua Colp's avatar
      frame: Better handle interpolated frames. · 985a5fd7
      Joshua Colp authored
      Interpolated frames are frames which contain a number of
      samples but have no actual data. Audiohooks did not
      handle this case when translating an incoming frame into
      signed linear. It assumed that a frame would always contain
      media when it may not. If this occurs audiohooks will now
      immediately return and not act on the frame.
      
      As well for users of ast_trans_frameout the function has
      been changed to be a bit more sane and ensure that the data
      pointer on a frame is set to NULL if no data is actually
      on the frame. This allows the various spots in Asterisk that
      check for an interpolated frame based on the presence of a
      data pointer to work as expected.
      
      ASTERISK-26926
      
      Change-Id: I7fa22f631fa28d540722ed789ce28e84c7f8662b
      985a5fd7
  3. Mar 20, 2017
    • Aaron An's avatar
      audiohook.c: Lost RTP packets lead to out-of-sync MixMonitor. · 25016a74
      Aaron An authored
      Fixed a bug in function "ast_audiohook_write_frame" that checked the
      variable other_factory_samples and only flushed the factories, so they
      would be in sync, when other_factory_samples > 0. When there is not any
      rtp incoming the variable other_factory_samples will be 0, and although
      the result of "our_factory_ms - other_factory_ms" may be very large,
      this led to the record file not syncing.
      
      ASTERISK-26875 #close
      Reported-by: Aaron An
      Tested-by: Aaron An
      
      Change-Id: Ia4d890fb8fc1636a7188502bab35f555685aea22
      25016a74
  4. Feb 01, 2017
    • Sean Bright's avatar
      audiohooks: Muting a hook can mute underlying frames · 2849b726
      Sean Bright authored
      If an audiohook is placed on a channel that does not require transcoding,
      muting that hook will cause the underlying frames to be muted as well.
      
      The original patch is from David Woolley but I have modified slightly.
      
      ASTERISK-21094 #close
      Reported by: David Woolley
      Patches:
            ASTERISK-21094-Patch-1.8-1.txt (license #5737) patch uploaded
            by David Woolley
      
      Change-Id: Ib2b68c6283e227cbeb5fa478b2d0f625dae338ed
      2849b726
  5. 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
  6. Apr 27, 2016
    • Jean Aunis's avatar
      app_chanspy: reduce audio loss on the spying channel. · 72817707
      Jean Aunis authored
      ChanSpy was creating its audiohook with the flags AST_AUDIOHOOK_TRIGGER_SYNC
      and AST_AUDIOHOOK_SMALL_QUEUE, which caused audio frames to be lost when
      queues grow too large or when read and write queues go out of sync.
      Now these flags are set conditionally:
      - AST_AUDIOHOOK_TRIGGER_SYNC is not set if the option "o" is set
      - a new option "l" is created: if set, AST_AUDIOHOOK_SMALL_QUEUE will not
      be set on the audiohook
      
      ASTERISK-25866
      
      Change-Id: I9c7652f41d9fa72c8691e4e70ec4fd16b047a4dd
      72817707
  7. Dec 03, 2015
    • Jonathan Rose's avatar
      Fix crash in audiohook translate to slin · 69457b8d
      Jonathan Rose authored
      This patch fixes a crash which would occur when an audiohook was
      applied to a channel using an audio codec that could not be translated
      to signed linear (such as when using pass-through codecs like OPUS or
      when the codec translator module for the format in use is not loaded).
      
      ASTERISK-25498 #close
      Reported by: Ben Langfeld
      
      Change-Id: Ib6ea7373fcc22e537cad373996136636201f4384
      69457b8d
  8. Aug 13, 2015
  9. Jul 22, 2015
    • Joshua Colp's avatar
      audiohook: Use manipulated frame instead of dropping it. · 1cc99ba8
      Joshua Colp authored
      Previous changes to sample rate support in audiohooks accidentally
      removed code responsible for allowing the manipulate audiohooks
      to work. Without this code the manipulated frame would be dropped
      and not used. This change restores it.
      
      ASTERISK-25253 #close
      
      Change-Id: I3ff50664cd82faac8941f976fcdcb3918a50fe13
      1cc99ba8
    • Joshua Colp's avatar
      audiohook: Read the correct number of samples based on audiohook format. · e5fe8d40
      Joshua Colp authored
      Due to changes in audiohooks to support different sample rates the
      underlying storage of samples is in the format of the audiohook
      itself and not of the format being requested. This means that if a
      channel is using G722 the samples stored will be at 16kHz. If
      something subsequently reads from the audiohook at a format which
      is not the same sample rate as the audiohook the number of samples
      needs to be adjusted.
      
      Given the following example:
      1. Channel writing into audiohook at 16kHz (as it is using G722).
      2. Chanspy reading from audiohook at 8kHz.
      
      The original code would read 160 samples from the audiohook for
      each 20ms of audio. This is incorrect. Since the audio in the
      audiohook is at 16kHz the actual number needing to be read is 320.
      Failure to read this much would cause the audiohook to reset
      itself constantly as the buffer became full.
      
      This change adjusts the requested number of samples by determining
      the duration of audio requested and then calculating how many
      samples that would be in the audiohook format.
      
      ASTERISK-25247 #close
      
      Change-Id: Ia91ce516121882387a315fd8ee116b118b90653d
      e5fe8d40
  10. May 20, 2015
    • Kevin Harwell's avatar
      audiohook.c: Difference in read/write rates caused continuous buffer resets · 7bf88eb6
      Kevin Harwell authored
      Currently, everytime a sample rate change occurs (on read or write) the
      associated factory buffers are reset. If the requested sample rate on a
      read differed from that of a write then the buffers are continually reset
      on every read and write. This has the side effect of emptying the buffer,
      thus there being no data to read and then write to a file in the case of
      call recording.
      
      This patch fixes it so that an audiohook_list's rate always maintains the
      maximum sample rate among hooks and formats. Audiohook sample rates are
      only overwritten by this value when slin native compatibility is turned on.
      Also, the audiohook sample rate can only overwrite the list's sample rate
      when its rate is greater than that of the list or if compatibility is
      turned off. This keeps the rate from constantly switching/resetting.
      
      ASTERISK-24944 #close
      Reported by: Ronald Raikes
      
      Change-Id: Idab4dfef068a7922c09cc631dda27bc920a6c76f
      7bf88eb6
  11. 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
  12. Mar 12, 2015
    • Matthew Jordan's avatar
      main/audiohook: Update internal sample rate on reads · 38ee441e
      Matthew Jordan authored
      When an audiohook is created (which is used by the various Spy applications
      and Snoop channel in Asterisk 13+), it initially is given a sample rate of
      8kHz. It is expected, however, that this rate may change based on the media
      that passes through the audiohook. However, the read/write operations on the
      audiohook behave very differently.
      
      When a frame is written to the audiohook, the format of the frame is checked
      against the internal sample rate. If the rate of the format does not match
      the internal sample rate, the internal sample rate is updated and a new SLIN
      format is chosen based on that sample rate. This works just fine.
      
      When a frame is read, however, we do something quite different. If the format
      rate matches the internal sample rate, all is fine. However, if the rates
      don't match, the audiohook attempts to "fix up" the number of samples that
      were requested. This can result in some seriously large number of samples
      being requested from the read/write factories.
      
      Consider the worst case - 192kHz SLIN. If we attempt to read 20ms worth of
      audio produced at that rate, we'd request 3840 samples (192000 / (1000 / 20)).
      However, if the audiohook is still expecting an internal sample rate of 8000,
      we'll attempt to "fix up" the requested samples to:
      
        samples_converted = samples * (ast_format_get_sample_rate(format) /
                                       (float) audiohook->hook_internal_samp_rate);
      
        which is:
      
        92160 = 3840 * (192000 / 8000)
      
      This results in us attempting to read 92160 samples from our factories, as
      opposed to the 3840 that we actually wanted. On a 64-bit machine, this
      miraculously survives - despite allocating up to two buffers of length 92160
      on the stack. The 32-bit machines aren't quite so lucky. Even in the case where
      this works, we will either (a) get way more samples than we wanted; or (b) get
      about 3840 samples, assuming the timing is pretty good on the machine.
      
      Either way, the calculation being performed is wrong, based on the API users
      expectations.
      
      My first inclination was to allocate the buffers on the heap. As it is,
      however, there's at least two drawbacks with doing this:
      (1) It's a bit complicated, as the size of the buffers may change during the
          lifetime of the audiohook (ew).
      (2) The stack is faster (yay); the heap is slower (boo).
      
      Since our calculation is flat out wrong in the first place, this patch fixes
      this issue by instead updating the internal sample rate based on the format
      passed into the read operation. This causes us to read the correct number of
      samples, and has the added benefit of setting the audihook with the right
      SLIN format.
      
      Note that this issue was caught by the Asterisk Test Suite as a result of
      r432195 in the 13 branch. Because this issue is also theoretically possible
      in Asterisk 11, the change is being made here as well.
      
      Review: https://reviewboard.asterisk.org/r/4475/
      ........
      
      Merged revisions 432810 from http://svn.asterisk.org/svn/asterisk/branches/11
      ........
      
      Merged revisions 432811 from http://svn.asterisk.org/svn/asterisk/branches/13
      
      
      git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@432812 65c4cc65-6c06-0410-ace0-fbb531ad65f3
      38ee441e
  13. Oct 30, 2014
  14. Oct 03, 2014
  15. Jul 20, 2014
  16. Jul 18, 2014
  17. May 30, 2014
  18. May 09, 2014
  19. Apr 11, 2014
  20. Nov 23, 2013
  21. Jul 19, 2013
  22. Sep 22, 2012
    • Andrew Latham's avatar
      Doxygen Updates Janitor Work · fd98835f
      Andrew Latham authored
      * Whitespace, doc-blocks, spelling, case, missing and incorrect tags.
      * Add cleanup to Makefile for the Doxygen configuration update
      * Start updating Doxygen configuration for cleaner output
      * Enable inclusion of configuration files into documentation
      * remove mantisworkflow...
      * update documentation README
      * Add markup to Tilghman's email and talk with him about updating his email, he knows...
      * no code changes on this commit other than the mentioned Makefile change
      
      (issue ASTERISK-20259)
      
      
      git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@373384 65c4cc65-6c06-0410-ace0-fbb531ad65f3
      fd98835f
  23. Aug 30, 2012
    • Matthew Jordan's avatar
      Clean up doxygen warnings · 8018b879
      Matthew Jordan authored
      This patch fixes numerous doxygen warnings across Asterisk.  It also updates
      the makefile to regenerate the doxygen configuration on the local system
      before running doxygen to help prevent warnings/errors on the local system.
      
      Much thanks to Andrew for tackling one of the Asterisk janitor projects!
      
      (issue ASTERISK-20259)
      Reported by: Andrew Latham
      Patches:
        doxygen_partial.diff uploaded by Andrew Latham (license 5985)
        make_progdocs.diff uploaded by Andrew Latham (license 5985)
      
      
      
      git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@371989 65c4cc65-6c06-0410-ace0-fbb531ad65f3
      8018b879
  24. Jun 15, 2012
    • Kevin P. Fleming's avatar
      Multiple revisions 369001-369002 · 166b4e2b
      Kevin P. Fleming authored
      ........
        r369001 | kpfleming | 2012-06-15 10:56:08 -0500 (Fri, 15 Jun 2012) | 11 lines
        
        Add support-level indications to many more source files.
        
        Since we now have tools that scan through the source tree looking for files
        with specific support levels, we need to ensure that every file that is
        a component of a 'core' or 'extended' module (or the main Asterisk binary)
        is explicitly marked with its support level. This patch adds support-level
        indications to many more source files in tree, but avoids adding them to
        third-party libraries that are included in the tree and to source files
        that don't end up involved in Asterisk itself.
      ........
        r369002 | kpfleming | 2012-06-15 10:57:14 -0500 (Fri, 15 Jun 2012) | 3 lines
        
        Add a script to enable finding source files without support-levels defined.
      ........
      
      Merged revisions 369001-369002 from http://svn.asterisk.org/svn/asterisk/branches/1.8
      ........
      
      Merged revisions 369005 from http://svn.asterisk.org/svn/asterisk/branches/10
      
      
      git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@369013 65c4cc65-6c06-0410-ace0-fbb531ad65f3
      166b4e2b
  25. May 02, 2012
  26. Mar 22, 2012
  27. Feb 20, 2012
  28. Feb 16, 2012
  29. Dec 28, 2011
  30. Dec 27, 2011
  31. May 03, 2011
  32. Mar 14, 2011
  33. Mar 11, 2011
  34. Feb 22, 2011
    • David Vossel's avatar
      Media Project Phase2: SILK 8khz-24khz, SLINEAR 8khz-192khz, SPEEX 32khz, hd... · d760e81f
      David Vossel authored
      Media Project Phase2: SILK 8khz-24khz, SLINEAR 8khz-192khz, SPEEX 32khz, hd audio ConfBridge, and other stuff
      
      -Functional changes
      1. Dynamic global format list build by codecs defined in codecs.conf
      2. SILK 8khz, 12khz, 16khz, and 24khz with custom attributes defined in codecs.conf
      3. Negotiation of SILK attributes in chan_sip.
      4. SPEEX 32khz with translation
      5. SLINEAR 8khz, 12khz, 24khz, 32khz, 44.1khz, 48khz, 96khz, 192khz with translation
         using codec_resample.c
      6. Various changes to RTP code required to properly handle the dynamic format list
         and formats with attributes.
      7. ConfBridge now dynamically jumps to the best possible sample rate.  This allows
         for conferences to take advantage of HD audio (Which sounds awesome)
      8. Audiohooks are no longer limited to 8khz audio, and most effects have been
         updated to take advantage of this such as Volume, DENOISE, PITCH_SHIFT.
      9. codec_resample now uses its own code rather than depending on libresample.
      
      -Organizational changes
      Global format list is moved from frame.c to format.c
      Various format specific functions moved from frame.c to format.c
      
      Review: https://reviewboard.asterisk.org/r/1104/
      
      
      git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@308582 65c4cc65-6c06-0410-ace0-fbb531ad65f3
      d760e81f
  35. Feb 04, 2011
  36. Feb 03, 2011
  37. Jul 27, 2010
Loading