Skip to content
Snippets Groups Projects
  1. May 05, 2015
  2. May 03, 2015
    • Corey Farrell's avatar
      Remove unneeded uses of optional_api providers. · c3ec5da1
      Corey Farrell authored
      A few cases exist where headers of optional_api provders are included but
      not needed.  This causes unneeded calls to ast_optional_api_use.
      
      * Don't include optional_api.h from sip_api.h.
      * Move 'struct ast_channel_monitor' to channel.h.
      * Don't include monitor.h from chan_sip.c, channel.c or features.c.
      
      The move of struct ast_channel_monitor is needed since channel.c depends on
      it.  This has no effect on users of monitor.h since channel.h is included
      from monitor.h.
      
      ASTERISK-25051 #close
      Reported by: Corey Farrell
      
      Change-Id: I53ea65a9fc9693c89f8bcfd6120649bfcfbc3478
      c3ec5da1
  3. Apr 30, 2015
    • Mark Michelson's avatar
      Restrict functionality when ACLs are misconfigured. · 11ffcf66
      Mark Michelson authored
      This patch has two main purposes:
      
      1) Improve warning messages when ACLs are configured improperly.
      2) Prevent misconfigured ACLs from allowing potentially unwanted
      traffic.
      
      To acomplish point (2) in most cases, whatever configuration object that
      the ACL belonged to was not allowed to load.
      
      The one exception is res_pjsip_acl. In that case, ACLs are their own
      configuration object. Furthermore, the module loading code has no
      indication that a ACL configuration had a failure. So the tactic taken
      here is to create an ACL that just blocks everything.
      
      ASTERISK-24969
      Reported by Corey Farrell
      
      Change-Id: I2ebcb6959cefad03cea4d81401be946203fcacae
      11ffcf66
    • Richard Mudgett's avatar
      chan_dahdi: Add the chan_dahdi.conf force_restart_unavailable_chans option. · 03c51cf5
      Richard Mudgett authored
      Some telco switches occasionally ignore ISDN RESTART requests.  The fix
      for ASTERISK-19608 added an escape clause for B channels in the restarting
      state if the telco ignores a RESTART request.  If the telco fails to
      acknowledge the RESTART then Asterisk will assume the telco acknowledged
      the RESTART on the second call attempt requesting the B channel by the
      telco.  The escape clause is good for dealing with RESTART requests in
      general but it does cause the next call for the restarting B channel to be
      rejected if the telco insists the call must go on that B channel.
      
      chan_dahdi doesn't really need to issue a RESTART request in response to
      receiving a cause 44 (Requested channel not available) code.  Sending the
      RESTART in such a situation is not required (nor prohibited) by the
      standards.  I think chan_dahdi does this for historical reasons to deal
      with buggy peers to get channels unstuck in a similar fashion as the
      chan_dahdi.conf resetinterval option.
      
      * Add the chan_dahdi.conf force_restart_unavailable_chans compatability
      option that when disabled will prevent chan_dahdi from trying to RESTART
      the channel in response to a cause 44 code.
      
      ASTERISK-25034 #close
      Reported by: Richard Mudgett
      
      Change-Id: Ib8b17a438799920f4a2038826ff99a1884042f65
      03c51cf5
  4. Apr 28, 2015
  5. Apr 27, 2015
    • Corey Farrell's avatar
      Astobj2: Allow reference debugging to be enabled/disabled by config. · 5c1d07ba
      Corey Farrell authored
      * The REF_DEBUG compiler flag no longer has any effect on code that uses
        Astobj2.  It is used to determine if reference debugging is enabled by
        default.  Reference debugging can be enabled or disabled in asterisk.conf.
      * Caller information is provided in logger errors for ao2 bad magic numbers.
      * Optimizes AO2 by merging internal functions with the public counterpart.
        This was possible now that we no longer require a dual ABI.
      
      ASTERISK-24974 #close
      Reported by: Corey Farrell
      
      Change-Id: Icf3552721fe999365ba8a8cf00a965aa6b897cc1
      5c1d07ba
  6. Apr 26, 2015
  7. Apr 24, 2015
    • Diederik de Groot's avatar
      Clang: Fix some more tautological-compare warnings. · f8e21a1a
      Diederik de Groot authored
      clang can warn about a so called tautological-compare, when it finds
      comparisons which are logically always true, and are therefor deemed
      unnecessary.
      
      Exanple:
      unsigned int x = 4;
      if (x > 0)    // x is always going to be bigger than 0
      
      Enum Case:
      Each enumeration is its own type. Enums are an integer type but they
      do not have to be *signed*. C leaves it up to the compiler as an
      implementation option what to consider the integer type of a particu-
      lar enumeration is. Gcc treats an enum without negative values as
      an int while clang treats this enum as an unsigned int.
      
      rmudgett & mmichelson: cast the enum to (unsigned int) in assert.
      The cast does have an effect. For gcc, which seems to treat all enums
      as int, the cast to unsigned int will eliminate the possibility of
      negative values being allowed. For clang, which seems to treat enums
      without any negative members as unsigned int, the cast will have no
      effect. If for some reason in the future a negative value is ever
      added to the enum the assert will still catch the negative value.
      
      ASTERISK-24917
      Change-Id: Ief23ef68916192b9b72dabe702b543ecfeca0b62
      f8e21a1a
  8. Apr 21, 2015
    • Richard Mudgett's avatar
      chan_dahdi/sig_pri: Make post AMI HangupRequest events on PRI channels. · 614f5066
      Richard Mudgett authored
      The chan_dahdi channel driver is a very old driver.  The ability for it to
      support ISDN was added well after the initial analog support.  Setting the
      softhangup flags is a carry over from the original analog code.  The
      driver was not updated to call ast_queue_hangup() which will post the AMI
      HangupRequest event.
      
      * Changed sig_pri.c to call ast_queue_hangup() instead of setting the
      softhangup flag when the remote party initiates a hangup.
      
      ASTERISK-24895 #close
      Reported by: Andrew Zherdin
      
      Change-Id: I5fe2e48556507785fd8ab8e1c960683fd5d20325
      614f5066
  9. Apr 14, 2015
    • Corey Farrell's avatar
      Build System: Create Makefile macro MOD_ADD_SOURCE. · 62508d68
      Corey Farrell authored
      This new macro allows a single line to add all additional
      sources to a module.  This helps prevent modules from
      missing steps, and makes future changes easier since
      they can be made in a single place.
      
      ASTERISK-24960 #close
      Reported by: Corey Farrell
      
      Change-Id: I38f12d8b72c5e7bb37a879b2fb51761a2855eb4b
      62508d68
  10. 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
  11. 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
    • Kevin Harwell's avatar
      chan_sip: make progressinband default to no · 66f3fd00
      Kevin Harwell authored
      After the "progressinband" value setting of "never" was updated to never send a
      183 this separated its use from the "no" value. Since "never" was the default,
      but most users probably expect "no" this patch updates the default for the
      "progressinband" setting to "no."
      
      ASTERISK-24835 #close
      Reported by: Andrew Nagy
      Review: https://reviewboard.asterisk.org/r/4606/
      ........
      
      Merged revisions 434654 from http://svn.asterisk.org/svn/asterisk/branches/13
      
      
      git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@434655 65c4cc65-6c06-0410-ace0-fbb531ad65f3
      66f3fd00
    • Matthew Jordan's avatar
      res_pjsip: Add an 'auto' option for DTMF Mode · 8bae18ab
      Matthew Jordan authored
      This patch adds support for automatically detecting the type of DTMF that a
      PJSIP endpoint supports. When the 'dtmf_mode' endpoint option is set to 'auto',
      the channel created for an endpoint will attempt to determine if RFC 4733
      DTMF is supported. If so, it will use that DTMF type. If not, the DTMF type
      for the channel will be set to inband.
      
      Review: https://reviewboard.asterisk.org/r/4438
      
      ASTERISK-24706 #close
      Reported by: yaron nahum
      patches:
        yaron_patch_3_Feb.diff submitted by yaron nahum (License 6676)
      ........
      
      Merged revisions 434637 from http://svn.asterisk.org/svn/asterisk/branches/13
      
      
      git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@434638 65c4cc65-6c06-0410-ace0-fbb531ad65f3
      8bae18ab
    • Matthew Jordan's avatar
      channels/chan_iax2: Improve POKE expiration time calculation for lossy networks · 80c443be
      Matthew Jordan authored
      POKE is used to check for peer availability; however, in networks with packet
      loss, the current calculations may result in POKE expiration times that are too
      short. This patch alters the expiration/retry time logic to take into account
      the last known qualify round trip time, as opposed to always using a static
      value for each peer.
      
      Review: https://reviewboard.asterisk.org/r/4536
      
      ASTERISK-22352 #close
      Reported by: Frederic Van Espen
      
      ASTERISK-24894 #close
      Reported by: Y Ateya
      patches:
        poke_noanswer_duration.diff submitted by Y Ateya (License 6693)
      ........
      
      Merged revisions 434564 from http://svn.asterisk.org/svn/asterisk/branches/11
      ........
      
      Merged revisions 434565 from http://svn.asterisk.org/svn/asterisk/branches/13
      
      
      git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@434566 65c4cc65-6c06-0410-ace0-fbb531ad65f3
      80c443be
    • Matthew Jordan's avatar
      channels/chan_iax2: Add a configuration parameter for call token expiration · b3d01f1f
      Matthew Jordan authored
      This patch adds a new configuration parameter, 'calltokenexpiration', that
      controls how long before an authentication call token is expired. The default
      maintains the RFC specified 10 seconds. Setting it to a higher value may be
      useful in lossy networks.
      
      Review: https://reviewboard.asterisk.org/r/4588
      
      ASTERISK-24939 #close
      Reported by: Y Ateya
      patches:
        ctoken_configuration.diff submitted by Y Ateya (License 6693)
      
      
      git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@434563 65c4cc65-6c06-0410-ace0-fbb531ad65f3
      b3d01f1f
  12. Apr 09, 2015
    • Richard Mudgett's avatar
      chan_iax2.c: Fix ref leak in iax2_request(). · b2b1f24a
      Richard Mudgett authored
      * Increased warning message format capability string buffer size in
      iax2_request().
      
      Review: https://reviewboard.asterisk.org/r/4601/
      ........
      
      Merged revisions 434510 from http://svn.asterisk.org/svn/asterisk/branches/13
      
      
      git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@434511 65c4cc65-6c06-0410-ace0-fbb531ad65f3
      b2b1f24a
    • Matthew Jordan's avatar
      clang compiler warnings: Fix autological comparisons · ea009872
      Matthew Jordan authored
      This fixes autological comparison warnings in the following:
       * chan_skinny: letohl may return a signed or unsigned value, depending on the
         macro chosen
       * func_curl: Provide a specific cast to CURLoption to prevent mismatch
       * cel: Fix enum comparisons where the enum can never be negative
       * enum: Fix comparison of return result of dn_expand, which returns a signed
         int value
       * event: Fix enum comparisons where the enum can never be negative
       * indications: tone_data.freq1 and freq2 are unsigned, and hence can never be
         negative
       * presencestate: Use the actual enum value for INVALID state
       * security_events: Fix enum comparisons where the enum can never be negative
       * udptl: Don't bother to check if the return value from encode_length is less
         than 0, as it returns an unsigned int
       * translate: Since the parameters are unsigned int, don't bother checking
         to see if they are negative. The cast to unsigned int would already blow
         past the matrix bounds.
       * res_pjsip_exten_state: Use a temporary value to cache the return of
         ast_hint_presence_state
       * res_stasis_playback: Fix enum comparisons where the enum can never be
         negative
       * res_stasis_recording: Add an enum value for the case where the recording
         operation is in error; fix enum comparisons
       * resource_bridges: Use enum value as opposed to -1
       * resource_channels: Use enum value as opposed to -1
      
      Review: https://reviewboard.asterisk.org/r/4533
      ASTERISK-24917
      Reported by: dkdegroot
      patches:
        rb4533.patch submitted by dkdegroot (License 6600)
      ........
      
      Merged revisions 434469 from http://svn.asterisk.org/svn/asterisk/branches/11
      ........
      
      Merged revisions 434470 from http://svn.asterisk.org/svn/asterisk/branches/13
      
      
      git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@434471 65c4cc65-6c06-0410-ace0-fbb531ad65f3
      ea009872
  13. Apr 08, 2015
  14. Apr 07, 2015
  15. Apr 06, 2015
  16. Mar 31, 2015
  17. Mar 30, 2015
  18. Mar 28, 2015
  19. Mar 24, 2015
    • Richard Mudgett's avatar
      chan_pjsip: Add "rpid_immediate" option to prevent unnecessary "180 Ringing" messages. · 4c2fc5b8
      Richard Mudgett authored
      Incoming PJSIP call legs that have not been answered yet send unnecessary
      "180 Ringing" or "183 Progress" messages every time a connected line
      update happens.  If the outgoing channel is also PJSIP then the incoming
      channel will always send a "180 Ringing" or "183 Progress" message when
      the outgoing channel sends the INVITE.
      
      Consequences of these unnecessary messages:
      
      * The caller can start hearing ringback before the far end even gets the
      call.
      
      * Many phones tend to grab the first connected line information and refuse
      to update the display if it changes.  The first information is not likely
      to be correct if the call goes to an endpoint not under the control of the
      first Asterisk box.
      
      When connected line first went into Asterisk in v1.8, chan_sip received an
      undocumented option "rpid_immediate" that defaults to disabled.  When
      enabled, the option immediately passes connected line update information
      to the caller in "180 Ringing" or "183 Progress" messages as described
      above.
      
      * Added "rpid_immediate" option to prevent unnecessary "180 Ringing" or
      "183 Progress" messages.  The default is "no" to disable sending the
      unnecessary messages.
      
      ASTERISK-24781 #close
      Reported by: Richard Mudgett
      
      Review: https://reviewboard.asterisk.org/r/4473/
      ........
      
      Merged revisions 433338 from http://svn.asterisk.org/svn/asterisk/branches/13
      
      
      git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@433339 65c4cc65-6c06-0410-ace0-fbb531ad65f3
      4c2fc5b8
  20. Mar 19, 2015
  21. Mar 13, 2015
    • Richard Mudgett's avatar
      chan_pjsip/res_pjsip_callerid: Make Party ID handling simpler and consistent. · 636d82f4
      Richard Mudgett authored
      The res_pjsip modules were manually checking both name and number
      presentation values when there is a function that determines the combined
      presentation for a party ID struct.  The function takes into account if
      the name or number components are valid while the manual code rarely
      checked if the data was even valid.
      
      * Made use ast_party_id_presentation() rather than manually checking party
      ID presentation values.
      
      * Ensure that set_id_from_pai() and set_id_from_rpid() will not return
      presentation values other than what is pulled out of the SIP headers.  It
      is best if the code doesn't assume that AST_PRES_ALLOWED and
      AST_PRES_USER_NUMBER_UNSCREENED are zero.
      
      * Fixed copy paste error in add_privacy_params() dealing with RPID
      privacy.
      
      * Pulled the id->number.valid test from add_privacy_header() and
      add_privacy_params() up into the parent function add_id_headers() to skip
      adding PAI/RPID headers earlier.
      
      * Made update_connected_line_information() not send out connected line
      updates if the connected line number is invalid.  Lower level code would
      not add the party ID information and thus the sent message would be
      unnecessary.
      
      * Eliminated RAII_VAR usage in send_direct_media_request().
      
      Review: https://reviewboard.asterisk.org/r/4472/
      ........
      
      Merged revisions 432892 from http://svn.asterisk.org/svn/asterisk/branches/13
      
      
      git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@432893 65c4cc65-6c06-0410-ace0-fbb531ad65f3
      636d82f4
    • Corey Farrell's avatar
      Logger: Convert 'struct ast_callid' to unsigned int. · c08fd275
      Corey Farrell authored
      Switch logger callid's from AO2 objects to simple integers.
      This helps in two ways.  Copying integers is faster than
      referencing AO2 objects, so this will result in a small
      reduction in logger overhead.  This also erases the possibility
      of an infinate loop caused by an invalid callid in
      threadstorage.
      
      ASTERISK-24833 #comment Committed callid conversion to trunk. 
      Reported by: Corey Farrell
      Review: https://reviewboard.asterisk.org/r/4466/
      
      
      git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@432834 65c4cc65-6c06-0410-ace0-fbb531ad65f3
      c08fd275
  22. Mar 06, 2015
    • Richard Mudgett's avatar
      chan_dahdi/sig_analog: Fix distinctive ring detection to suck less. · c7cc1b30
      Richard Mudgett authored
      The distinctive ring feature interferes with detecting Caller ID and
      appears to have been broken for years.  What happens is if you have a
      ring-ring cadence as used in the UK you get too many DAHDI events for the
      distinctive ring pattern array and Caller ID detection is aborted.  I
      think when Zapata/DAHDI added the ring begin event it broke distinctive
      ring.  More events happen than before and the code does no filtering of
      which event times are recorded in the pattern array.
      
      * Made distinctive ring only record the ringt count when the ring ends
      instead of on just any DAHDI event.  Distinctive ring can be ring,
      ring-ring, ring-ring-ring, or different ring durations for the up to three
      rings.
      
      * Fixed the distinctive ring detection enable (chan_dahdi.conf option
      usedistinctiveringdetection) to be per port instead of somewhat per port
      and somewhat global.  This has been broken since v1.8.
      
      * Fixed using the default distinctive ring context when the detected
      pattern does not match any configured dringX patterns.  The default
      context did not get set when the previous call was a matched distinctive
      ring pattern and the current call is not matched.  This has been broken
      since v1.8.
      
      * Made distinctive ring have no effect on Caller ID detection when it is
      disabled.  Caller ID detection just monitors for 10 seconds before giving
      up.
      
      * Fixed leak of struct callerid_state memory when a polarity reversal
      during Caller ID detection causes the incoming call to be aborted.
      
      DAHDI-1143
      AST-1545
      ASTERISK-24825 #close
      Reported by: Richard Mudgett
      
      ASTERISK-17588
      Reported by: Daniel Flounders
      
      Review: https://reviewboard.asterisk.org/r/4444/
      ........
      
      Merged revisions 432530 from http://svn.asterisk.org/svn/asterisk/branches/11
      ........
      
      Merged revisions 432534 from http://svn.asterisk.org/svn/asterisk/branches/13
      
      
      git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@432551 65c4cc65-6c06-0410-ace0-fbb531ad65f3
      c7cc1b30
    • Richard Mudgett's avatar
      chan_sip: Fix realtime locking inversion when poking a just built peer. · f1ab2c5e
      Richard Mudgett authored
      When a realtime peer is built it can cause a locking inversion when the
      just built peer is poked.  If the CLI command "sip show channels" is
      periodically executed then a deadlock can happen because of the locking
      inversion.
      
      * Push the peer poke off onto the scheduler thread to avoid the locking
      inversion of the just built realtime peer.
      
      AST-1540
      ASTERISK-24838 #close
      Reported by: Richard Mudgett
      
      Review: https://reviewboard.asterisk.org/r/4454/
      ........
      
      Merged revisions 432526 from http://svn.asterisk.org/svn/asterisk/branches/11
      ........
      
      Merged revisions 432528 from http://svn.asterisk.org/svn/asterisk/branches/13
      
      
      git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@432529 65c4cc65-6c06-0410-ace0-fbb531ad65f3
      f1ab2c5e
Loading