Skip to content
Snippets Groups Projects
  1. Jul 09, 2015
    • Joshua Colp's avatar
      bridge_native_rtp.c: Don't start native RTP bridging after attended transfer. · 4a25d554
      Joshua Colp authored
      The bridge_native_rtp module adds a frame hook to channels which are in
      a native RTP bridge. This frame hook is used to intercept when a hold
      or unhold frame traverses the bridge so native RTP can be stopped or
      started as appropriate. This is expected but exposes a specific bug
      when attended transfers are involved.
      
      Upon completion of an attended transfer an unhold frame is queued up
      to take one of the channels involved off hold. After this is done
      the channel is moved between bridges.
      
      When the frame hook is involved in this case for the unhold it
      releases the channel lock and acquires the bridge lock. This
      allows the bridge core to step in and move the channel
      (potentially changing the bridging techology) from another thread.
      Once completed the bridge lock is released by the bridge core.
      The frame hook is then able to acquire the bridge lock and
      wrongfully starts native RTP again, despite the channel no longer
      being in the bridge or needing to start native RTP. In fact at
      this point the frame hook is no longer attached to the channel.
      
      This change makes it so the native RTP bridge data is available to
      the frame hook when it is invoked. Whether the frame hook has
      been detached or not is stored on the native RTP bridge data and
      is checked by the frame hook before starting or stopping native
      RTP bridging. If the frame hook has been detached it does nothing.
      
      ASTERISK-25240 #close
      
      Change-Id: I13a73186a05f4e5a764f81e5cd0ccec1ed1891d2
      4a25d554
  2. Jul 08, 2015
  3. Jul 07, 2015
  4. Jul 06, 2015
    • Richard Mudgett's avatar
      res_pjsip_mwi.c: Fix MWI subscription memory corruption crash. · 189841dd
      Richard Mudgett authored
      MWI subscriptions can crash or corrupt memory when using the subscription
      datastore to access the MWI subscription object because the datastore is
      not holding a reference to the object.
      
      * Give the subscription datastore a ref to the MWI subscription object.
      It is unfortunate that the ref causes a circular ref chain that must be
      explicitly broken to allow the memory to get released.  The loop is broken
      when the subscription is shutdown and if the subscription setup fails.
      
      ASTERISK-25168 #close
      Reported by: Carl Fortin
      
      Change-Id: Ice4fa823f138ff10a6c74d280699c41a82836d4f
      189841dd
    • Richard Mudgett's avatar
      PJSIP XML, XPIDF: Fix buffer size overwrite memory corruption error. · 7cd99be5
      Richard Mudgett authored
      When res_pjsip body generator modules were generating XML or XPIDF
      response bodies, there was a chance that the generated body would be the
      exact size of the supplied buffer.  Adding the nul string terminator would
      then write beyond the end of the buffer and potentially corrupt memory.
      
      * Fix MALLOC_DEBUG high fence violations caused by adding a nul string
      terminator on the end of a buffer for XML or XPIDF response bodies.
      
      * Made calls to pj_xml_print() safer if the XML prolog is requested.  Due
      to a bug in pjproject, the return value could be -1 _or_
      AST_PJSIP_XML_PROLOG_LEN if the supplied buffer is not large enough.
      
      * Updated the doxygen comment of AST_PJSIP_XML_PROLOG_LEN to describe the
      return value of pj_xml_print() when the supplied buffer is not large
      enough.
      
      ASTERISK-25168
      Reported by: Carl Fortin
      
      Change-Id: Id70e1d373a6a2b2bd9e678b5cbc5e55b308981de
      7cd99be5
    • Richard Mudgett's avatar
      PJSIP FAX: Fix T.38 automatic reject timer NULL channel pointer dereferences. · 792ed7ce
      Richard Mudgett authored
      When a caller calls a FAX number and then hangs up right after the call is
      answered then the T.38 re-INVITE automatic reject timer may still be
      running after the channel goes away.
      
      * Added session NULL channel checks on the code paths that get executed by
      t38_automatic_reject() to prevent a crash when the T.38 re-INVITE
      automatic reject timer expires.
      
      ASTERISK-25168
      Reported by: Carl Fortin
      
      Change-Id: I07b6cd23815aedce5044f8f32543779e2f7a2403
      792ed7ce
    • Richard Mudgett's avatar
      res_pjsip_mwi.c: Use safer loop coding in mwi_subscription_mailboxes_str(). · 030e8339
      Richard Mudgett authored
      Change-Id: I6f39d809a6d1b47b35bb32b298f5a12f35d6f907
      030e8339
    • Richard Mudgett's avatar
      res_pjsip_mwi.c: Eliminate a simple RAII_VAR. · 453d7b8d
      Richard Mudgett authored
      Change-Id: Ib1843f81e826a6c760c424c88eb70c350d9d61da
      453d7b8d
    • Richard Mudgett's avatar
      res_pjsip_mwi.c: Fix mid-line log message line breaks. · 786c6d42
      Richard Mudgett authored
      * Add create_mwi_subscriptions_for_endpoint() doxygen comment.
      
      Change-Id: I3c3f921f4ec749fb65b62d2f6fa0d4d1888b94e2
      786c6d42
    • Richard Mudgett's avatar
      res_pjsip_t38.c: Fix always false if test. · 1b91094e
      Richard Mudgett authored
      Calling t38_change_state() sets the t38 state so it makes little sense to
      then check the state right after the call for something else.
      
      * Made the code in t38_interpret_parameters() reject or exit T.38 mode as
      intended but not implemented.
      
      Change-Id: Ib281263a6ed44da9448132c4e6df1e183b8a3df2
      1b91094e
    • Mark Michelson's avatar
    • Kevin Harwell's avatar
      res_pjsip: Failover when server is not available · 74135c8e
      Kevin Harwell authored
      Previously Asterisk did not properly failover to the next resolved DNS
      address when a endpoint could not be reached. With this patch, and while
      using res_pjsip, SIP requests (both in/out of dialog) now attempt to use
      the next address in the list of resolved addresses until a proper response
      is received or no more addresses are left.
      
      ASTERISK-25076 #close
      Reported by: Joshua Colp
      
      Change-Id: Ief14f4ebd82474881f72f4538f4577f30af2a764
      74135c8e
    • Joshua Colp's avatar
      res_sorcery_memory_cache: Execute stale unit test last. · 38a3c27a
      Joshua Colp authored
      In Jenkins there is currently a sporadic test failure of a
      variable number of sorcery memory cache unit tests. I have not
      been able to reproduce this on the build agents themselves or
      on my development machine.
      
      My working theory is that the stale unit test is causing a
      sorcery instance to persist longer than expected, causing subsequent
      tests to fail when setting up and initializing the next
      sorcery instance.
      
      To see if this is the case this change moves the stale unit test
      to execute last so no subsequent unit tests can have issues
      initializing their sorcery instance.
      
      Change-Id: Ifd6550a949613be774b75fa5db12c02110f82c4a
      38a3c27a
  5. Jul 05, 2015
  6. Jul 04, 2015
    • Joshua Colp's avatar
      res/res_http_websocket: Don't send HTTP response fragmented. · f35a4b85
      Joshua Colp authored
      This change makes it so that when accepting a WebSocket
      connection the HTTP response is sent as one packet instead of
      fragmented. Browsers don't like it when you send it fragmented.
      
      ASTERISK-25103
      
      Change-Id: I9b82c4ec2949b0bce692ad0bf6f7cea9709e7f69
      f35a4b85
    • Matt Jordan's avatar
      Makefile: Remove coverage files on 'make clean' · 2c17515f
      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
      2c17515f
  7. Jul 02, 2015
    • Joshua Colp's avatar
    • Matt Jordan's avatar
    • Walter Doekes's avatar
      chan_sip: Fix early call pickup channel leak. · 34323f9f
      Walter Doekes authored
      When handle_invite_replaces() was called, and either ast_bridge_impart()
      failed or there was no bridge (because the channel we're picking up was
      still ringing), chan_sip would leak a channel.
      
      Thanks Matt and Corey for checking the bridge path.
      
      ASTERISK-25226 #close
      
      Change-Id: Ie736bb182170a73eef5bcef0ab0376f645c260c8
      34323f9f
    • Matt Jordan's avatar
    • Joshua Colp's avatar
    • Joshua Colp's avatar
    • Joshua Colp's avatar
      f398c815
    • Joshua Colp's avatar
      5fc08c48
    • Matt Jordan's avatar
      sorcery/realtime: Add a bit of debug and warning messages for bad configs · ef74ccb1
      Matt Jordan authored
      When a mapping does not exist between a sorcery.conf defined object and
      a realtime mapping in extconf, currently, the user will receive a slew
      of ERROR messages that don't really tell what is happening. Some ERROR
      messages may even be misleading, as they occur after the sorcery API has
      already given up on the attempt to load and create the sorcery object.
      
      This patch adds a bit of debug and a useful WARNING message for when a
      wizard's open callback fails for a particular object type. In the bad
      configurations that resulted in this patch, this provided a 'root cause'
      WARNING message that pointed in the right direction of the configuration
      problem.
      
      Change-Id: I1cc7344f2b015b8b9c85a7e6ebc8cb4753a8f80b
      ef74ccb1
    • Joshua Colp's avatar
      dns: Fix crash when invoking cancel in DNS recurring unit test. · f1843664
      Joshua Colp authored
      The recurring unit test expects the user data on a DNS query
      created as a result of a recurring DNS query to be the recurring
      structure itself. This is true, mostly. When invoking the user
      provided callback this user data is changed to the user provided
      data. This presents a race condition where the data may or may
      not point to the recurring data.
      
      This change simplifies the callback of the user provided callback
      by creating a new query and populating it with the expected values.
      This leaves the recurring DNS query alone and fixes the race
      condition. This is more in line with how the API should be used
      overall.
      
      ASTERISK-25222 #close
      
      Change-Id: I10fb6deec025dff097157e7ec17e6e4921778478
      f1843664
    • Walter Doekes's avatar
      chan_mgcp: Don't call close on fd -1. · 6fbb58c7
      Walter Doekes authored
      ASTERISK-25220 #close
      
      Change-Id: Ic48f3a82f51ada87f2fb0e016c9efe0ad56f1ee3
      6fbb58c7
    • Walter Doekes's avatar
      rtp_engine: Skip useless self-assignment in ast_rtp_engine_unload_format. · 13a318bb
      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
      13a318bb
    • Walter Doekes's avatar
      astfd: Fix buffer overflow in DEBUG_FD_LEAKS. · 40274e36
      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
      40274e36
    • Walter Doekes's avatar
      res_timing: Don't close FD 0 when out of open files. · 3fab8212
      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
      
      For the master branch, this was already fixed. This patch only ensures
      that we do not attempt to close a negative file descriptor.
      
      Change-Id: I147d7e33726c6e5a2751928d56561494f5800350
      3fab8212
  8. Jul 01, 2015
Loading