Skip to content
Snippets Groups Projects
  1. Jan 07, 2022
    • George Joseph's avatar
      bundled_pjproject: Make it easier to hack · 3f093b8d
      George Joseph authored
      There are times when you need to troubleshoot issues with bundled
      pjproject or add new features that need to be pushed upstream
      but...
      
      * The source directory created by extracting the pjproject tarball
        is not scanned for code changes so you have to keep forcing
        rebuilds.
      * The source directory isn't a git repo so you can't easily create
        patches, do git bisects, etc.
      * Accidentally doing a make distclean will ruin your day by wiping
        out the source directory, and your changes.
      * etc.
      
      This commit makes that easier.
      See third-party/pjproject/README-hacking.md for the details.
      
      ASTERISK-29824
      
      Change-Id: Idb1251040affdab31d27cd272dda68676da9b268
      3f093b8d
  2. Aug 19, 2021
    • George Joseph's avatar
      res_pjproject: Allow mapping to Asterisk TRACE level · b72425b1
      George Joseph authored
      Allow mapping pjproject log messages to the Asterisk TRACE
      log level.  The defaults were also changes to log pjproject
      levels 3,4 to DEBUG and 5,6 to TRACE.  Previously 3,4,5,6
      all went to DEBUG.
      
      ASTERISK-29582
      
      Change-Id: I859a37a8dec263ed68099709cfbd3e665324c72d
      b72425b1
  3. Nov 20, 2020
  4. Sep 12, 2018
  5. Sep 06, 2018
    • Sean Bright's avatar
      res_pjproject: Add utility functions to convert between socket structures · 600c5d79
      Sean Bright authored
      Currently, to convert from a pj_sockaddr to an ast_sockaddr, the address
      needs to be rendered to a string and then parsed into the correct
      structure. This also involves a call to getaddrinfo(3). The same is true
      for the inverse operation.
      
      Instead, because we know the internal structure of both ast_sockaddr and
      pj_sockaddr, we can translate directly between the two without the
      need for an intermediate string.
      
      Change-Id: If0fc4bba9643f755604c6ffbb0d7cc46020bc761
      600c5d79
  6. Feb 28, 2018
    • Richard Mudgett's avatar
      pjproject: Add cache_pools debugging option. · 1a36a452
      Richard Mudgett authored
      The pool cache gets in the way of finding use after free errors of memory
      pool contents.  Tools like valgrind and MALLOC_DEBUG don't know when a
      pool is released because it gets put into the cache instead of being
      freed.
      
      * Added the "cache_pools" option to pjproject.conf.  Disabling the option
      helps track down pool content mismanagement when using valgrind or
      MALLOC_DEBUG.  The cache gets in the way of determining if the pool
      contents are used after free and who freed it.
      
      To disable the pool caching simply disable the cache_pools option in
      pjproject.conf and restart Asterisk.
      
      Sample pjproject.conf setting:
      [startup]
      cache_pools=no
      
      * Made current users of the caching pool factory initialization and
      destruction calls call common routines to create and destroy cached pools.
      
      ASTERISK-27704
      
      Change-Id: I64d5befbaeed2532f93aa027a51eb52347d2b828
      1a36a452
  7. Jan 24, 2018
    • Corey Farrell's avatar
      Remove redundant module checks and references. · 527cf5a5
      Corey Farrell authored
      This removes references that are no longer needed due to automatic
      references created by module dependencies.
      
      In addition this removes most calls to ast_module_check as they were
      checking modules which are listed as dependencies.
      
      Change-Id: I332a6e8383d4c72c8e89d988a184ab8320c4872e
      527cf5a5
  8. Nov 07, 2017
  9. Nov 06, 2017
  10. Oct 10, 2017
  11. Jan 24, 2017
    • Richard Mudgett's avatar
      PJPROJECT logging: Fix detection of max supported log level. · 6f3e8c8e
      Richard Mudgett authored
      The mechanism used for detecting the maximum log level compiled into the
      linked pjproject did not work.  The API call simply stores the requested
      level into an integer and does no range checking.  Asterisk was assuming
      that there was range checking and limited the new value to the allowable
      range.  To get the actual maximum log level compiled into the linked
      pjproject we need to get and save off the initial set log level from
      pjproject.  This is the maximum log level supported.
      
      * Get and save off the initial log level setting before altering it to the
      desired level on startup.  This has to be done by a macro rather than
      calling a core function to avoid incorrectly linking pjproject.
      
      * Split the initial log level warning messages to warn if the linked
      pjproject cannot support the requested startup level and if it is too low
      to get the pjproject buildopts for "pjproject show buildopts".
      
      * Adjust the CLI "pjproject set log level" to check the saved max log
      level and to generate normal output messages instead of a warning message.
      
      ASTERISK-26743 #close
      
      Change-Id: I40aa76653e2a1dece66c3f8734594b4f0471cfb4
      6f3e8c8e
  12. Nov 30, 2016
    • Richard Mudgett's avatar
      PJPROJECT logging: Made easier to get available logging levels. · 1dfa11b6
      Richard Mudgett authored
      Use of the new logging is as simple as issuing the new CLI command or
      setting the new pjproject.conf option.
      
      Other options that can affect the logging are how you have the pjproject
      log levels mapped to Asterisk log types in pjproject.conf and if you have
      configured Asterisk to log the DEBUG type messages.  Altering the
      pjproject.conf level mapping shouldn't be necessary for most installations
      as the default mapping is sensible.  Configuring Asterisk to log the DEBUG
      message type is standard practice for collecting debug information.
      
      * Added CLI "pjproject set log level" command to dynamically adjust the
      maximum pjproject log message level.
      
      * Added CLI "pjproject show log level" command to see the currently set
      maximum pjproject log message level.
      
      * Added pjproject.conf startup section "log_level" option to set the
      initial maximum pjproject log message level so all messages could be
      captured from initialization.
      
      * Set PJ_LOG_MAX_LEVEL to 6 to compile in all defined logging levels into
      bundled pjproject.  Pjproject will use the currently set run time log
      level to determine if a log message is generated just like Asterisk
      verbose and debug logging levels.
      
      * In log_forwarder(), made always log enabled and mapped pjproject log
      messages.  DEBUG mapped log messages are no longer gated by the current
      Asterisk debug logging level.
      
      * Removed RAII_VAR() from res_pjproject.c:get_log_level().
      
      ASTERISK-26630 #close
      
      Change-Id: I6dca12979f482ffb0450aaf58db0fe0f6d2e5389
      1dfa11b6
  13. 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
  14. Jun 21, 2016
  15. Feb 18, 2016
    • George Joseph's avatar
      res_pjproject: Add ability to map pjproject log levels to Asterisk log levels · f8767a88
      George Joseph authored
      Warnings and errors in the pjproject libraries are generally handled by
      Asterisk.  In many cases, Asterisk wouldn't even consider them to be warnings
      or errors so the messages emitted by pjproject directly are either superfluous
      or misleading.  A good exampe of this are the level-0 errors pjproject emits
      when it can't open a TCP/TLS socket to a client to send an OPTIONS.  We don't
      consider a failure to qualify a UDP client an "ERROR", why should a TCP/TLS
      client be treated any differently?
      
      A config file for res_pjproject has bene added (pjproject.conf) and a new
      log_mappings object allows mapping pjproject levels to Asterisk levels
      (or nothing).  The defaults if no pjproject.conf file is found are the same
      as those that were hard-coded into res_pjproject initially: 0,1 = LOG_ERROR,
      2 = LOG_WARNING, 3,4,5 = LOG_DEBUG<level>
      
      Change-Id: Iba7bb349c70397586889b8f45b8c3d6c6c8c3898
      f8767a88
  16. Feb 02, 2016
  17. Jan 21, 2016
    • Richard Mudgett's avatar
      res_pjsip: Add CLI "pjsip dump endpt [details]" · 5615db37
      Richard Mudgett authored
      Dump the res_pjsip endpt internals.
      
      In non-developer mode we will not document or make easily accessible the
      "details" option even though it is still available.  The user has to know
      it exists to use it.  Presumably they would also be aware of the potential
      crash warning below.
      
      Warning: PJPROJECT documents that the function used by this CLI command
      may cause a crash when asking for details because it tries to access all
      active memory pools.
      
      Change-Id: If2d98a3641c9873364d1daaad971376311aef3cb
      5615db37
  18. Jan 20, 2016
    • George Joseph's avatar
      res_pjproject: Add module providing pjproject logging and utils · dd5c0639
      George Joseph authored
      res_pjsip_log_forwarder has been renamed to res_pjproject
      and enhanced as follows:
      
      As a follow-on to the recent 'Add CLI "pjsip show buildopts"' patch,
      a new ast_pjproject_get_buildopt function has been added.  It
      allows the caller to get the value of one of the buildopts.
      
      The initial use case is retrieving the runtime value of
      PJ_MAX_HOSTNAME to insure we don't send a hostname greater
      than pjproject can handle.  Since it can differ between
      the version of pjproject that Asterisk was compiled against
      and the version of pjproject that Asterisk is running against,
      we can't use the PJ_MAX_HOSTNAME macro directly in Asterisk
      source code.
      
      Change-Id: Iab6e82fec3d7cf00c1cf6185c42be3e7569dee1e
      dd5c0639
  19. Jan 19, 2016
  20. Jan 13, 2016
    • Richard Mudgett's avatar
      res_pjsip_log_forwarder.c: Add CLI "pjsip show buildopts". · 1fffe71f
      Richard Mudgett authored
      PJPROJECT has a function available to dump the compile time
      options used when building the library.
      
      * Add CLI "pjsip show buildopts" command.
      
      * Update contrib/scripts/autosupport to get pjproject information.
      
      Change-Id: Id93a6a916d765b2a2e5a1aeb54caaf83206be748
      1fffe71f
  21. May 13, 2015
  22. 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
  23. Jul 25, 2014
  24. Sep 13, 2013
Loading