Skip to content
Snippets Groups Projects
  1. Oct 09, 2016
  2. Sep 30, 2016
    • Corey Farrell's avatar
      astobj2: Add backtrace to log_bad_ao2. · 2a03575c
      Corey Farrell authored
      * Compile __ast_assert_failed unconditionally.
      * Use __ast_assert_failed to log messages from log_bad_ao2
      * Remove calls to ast_assert(0) that happen after log_bad_ao2 was run.
      
      Change-Id: I48f1af44b2718ad74a421ff75cb6397b924a9751
      2a03575c
  3. Sep 29, 2016
  4. Sep 27, 2016
    • Corey Farrell's avatar
      logger: Output early verbose messages to console. · 2d2a8944
      Corey Farrell authored
      Verbose messages should be printed to the console if the sublevel is
      less than option_verbose.  This fix ensures the welcome message with
      copyright and license are printed at daemon and interactive rasterisk
      startup.
      
      ASTERISK-26410 #close
      
      Change-Id: Ia44235e30ec328aba92ea2c8a837b094e65c9a03
      2d2a8944
  5. Sep 23, 2016
    • George Joseph's avatar
      chan_sip: Address runaway when realtime peers subscribe to mailboxes · d4259710
      George Joseph authored
      Users upgrading from asterisk 13.5 to a later version and who use
      realtime with peers that have mailboxes were experiencing runaway
      situations that manifested as a continuous stream of taskprocessor
      congestion errors, memory leaks and an unresponsive chan_sip.
      
      A related issue was that setting rtcachefriends=no NEVER worked in
      asterisk 13 (since the move to stasis).  In 13.5 and earlier, when a
      peer tried to register, all of the stasis threads would block and
      chan_sip would again become unresponsive.  After 13.5, the runaway
      would happen.
      
      There were a number of causes...
      * mwi_event_cb was (indirectly) calling build_peer even though calls to
        mwi_event_cb are often caused by build_peer.
      * In an effort to prevent chan_sip from being unloaded while messages
        were still in flight, destroy_mailboxes was calling
        stasis_unsubscribe_and_join but in some cases waited forever for the
        final message.
      * add_peer_mailboxes wasn't properly marking the existing mailboxes
        on a peer as "keep" so build_peer would always delete them all.
      * add_peer_mwi_subs was unsubscribing existing mailbox subscriptions
        then just creating them again.
      
      All of this was causing a flood of subscribes and unsubscribes on
      multiple threads all for the same peer and mailbox.
      
      Fixes...
      * add_peer_mailboxes now marks mailboxes correctly and build_peer only
        deletes the ones that really are no longer needed by the peer.
      * add_peer_mwi_subs now only adds subscriptions marked as "new" instead
        of unsubscribing and resubscribing everything.  It also adds the peer
        object's address to the mailbox instead of its name to the subscription
        userdata so mwi_event_cb doesn't have to call build_peer.
      
      With these changes, with rtcachefriends=yes (the most common setting),
      there are no leaks, locks, loops or crashes at shutdown.
      
      rtcachefriends=no still causes leaks but at least it doesn't lock, loop
      or crash.  Since making rtcachefriends=no work wasnt in scope for this
      issue, further work will have to be deferred to a separate patch.
      
      Side fixes...
       * The ast_lock_track structure had a member named "thread" which gdb
         doesn't like since it conflicts with it's "thread" command.  That
         member was renamed to "thread_id".
      
      ASTERISK-25468 #close
      
      Change-Id: I07519ef7f092629e1e844f855abd279d6475cdd0
      d4259710
  6. Sep 21, 2016
  7. Sep 20, 2016
    • Corey Farrell's avatar
      logger: Simplify ast_callid handling code. · 923edf25
      Corey Farrell authored
      Routines responsible for managing ast_callid's are overly complicated.
      This is left-over code from when ast_callid was an AO2 object.  Now that
      it is an integer the code can be reduced.
      
      ast_callid handler code no longer prints it's own error message upon failure
      to allocate threadstorage as ast_calloc would have already printed a
      message.  Debug messages that were printed when TEST_FRAMEWORK was
      enabled have been also been removed.
      
      Change-Id: I65a768a78dc6cf3cfa071e97f33ce3dce280258e
      923edf25
    • Corey Farrell's avatar
      core: Fix LOW_MEMORY missing symbol ast_pbx_uuid_get. · 5cb905a2
      Corey Farrell authored
      Move the function outside the conditional block that excludes
      LOW_MEMORY.
      
      ASTERISK-26273 #close
      
      Change-Id: Ic290fa128222c410c3531107e30efacabc8493b4
      5cb905a2
    • Corey Farrell's avatar
      logger: Always enable verbose for console channel. · 00f1d05d
      Corey Farrell authored
      Previous versions of Asterisk did not require verbose to be specified in
      logger.conf for the console channel, if it was requested by command line
      or asterisk.conf it just worked.  This change causes Asterisk to always
      enable verbose in the console channel level mask.  Verbose is displayed
      on consoles if requested by command line, option_verbose or 'core set
      verbose'.
      
      This also delays initialization of the logger until after threadstorage
      is initialized.  Initializing too early can cause messages to be printed
      multiple times to the console (stdout).
      
      ASTERISK-26391 #close
      
      Change-Id: I52187d67c2fcb3efd5561bf04b3e5e23e5ee8a04
      00f1d05d
    • Corey Farrell's avatar
      logger: Fix default console settings. · 74f562a8
      Corey Farrell authored
      When logger.conf is missing or invalid we should be printing notices,
      warnings and errors to the console.  The logmask was incorrectly
      calculated.
      
      Change-Id: Ibaa9465a8682854bc1a5e9ba07079bea1bfb6bb3
      74f562a8
  8. Sep 19, 2016
    • Walter Doekes's avatar
      asterisk.c: Non-root users also get the astcanary after core restart. · 0bc99127
      Walter Doekes authored
      Without this change, a 'core restart' would kill the astcanary forever
      if you're not running as root. Both with and without this patch, the
      scheduling priority was still SCHED_RR after restart.
      
      Additionally, the astcanary is now spawned if you start with high
      priority and Asterisk doesn't get a chance to lower it. For example
      through: `chrt -r 10 sudo -u asterisk asterisk -c`
      
      Also reap killed astcanary processes on core restart.
      
      ASTERISK-26352 #close
      
      Change-Id: Iacb49f26491a0717084ad46ed96b0bea5f627a55
      0bc99127
    • Walter Doekes's avatar
      asterisk.c: When astcanary dies on linux, reset priority on all threads. · bffaf466
      Walter Doekes authored
      Previously only the canary checking thread itself had its priority set
      to SCHED_OTHER. Now all threads are traversed and adjusted.
      
      ASTERISK-19867 #close
      Reported by: Xavier Hienne
      
      Change-Id: Ie0dd02a3ec42f66a78303e9c1aac28f7ed9aae39
      bffaf466
  9. Sep 15, 2016
    • Joshua Colp's avatar
      rtp: Only accept the first payload for a format in SDP. · 0376af95
      Joshua Colp authored
      When receiving an SDP offer with multiple payloads for
      the same format we would generate an answer with the first
      payload, but during the payload crossover operation
      (to set the payloads for receiving) we would remove all
      payloads but the last. This would result in incoming
      traffic being matched against the wrong format and outgoing
      traffic being sent using the wrong payload.
      
      This change makes it so that once a format has a payload
      number put into the mapping all subsequent ones are ignored.
      This ensures there is only ever one payload in the mapping
      and that it is the payload placed into the answer SDP.
      
      ASTERISK-26365 #close
      
      Change-Id: I1e8150860a3518cab36d00b1fab50f9352b64e60
      0376af95
    • Tzafrir Cohen's avatar
      sd_notify (systemd status notifications) support · 07b95f7c
      Tzafrir Cohen authored
      sd_notify() is used to notify systemd of changes to the status of the
      process. This allows the systemd daemon to know when the process
      finished loading (and thus only start another program after Asterisk has
      finished loading).
      
      To use this, use a systemd unit with 'Type=notify' for Asterisk.
      
      This commit also adds the function ast_sd_notify(), a wrapper around
      sd_notify that does nothing if not built with systemd support.
      
      Also adds support for libsystemd detection in the configure script.
      
      Change-Id: Ied6a59dafd5ef331c5c7ae8f3ccd2dfc94be7811
      07b95f7c
    • Timo Teräs's avatar
      Fix showing of swap details when sysinfo() is available · bc81765b
      Timo Teräs authored
      If sysinfo() is available, but not sysctl() or swapctl() the
      printing code for swap buffer sizes is incorrectly omitted.
      The above condition happens with musl c-library.
      
      Fix #if rule to consider defined(HAVE_SYSINFO). And also
      remove the redundant || defined(HAVE_SYSCTL) which was
      incorrectly there to start with. Now swap information is
      displayed only if an actual libc function to get it is
      available.
      
      This also fixes warnings previously seen with musl libc:
      
         [CC] asterisk.c -> asterisk.o
      asterisk.c: In function 'handle_show_sysinfo':
      asterisk.c:773:6: warning: variable 'totalswap' set but not used
       [-Wunused-but-set-variable]
        int totalswap = 0;
            ^~~~~~~~~
      asterisk.c:770:11: warning: variable 'freeswap' set but not used
       [-Wunused-but-set-variable]
        uint64_t freeswap = 0;
                 ^~~~~~~~
      
      Change-Id: I1fb21dad8f27e416c60f138c6f2bff03fb626eca
      bc81765b
  10. Sep 14, 2016
    • Joshua Colp's avatar
      rtp: Preserve timestamps on video frames. · 89764f7a
      Joshua Colp authored
      Currently when receiving video over RTP we store only
      a calculated samples on the frame. When starting the video
      it can take some time for this calculation to actually yield
      a value as it requires constant changing timestamps. As well
      if a video frame passes over multiple RTP packets this calculation
      will fail as the timestamp is the same as the previous RTP
      packet and the number of samples calculated will be 0.
      
      This change preserves the timestamp on the frame and allows
      it to pass through the core. When sending the video this timestamp
      is used instead of a new one being calculated.
      
      ASTERISK-26367 #close
      
      Change-Id: Iba8179fb5c14c9443aee4baf670d2185da3ecfbd
      89764f7a
  11. Sep 02, 2016
  12. Aug 29, 2016
    • Etienne Lessard's avatar
      pbx.c: Prevent infinite recursion in manager_show_dialplan_helper. · 5e075857
      Etienne Lessard authored
      Previously, if context A was including context B and context B was including
      context A, i.e. if there was a circular dependency between contexts, then
      calling manager_show_dialplan_helper could lead to an infinite recursion,
      resulting in a crash.
      
      This commit applies the same solution as the one implemented in the
      show_dialplan_helper function. The manager_show_dialplan_helper and
      show_dialplan_helper functions contain lots of code in common, but the former
      was missing the "infinite recursion avoidance" code.
      
      ASTERISK-26226 #close
      
      Change-Id: I1aea85133c21787226f4f8442253a93000aa0897
      5e075857
  13. Aug 26, 2016
    • Alexander Traud's avatar
      channel: No hung-up on failing security requirements. · 858fa5eb
      Alexander Traud authored
      In your Diaplan, if you specify
       same => n,Set(CHANNEL(secure_bridge_media)=1)
       same => n,Set(CHANNEL(secure_bridge_signaling)=1)
      only the SIP channel driver chan_sip supports this. All other channels drivers
      like res_pjsip fail. In case of failure, the original sRTP source code released
      the whole channel, even if not hung-up, yet. This change does not release the
      channel but instead hangs-up the channel.
      
      ASTERISK-26306
      
      Change-Id: I0489f0cb660fab6673b0db8af027d116e70a66db
      858fa5eb
  14. Aug 25, 2016
  15. Aug 24, 2016
  16. Aug 20, 2016
    • Corey Farrell's avatar
      Fix checks for allocation debugging. · 55ccdf93
      Corey Farrell authored
      MALLOC_DEBUG should not be used to check if debugging is actually
      enabled, __AST_DEBUG_MALLOC should be used instead.  MALLOC_DEBUG only
      indicates that debugging is requested, __AST_DEBUG_MALLOC indicates it
      is active.
      
      Change-Id: I3ce9cdb6ec91b74ee1302941328462231be1ea53
      55ccdf93
    • Corey Farrell's avatar
      Fix naming mismatch of allocator functions. · 8061d9f6
      Corey Farrell authored
      Allocator functions that take file/line/func parameters are prefixed
      with single-underscore when MALLOC_DEBUG is not defined,
      double-underscore when it is defined.  This change updates all
      allocators that accept file/line/func to have the same prototype in
      either ABI mode.  The parameter order of __ast_vasprintf and
      __ast_asprintf in utils.h have been changed to match that of astmm.h.
      
      End-use allocator macro's have been removed from astmm.h and moved to an
      unconditional part of utils.h.
      
      Change-Id: I823bb6ce2b5675b3a4735948f10a3b420e9a023a
      8061d9f6
  17. Aug 19, 2016
    • Torrey Searle's avatar
      res_ari: Add http prefix to generated docs · c1b6a796
      Torrey Searle authored
      updated the uri handler to include the url prefix of the http server
      this enables res_ari to add it to the uris when generating docs
      
      Change-Id: I279335a2625261a8492206c37219698f42591c2e
      (cherry picked from commit 6f448f32)
      c1b6a796
  18. Aug 16, 2016
    • Corey Farrell's avatar
      Refactor usage pattern of xmldoc info tag. · 824a4e84
      Corey Farrell authored
      This updates func_channel.c and main/message.c to use a generic xpointer
      include instead of including info from each channel driver.  Now the
      name attribute of info is CHANNEL or CHANNEL_EXAMPLES to be included in
      documentation for func_channel.  Setting the name attribute of info to
      MessageToInfo or MessageFromInfo causes it to be included in the
      MessageSend application and AMI action.
      
      Change-Id: I89fd8276a3250824241a618009714267d3a8d1ea
      824a4e84
  19. Aug 15, 2016
  20. Aug 12, 2016
    • Corey Farrell's avatar
      Run mandatory cleanup when startup fails. · 9debe1ca
      Corey Farrell authored
      Errors during startup result in an exit.  These error branches should be
      calling ast_run_atexit(0) to ensure mandatory cleanup is run.
      
      ASTERISK-26267 #close
      
      Change-Id: If226f2326ae2df7add20040696132214cf2bb680
      9debe1ca
  21. Aug 11, 2016
    • Richard Mudgett's avatar
      taskprocessor.c: Tweak high water checks. · 4a5da6c9
      Richard Mudgett authored
      * The high water check in ast_taskprocessor_alert_set_levels() would
      trigger immediately if the new high water level is zero and the queue was
      empty.
      
      * The high water check in taskprocessor_push() was off by one.
      
      Change-Id: I687729fb4efa6a0ba38ec9c1c133c4d407bc3d5d
      4a5da6c9
    • Richard Mudgett's avatar
      res_pjsip: Make aor named lock a mutex. · 5ba6357b
      Richard Mudgett authored
      The named aor lock was always being locked for writes so a rwlock adds no
      benefit and may be slower because rwlocks are biased toward read locking.
      
      Change-Id: I8c5c2c780eb30ce5441832257beeb3506fd12b28
      5ba6357b
Loading