Skip to content
Snippets Groups Projects
  1. Jun 13, 2018
    • ktyerman's avatar
      chan_iax2: better handling for timeout and EINTR · e1908ea4
      ktyerman authored
      The iax2 module is not handling timeout and EINTR case properly. Mainly when
      there is an interupt to the kernel thread. In case of ast_io_wait recieves a
      signal, or timeout it can be an error or return 0 which eventually escapes the
      thread loop, so that it cant recieve any data. This then causes the modules
      receive queue to build up on the kernel and stop any communications via iax in
      asterisk.
      
      The proposed patch is for the iax module, so that timeout and EINTR does not
      exit the thread.
      
      ASTERISK-27705
      Reported-by: Kirsty Tyerman
      
      Change-Id: Ib4c32562f69335869adc1783608e940c3535fbfb
      e1908ea4
  2. Jun 08, 2018
  3. Jun 07, 2018
    • George Joseph's avatar
      chan_pjsip: Register for "BEFORE_MEDIA" responses · 1725eaf8
      George Joseph authored
      chan_pjsip wasn't registering for "BEFORE_MEDIA" responses which meant
      it was not updating HANGUPCAUSE for 4XX responses.  If the remote end
      sent a "180 Ringing", then a "486 Busy", the hangup cause was left at
      "180 Normal Clearing".
      
      * Removed chan_pjsip_incoming_response from the original session
        supplement (which was handling only "AFTER MEDIA") and added it to a
        new session supplement which accepts both "BEFORE_MEDIA" and
        "AFTER_MEDIA".
      
      * Also cleaned up some cleanup code in load module.
      
      ASTERISK-27902
      
      Change-Id: If9b860541887aca8ac2c9f2ed51ceb0550fb007a
      1725eaf8
  4. May 21, 2018
    • Matthew Fredrickson's avatar
      netsock2: Add ast_sockaddr_resolve_first_af to netsock2 public API · 9f9dce05
      Matthew Fredrickson authored
      This function originally was used in chan_sip to enable some simplifying
      assumptions and eventually was copy and pasted into res_pjsip_logger and
      res_hep.  Since it's replicated in three places, it's probably best to
      move it into the public netsock2 API for these modules to use.
      
      Change-Id: Id52e23be885601c51d70259f62de1a5e59d38d04
      9f9dce05
  5. May 11, 2018
    • Corey Farrell's avatar
      Fix GCC 8 build issues. · b5914d90
      Corey Farrell authored
      This fixes build warnings found by GCC 8.  In some cases format
      truncation is intentional so the warning is just suppressed.
      
      ASTERISK-27824 #close
      
      Change-Id: I724f146cbddba8b86619d4c4a9931ee877995c84
      b5914d90
  6. May 03, 2018
    • Tzafrir Cohen's avatar
      chan_dahdi: Configurable dialed digit timeouts · 63015314
      Tzafrir Cohen authored
      Analog phones dial overlap dialing and it is chan_dahdi's job to read the
      numbers.  It has three timeout constants that this commit converts to
      channel-level configuration options:
      
      * firstdigit_timeout: Default time (ms) to detect first digit
      
      * interdigit_timeout: Default time (ms) to detect following digits
      
      * matchdigit_timeout: Default time (ms) to wait in case of ambiguous
      match.  This happens when the dialed digits match a number in the current
      context but are also the prefix of another number.
      
      Change-Id: Ib728fa900a4f6ae56d1ed810aba61b6593fb7213
      63015314
  7. Apr 20, 2018
  8. Apr 17, 2018
    • George Joseph's avatar
      bridge_softmix: Forward TEXT frames · 4fb7967c
      George Joseph authored
      Core bridging and, more specifically, bridge_softmix have been
      enhanced to relay received frames of type TEXT or TEXT_DATA to all
      participants in a softmix bridge.  res_pjsip_messaging and
      chan_pjsip have been enhanced to take advantage of this so when
      res_pjsip_messaging receives an in-dialog MESSAGE message from a
      user in a conference call, it's relayed to all other participants
      in the call.
      
      res_pjsip_messaging already queues TEXT frames to the channel when
      it receives an in-dialog MESSAGE from an endpoint and chan_pjsip
      will send an MESSAGE when it gets a TEXT frame.  On a normal
      point-to-point call, the frames are forwarded between the two
      correctly.  bridge_softmix was not though so messages weren't
      getting forwarded to conference bridge participants.  Even if they
      were, the bridging code had no way to tell the participants who
      sent the message so it would look like it came from the bridge
      itself.
      
      * The TEXT frame type doesn't allow storage of any meta data, such
      as sender, on the frame so a new TEXT_DATA frame type was added that
      uses the new ast_msg_data structure as its payload.  A channel
      driver can queue a frame of that type when it receives a message
      from outside.  A channel driver can use it for sending messages
      by implementing the new send_text_data channel tech callback and
      setting the new AST_CHAN_TP_SEND_TEXT_DATA flag in its tech
      properties.  If set, the bridging/channel core will use it instead
      of the original send_text callback and it will get the ast_msg_data
      structure. Channel drivers aren't required to implement this.  Even
      if a TEXT_DATA enabled driver uses it for incoming messages, an
      outgoing channel driver that doesn't will still have it's send_text
      callback called with only the message text just as before.
      
      * res_pjsip_messaging now creates a TEXT_DATA frame for incoming
      in-dialog messages and sets the "from" to the display name in the
      "From" header, or if that's empty, the caller id name from the
      channel.  This allows the chat client user to set a friendly name
      for the chat.
      
      * bridge_softmix now forwards TEXT and TEXT_DATA frames to all
      participants (except the sender).
      
      * A new function "ast_sendtext_data" was added to channel which
      takes an ast_msg_data structure and calls a channel's
      send_text_data callback, or if that's not defined, the original
      send_text callback.
      
      * bridge_channel now calls ast_sendtext_data for TEXT_DATA frame
      types and ast_sendtext for TEXT frame types.
      
      * chan_pjsip now uses the "from" name in the ast_msg_data structure
      (if it exists) to set the "From" header display name on outgoing text
      messages.
      
      Change-Id: Idacf5900bfd5f22ab8cd235aa56dfad090d18489
      4fb7967c
    • Alexander Traud's avatar
      chan_vpb: Avoid GNU old-style field designator extension. · 3d9345e3
      Alexander Traud authored
      clang 6.0 warned about this. Beside that, this change removes the used variable
      'desc'.
      
      ASTERISK-27808
      
      Change-Id: Ia26bdcc0a562c058151814511cfcf70ecafa595b
      3d9345e3
  9. Apr 12, 2018
    • Richard Mudgett's avatar
      res_pjsip.c: Split ast_sip_push_task_synchronous() to fit expectations. · 237d341b
      Richard Mudgett authored
      ast_sip_push_task_synchronous() did not necessarily execute the passed in
      task under the specified serializer.  If the current thread is any
      registered pjsip thread then it would execute the task immediately instead
      of under the specified serializer.  Reentrancy issues could result if the
      task does not execute with the right serializer.
      
      The original reason ast_sip_push_task_synchronous() checked to see if the
      current thread was a registered pjsip thread was because of a deadlock
      with masquerades and the channel technology's fixup callback
      (ASTERISK_22936).  A subsequent masquerade deadlock fix (ASTERISK_24356)
      involving call pickups avoided the original deadlock situation entirely.
      The PJSIP channel technology's fixup callback no longer needed to call
      ast_sip_push_task_synchronous().
      
      However, there are a few places where this unexpected behavior is still
      required to avoid deadlocks.  The pjsip monitor thread executes callbacks
      that do calls to ast_sip_push_task_synchronous() that would deadlock if
      the task were actually pushed to the specified serializer.  I ran into one
      dealing with the pubsub subscriptions where an ao2 destructor called
      ast_sip_push_task_synchronous().
      
      * Split ast_sip_push_task_synchronous() into
      ast_sip_push_task_wait_servant() and ast_sip_push_task_wait_serializer().
      ast_sip_push_task_wait_servant() has the old behavior of
      ast_sip_push_task_synchronous().  ast_sip_push_task_wait_serializer() has
      the new behavior where the task is always executed by the specified
      serializer or a picked serializer if one is not passed in.  Both functions
      behave the same if the current thread is not a SIP servant.
      
      * Redirected ast_sip_push_task_synchronous() to
      ast_sip_push_task_wait_servant() to preserve API for released branches.
      
      ASTERISK_26806
      
      Change-Id: Id040fa42c0e5972f4c8deef380921461d213b9f3
      237d341b
  10. Apr 06, 2018
    • Richard Mudgett's avatar
      res_pjsip_refer/chan_sip: Fix INVITE with replaces transfer to ConfBridge · 0c03eab9
      Richard Mudgett authored
      There is a problem when an INVITE-with-Replaces transfer targets a channel
      in a ConfBridge.  The transfer will unconditionally swap out the
      ConfBridge channel.  Unfortunately, the ConfBridge state will not be aware
      of this change.  Unexpected behavior will happen as a result since
      ConfBridge channels currently can only be replaced by a masquerade and not
      normal bridge channel moves.
      
      * We just need to pretend that the channel isn't in a bridge (like other
      transfer methods already do) so the transfer channel will masquerade into
      the ConfBridge channel.
      
      Change-Id: I209beb0e748fa4f4b92a576f36afa8f495ba4c82
      0c03eab9
    • Joshua Colp's avatar
      pjsip / res_rtp_asterisk: Add support for sending REMB · c7bd5540
      Joshua Colp authored
      This change allows chan_pjsip to be given an AST_FRAME_RTCP
      containing REMB feedback and pass it to res_rtp_asterisk.
      Once res_rtp_asterisk receives the frame a REMB RTCP feedback
      packet is constructed with the appropriate contents and sent
      to the remote endpoint.
      
      ASTERISK-27776
      
      Change-Id: Ic53f821c1560d8924907ad82c4d9c0bc322b38cd
      c7bd5540
  11. Apr 05, 2018
    • Richard Mudgett's avatar
      chan_sip.c: Fix INVITE with replaces channel ref leak. · d72a2966
      Richard Mudgett authored
      Given the below call scenario:
      A -> Ast1 -> B
      C <- Ast2 <- B
      
      1) A calls B through Ast1
      2) B calls C through Ast2
      3) B transfers A to C
      
      When party B transfers A to C, B sends a REFER to Ast1 causing Ast1 to
      send an INVITE with replaces to Ast2.  Ast2 then leaks a channel ref of
      the channel between Ast1 and Ast2.
      
      Channel ref leaks are easily seen in the CLI "core show channels" output.
      The leaked channels appear in the output but you can do nothing with them
      and they never go away unless you restart Asterisk.
      
      * Properly account for the channel refs when imparting a channel into a
      bridge when handling an INVITE with replaces in handle_invite_replaces().
      The ast_bridge_impart() function steals a channel ref but the code didn't
      account for how many refs were held by the code at the time and which ref
      was stolen.
      
      * Eliminated RAII_VAR in handle_invite_replaces().
      
      ASTERISK-27740
      
      Change-Id: I7edbed774314b55acf0067b2762bfe984ecaa9a4
      d72a2966
  12. Mar 27, 2018
    • Joshua Colp's avatar
      res_rtp_asterisk: Add support for raising additional RTCP messages. · e14b0e96
      Joshua Colp authored
      This change extends the existing AST_FRAME_RTCP frame type to be
      able to contain additional RTCP message types, such as feedback
      messages. The payload type is contained in the subclass which allows
      knowing what is in the frame itself.
      
      The RTCP feedback message type is now handled and REMB[1] messages
      are raised with their containing information.
      
      This also fixes a bug where all feedback messages were triggering
      video updates instead of just FIR and FUR.
      
      Finally RTCP frames are now passed up through the Asterisk core to
      what is handling the channel, mapped appropriately in the case of
      bridging, and written to an outgoing stream. Since RTCP frames are
      on a per-stream basis this is only done on multistream capable
      channels.
      
      [1] https://tools.ietf.org/html/draft-alvestrand-rmcat-remb-03
      
      ASTERISK-27758
      ASTERISK-26366
      
      Change-Id: I680da0ad8d5059d5e9655d896fb9d92e9da8491e
      e14b0e96
  13. Mar 16, 2018
    • Alexander Traud's avatar
      BuildSystem: Enable Advanced Linux Sound Architecture (ALSA) in NetBSD. · 00789174
      Alexander Traud authored
      In the script ./configure, AST_EXT_LIB_CHECK checks for external libraries. Some
      libraries do not specify all their dependencies and require additional shared
      libraries. In AST_EXT_LIB_CHECK, this is the fifth parameter. However, if a
      library is specified there, it must exist on the platform, because ./configure
      tries to compile/link/execute a small app using those statements. For example,
      the library libdl.so is Linux specific and does not exist on BSD-like platforms.
      
      Furthermore, no supported platform/version was found, which still (ever?)
      requires those additional libraries. Therefore, they were simply removed.
      
      Finally, this change adds the error code ESTRPIPE to the channel driver
      chan_alsa for those platforms which lack it, again for example NetBSD.
      
      ASTERISK-27720
      
      Change-Id: I3b21f2135f6cbfac7590ccdc2df753257f426e0b
      00789174
  14. Mar 14, 2018
    • Corey Farrell's avatar
      loader: Convert reload_classes to built-in modules. · 572a508e
      Corey Farrell authored
      * acl (named_acl.c)
      * cdr
      * cel
      * ccss
      * dnsmgr
      * dsp
      * enum
      * extconfig (config.c)
      * features
      * http
      * indications
      * logger
      * manager
      * plc
      * sounds
      * udptl
      
      These modules are now loaded at appropriate time by the module loader.
      Unlike loadable modules these use AST_MODULE_LOAD_FAILURE on error so
      the module loader will abort startup on failure of these modules.
      
      Some of these modules are still initialized or shutdown from outside the
      module loader.  logger.c is initialized very early and shutdown very
      late, manager.c is initialized by the module loader but is shutdown by
      the Asterisk core (too much uses it without holding references).
      
      Change-Id: I371a9a45064f20026c492623ea8062d02a1ab97f
      572a508e
  15. Mar 07, 2018
    • Corey Farrell's avatar
      Replace direct checks of option_debug with DEBUG_ATLEAST macro. · c8a521b6
      Corey Farrell authored
      Checking option_debug directly is incorrect as it ignores file/module
      specific debug settings.  This system-wide change replaces nearly all
      direct checks for option_debug with the DEBUG_ATLEAST macro.
      
      Change-Id: Ic342d4799a945dbc40ac085ac142681094a4ebf0
      c8a521b6
    • Jean Aunis's avatar
      chan_sip: Fix improper RTP framing on outgoing calls · 75a35ee5
      Jean Aunis authored
      The "ptime" SDP parameter received in a SIP response was not honoured.
      Moreover, in the abscence of this "ptime" parameter, locally configured
      framing was lost during response processing.
      
      This patch systematically stores the framing information in the
      ast_rtp_codecs structure, taking it from the response or from the
      configuration as appropriate.
      
      ASTERISK-27674
      
      Change-Id: I828a6a98d27a45a8afd07236a2bd0aa3cbd3fb2c
      75a35ee5
  16. Mar 03, 2018
  17. Feb 20, 2018
    • Joshua Colp's avatar
      chan_sip: Emit a second ringing event to ensure channel is found. · 259c8067
      Joshua Colp authored
      When constructing a dialog-info+xml NOTIFY message a ringing channel
      is found if the state is ringing and further information is placed into
      the message. Due to the migration to the Stasis message bus this did
      not always work as expected.
      
      This change raises a second ringing event in such a way to guarantee
      that the event is received by chan_sip and another lookup is done to
      find the ringing channel.
      
      ASTERISK-24488
      
      Change-Id: I547a458fc59721c918cb48be060cbfc3c88bcf9c
      259c8067
  18. Feb 13, 2018
  19. Feb 03, 2018
    • Oron Peled's avatar
      chan_console: don't read and write at the same time · 5b8fea93
      Oron Peled authored
      It seems that the ALSA backend of PortAudio doesn't know how to both
      read and write at the same time by adding a per-device mutex.
      
      FIXME: currently only a draft version. Need to either auto-detect
      we work with the ALSA backend or add an extra configuration option
      to use this mutex.
      
      ASTERISK-27426 #close
      
      Change-Id: I635eacee45f5413faa18f5a3b606af03b926dacb
      5b8fea93
  20. Jan 24, 2018
    • Corey Farrell's avatar
      Remove redundant module checks and references. · 527cf5a5
      Corey Farrell authored
      This removes references that are no longer needed due to automatic
      references created by module dependencies.
      
      In addition this removes most calls to ast_module_check as they were
      checking modules which are listed as dependencies.
      
      Change-Id: I332a6e8383d4c72c8e89d988a184ab8320c4872e
      527cf5a5
  21. Jan 18, 2018
  22. Jan 15, 2018
    • Corey Farrell's avatar
      loader: Add dependency fields to module structures. · 9cfdb81e
      Corey Farrell authored
      * Declare 'requires' and 'enhances' text fields on module info structure.
      * Rename 'nonoptreq' to 'optional_modules'.
      * Update doxygen comments.
      
      Still need to investigate dependencies among modules I cannot compile.
      
      Change-Id: I3ad9547a0a6442409ff4e352a6d897bef2cc04bf
      9cfdb81e
  23. Jan 11, 2018
  24. Dec 31, 2017
    • Sean Bright's avatar
      ice: Increase foundation buffer size · 15f8b9b8
      Sean Bright authored
      Per RFC 5245, the foundation specified with an ICE candidate can be up
      to 32 characters but we are only allowing for 31.
      
      ASTERISK-27498 #close
      Reported by: Michele Prà
      
      Change-Id: I05ce7a5952721a76a2b4c90366168022558dc7cf
      15f8b9b8
  25. Dec 22, 2017
  26. Dec 20, 2017
    • Corey Farrell's avatar
      Fix Common Typo's. · 1b80ffa4
      Corey Farrell authored
      Fix instances of:
      * Retreive
      * Recieve
      * other then
      * different then
      * Repeated words ("the the", "an an", "and and", etc).
      * othterwise, teh
      
      ASTERISK-24198 #close
      
      Change-Id: I3809a9c113b92fd9d0d9f9bac98e9c66dc8b2d31
      1b80ffa4
  27. Dec 19, 2017
    • Corey Farrell's avatar
      chan_sip: Fix memory leaks. · 3c037ef9
      Corey Farrell authored
      In change_redirecting_information variables we use ast_strlen_zero to
      see if a value should be saved.  In the case where the value is not NULL
      but is a zero length string we leaked.
      
      handle_response_subscribe leaked a reference to the ccss monitor
      instance.
      
      Change-Id: Ib11444de69c3d5b2360a88ba2feb54d2c2e9f05f
      3c037ef9
    • Corey Farrell's avatar
      Remove constant conditionals (dead-code). · b3e839de
      Corey Farrell authored
      Some variables are set and never changed, making them constant.  This
      means that code in the 'false' block of the conditional is unreachable.
      
      In chan_skinny and res_config_ldap I used preprocessor directive `#if 0`
      as I'm unsure if the unreachable code could be enabled in the future.
      
      Change-Id: I62e2aac353d739fb3c983cf768933120f5fba059
      b3e839de
    • Oron Peled's avatar
      chan_console: Use correct parameter for 'set active' · c02e2564
      Oron Peled authored
      chan_console supports multiple devices but the CLI only works on a
      single device. 'console set active' selects this device.
      
      Sadly that CLI picks the wrong command-line parameter and will only
      work for a device called 'active'.
      
      ASTERISK-27490 #close
      
      Change-Id: I2f0e5fe63db19845bee862575b739360797dc73d
      c02e2564
  28. Dec 18, 2017
    • Corey Farrell's avatar
      netsock: Remove from Asterisk core. · 064c74e4
      Corey Farrell authored
      This moves netsock.c / netsock.h to the chan_iax2 module.  netsock.h has
      been marked deprecated since 13.0.0, chan_iax2 is the only remaining
      user.
      
      Change-Id: I28c6578043bac18de5ea608e136acec4f83d5dd3
      064c74e4
  29. Dec 16, 2017
    • Richard Mudgett's avatar
      chan_pjsip.c: Improve ast_request() diagnostic msgs. · 4a461bcd
      Richard Mudgett authored
      Attempting to dial PJSIP/endpoint when the endpoint doesn't exist and
      disable_multi_domain=no results in a misleading empty endpoint name
      message.  The message should say the endpoint was not found.
      
      * Added missing endpoint not found message.
      
      * Added more information to the empty endpoint name msgs if available.
      
      * Eliminated RAII_VAR in request().
      
      Change-Id: I21da85ebd62dcc32115b2ffcb5157416ebae51e4
      4a461bcd
  30. Dec 15, 2017
    • Corey Farrell's avatar
      chan_sip: Add security event for calls to invalid extension. · 6f8b34f9
      Corey Farrell authored
      Log a message to security events when an INVITE is received to an
      invalid extension.
      
      ASTERISK-25869 #close
      
      Change-Id: I0da40cd7c2206c825c2f0d4e172275df331fcc8f
      6f8b34f9
    • Corey Farrell's avatar
      aco: Minimize use of regex. · bf2d3593
      Corey Farrell authored
      Remove nearly all use of regex from ACO users.  Still remaining:
      * app_confbridge has a legitamate use of option name regex.
      * ast_sorcery_object_fields_register is implemented with regex, all
        callers use simple prefix based regex.  I haven't decided the best
        way to fix this in both 13/15 and master.
      
      Change-Id: Ib5ed478218d8a661ace4d2eaaea98b59a897974b
      bf2d3593
  31. Dec 13, 2017
  32. Dec 12, 2017
    • Sean Bright's avatar
      chan_sip: Don't send trailing \0 on keep alive packets · 0c9cc7e9
      Sean Bright authored
      This is a partial fix for ASTERISK~25817 but does not address the
      comments regarding RFC 5626.
      
      Change-Id: I227e2d10c0035bbfa1c6e46ae2318fd1122d8420
      0c9cc7e9
    • Sean Bright's avatar
      chan_sip: Don't crash in Dial on invalid destination · 5039b574
      Sean Bright authored
      Stripping the DNID in a SIP dial string can result in attempting to call
      the argument parsing macros on an empty string, causing a crash.
      
      ASTERISK-26131 #close
      Reported by: Dwayne Hubbard
      Patches:
      	dw-asterisk-master-dnid-crash.patch (license #6257) patch
      	uploaded by Dwayne Hubbard
      
      Change-Id: Ib84c1f740a9ec0539d582b09d847fc85ddca1c5e
      5039b574
Loading