Skip to content
Snippets Groups Projects
  1. Dec 01, 2017
    • Sean Bright's avatar
      config: Speed up ACO & sorcery initialization · 1ad0fbc8
      Sean Bright authored
      When starting Asterisk in the foreground, there is a perceptible delay
      when loading modules that use the ACO and sorcery config frameworks.
      For example, a lightly configured res_pjsip took 853ms to load on my
      VM.
      
      I tracked down the slowness to the XPath queries used to associate the
      relevant documentation with the config options. One improvement was
      adding a call to xmlXPathOrderDocElems after loading an XML document.
      From the libxml2 docs:
      
        Call this routine to speed up XPath computation on static documents.
      
      The second change was to remove recursive descent and wildcard
      operators from the XPath queries. After these changes, res_pjsip takes
      85ms to load on my VM and there is no longer a perceptible delay when
      starting Asterisk in the foreground.
      
      Change-Id: I45d457f1580e26bf5a2b0dab16e8e9ae46dcbd82
      1ad0fbc8
  2. Nov 27, 2017
    • Corey Farrell's avatar
      CLI: Remove compatibility code. · d12a2ab4
      Corey Farrell authored
      Previous commits maintained compatibility with older remote console
      clients as well as maintaining all API's.
      
      Remove the following compatibility code:
      * ast_cli_generatornummatches.
      * Remote command "_command nummatches".
      * Sorting / duplicate removal by remote console.
      
      Change-Id: I59e6ce94fa57ae564888442049695f7e46746437
      d12a2ab4
  3. Nov 26, 2017
    • Alexander Traud's avatar
      translate: Transcode siren14, speex32, silk24, and silk12 via slin16. · 58115e9c
      Alexander Traud authored
      When a format has no pre-recorded sound files, Asterisk has to transcode between
      formats. For this, Asterisk has a fixed translation table. If the pre-recorded
      sound files are not available in the same sample rate, Asterisk has not only to
      transcode but also to resample.
      
      Asterisk has pre-recorded files for SLN (8000 kHz) and SLN16 (16000 kHz).
      However before this change, Asterisk did not take the sample rate into account,
      because the translation paths to SLN and SLN16 got the same score/weight in the
      table. Consequently, you might have got narrow-band audio with siren14, speex32,
      silk24, and silk12 although those are (ultra) wide-band audio codecs.
      
      With this change, the distance in sample-rates is taken into account. Now on the
      Command-Line interface (CLI) 'core show channels', you should see:
      (slin@16000)->(slin@32000)->(speex@32000).
      
      ASTERISK-23735
      Reported by: Richard Kenner
      
      Change-Id: I9448295c1978be26f8633b6066395e7bbbe2e213
      58115e9c
  4. Nov 25, 2017
  5. Nov 21, 2017
    • Corey Farrell's avatar
      CLI: Finish conversion of completion handling to vectors. · b79d04f8
      Corey Farrell authored
      Change-Id: Ib81318f4ee52a5e73b003316e13fe9be1dd897a1
      b79d04f8
    • Corey Farrell's avatar
      CLI: Refactor cli_complete. · fbb8c0d3
      Corey Farrell authored
      * Stop using "_COMMAND NUMMATCHES" on remote consoles.  Using this
        command had doubled the amount of work needed from the Asterisk
        daemon for each completion request.
      * Fix code formatting.
      * Remove static buffer used to send the command, use the same buffer
        that will receive the results.
      * Move sort from ast_cli_display_match_list.
      
      Change-Id: Ie2211b519a3d4bec45bf46e0095bdd01d384cb69
      fbb8c0d3
    • Corey Farrell's avatar
      CLI: Rewrite ast_el_strtoarr to use vector's internally. · 1cd24cd7
      Corey Farrell authored
      This rewrites ast_el_strtoarr to use vector's internally, but still
      return the original NULL terminated array of strings.
      
      Change-Id: Ibfe776cbe14f750effa9ca360930acaccc02e957
      1cd24cd7
    • Corey Farrell's avatar
      CLI: Refactor ast_cli_display_match_list. · 9c0a2110
      Corey Farrell authored
      * Stop estimating line count, just print until we run out of matches.
      * Stop freeing entries, the caller does that anyways.
      * Stop calculating / returning numoutput, it was ignored.
      
      Change-Id: I7f92afa8bea92241a95227587367424c8c32a5cb
      9c0a2110
    • Corey Farrell's avatar
      CLI: Create ast_cli_completion_add function. · 9587a61f
      Corey Farrell authored
      Some completion generators are very inefficent due to the way CLI
      requests matches one at a time.  ast_cli_completion_add can be called
      multiple times during one invokation of a CLI generator to add all
      results without having to reinitialize the search state for each match.
      
      Change-Id: I73d26d270bbbe1e3e6390799cfc1b639e39cceec
      9587a61f
    • Corey Farrell's avatar
      CLI: Remove calls to ast_cli_generator. · a02cbc2e
      Corey Farrell authored
      The ability to add to localized storage cannot be supported by
      ast_cli_generator.  The only calls to ast_cli_generator should be by
      functions that need to proxy the CLI generator, for example 'cli check
      permissions' or 'core show help'.
      
      * ast_cli_generatornummatches now retrieves the vector of matches and
        reports the number of elements (not including 'best' match).
      * test_substitution retrieves and iterates the vector.
      
      Change-Id: I8cd6b93905363cf7a33a2d2b0e2a8f8446d9f248
      a02cbc2e
    • Corey Farrell's avatar
      loader: Fix comments in struct ast_module. · 10b4b5d2
      Corey Farrell authored
      Make the comments follow doxygen format, move comments to the line
      before each field they describe.
      
      Change-Id: Ic445468398b5e88f13910f7c2f70bd15aad33a27
      10b4b5d2
  6. Nov 20, 2017
  7. Nov 19, 2017
    • Corey Farrell's avatar
      Build: Fix issues building without SSL. · 999e0c17
      Corey Farrell authored
      * Fix conditional in libasteriskssl.
      * Use variables produced by configure to link the SSL and uuid libraries
        into libasteriskpj.so instead of hard-coding them.
      
      ASTERISK-27431
      
      Change-Id: I3977931fd3ef8c4e4376349ccddb354eb839b58d
      999e0c17
    • Corey Farrell's avatar
      iostream: Fix ast_iostream_printf declaration. · b4862e46
      Corey Farrell authored
      This adds the printf attribute and changes 'fmt' from 'const void *' to
      'const char *'.  This resolves a warning from some compiler for
      vsnprintf needing a literal string for format.
      
      Change-Id: I71c33a8262590042ee451e1146760c10bb22fb78
      b4862e46
  8. Nov 17, 2017
    • Corey Farrell's avatar
      acl: Fix allocation related issues. · c4f11911
      Corey Farrell authored
      Add checks for allocation errors, cleanup and report failure when they
      occur.
      
      * ast_duplicate_acl_list: Replace log warnings with errors, add missing
        line-feed.
      * ast_append_acl: Add missing line-feed to logger message.
      * ast_append_ha: Avoid ast_strdupa in loop by moving debug message to
        separate function.
      * ast_ha_join: Use two separate calls to ast_str_append to avoid using
        ast_strdupa in a loop.
      
      Change-Id: Ia19eaaeb0b139ff7ce7b971c7550e85c8b78ab76
      c4f11911
    • Joshua Colp's avatar
      bridge_basic: Ignore answer from transfer target when they've timed out. · 781a520b
      Joshua Colp authored
      This is a fun one.
      
      Given the following attended transfer scenario:
      
      1. Transfer target is called
      2. Transferer hangs up
      3. Transfer target call attempt reaches timeout
      4. Transfer target is told to hang up
      5. Transfer target answers before channel is hung up
      6. Transferer recall target is called
      
      A crash would occur. This is because the transfer target call
      attempt, despite being told to hang up, would raise a recall
      target answer before the recall target had been answered. As it
      had not answered there would be no recall target channel and it
      would implode.
      
      This change makes it so that if the transfer target has been
      hung up we don't tell the attended transfer code that it has
      answered. We also clear out the stimulus that the recall target
      has been answered after telling the transfer target to hang up,
      in case it was able to raise the information before we told it
      to hangup.
      
      ASTERISK-27361
      
      Change-Id: Ifb8b255a9c4d2c5c1b8ad77bf54f659ed286df99
      781a520b
    • Corey Farrell's avatar
      aoc: Fix memory management issues. · a95f2994
      Corey Farrell authored
      aoc_publish_blob failed to check for msg allocation error and never
      released msg.
      
      Change-Id: Ib31a9ffb81056a0d496a49d7eec795005a44bcd5
      a95f2994
  9. 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
  10. Nov 13, 2017
    • Corey Farrell's avatar
      core: Use ast_alertpipe for Asterisk signal monitoring thread. · edd1016d
      Corey Farrell authored
      Reduce the signal monitoring thread file descriptor use from two to one
      on systems that support eventfd.
      
      Change-Id: Id4041a237d481ff699639e153ea6982fee14a462
      edd1016d
    • Corey Farrell's avatar
      core: Fix configuration of remote console socket path. · cdaaa14a
      Corey Farrell authored
      The remote console socket path is the combination of asterisk.conf
      settings astrundir from [directories] and astctl from [files].
      Unconditionally combine the two strings after processing all values
      to ensure we end up with the correct socket path.
      
      ASTERISK-27415
      
      Change-Id: Ib1e2805d55d6b0955c6430a1a2a93acbf9b091e8
      cdaaa14a
    • Sean Bright's avatar
      sorcery: Add ast_sorcery_retrieve_by_prefix() · ffccce76
      Sean Bright authored
      Some consumers of the sorcery API use ast_sorcery_retrieve_by_regex
      only so that they can anchor the potential match as a prefix and not
      because they truly need regular expressions.
      
      Rather than using regular expressions for simple prefix lookups, add
      a new operation - ast_sorcery_retrieve_by_prefix - that does them.
      
      Change-Id: I56f4e20ba1154bd52281f995c27a429a854f6a79
      ffccce76
    • Corey Farrell's avatar
      CLI: Create ast_cli_completion_vector. · 14d60cee
      Corey Farrell authored
      This is a rewrite of ast_cli_completion_matches using a vector to build
      the list.  The original function calls the vector version, NULL
      terminates the vector and extracts the elements array.
      
      One change in behavior the results are now sorted and deduplicated. This
      will solve bugs where some duplicate checking was done before the list
      was sorted.
      
      Change-Id: Iede20c5b4d965fa5ec71fda136ce9425eeb69519
      14d60cee
  11. Nov 11, 2017
    • Richard Mudgett's avatar
      core: Add cache_media_frames debugging option. · 90bb0a3e
      Richard Mudgett authored
      The media frame cache gets in the way of finding use after free errors of
      media frames.  Tools like valgrind and MALLOC_DEBUG don't know when a
      frame is released because it gets put into the cache instead of being
      freed.
      
      * Added the "cache_media_frames" option to asterisk.conf.  Disabling the
      option helps track down media frame mismanagement when using valgrind or
      MALLOC_DEBUG.  The cache gets in the way of determining if the frame is
      used after free and who freed it.  NOTE: This option has no effect when
      Asterisk is compiled with the LOW_MEMORY compile time option enabled
      because the cache code does not exist.
      
      To disable the media frame cache simply disable the cache_media_frames
      option in asterisk.conf and restart Asterisk.
      
      Sample asterisk.conf setting:
      [options]
      cache_media_frames=no
      
      ASTERISK-27413
      
      Change-Id: I0ab2ce0f4547cccf2eb214901835c2d951b78c00
      90bb0a3e
    • Richard Mudgett's avatar
      frame.c: Make ast_frame_free()/ast_frfree() NULL tolerant · b865d29f
      Richard Mudgett authored
      Change-Id: Ic49d821ef88ada38a31bdd835b9531443c55d793
      b865d29f
  12. Nov 10, 2017
  13. Nov 08, 2017
    • Corey Farrell's avatar
      DEBUG_FD_LEAKS: Add missing FD creators. · 0bda39c6
      Corey Farrell authored
      This adds FD tracking for the following functions:
      * eventfd
      * timerfd_create
      * socketpair
      * accept
      
      ASTERISK-27404
      
      Change-Id: Id6848fe904ade2d34eb39d2a20bd6b223e1111fc
      0bda39c6
    • Richard Mudgett's avatar
      AST-2017-010: Fix cdr_object_update_party_b_userfield_cb() buf overrun · b358e441
      Richard Mudgett authored
      cdr_object_update_party_b_userfield_cb() could overrun the fixed buffer if
      the supplied string is too long.  The long string could be supplied by
      external means using the CDR(userfield) function.
      
      This may seem reminiscent to AST-2017-001 (ASTERISK_26897) and it is.  The
      earlier patch fixed the buffer overrun for Party A's userfield while this
      patch fixes the same thing for Party B's userfield.
      
      ASTERISK-27337
      
      Change-Id: I0fa767f65ecec7e676ca465306ff9e0edbf3b652
      b358e441
  14. Nov 07, 2017
  15. Nov 06, 2017
Loading