Skip to content
Snippets Groups Projects
  1. Dec 19, 2017
  2. Dec 18, 2017
    • Corey Farrell's avatar
      netsock: Remove from Asterisk core. · 064c74e4
      Corey Farrell authored
      This moves netsock.c / netsock.h to the chan_iax2 module.  netsock.h has
      been marked deprecated since 13.0.0, chan_iax2 is the only remaining
      user.
      
      Change-Id: I28c6578043bac18de5ea608e136acec4f83d5dd3
      064c74e4
    • Corey Farrell's avatar
      CLI: Fix 'core set debug channel' completion bug. · 731a23fb
      Corey Farrell authored
      The completion generator is missing a return so typing "core set debug
      all off <tab>" causes the command to actually execute.
      
      Change-Id: Ibf6462088a74eee66967732b50445783ebefc20b
      731a23fb
  3. Dec 15, 2017
    • Corey Farrell's avatar
      cdr: Minor optimizations. · e6768c0f
      Corey Farrell authored
      * bridge_candidate_process: remove SCOPED_AO2LOCK and return value.
      * handle_standard_bridge_enter_message: replace recursive call with goto
        statement.
      
      ASTERISK-24297
      
      Change-Id: Id2eaa0822fb8dc799f63422bb3aa89de9d4ee2a2
      e6768c0f
    • Corey Farrell's avatar
      aco: Minimize use of regex. · bf2d3593
      Corey Farrell authored
      Remove nearly all use of regex from ACO users.  Still remaining:
      * app_confbridge has a legitamate use of option name regex.
      * ast_sorcery_object_fields_register is implemented with regex, all
        callers use simple prefix based regex.  I haven't decided the best
        way to fix this in both 13/15 and master.
      
      Change-Id: Ib5ed478218d8a661ace4d2eaaea98b59a897974b
      bf2d3593
    • Corey Farrell's avatar
      aco: Create ways to minimize use of regex. · a455e183
      Corey Farrell authored
      ACO uses regex in many situations where it is completely unneeded.  In
      some cases this doubles the total processing performed by
      aco_process_config.
      
      * Create ACO_IGNORE category type for use in place of skip_category
        regex source string.
      * Create additional aco_category_op values to allow specifying category
        filter using either a single plain string or a NULL terminated array
        of plain strings.
      * Create ACO_PREFIX to allow matching option names to case insensitive
        prefixes.
      
      Change-Id: I66a920dcd8e2b0301f73f968016440a985e72821
      a455e183
    • Corey Farrell's avatar
      loader: Use vector to build apha sorted module lists. · 9d579761
      Corey Farrell authored
      Change-Id: I9c519f4dec3cda98b2f34d314255a31d49a6a467
      9d579761
    • Corey Farrell's avatar
      loader: Replace priority heap with vector. · 7b549033
      Corey Farrell authored
      This is needed for future changes which will require being able to
      process the load priority out of order.
      
      Change-Id: Ia23421197f09789940510b03ebbbf3bf24d51bea
      7b549033
  4. Dec 14, 2017
    • Corey Farrell's avatar
      loader: Rework of load_dynamic_module. · 3505cc88
      Corey Farrell authored
      * Split off load_dlopen to perform actual dlopen, check results and log
        warnings when needed.
      * Always use RTLD_NOW.
      * Use flags which minimize number of calls to dlopen required.  First
        attempt always uses RTLD_GLOBAL when global_symbols_only is enabled,
        RTLD_LOCAL when it is not.
      
      This patch significantly reduces the number of dlopen's performed.  With
      299 modules my system ran dlopen 857 times before this patch, 655 times
      after this patch.
      
      Change-Id: Ib2c9903cfddcc01aed3e01c1e7fe4a3fb9af0f8b
      3505cc88
    • Corey Farrell's avatar
      loader: Minor fix to module registration. · 80bf0ee9
      Corey Farrell authored
      This protects the module loader itself against crashing if dlopen is
      called on a module from outside loader.c.
      
      * Expand scope of lock inside ast_module_register to include reading of
        resource_being_loaded.
      * NULL check resource_being_loaded.
      * Set resource_being_loaded NULL as soon as dlopen returns.  This fixes
        some error paths where it was not NULL'ed.
      * Create module_destroy function to deduplicate code from
        ast_module_unregister and modules_shutdown.
      * Resolve leak that occured if a module did not successfully register.
      * Simplify checking for successful registration.
      
      Change-Id: I40f07a315e55b92df4fc7faf525ed6d4f396e7d2
      80bf0ee9
    • Richard Mudgett's avatar
      res_rtp_asterisk.c: Disable packet flood detection for video streams. · 98f7e925
      Richard Mudgett authored
      We should not do flood detection on video RTP streams.  Video RTP streams
      are very bursty by nature.  They send out a burst of packets to update the
      video frame then wait for the next video frame update.  Really only audio
      streams can be checked for flooding.  The others are either bursty or
      don't have a set rate.
      
      * Added code to selectively disable packet flood detection for video RTP
      streams.
      
      ASTERISK-27440
      
      Change-Id: I78031491a6e75c2d4b1e9c2462dc498fe9880a70
      98f7e925
  5. Dec 13, 2017
    • Corey Farrell's avatar
      CLI: Remove special handling of 'core set verbose' from rasterisk. · 5f6a3c43
      Corey Farrell authored
      rasterisk does not need to handle setting verbose levels locally, it
      should just tell the daemon what it wants and print what it is given.
      Just max out the verbose level on the local client so all filtering
      happens on the daemon.
      
      ASTERISK-20281 #close
      
      Change-Id: Ia305f75f1fc424a9169bfa30ef70d626ace2c8a8
      5f6a3c43
  6. Dec 12, 2017
  7. Dec 11, 2017
    • Kevin Harwell's avatar
      pjsip_options: wrongly applied "UNKNOWN" status · b088cddc
      Kevin Harwell authored
      A couple of places were setting the status to "UNKNOWN" when qualifies were
      being disabled. Instead this should be set to the "CREATED" status that
      represents when a contact is given (uri available), but the qualify frequency
      is set to zero so we don't know the status.
      
      This patch updates the relevant places with "CREATED". It also updates the
      "CREATED" status description (value shown in CLI/AMI/ARI output) to a value
      of "NonQualified"/"NonQual" as this description is hopefully less confusing.
      
      ASTERISK-27467
      
      Change-Id: Id67509d25df92a72eb3683720ad2a95a27b50c89
      b088cddc
    • Richard Mudgett's avatar
      stasis_channels.c: Don't set channel snapshot caller_dnid twice. · c2ec82bf
      Richard Mudgett authored
      Change-Id: Ib8d45bbdfbda81e65045f6dff874d189b74e5471
      c2ec82bf
  8. Dec 10, 2017
    • Sean Bright's avatar
      astdb: Improve prefix searches in astdb · 9a9edc6c
      Sean Bright authored
      Using the LIKE operator requires a full table scan of 'astdb', whereas a
      comparison operation is able to use the primary key index.
      
      This patch adds a new function to the AstDB API for quick prefix matches
      and updates res_sorcery_astdb to utilize it. This showed substantial
      performance improvement in my test environment.
      
      Related to ASTERISK~26806, but does not completely resolve it.
      
      Change-Id: I7d37f9ba2aea139dabf2ca72d31fbe34bd9b2fa1
      9a9edc6c
  9. Dec 09, 2017
    • Corey Farrell's avatar
      loader: Refactor resource_name_match. · d2e87b8e
      Corey Farrell authored
      Optimize resource_name_match.  This change eliminates use of
      ast_strdupa, instead verifying that both basename's are the same length,
      then using strncasecmp.
      
      Change-Id: I477275c0e954c99d74be5abfc8bb6545b04e5a3d
      d2e87b8e
  10. 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
  11. Dec 07, 2017
  12. Dec 06, 2017
    • Corey Farrell's avatar
      sounds_index: Avoid repeatedly reindexing. · ab191e97
      Corey Farrell authored
      The sounds index is rebuilt each time a format is registered or
      unregistered.  This causes the index to be repeatedly rebuilt during
      startup and shutdown.
      
      This patch significantly reduces the work done by delaying sound index
      initialization until after modules are loaded.  This way a reindex only
      occurs if a format module is loaded after startup.  We also skip
      reindexing when format modules are unloaded during shutdown.
      
      Change-Id: I585fd6ee04200612ab1490dc804f76805f89cf0a
      ab191e97
    • Corey Farrell's avatar
      media_index: Improve startup. · 2af59ebb
      Corey Farrell authored
      This eliminates some wasteful operations in media_index startup.
      
      * Replace statically set string-fields with char[0].
      * Eliminate pointless RAII_VAR's.
      * alloc_variant: Avoid pointless ao2_find on new info->variant.
      * Stop trying find_variant before alloc_variant.
      * process_media_file: replace ast_str with ast_asprintf.  This avoids
        reallocation of file_id_str.
      
      Overall sounds_index.c is about 27% of Asterisk startup time when using
      sample configs.  This patch reduces it to 20%.  This is a half-fix.  The
      real problem is that the media_index is regenerated repeatedly - 68
      times in my test.
      
      Change-Id: Ia50b752f8efb356f852b05c4be495a6631af8652
      2af59ebb
    • Richard Mudgett's avatar
      bridge_basic.c: Update transfer diagnostic messages addendum. · e97e4155
      Richard Mudgett authored
      * Added start DTMF transfer verbose messages.
      * Made associated transfer messages use a similar message format.
      * Adjusted message verbose level as requested by initial reporter.
      
      ASTERISK-27449
      
      Change-Id: I2045714586414b3c5ef1f3cc56c1c4af4b31f551
      e97e4155
  13. Dec 05, 2017
    • Niklas Larsson's avatar
      bridge_basic.c: Update transfer diagnostic messages. · 9d005831
      Niklas Larsson authored
      * Add the channel name to diagnostic messages so you will know which
      channel failed to transfer.
      
      * Promoted some debug messages to verbose 4 messages.
      
      ASTERISK-27449 #close
      
      Change-Id: Idac66b7628c99379cc9269158377fd87dc97a880
      9d005831
  14. Dec 01, 2017
    • Sean Bright's avatar
      config: Speed up config template lookup · d9fdeae6
      Sean Bright authored
      ast_category_get() has an (undocumented) implementation detail where it
      tries to match the category name first by an explicit pointer comparison
      and if that fails falls back to a normal match.
      
      When initially building an ast_config during ast_config_load, this
      pointer comparison can never succeed, but we will end up iterating all
      categories twice. As the number of categories using a template
      increases, this dual looping becomes quite expensive. So we pass a flag
      to category_get_sep() indicating if a pointer match is even possible
      before trying to do so, saving us a full pass over the list of current
      categories.
      
      In my tests, loading a file with 3 template categories and 12000
      additional categories that use those 3 templates (this file configures
      4000 PJSIP endpoints with AOR & Auth) takes 1.2 seconds. After this
      change, that drops to 22ms.
      
      Change-Id: I59b95f288e11eb6bb34f31ce4cc772136b275e4a
      d9fdeae6
    • 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
  15. 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
  16. 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
  17. Nov 25, 2017
  18. 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
  19. Nov 20, 2017
Loading