Skip to content
Snippets Groups Projects
  1. Jul 15, 2015
  2. Jul 11, 2015
    • Matt Jordan's avatar
      tests/test_devicestate: Add additional tests for the device state API · 883f6f5d
      Matt Jordan authored
      This patch adds more tests that exercise the device state API. This includes:
      
      * Tests that cover adding a device state provider, as well as deleting a
        device state provider. This also verifies that you cannot add an
        already added device state provider, and cannot delete an already
        deleted device state provider.
      * A test that covers changing device state and receiving said updates
        from a device state subscriber. This also covers hitting both the
        device state cache as well as a custom device state provider.
      * A test that covers converting device state to channel state and device
        state values to a string representation and back.
      * A test that covers obtaining device state from an active channel and a
        channel driver that provides its own device state.
      
      Change-Id: I2adca67ffb405cd8625a5d6df1e3f9b3d945c08d
      883f6f5d
    • Matt Jordan's avatar
      main/devicestate: Prevent duplicate registration of device state providers · e545c05e
      Matt Jordan authored
      Currently, the device state provider API will allow you to register a
      device state provider with the same case insensitive name more than
      once. This could cause strange issues, as the duplicate device state
      providers will not be queried when a device's state has to be polled.
      This patch updates the API such that a device state provider with the
      same name as one that has already registered will be rejected.
      
      Change-Id: I4a418a12280b7b6e4960bd44f302e27cd036ceb2
      e545c05e
  3. Jul 08, 2015
  4. Jul 06, 2015
    • Joshua Colp's avatar
      res_rtp_asterisk: Prevent simultaneous access to DTLS SSL context. · 1ad82732
      Joshua Colp authored
      This change moves logic for setting up the DTLS SSL contexts to
      when the SDP is done being processed instead of when ICE negotiation
      completes. It also stops handshakes from being initiated when we
      are acting as a server.
      
      Manipulating the SSL context when ICE negotiation has completed
      is problematic as the SSL context is not protected and if acting
      as a client the remote side may have started DTLS negotiation
      already.
      
      The retransmission timeout timer code has also been split up
      and simplified some. Both RTP and RTCP now have their own timers
      and the points at which the timer is stopped and started is now
      more specific. When a packet is sent the timer is started. When
      a response is received but before it is processed the timer is
      stopped. This provides a guarantee that the timeout is not
      occurring while the response is processed.
      
      ASTERISK-22805 #close
      ASTERISK-24550 #close
      ASTERISK-24651 #close
      ASTERISK-24832 #close
      ASTERISK-25103 #close
      ASTERISK-25127 #close
      
      Change-Id: Ib75ea2546f29d6efc3d2d37c58df6986c7bd9b91
      1ad82732
  5. Jul 05, 2015
  6. Jul 02, 2015
    • Joshua Colp's avatar
    • Joshua Colp's avatar
    • Joshua Colp's avatar
    • Joshua Colp's avatar
    • Joshua Colp's avatar
      aa04d438
    • Walter Doekes's avatar
      chan_sip: Fix early call pickup caused deadlock. · 0e6d3f5e
      Walter Doekes authored
      If non-magic pickup (no "pickup-" in callid) is used, chan_sip locks the
      channel it wants to pick up, and a bit further down, it locks the
      channel list when allocating a new channel.
      
      That causes a deadlock when another part of the code traverses over the
      channel list, locking all the channels one by one.
      
      This changeset fixes it by releasing the locks before calling sip_new
      and reacquiring them afterwards.  Unfortunately this involves doing the
      checks we already did again (because the channel may have changed).
      
      While trying to avoid duplicate code, I did some refactoring for
      readability:
      - if refer_locked == 1, we guarantee there is a locked channel
      - magic_callid holds a cached version of !ast_strlen_zero(pickup.exten)
      
      This is for branch 11 only. It appears that the changed code in 13 does
      not lock the components like it does in 11 and below. Reproducing the
      deadlock on 13 has thusfar failed.
      
      ASTERISK-25213 #close
      
      Change-Id: Ie1d15bec7d634035f48892e1ed6227411d7de2c1
      0e6d3f5e
    • Walter Doekes's avatar
      chan_mgcp: Don't call close on fd -1. · f6bbc4f1
      Walter Doekes authored
      ASTERISK-25220 #close
      
      Change-Id: Ic48f3a82f51ada87f2fb0e016c9efe0ad56f1ee3
      f6bbc4f1
    • Walter Doekes's avatar
      rtp_engine: Skip useless self-assignment in ast_rtp_engine_unload_format. · c139956e
      Walter Doekes authored
      When running valgrind on Asterisk, it complained about:
      
          ==32423== Source and destination overlap in memcpy(0x85a920, 0x85a920, 304)
          ==32423==    at 0x4C2F71C: memcpy@@GLIBC_2.14 (in /usr/lib/valgrind/...)
          ==32423==    by 0x55BA91: ast_rtp_engine_unload_format (rtp_engine.c:2292)
          ==32423==    by 0x4EEFB7: ast_format_attr_unreg_interface (format.c:1437)
      
      The code in question is a struct assignment, which may be performed by
      memcpy as a compiler optimization. It is changed to only copy the struct
      contents if source and destination are different.
      
      ASTERISK-25219 #close
      
      Change-Id: I6d3546c326b03378ca8e9b8cefd41c16e0088b9a
      c139956e
    • Walter Doekes's avatar
      astfd: Fix buffer overflow in DEBUG_FD_LEAKS. · 028554fa
      Walter Doekes authored
      If DEBUG_FD_LEAKS was used and more file descriptors than the default of
      1024 were available, some DEBUG_FD_LEAKS-patched functions would
      overwrite memory past the fixed-size (1024) fdleaks buffer.
      
      This change:
      - adds bounds checks to __ast_fdleak_fopen and __ast_fdleak_pipe
      - consistently uses ARRAY_LEN() instead of sizeof() or 1023 or 1024
      - stores pointers to constants instead of copying the contents
      - reorders the fdleaks struct for possibly tighter packing
      - adds a tiny bit of documentation
      
      ASTERISK-25212 #close
      
      Change-Id: Iacb69e7701c0f0a113786bd946cea5b6335a85e5
      028554fa
    • Walter Doekes's avatar
      res_timing: Don't close FD 0 when out of open files. · b090a8d4
      Walter Doekes authored
      This fixes so a failure to get a timer file descriptor does not cascade
      to closing FD 0.
      
      On error, both res_timing_kqueue and res_timing_timerfd would call the
      destructor before setting the file handle. The file handle had been
      initialized to 0, causing FD 0 to be closed. This in turn, resulted in
      floods of "CLI>" messages and an unusable terminal.
      
      ASTERISK-19277 #close
      Reported by: Barry Chern
      
      Change-Id: I147d7e33726c6e5a2751928d56561494f5800350
      b090a8d4
  7. Jul 01, 2015
  8. Jun 28, 2015
    • Matt Jordan's avatar
      Makefile: Remove coverage files on 'make clean' · 9b74dcb6
      Matt Jordan authored
      This patch updates a variety of Makefiles in Asterisk's build system to
      remove .gcda and .gcno files when 'make clean' is executed. These files
      are generated when '--enable-coverage' is passed to the Asterisk
      configure script.
      
      Change-Id: Ib70b41eea2ee2908885bff02e80faf9f40c84602
      9b74dcb6
  9. Jun 27, 2015
    • Matt Jordan's avatar
      main/pbx: Resolve case sensitivity regression in PBX hints · 96bbcf49
      Matt Jordan authored
      When 8297136f was merged for ASTERISK-25040, a regression was introduced
      surrounding the case sensitivity of device names within hints.
      Previously, device names - such as 'sip/foo' - were compared in a case
      insensitive fashion. Thus, 'sip/foo' was equivalent to 'SIP/foo'. After
      that patch, only the case sensitive name would match, i.e., 'SIP/foo'.
      As a result, some dialplan hints stopped working.
      
      This patch re-introduces case insensitive matching for device names in
      hints.
      
      ASTERISK-25040
      
      ASTERISK-25202 #close
      
      Change-Id: If5046a7d14097e1e3c12b63092b9584bb1e9cb4c
      96bbcf49
  10. Jun 16, 2015
  11. Jun 12, 2015
    • Damian Ivereigh's avatar
      chan_sip.c: Update dialog fromtag after request with auth · 8b60998d
      Damian Ivereigh authored
      If a client sends and INVITE which is 401 rejected, then subsequently
      sends a new INVITE with the auth info and uses a different fromtag
      from the first INVITE, Asterisk will accept the new INVITE as part of
      the original dialog - match_req_to_dialog() specifically ignores the
      fromtag. However it does not update the stored dialog with the new
      fromtag.
      
      This results in Asterisk being unable to match future packets that are
      part of this dialog (such as the ACK to the OK or the OK to the BYE),
      and the call is dropped.
      
      This problem was originally found when using an NEC-i SV8100-GE (NEC SIP
      Card).
      
      * After a successful match of a packet to the dialog, if the packet is
        not a SIP_RESPONSE, authentication is present and the fromtags are
        different, the stored fromtag is updated with the one from the recent
        INVITE.
      
      ASTERISK-25154 #close
      Reported by: Damian Ivereigh
      Tested by: Damian Ivereigh
      
      Change-Id: I5c16cf3b409e5ef9f2b2fe974b6bd2a45a6aa17e
      8b60998d
  12. Jun 11, 2015
    • Mark Michelson's avatar
      chan_sip: Prevent deadlock when performing BYE with Also transfer. · d821f56b
      Mark Michelson authored
      When a BYE with an Also header is successfully processed, and the sender
      of the BYE is bridged with another channel, chan_sip will unlock the
      owner of the dialog on which the BYE was received, call ast_async_goto()
      on the bridged channel, and then re-lock the owner. The reason for this
      locking behavior is that ast_async_goto() can result in a masquerade,
      which requires that the involved channels are unlocked.
      
      The problem here is that this causes a locking inversion since the
      dialog's lock is held when re-locking the owner channel after the async
      goto. The lock order is supposed to be channel and then sip_pvt.
      
      The fix proposed is simple. In addition to unlocking the owner channel
      before the ast_async_goto() call, also unlock the sip_pvt. Then relock
      both after ast_async_goto() returns, being sure to lock the channel and
      then the sip_pvt.
      
      ASTERISK-25139 #close
      Reported by Gregory Massel
      
      Change-Id: I72c4fc295ec8573bee599e8e9213c5350a3cd224
      d821f56b
  13. Jun 10, 2015
  14. Jun 08, 2015
    • Corey Farrell's avatar
      Fix unsafe uses of ast_context pointers. · 53658a14
      Corey Farrell authored
      Although ast_context_find, ast_context_find_or_create and
      ast_context_destroy perform locking of the contexts table,
      any context pointer can become invalid at any time that the
      contexts table is unlocked. This change adds locking around
      all complete operations involving these functions.
      
      Places where ast_context_find was followed by ast_context_destroy
      have been replaced with calls ast_context_destroy_by_name.
      
      ASTERISK-25094 #close
      Reported by: Corey Farrell
      
      Change-Id: I1866b6787730c9c4f3f836b6133ffe9c820734fa
      53658a14
  15. Jun 04, 2015
  16. May 31, 2015
    • Ivan Poddubny's avatar
      Fix buffer overflow in slin sample frames generation. · 99c54fe4
      Ivan Poddubny authored
      The length of frames retured by sample functions was twice as large as
      real, what caused global buffer overflow caught by AddressSanitizer.
      
      ASTERISK-24717 #close
      Reported by: Badalian Vyacheslav
      
      Change-Id: Iec2fe682aef13e556684912f906bedf7c18229c6
      99c54fe4
  17. May 25, 2015
    • Ivan Poddubny's avatar
      Astobj2: Correctly treat hash_fn returning INT_MIN · f9877139
      Ivan Poddubny authored
      The code in astobj2_hash.c wrongly assumed that abs(int) is always > 0.
      However, abs(INT_MIN) = INT_MIN and is still negative, as well as
      abs(INT_MIN) % num_buckets, and as a result this led to a crash.
      
      One way to trigger the bug is using host=::80 or 0.0.0.128 in peer
      configuration section in chan_sip or chan_iax.
      
      This patch takes the remainder before applying abs, so that bucket
      number is always in range.
      
      ASTERISK-25100 #close
      Reported by: Mark Petersen
      
      Change-Id: Id6981400ad526f47e10bcf7b847b62bd2785e899
      f9877139
  18. May 21, 2015
  19. May 20, 2015
    • Corey Edwards's avatar
      chan_sip/sdp_crypto.c: allow SDP crypto tag to be up to 9 digits · 2d297c7b
      Corey Edwards authored
      ASTERISK-24887 #close
      Reported by: Makoto Dei
      Tested by: tensai
      
      Change-Id: I6a96f572adb17f76b3acafe503a01c48eb5dd9bf
      2d297c7b
    • Kevin Harwell's avatar
      audiohook.c: Difference in read/write rates caused continuous buffer resets · 58970f14
      Kevin Harwell authored
      Currently, everytime a sample rate change occurs (on read or write) the
      associated factory buffers are reset. If the requested sample rate on a
      read differed from that of a write then the buffers are continually reset
      on every read and write. This has the side effect of emptying the buffer,
      thus there being no data to read and then write to a file in the case of
      call recording.
      
      This patch fixes it so that an audiohook_list's rate always maintains the
      maximum sample rate among hooks and formats. Audiohook sample rates are
      only overwritten by this value when slin native compatibility is turned on.
      Also, the audiohook sample rate can only overwrite the list's sample rate
      when its rate is greater than that of the list or if compatibility is
      turned off. This keeps the rate from constantly switching/resetting.
      
      ASTERISK-24944 #close
      Reported by: Ronald Raikes
      
      Change-Id: Idab4dfef068a7922c09cc631dda27bc920a6c76f
      58970f14
  20. May 14, 2015
  21. May 13, 2015
Loading