Skip to content
Snippets Groups Projects
  1. Oct 19, 2018
    • Corey Farrell's avatar
      lock: Replace __ast_mutex_logger with private log_mutex_error. · 4c19b949
      Corey Farrell authored
      __ast_mutex_logger used the variable `canlog` without accepting it as a
      argument.  Replace with internal macro `log_mutex_error` which takes
      canlog as the first arguement.  This will prevent confusion when working
      with lock.c code, many of the function declare the canlog variable and
      in some cases it previously appeared to be unused.
      
      Change-Id: I83b372cb0654c5c18eadc512f65a57fa6c2e9853
      Unverified
      4c19b949
  2. Oct 17, 2018
  3. Oct 04, 2018
    • Corey Farrell's avatar
      loader: Flag module as declined in all cases where it fails to load. · c8ee1a18
      Corey Farrell authored
      This has no effect on startup since AST_MODULE_LOAD_FAILURE aborts
      startup, but it's possible for this code to be returned on manual load
      of a module after startup.
      
      It is an error for a module to not have a load callback but this is not
      a fatal system error.  In this case flag the module as declined, return
      AST_MODULE_LOAD_FAILURE only if a required module is broken.
      
      Expand doxygen documentation for AST_MODULE_LOAD_*.
      
      Change-Id: I3c030bb917f6e5a0dfd9d91491a4661b348cabf8
      Unverified
      c8ee1a18
  4. Oct 02, 2018
    • Corey Farrell's avatar
      loader: Improve error handling. · e4cf513f
      Corey Farrell authored
      * Display list of unavailable dependencies when they cause another
        module to fail loading.
      * When a module declines to load find all modules which depend on it so
        they can be declined and listed together.
      * Prevent retry of declined modules during startup.
      * When a module fails to dlopen try loading it with RTLD_LAZY so we can
        attempt to display the list of missing dependencies.
      
      These changes are meant to reduce logger spam that is caused when a
      module has many dependencies and declines to load.  This also fixes some
      error paths which failed to recognize required modules.
      
      Module load/start errors are delayed until the end of loader startup.
      
      Change-Id: I046052c71331c556c09d39f47a3b92975f3e1758
      Unverified
      e4cf513f
  5. Sep 28, 2018
    • Corey Farrell's avatar
      lock: Improve performance of DEBUG_THREADS. · 205c6be8
      Corey Farrell authored
      Add a volatile flag to lock tracking structures so we only need to use
      the global lock when first initializing tracking.
      
      Additionally add support for DEBUG_THREADS_LOOSE_ABI.  This is used by
      astobj2.c to eliminate storage for tracking fields when DEBUG_THREADS is
      not defined.
      
      Change-Id: Iabd650908901843e9fff47ef1c539f0e1b8cb13b
      Unverified
      205c6be8
  6. Sep 25, 2018
    • George Joseph's avatar
      configure.ac: Check for unbound version >= 1.5 · 1ba51b00
      George Joseph authored
      In order to do this and provide good feedback, a new macro was
      created (AST_EXT_LIB_EXTRA_CHECK) which does the normal check and
      path setups for the library then compiles, links and runs a supplied
      code fragment to do the final determination.  In this case, the
      final code fragment compares UNBOUND_VERSION_MAJOR
      and UNBOUND_VERSION_MINOR to determine if they're greater than or
      equal to 1.5.
      
      Since we require version 1.5, some code in res_resolver_unbound
      was also simplified.
      
      ASTERISK-28045
      Reported by: Samuel Galarneau
      
      Change-Id: Iee94ad543cd6f8b118df8c4c7afd9c4e2ca1fa72
      1ba51b00
  7. Sep 24, 2018
  8. Sep 21, 2018
    • Kevin Harwell's avatar
      rtp_engine: rtcp_report_to_json can overflow the ssrc integer value · 31fba4e8
      Kevin Harwell authored
      When writing an RTCP report to json the code attempts to pack the "ssrc" and
      "source_ssrc" unsigned integer values as a signed int value type. This of course
      means if the ssrc's unsigned value is greater than that which can fit into a
      signed integer value it gets converted to a negative number. Subsequently, the
      negative value goes out in the json report.
      
      This patch now packs the value as a json_int_t, which is the widest integer type
      available on a given system. This should make it so the value no longer
      overflows.
      
      Note, this was caught by two failing tests hep/rtcp-receiver/ and
      hep/rtcp-sender.
      
      Change-Id: I2af275286ee5e795b79f0c3d450d9e4b28e958b0
      Unverified
      31fba4e8
  9. Sep 20, 2018
    • George Joseph's avatar
      stasis: Add function to delete topic from pool · d277db4a
      George Joseph authored
      There's been a long standing leak when using topic pools.  The
      topics in the pool get cleaned up when the last pool reference is
      released but you can't remove a topic specifically.  If you reloaded
      app_voicemail for instance, and mailboxes went away, their topics
      were left in the pool.
      
      * Added stasis_topic_pool_delete_topic() so modules can clean up
        topics from pools.
      * Registered the topic pool containers so it can be examined from
        the CLI when AO2_DEBUG is enabled.  They'll be named
        "<topic_pool_name>-pool".
      
      Change-Id: Ib7957951ee5c9b9b4482af7b9b4349112d62bc25
      d277db4a
  10. Sep 18, 2018
    • Joshua Colp's avatar
      pjproject: Upgrade to 2.8. · ce9a980b
      Joshua Colp authored
      This change brings in PJSIP 2.8, removes all the patches
      that were merged upstream, and makes a minor change to
      support a breaking change that was done.
      
      ASTERISK-28059
      
      Change-Id: I5097772b11b0f95c3c1f52df6400158666f0a189
      ce9a980b
  11. Sep 17, 2018
  12. Sep 14, 2018
    • Sean Bright's avatar
      res_pjsip: Log IPv6 addresses correctly · 07cb13f7
      Sean Bright authored
      Both pjsip_tx_data.tp_info.dst_name and pjsip_rx_data.pkt_info.src_name
      store IPv6 addresses without enclosing brackets. This causes some log
      output to be confusing because it is difficult to separate the IPv6
      address from a port specification.
      
      * Use pj_sockaddr_print() along with pjsip_tx_data.tp_info.dst_addr and
        pjsip_rx_data.pkt_info.src_addr where possible for consistent IPv6
        output.
      
      * When a pj_sockaddr is not available, explicitly wrap IPv6 addresses
        in brackets.
      
      * When assigning pjsip_rx_data.pkt_info.src_name ourselves, make sure
        to also set pjsip_rx_data.pkt_info.src_addr.
      
      Change-Id: I5cfe997ced7883862a12b9c7d8551d76ae02fcf8
      07cb13f7
  13. Sep 06, 2018
    • Sean Bright's avatar
      res_pjproject: Add utility functions to convert between socket structures · 600c5d79
      Sean Bright authored
      Currently, to convert from a pj_sockaddr to an ast_sockaddr, the address
      needs to be rendered to a string and then parsed into the correct
      structure. This also involves a call to getaddrinfo(3). The same is true
      for the inverse operation.
      
      Instead, because we know the internal structure of both ast_sockaddr and
      pj_sockaddr, we can translate directly between the two without the
      need for an intermediate string.
      
      Change-Id: If0fc4bba9643f755604c6ffbb0d7cc46020bc761
      600c5d79
  14. Aug 07, 2018
  15. Aug 06, 2018
    • Joshua Colp's avatar
      stasis: Reduce calculation of stasis message type hash. · 455ca109
      Joshua Colp authored
      When the stasis cache is used a hash is calculated for
      retrieving or inserting messages. This change calculates
      a hash when the message type is initialized that is then
      used each time needed. This ensures that the hash is
      calculated only once for the message type.
      
      Change-Id: I4fe6bfdafb55bf5c322dd313fbd8c32cce73ef37
      455ca109
  16. Aug 03, 2018
  17. Aug 01, 2018
    • Corey Farrell's avatar
      Build System: Improve ccache matching for different menuselect options. · a10a3aff
      Corey Farrell authored
      Changing any Menuselect option in the `Compiler Flags` section causes a
      full rebuild of the Asterisk source tree.  Every enabled option causes
      a #define to be added to buildopts.h, thus breaking ccache caching for
      every source file that includes "asterisk.h".  In most cases each option
      only applies to one or two files.  Now we only define those options for
      the specific sources which use them, this causes much better cache
      matching when working with multiple builds.  For example testing code
      with an without MALLOC_DEBUG will now use just over half the ccache
      size, only main/astmm.o will have two builds cached instead of every
      file.
      
      Reorder main/Makefile so _ASTCFLAGS set on specific object files are all
      together, sorted by filename.  Stop adding -DMALLOC_DEBUG to CFLAGS of
      bundled pjproject, this define is no longer used by any header so only
      serves to break cache.
      
      The only code change is a slight adjustment to how main/astmm.c is
      initialized.  Initialization functions always exist so main/asterisk.c
      can call them unconditionally.  Additionally rename the astmm
      initialization functions so they are not exported.
      
      Change-Id: Ie2085237a964f6e1e6fff55ed046e2afff83c027
      a10a3aff
  18. Jul 28, 2018
    • Alexander Traud's avatar
      BuildSystem: Enable Jansson in Solaris 11. · 0a4d5873
      Alexander Traud authored
      In Solaris, the header <jansson.h> is in /usr/include/jansson. To find
      Jansson even in such a subdirectory, the tool pkg-config is queried via
      AST_PKG_CONFIG_CHECK. For those platforms, which do not list Jansson via
      pkg-config, the previous check remains and is executed thereafter.
      
      Because the check for the NetBSD Editline library uses the tool pkg-config
      the code of PKG_PROG_PKG_CONFIG must be used. Because that check happens
      earlier than Jansson, it must be placed in front of that.
      
      ASTERISK-27991
      
      Change-Id: I69ea0f379f87a50049654b2487c76ee1c04fa53a
      0a4d5873
  19. Jul 25, 2018
    • Joshua Colp's avatar
      devicestate: Don't create topic when change isn't cached. · 66f58131
      Joshua Colp authored
      When publishing a device state the change can be marked as being
      cachable or not. If it is not cached the change is just published
      to all interested and not stored away for later query. This was not
      fully taken into account when publishing in stasis. The act of
      publishing would create a topic for the device even if it may be
      ephemeral.
      
      This change makes it so messages which are not cached won't create
      a topic for the device. If a topic does already exist it will be
      published to but otherwise the change will only be published to
      the device state all topic.
      
      ASTERISK-27591
      
      Change-Id: I18da0e8cbb18e79602e731020c46ba4101e59f0a
      66f58131
  20. Jul 23, 2018
    • George Joseph's avatar
      xmldoc.c: Fix dump of xml document · ba8f2c40
      George Joseph authored
      The "xmldoc dump" cli command was simply concatenating xml documents
      into the output file.  The resulting file had multiple "xml"
      processing instructions and multiple root elements which is illegal.
      Normally this isn't an issue because Asterisk has only 1 main xml
      documentation file but codec_opus has its own file so if it's
      downloaded and you do "xmldoc dump", the result is invalid.
      
      * Added 2 new functions to xml.c:
          ast_xml_copy_node_list creates a copy of a list of children.
          ast_xml_add_child_list adds a list to an existing list.
      
      * Modified handle_dump_docs to create a new output document and
        add to it the children from each input file.  It then dumps the
        new document to the output file.
      
      Change-Id: I3f182d38c75776aee76413dadd2d489d54a85c07
      ba8f2c40
  21. Jul 22, 2018
    • Joshua Colp's avatar
      sched: Make ABI compatible between dev mode and non-dev mode. · 33f855bb
      Joshua Colp authored
      In the past there was an assertion in the ast_sched_del function
      and in order to ensure it was useful the calling function name,
      line number, and filename had to be passed in. This cause the ABI
      to be different between dev mode and non-dev mode.
      
      This assertion is no longer present so the special logic can be
      removed to make it the same between them both.
      
      Change-Id: Icbc69c801e357d7004efc5cf2ab936d9b83b6ab8
      33f855bb
  22. Jul 20, 2018
  23. Jul 18, 2018
    • Ben Ford's avatar
      res_rtp_asterisk: Add support for sending NACK requests. · 5bacde37
      Ben Ford authored
      Support has been added for receiving a NACK request and handling it.
      Now, Asterisk can detect when a NACK request should be sent and knows
      how to construct one based on the packets we've received from the remote
      end. A buffer has been added that will store out of order packets until
      we receive the packet we are expecting. Then, these packets are handled
      like normal and frames are queued to the core like normal. Asterisk
      knows which packets to request in the NACK request using a vector
      which stores the sequence numbers of the packets we are currently missing.
      
      If a missing packet is received, cycle through the buffer until we reach
      another packet we have not received yet. If the buffer reaches a certain
      size, send a NACK request. If the buffer reaches its max size, queue all
      frames to the core and wipe the buffer and vector.
      
      According to RFC3711, the NACK request must be sent out in a compound
      packet. All compound packets must start with a sender or receiver
      report, so some work was done to refactor the current sender / receiver
      code to allow it to be used without having to also include sdes
      information and automatically send the report.
      
      Also added additional functionality to ast_data_buffer, along with some
      testing.
      
      For more information, refer to the wiki page:
      https://wiki.asterisk.org/wiki/display/AST/WebRTC+User+Experience+Improvements
      
      ASTERISK-27810 #close
      
      Change-Id: Idab644b08a1593659c92cda64132ccc203fe991d
      5bacde37
  24. Jul 16, 2018
    • Corey Farrell's avatar
      loader: Fix startup issues. · 49f83a74
      Corey Farrell authored
      * Merge the preload and load stages, use load ordering to try preload's
        first.  This fixes an issue where `preload=res_config_curl` would fail
        unless res_curl and func_curl were also preloaded.  Now it is only
        required that those modules be loaded during startup: autoload or
        regular load is good enough.
      * The configuration option `require` and `preload-require` were only
        effective if the modules failed to load.  These options will now abort
        Asterisk startup if required modules fail to reach the 'Running'
        state.
      * Missing or invalid 'module.conf' did not prevent startup.  Asterisk
        doesn't do anything without modules so this a fatal error.
      
      Change-Id: Ie4176699133f0e3a823b43f90c3348677e43a5f3
      49f83a74
  25. Jul 13, 2018
  26. Jul 06, 2018
    • George Joseph's avatar
      res_pjsip: Add 'suppress_q850_reason_headers' option to endpoint · 8f42447c
      George Joseph authored
      A new option 'suppress_q850_reason_headers' has been added to the
      endpoint object. Some devices can't accept multiple Reason headers and
      get confused when both 'SIP' and 'Q.850' Reason headers are received.
      This option allows the 'Q.850' Reason header to be suppressed.
      The default value is 'no'.
      
      ASTERISK-27949
      Reported-by: Ross Beer
      
      Change-Id: I54cf37a827d77de2079256bb3de7e90fa5e1deb1
      8f42447c
  27. Jun 28, 2018
    • Richard Mudgett's avatar
      AMI SendText action: Fix to use correct thread to send the text. · 7a238fe7
      Richard Mudgett authored
      The AMI action was directly sending the text to the channel driver.
      However, this makes two threads attempt to handle media and runs afowl of
      CHECK_BLOCKING.
      
      * Queue a read action to make the channel's media handling thread actually
      send the text message.  This changes the AMI actions success/fail response
      to just mean the text was queued to be sent not that the text actually got
      sent.  The channel driver may not even support sending text messages.
      
      ASTERISK-27943
      
      Change-Id: I9dce343d8fa634ba5a416a1326d8a6340f98c379
      7a238fe7
  28. Jun 26, 2018
    • George Joseph's avatar
      res_pjsip_session: Add ability to accept multiple sdp answers · 880fbff6
      George Joseph authored
      pjproject by default currently will follow media forked during an INVITE
      on outbound calls if the To tag is different on a subsequent response as
      that on an earlier response.  We handle this correctly.  There have
      been reported cases where the To tag is the same but we still need to
      follow the media.  The pjproject patch in this commit adds the
      capability to sip_inv and also adds the capability to control it at
      runtime.  The original "different tag" behavior was always controllable
      at runtime but we never did anything with it and left it to default to
      TRUE.
      
      So, along with the pjproject patch, this commit adds options to both the
      system and endpoint objects to control the two behaviors, and a small
      logic change to session_inv_on_media_update in res_pjsip_session to
      control the behavior at the endpoint level.
      
      The default behavior for "different tags" remains the same at TRUE and
      the default for "same tag" is FALSE.
      
      Change-Id: I64d071942b79adb2f0a4e13137389b19404fe3d6
      ASTERISK-27936
      Reported-by: Ross Beer
      880fbff6
  29. Jun 23, 2018
  30. Jun 19, 2018
  31. Jun 18, 2018
  32. Jun 08, 2018
    • Alexander Traud's avatar
      res_rtp_asterisk: Allow OpenSSL configured with no-deprecated. · 0743ad64
      Alexander Traud authored
      Furthermore, allow OpenSSL configured with no-dh. Additionally, this change
      allows auto-negotiation of the elliptic curve/group for servers, not only with
      OpenSSL 1.0.2 but also with OpenSSL 1.1.0 and newer. This enables X25519
      (since OpenSSL 1.1.0) and X448 (since OpenSSL 1.1.1) as a side-effect.
      
      ASTERISK-27910
      
      Change-Id: I5b0dd47c5194ee17f830f869d629d7ef212cf537
      0743ad64
  33. May 28, 2018
    • Alexander Traud's avatar
      tcptls.h: Repair ./configure --with-ssl=PATH. · 24503fb6
      Alexander Traud authored
      asterisk/tcptls.h was included (explicitly, implicitly, or transitively). Those
      inclusions got replaced by forward declarations. As side effect, the inclusions
      got completed.
      
      ASTERISK-27878
      
      Change-Id: I9d102728e30336d6522e5e4ae9e964013a0835f7
      24503fb6
  34. May 23, 2018
    • Joshua Colp's avatar
      rtp: Add support for RTP extension negotiation and abs-send-time. · a507c73a
      Joshua Colp authored
      When RTP was originally created it had the ability to place a single
      extension in an RTP packet. In practice people wanted to potentially
      put multiple extensions in one and so RFC 5285 (obsoleted by RFC
      8285) came into existence. This allows RTP extensions to be negotiated
      with a unique identifier to be used in the RTP packet, allowing
      multiple extensions to be present in the packet.
      
      This change extends the RTP engine API to add support for this. A
      user of it can enable extensions and the API provides the ability to
      retrieve the information (to construct SDP for example) and to provide
      negotiated information (from SDP). The end result is that the RTP
      engine can then query to see if the extension has been negotiated and
      what unique identifier is to be used. It is then up to the RTP engine
      implementation to construct the packet appropriately.
      
      The first extension to use this support is abs-send-time which is
      defined in the REMB draft[1] and is a second timestamp placed in an
      RTP packet which is for when the packet has left the sending system.
      It is used to more accurately determine the available bandwidth.
      
      ASTERISK-27831
      
      [1] https://tools.ietf.org/html/draft-alvestrand-rmcat-remb-03
      
      Change-Id: I508deac557867b1e27fc7339be890c8018171588
      a507c73a
  35. 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
Loading