Skip to content
Snippets Groups Projects
  1. Nov 18, 2019
    • Kevin Harwell's avatar
      various files - fix some alerts raised by lgtm code analysis · bdd785d3
      Kevin Harwell authored
      This patch fixes several issues reported by the lgtm code analysis tool:
      
      https://lgtm.com/projects/g/asterisk/asterisk
      
      Not all reported issues were addressed in this patch. This patch mostly fixes
      confirmed reported errors, potential problematic code points, and a few other
      "low hanging" warnings or recommendations found in core supported modules.
      These include, but are not limited to the following:
      
      * innapropriate stack allocation in loops
      * buffer overflows
      * variable declaration "hiding" another variable declaration
      * comparisons results that are always the same
      * ambiguously signed bit-field members
      * missing header guards
      
      Change-Id: Id4a881686605d26c94ab5409bc70fcc21efacc25
      bdd785d3
  2. Oct 18, 2019
    • Salah Ahmed's avatar
      Crash during "pjsip show channelstats" execution · ddb0091d
      Salah Ahmed authored
      During execution "pjsip show channelstats" cli command by an
      external module asterisk crashed. It seems this is a separate
      thread running to fetch and print rtp stats. The crash happened on
      the ao2_lock method, just before it going to read the rtp stats on
      a rtp instance. According to gdb backtrace log, it seems the
      session media was already cleaned up at that moment.
      
      ASTERISK-28578
      
      Change-Id: I3e05980dd4694577be6d39be2c21a5736bae3c6f
      ddb0091d
  3. Oct 08, 2019
  4. Oct 01, 2019
  5. Sep 17, 2019
    • Florian Floimair's avatar
      core: Add H.265/HEVC passthrough support · c1898320
      Florian Floimair authored
      This change adds H.265/HEVC as a known codec and creates a cached
      "h265" media format for use.
      
      Note that RFC 7798 section 7.2 also describes additional SDP
      parameters. Handling of these is not yet supported.
      
      ASTERISK-28512
      
      Change-Id: I26d262cc4110b4f7e99348a3ddc53bad0d2cd1f2
      c1898320
    • Guido Falsi's avatar
      chan_dahdi: Fix build with clang/llvm · 4072e219
      Guido Falsi authored
      On FreeBSD using the clang/llvm compiler build fails to build due
      to the switch statement argument being a non integer type expression.
      Switch to an if/else if/else construct to sidestep the issue.
      
      ASTERISK-28536 #close
      
      Change-Id: Idf4a82cc1e94580a2d017fe9e351c226f23e20c8
      4072e219
  6. Sep 16, 2019
    • Joshua Colp's avatar
      chan_pjsip: Relock correct channel during "fax" redirect. · c358da47
      Joshua Colp authored
      When fax detection occurs on an outbound PJSIP channel the
      redirect operation will result in a masquerade occurring and
      the underlying channel on the session changing. The code
      incorrectly relocked the new channel instead of the old
      channel when returning. This resulted in the new channel
      being locked indefinitely. The code now always acts on the
      expected channel.
      
      ASTERISK-28538
      
      Change-Id: I2b2e60d07e74383ae7e90d752c036c4b02d6b3a3
      c358da47
  7. Sep 12, 2019
    • Sean Bright's avatar
      channels: Allow updating variable value · 32ce6e9a
      Sean Bright authored
      When modifying an already defined variable in some channel drivers they
      add a new variable with the same name to the list, but that value is
      never used, only the first one found.
      
      Introduce ast_variable_list_replace() and use it where appropriate.
      
      ASTERISK-23756 #close
      Patches:
        setvar-multiplie.patch submitted by Michael Goryainov
      
      Change-Id: Ie1897a96c82b8945e752733612ee963686f32839
      32ce6e9a
  8. Sep 10, 2019
    • Frederic LE FOLL's avatar
      chan_dahdi: set CHANNEL(hangupsource) when a PRI channel hangs up · 41b67f15
      Frederic LE FOLL authored
      When the remote ISDN party ends an ISDN call on a PRI link
      (DISCONNECT), CHANNEL(hangupsource) information is not available.
      
      chan_dahdi already contains an ast_set_hangupsource() in
      __dahdi_exception() function but it seems that ISDN message processing
      does not use this part of code.
      
      Two other channel modules associate ast_queue_hangup() and
      ast_set_hangupsource() functions calls:
      - chan_pjsip in chan_pjsip_session_end() function,
      - chan_sip in sip_queue_hangup_cause() function.
      chan_iax2 separates them, in iax2_queue_hangup()/iax2_destroy() and
      set_hangup_source_and_cause().
      
      Thus, I propose to add ast_set_hangupsource() beside
      ast_queue_hangup() in sig_pri_queue_hangup(), like chan_pjsip and
      chan_sip already do.
      
      ASTERISK-28525
      
      Change-Id: I0f588a4bcf15ccd0648fd69830d1b801c3f21b7c
      41b67f15
    • George Joseph's avatar
      chan_sip: Update links referenced in deprecation notice · 5fb9b231
      George Joseph authored
      The links in the deprecation notice were the shortened
      variety but it makes better sense to show the unshortened
      links as they're more descriptive.
      
      I.E.
      wiki.asterisk.org/wiki/display/AST/Migrating+from+chan_sip+to+res_pjsip
      rather than
      wiki.asterisk.org/wiki/x/tAHOAQ
      
      Change-Id: If2da5d5243e2d4a6f193b15691d23e7e5a7c57a9
      5fb9b231
  9. Sep 04, 2019
  10. Aug 27, 2019
    • Igor Goncharovsky's avatar
      chan_unistim: Fix code, causing all incoming DTMF sent back to asterisk · 1d06a1ef
      Igor Goncharovsky authored
      Current implementation of ast_channel_tech send_digit_begin hook uses
      same function for tone playback as key press handler. This cause every
      incoming dtmf send back to asterisk. In case of two unistim phones
      connected to each other, it'll cause indefinite DTMF loop. Fix add
      separate function for dtmf tone phone play.
      
      Change-Id: I5795db468df552f0c89c7576b6b3858b26c4eab4
      1d06a1ef
  11. Aug 26, 2019
  12. Aug 22, 2019
    • George Joseph's avatar
      chan_rtp: Accept hostname as well as ip address as destination · 19045db3
      George Joseph authored
      The UnicastRTP channel driver provided by chan_rtp now accepts
      "<hostname>:<port>" as an alternative to "<ip_address>:<port>"
      in the destination. The first AAAA (preferred) or A record resolved
      will be used as the destination. The lookup is synchronous so beware
      of possible dialplan delays if you specify a hostname.
      
      Change-Id: Ie6f95b983a8792bf0dacc64c7953a41032dba677
      19045db3
  13. Aug 01, 2019
    • Kevin Harwell's avatar
      various modules: json integer overflow · 3656c42c
      Kevin Harwell authored
      There were still a few places in the code that could overflow when "packing"
      a json object with a value outside the base type integer's range. For instance:
      
      unsigned int value = INT_MAX + 1
      ast_json_pack("{s: i}", value);
      
      would result in a negative number being "packed". In those situations this patch
      alters those values to a ast_json_int_t, which widens the value up to a long or
      long long.
      
      ASTERISK-28480
      
      Change-Id: Ied530780d83e6f1772adba0e28d8938ef30c49a1
      3656c42c
  14. Jul 22, 2019
  15. Jul 11, 2019
    • Francesco Castellano's avatar
      chan_sip: Handle invalid SDP answer to T.38 re-invite · 8438d19b
      Francesco Castellano authored
      The chan_sip module performs a T.38 re-invite using a single media
      stream of udptl, and expects the SDP answer to be the same.
      
      If an SDP answer is received instead that contains an additional
      media stream with no joint codec a crash will occur as the code
      assumes that at least one joint codec will exist in this
      scenario.
      
      This change removes this assumption.
      
      ASTERISK-28465
      
      Change-Id: I8b02845b53344c6babe867a3f0a5231045c7ac87
      8438d19b
  16. Jul 08, 2019
    • Kevin Harwell's avatar
      MWI: Update modules that subscribe to MWI to use new API calls · 9637e1df
      Kevin Harwell authored
      The MWI core recently got some new API calls that make tracking MWI state
      lifetime more reliable. This patch updates those modules that subscribe to
      specific MWI topics to use the new API. Specifically, these modules now
      subscribe to both MWI topics and MWI state.
      
      ASTERISK-28442
      
      Change-Id: I32bef880b647246823dbccdf44a98d384fcabfbd
      9637e1df
  17. Jul 01, 2019
    • Chris-Savinovich's avatar
      chan_dahdi.c: crash in chan_dahdi · 0e669712
      Chris-Savinovich authored
      Fixes a crash in chan_dahdi occurring on 32-bit systems. A previous
      patch introduced a variable of type unassigned long long which is 64-bits.
      Casting it as 'ast_json_int_t' along with JSON type 'I' makes it work
      with 32-bit systems.
      
      ASTERISK-28457
      
      Change-Id: I9cef6b5f2d826fc5c93f2f6a1c997c4e3e6c93fe
      0e669712
  18. Jun 25, 2019
    • Dan Cropp's avatar
      chan_pjsip: Transmit REFER waits for the REFER result setting TRANSFERSTATUS · e52fbae0
      Dan Cropp authored
      Previously, when a Transfer (REFER) was performed, chan_pjsip would set
      the TRANSFERSTATUS to SUCCESS when the REFER was queued up.  This did not
      reflect a successful/unsuccessful transfer the way chan_sip did.
      Added a callback module to process the refer subscription information.
      
      Now depends on res_pjsip_pubsub so call transfer progress can be monitored
      and reported
      
      ASTERISK-26968 #close
      Reported-by: Dan Cropp
      
      Change-Id: If6c27c757c66f71e8b75e3fe49da53ebe62395dc
      e52fbae0
  19. Jun 24, 2019
  20. Jun 17, 2019
    • George Joseph's avatar
      chan_dahdi: Address gcc9 issues · 92d4ec29
      George Joseph authored
      Fixed format-truncation issues in chan_dahdi.c and
      sig_analog.c.  Since they're related to fields provided
      by dahdi-tools we can't change the buffer sizes so we're just
      checking the return from snprintf and printing an errior if we
      overflow.
      
      Change-Id: Idc1f3c1565b88a7d145332a0196074b5832864e5
      92d4ec29
  21. Jun 10, 2019
    • agupta's avatar
      chan_pjsip.c: Check for channel and session to not be NULL in hangup · d2f7b226
      agupta authored
      We have seen some rare case of segmentation fault in hangup function
      and we could notice that channel pointer was NULL.  Debug log shows
      that there is a 200 OK answer and SIP timeout at the same time.  It
      looks that while the SIP session was being destroyed due to timeout
      call hangup due to answer event lead to race condition and channel
      is being destroyed from two different places.  The check ensures we
      check it not to be NULL before freeing it.
      
      ASTERISK-25371
      
      Change-Id: I19f6566830640625e08f7b87bfe15758ad33a778
      d2f7b226
  22. May 23, 2019
    • Guido Falsi's avatar
      chan_dahdi: add missing include. · db535439
      Guido Falsi authored
      After some definitions have been moved to asterisk/mwi.h the files
      channels/chan_dahdi.h channels/sig_pri.c are missing this new
      include.
      
      ASTERISK-28427 #close
      
      Change-Id: Ia8cc595eeda653324643f40dcd9799d4c3f0ac91
      db535439
  23. May 16, 2019
    • Alexei Gradinari's avatar
      pjsip: replace 180 by 183 if SDP negotiation has completed · 466a1796
      Alexei Gradinari authored
      The caller endpoint hears dead silence if a callee replies 180 (without SDP)
      and the caller already received 183 (with SDP).
      It happens because Asterisk sends 180 (WITH SDP) to the caller,
      there are not incoming RTP packets from the callee
      and Asterisk does not generate inband ringing,
      so there are not any outgoing RTP packets to the caller.
      
      This patch replaces 180 by 183 if SDP negotiation has completed,
      as if the caller endpoint is configured with "inband_progress=yes".
      
      In this case Asterisk will generate inband ringing untill Asterisk receive
      incoming RTP packets from the callee.
      
      ASTERISK-27994 #close
      
      Change-Id: I7450b751083ec30d68d6abffe922215a15ae5a73
      466a1796
  24. May 10, 2019
    • George Joseph's avatar
      Fixes for GCC 9 · c5c953c1
      George Joseph authored
      Various fixes for issues caught by gcc 9.  Mostly snprintf
      trying to copy to a buffer potentially too small.
      
      ASTERISK-28412
      
      Change-Id: I9e85a60f3c81d46df16cfdd1c329ce63432cf32e
      c5c953c1
  25. Apr 23, 2019
    • Kevin Harwell's avatar
      mwi core: Move core MWI functionality into its own files · ff0d0ac2
      Kevin Harwell authored
      There is enough MWI functionality to warrant it having its own 'c' and header
      files. This patch moves all current core MWI data structures, and functions
      into the following files:
      
      main/mwi.h
      main/mwi.c
      
      Note, code was simply moved, and not modified. However, this patch is also in
      preparation for core MWI changes, and additions to come.
      
      Change-Id: I9dde8bfae1e7ec254fa63166e090f77e4d3097e0
      ff0d0ac2
  26. Apr 05, 2019
  27. Apr 03, 2019
    • Ben Ford's avatar
      build: Fix compiler warnings/errors. · dd1cc779
      Ben Ford authored
      The compiler complained about a couple of variables that weren't
      initialized but were being used. Initializing them to NULL resolves the
      warnings/errors.
      
      ASTERISK-28362 #close
      
      Change-Id: I6243afc5459b416edff6bbf571b0489f6b852e4b
      dd1cc779
  28. Mar 27, 2019
    • Alexei Gradinari's avatar
      pjsip: restrict function PJSIP_PARSE_URI to parse only SIP/SIPS URIs · f236377c
      Alexei Gradinari authored
      The next usage of PJSIP_PARSE_URI will crash asterisk
      ${PJSIP_PARSE_URI(tel:+1234567890,host)}
      or
      ${PJSIP_PARSE_URI(192.168.1.1:5060,host)}
      
      The function pjsip_parse_uri successfully parses then, but returns
      struct pjsip_other_uri *.
      
      This patch restricts parsing only SIP/SIPS URIs.
      
      Change-Id: I16f255c2b86a80a67e9f9604b94b129a381dd25e
      f236377c
  29. Mar 25, 2019
    • Sean Bright's avatar
      chan_sip: Ensure 'qualifygap' isn't negative · 1499640d
      Sean Bright authored
      Passing negative intervals to the scheduler rips a hole in the
      space-time continuum.
      
      ASTERISK-25792 #close
      Reported by: Paul Sandys
      
      Change-Id: Ie706f21cee05f76ffb6f7d89e9c867930ee7bcd7
      1499640d
  30. Mar 11, 2019
  31. Mar 08, 2019
    • Torrey Searle's avatar
      chan_pjsip: add a flag to ignore 183 responses if no SDP present · 4661c085
      Torrey Searle authored
      chan_sip will always ignore 183 responses that do not contain SDP
      however, chan_pjsip will currently always translate it into a
      183 with SDP.  This new flag allows chan_pjsip to have the same
      behavior as chan_sip.
      
      ASTERISK-28322 #close
      
      Change-Id: If81cfaa17c11b6ac703e3d71696f259d86c6be4a
      4661c085
  32. Mar 07, 2019
    • Sean Bright's avatar
      Replace calls to strtok() with strtok_r() · 2473b791
      Sean Bright authored
      strtok() uses a static buffer, making it not thread safe.
      
      Also add a #define to cause a compile failure if strtok is used.
      
      Change-Id: Icce265153e1e65adafa8849334438ab6d190e541
      2473b791
  33. Feb 14, 2019
Loading