Skip to content
Snippets Groups Projects
  1. Apr 20, 2015
    • George Joseph's avatar
      pjsip_options: Fix non-qualified contacts showing as unavailable · 298faf7c
      George Joseph authored
      The "Add qualify_timeout processing and eventing" patch introduced
      an issue where contacts that had qualify_frequency set to 0 were
      showing Unavailable instead Unknown.  This patch checks for
      qualify_frequency=0 and create an "Unknown"  contact_status
      with an RTT = 0.
      
      Previously, the lack of contact_status implied Unknown but since
      we're now changing endpoint state based on contact_status, I've
      had to add new UNKNOWN status so that changes could trigger the
      appropriate contact_status observers.
      
      ASTERISK-24977: #close
      
      Change-Id: Ifcbc01533ce57f0e4e584b89a395326e098b8fe7
      298faf7c
  2. Apr 17, 2015
    • Matt Jordan's avatar
    • Mark Michelson's avatar
      Detect potential forwarding loops based on count. · aae45acb
      Mark Michelson authored
      A potential problem that can arise is the following:
      
      * Bob's phone is programmed to automatically forward to Carol.
      * Carol's phone is programmed to automatically forward to Bob.
      * Alice calls Bob.
      
      If left unchecked, this results in an endless loops of call forwards
      that would eventually result in some sort of fiery crash.
      
      Asterisk's method of solving this issue was to track which interfaces
      had been dialed. If a destination were dialed a second time, then
      the attempt to call that destination would fail since a loop was
      detected.
      
      The problem with this method is that call forwarding has evolved. Some
      SIP phones allow for a user to manually forward an incoming call to an
      ad-hoc destination. This can mean that:
      
      * There are legitimate use cases where a device may be dialed multiple
      times, or
      * There can be human error when forwarding calls.
      
      This change removes the old method of detecting forwarding loops in
      favor of keeping a count of the number of destinations a channel has
      dialed on a particular branch of a call. If the number exceeds the
      set number of max forwards, then the call fails. This approach has
      the following advantages over the old:
      
      * It is much simpler.
      * It can detect loops involving local channels.
      * It is user configurable.
      
      The only disadvantage it has is that in the case where there is a
      legitimate forwarding loop present, it takes longer to detect it.
      However, the forwarding loop is still properly detected and the
      call is cleaned up as it should be.
      
      Address review feedback on gerrit.
      
      * Correct "mfgium" to "Digium"
      * Decrement max forwards by one in the case where allocation of the
        max forwards datastore is required.
      * Remove irrelevant code change from pjsip_global_headers.c
      
      ASTERISK-24958 #close
      
      Change-Id: Ia7e4b7cd3bccfbd34d9a859838356931bba56c23
      aae45acb
    • Matt Jordan's avatar
      Merge topic 'ASTERISK-24863' · bb347fa5
      Matt Jordan authored
      * changes:
        res_pjsip: Add global option to limit the maximum time for initial qualifies
        pjsip_options: Add qualify_timeout processing and eventing
        res_pjsip: Refactor endpt_send_request to include transaction timeout
      bb347fa5
    • Joshua Colp's avatar
  3. Apr 16, 2015
    • Kevin Harwell's avatar
      bridge.c: NULL app causes crash during attended transfer · 56a2baa2
      Kevin Harwell authored
      Due to a race condition there was a chance that during an attended transfer the
      channel's application would return NULL. This, of course, would cause a crash
      when attempting to access the memory. This patch retrieves the channel's app
      at an earlier time in processing in hopes that the app name is available.
      However, if it is not then "unknown" is used instead. Since some string value
      is now always present the crash can no longer occur.
      
      ASTERISK-24869 #close
      Reported by: viniciusfontes
      Review: https://gerrit.asterisk.org/#/c/133/
      
      Change-Id: I5134b84c4524906d8148817719d76ffb306488ac
      56a2baa2
    • George Joseph's avatar
      res_pjsip: Add global option to limit the maximum time for initial qualifies · c6ed6816
      George Joseph authored
      
      Currently when Asterisk starts initial qualifies of contacts are spread out
      randomly between 0 and qualify_timeout to prevent network and system overload.
      If a contact's qualify_frequency is 5 minutes however, that contact may be
      unavailable to accept calls for the entire 5 minutes after startup.  So while
      staggering the initial qualifies is a good idea, basing the time on
      qualify_timeout could leave contacts unavailable for too long.
      
      This patch adds a new global parameter "max_initial_qualify_time" that sets the
      maximum time for the initial qualifies.  This way you could make sure that all
      your contacts are initialy, randomly qualified within say 30 seconds but still
      have the contact's ongoing qualifies at a 5 minute interval.
      
      If max_initial_qualify_time is > 0, the formula is initial_interval =
      min(max_initial_interval, qualify_timeout * random().  If not set,
      qualify_timeout is used.
      
      The default is "0" (disabled).
      
      ASTERISK-24863 #close
      
      Change-Id: Ib80498aa1ea9923277bef51d6a9015c9c79740f4
      Tested-by: default avatarGeorge Joseph <george.joseph@fairview5.com>
      c6ed6816
    • Scott Griepentrog's avatar
      res_pjsip_pubsub: On notify fail deleted sub_tree is then referenced · 664d3263
      Scott Griepentrog authored
      This change makes the send_notify of the sub_tree
      not happen when the sub_tree has been deleted due
      to the notify call failing, which avoids a crash.
      
      ASTERISK-24970 #close
      
      Change-Id: I1f20ffc08b192f59c457293b218025a693992cbf
      664d3263
    • George Joseph's avatar
      pjsip_options: Add qualify_timeout processing and eventing · 51886c68
      George Joseph authored
      This is the second follow-on to https://reviewboard.asterisk.org/r/4572/ and the
      discussion at
      http://lists.digium.com/pipermail/asterisk-dev/2015-March/073921.html
      
      
      
      The basic issues are that changes in contact status don't cause events to be
      emitted for the associated endpoint.  Only dynamic contact add/delete actions
      update the endpoint.  Also, the qualify timeout is fixed by pjsip at 32 seconds
      which is a long time.
      
      This patch makes use of the new transaction timeout feature in r4585 and
      provides the following capabilities...
      
      1.  A new aor/contact variable 'qualify_timeout' has been added that allows the
      user to specify the maximum time in milliseconds to wait for a response to an
      OPTIONS message.  The default is 3000ms.  When the timer expires, the contact is
      marked unavailable.
      
      2.  Contact status changes are now propagated up to the endpoint as follows...
      When any contact is 'Available', the endpoint is marked as 'Reachable'.  When
      all contacts are 'Unavailable', the endpoint is marked as 'Unreachable'.  The
      existing endpoint events are generated appropriately.
      
      ASTERISK-24863 #close
      
      Change-Id: Id0ce0528e58014da1324856ea537e7765466044a
      Tested-by: Dmitriy Serov
      Tested-by: default avatarGeorge Joseph <george.joseph@fairview5.com>
      51886c68
    • Matt Jordan's avatar
    • George Joseph's avatar
      res_pjsip: Refactor endpt_send_request to include transaction timeout · ab6382ca
      George Joseph authored
      This is the first follow-on to https://reviewboard.asterisk.org/r/4572/ and the
      discussion at
      http://lists.digium.com/pipermail/asterisk-dev/2015-March/073921.html
      
      
      
      Since we currently have no control over pjproject transaction timeout, this
      patch pulls the pjsip_endpt_send_request function out of pjproject and into
      res_pjsip/endpt_send_transaction in order to implement that capability.
      
      Now when the transaction is initiated, we also schedule our own pj_timer with
      our own desired timeout.
      
      If the transaction completes before either timeout, pjproject cancels its timer,
      and calls our tsx callback where we cancel our timer and run the app callback.
      
      If the pjproject timer times out first, pjproject calls our tsx callback where
      we cancel our timer and run the app callback.
      
      If our timer times out first, we terminate the transaction which causes
      pjproject to cancel its timer and call our tsx callback where we run the app
      callback.
      
      Regardless of the scenario, pjproject is calling the tsx callback inside the
      group_lock and there are checks in the callback to make sure it doesn't run
      twice.
      
      As part of this patch ast_sip_send_out_of_dialog_request was created to replace
      its similarly named private function.  It takes a new timeout argument in
      milliseconds (<= 0 to disable the timeout).
      
      ASTERISK-24863 #close
      Reported-by: default avatarGeorge Joseph <george.joseph@fairview5.com>
      Tested-by: default avatarGeorge Joseph <george.joseph@fairview5.com>
      
      Change-Id: I0778dc730d9689c5147a444a04aee3c1026bf747
      ab6382ca
    • Matt Jordan's avatar
  4. Apr 15, 2015
    • George Joseph's avatar
      More .gitignore updates · 043c38f6
      George Joseph authored
      
      Added .pyc and .sha1 to the top-level .gitignore.
      
      Change-Id: I7dfc4f554d54d22947b38140d3305007503cc16a
      Tested-by: default avatarGeorge Joseph <george.joseph@fairview5.com>
      043c38f6
    • Corey Farrell's avatar
      Build System: Enable use of ~/.asterisk.makeopts and /etc/asterisk.makeopts. · abf10a1d
      Corey Farrell authored
      The Makefile claims that you can set default menuselect options by creating
      ~/.asterisk.makeopts or /etc/asterisk.makeopts, but they are never read.
      The rule for menuselect.makeopts is only allowed to run if the active target
      is 'menuselect', but the menuselect target doesn't depend on
      menuselect.makeopts.  A dot (wildcard character) was added so the rule will
      be active for the targets that cause it to run: nmenuselect, cmenuselect,
      and gmenuselect.
      
      ASTERISK-13271 #close
      Reported by: John Nemeth
      
      Change-Id: Ibde804ff196283def49ccb9432fbf224a22586e2
      abf10a1d
    • Joshua Colp's avatar
      res_pjsip: Add external PJSIP resolver implementation using core DNS API. · a3cec44a
      Joshua Colp authored
      This change adds the following:
      
      1. A query set implementation. This is an API that allows queries to be executed in parallel and once all have completed a callback is invoked.
      2. Unit tests for the query set implementation.
      3. An external PJSIP resolver which uses the DNS core API to do NAPTR, SRV, AAAA, and A lookups.
      
      For the resolver it will do NAPTR, SRV, and AAAA/A lookups in parallel. If NAPTR or SRV
      are available it will then do more queries. And so on. Preference is NAPTR > SRV > AAAA/A,
      with IPv6 preferred over IPv4. For transport it will prefer TLS > TCP > UDP if no explicit
      transport has been provided. Configured transports on the system are taken into account to
      eliminate resolved addresses which have no hope of completing.
      
      ASTERISK-24947 #close
      Reported by: Joshua Colp
      
      Change-Id: I56cb03ce4f9d3d600776f36928e0b3e379b5d71e
      a3cec44a
    • Matt Jordan's avatar
    • Rodrigo Ramírez Norambuena's avatar
      cel_pgsql: Fix name string for log on unable allocate memory. · 33a319ae
      Rodrigo Ramírez Norambuena authored
      The LOG_ERROR has reference to CDR instead of CEL  for LENGTHEN_BUF1 and
      LENGTHEN_BUF2.
      
      ASTERISK-24965 #close
      Reported by: Rodrigo Ramirez Norambuena
      
      Change-Id: Icc818697d7d66d34bfe3048cdd15ca2b06c89744
      33a319ae
  5. Apr 14, 2015
  6. Apr 13, 2015
    • David M. Lee's avatar
      Fixing extconf compile · a573b77f
      David M. Lee authored
      During the mass code deletion for clang support, a stray backslash was
      left behind that was causing utils to fail to compile.
      
      Change-Id: I60e5fa58c9a5b248bde23aaada79ff663f87a2a1
      a573b77f
    • Matt Jordan's avatar
    • Joshua Colp's avatar
    • Matt Jordan's avatar
      build_tools/make_version: Update version parsing for Git migration · 3f9aa299
      Matt Jordan authored
      External systems - such as the Asterisk Test Suite - require knowledge of the
      upstream branch. Unfortunately, after moving to Git, the Asterisk version
      currently consists of only a 'GIT" prefix followed by an object blob,
      e.g., GIT-as08d7. This makes it difficult for such systems to know what
      features are available in a particular check out of Asterisk.
      
      This patch fixes this by hardcoding the branch in a variable in the
      make_version script. Since the mainline branches are not changed often -
      typically only once a year - this is a reasonable approach to solving
      the problem, and is more reliable than parsing the output of 'git branch
      -vv'. Branches that track off of an upstream primary branch will then get the
      benefit of knowing which mainline branch they are currently based off
      of.
      
      ASTERISK-24954 #close
      
      Change-Id: I8090d5d548b6d19e917157ed530b914b7eaf9799
      3f9aa299
    • Corey Farrell's avatar
      Optional API: Fix handling of sources that are both provider and user. · fbc8ddfe
      Corey Farrell authored
      OPTIONAL_API has conditionals to define AST_OPTIONAL_API and
      AST_OPTIONAL_API_ATTR differently based on if AST_API_MODULE is defined.
      Unfortunately this is inside the include protection block, so only the
      first status of AST_API_MODULE is respected.  For example res_monitor
      is an optional API provider, but uses func_periodic_hook.  This makes
      func_periodic_hook non-optional to res_monitor.
      
      This changes optional_api.h so that AST_OPTIONAL_API and
      AST_OPTIONAL_API_ATTR is redefined every time the header is included.
      
      ASTERISK-17608 #close
      Reported by: Warren Selby
      
      Change-Id: I8fcf2a5e7b481893e17484ecde4f172c9ffb5679
      fbc8ddfe
    • 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
  7. Apr 12, 2015
    • Matt Jordan's avatar
      Merge "main/editline: Add .gitignore." · 1174ef58
      Matt Jordan authored
      1174ef58
    • Corey Farrell's avatar
      main/editline: Add .gitignore. · 5d34bce6
      Corey Farrell authored
      This patch adds a .gitignore for main/editline to ignore all build results.
      
      Change-Id: I68c7bf375ea46282689e5a706534b69fca233b5d
      5d34bce6
    • Matt Jordan's avatar
      .gitignore: Ignore tarballs (*.gz) · d6605b3c
      Matt Jordan authored
      This patch updates the root .gitignore file to ignore files with a .gz
      extension. This will cause git to ignore downloaded sound tarballs in
      the the sounds/ directory.
      
      Change-Id: Ie84f085cc0fa51262209e7bfc1b1ba8c04a1ef59
      d6605b3c
    • George Joseph's avatar
      Add .gitignore and .gitreview files · b35e184d
      George Joseph authored
      Add the .gitignore and .gitreview files to the asterisk repo.
      
      NB:  You can add local ignores to the .git/info/exclude file
      without having to do a commit.
      
      Common ignore patterns are in the top-level .gitignore file.
      Subdirectory-specific ignore patterns are in their own .gitignore
      files.
      
      Change-Id: I842a1588ff27d8a0189f12d597f0a7af033d6c69
      Tested-by: George Joseph
      b35e184d
  8. Apr 11, 2015
  9. Apr 10, 2015
    • Richard Mudgett's avatar
      chan_pjsip/res_pjsip/bridge_softmix/core: Improve translation path choices. · c499cabf
      Richard Mudgett authored
      With this patch, chan_pjsip/res_pjsip now sets the native formats to the
      codecs negotiated by a call.
      
      * The changes in chan_pjsip.c and res_pjsip_sdp_rtp.c set the native
      formats to include all the negotiated audio codecs instead of only the
      initial preferred audio codec and later the currently received audio
      codec.
      
      * The audio frame handling in channel.c:ast_read() is more streamlined and
      will automatically adjust to changes in received frame formats.  The new
      policy is to remove translation and pass the new frame format to the
      receiver except if the translation was to a signed linear format.  A more
      long winded version is commented in ast_read() along with some caveats.
      
      * The audio frame handling in channel.c:ast_write() is more streamlined
      and will automatically adjust any needed translation to changes in the
      frame formats sent.  Frame formats sent can change for many reasons such
      as a recording is being played back or the bridged peer changed the format
      it sends.  Since it is a normal expectation that sent formats can change,
      the codec mismatch warning message is demoted to a debug message.
      
      * Removed the short circuit check in
      channel.c:ast_channel_make_compatible_helper().  Two party bridges need to
      make channels compatible with each other.  However, transfers and moving
      channels among bridges can result in otherwise compatible channels having
      sub-optimal translation paths if the make compatible check is short
      circuited.  A result of forcing the reevaluation of channel compatibility
      is that the asterisk.conf:transcode_via_slin and codecs.conf:genericplc
      options take effect consistently now.  It is unfortunate that these two
      options are enabled by default and negate some of the benefits to the
      changes in channel.c:ast_read() by forcing translation through signed
      linear on a two party bridge.
      
      * Improved the softmix bridge technology to better control the translation
      of frames to the bridge.  All of the incoming translation is now normally
      handled by ast_read() instead of splitting any translation steps between
      ast_read() and the slin factory.  If any frame comes in with an unexpected
      format then the translation path in ast_read() is updated for the next
      frame and the slin factory handles the current frame translation.
      
      This is the final patch in a series of patches aimed at improving
      translation path choices.  The other patches are on the following reviews:
      https://reviewboard.asterisk.org/r/4600/
      https://reviewboard.asterisk.org/r/4605/
      
      ASTERISK-24841 #close
      Reported by: Matt Jordan
      
      Review: https://reviewboard.asterisk.org/r/4609/
      ........
      
      Merged revisions 434671 from http://svn.asterisk.org/svn/asterisk/branches/13
      
      
      git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@434672 65c4cc65-6c06-0410-ace0-fbb531ad65f3
      c499cabf
Loading