Skip to content
Snippets Groups Projects
  1. Jan 06, 2021
    • Sean Bright's avatar
      asterisk: Export additional manager functions · 68d3d3af
      Sean Bright authored
      Rename check_manager_enabled() and check_webmanager_enabled() to begin
      with ast_ so that the symbols are automatically exported by the
      linker.
      
      ASTERISK~29184
      
      Change-Id: I85762b9a5d14500c15f6bad6507138c8858644c9
      68d3d3af
  2. Jan 04, 2021
    • Nick French's avatar
      res_pjsip: Prevent segfault in UDP registration with flow transports · 3c8598ff
      Nick French authored
      Segfault occurs during outbound UDP registration when all
      transport states are being iterated over. The transport object
      in the transport is accessed, but flow transports have a NULL
      transport object.
      
      Modify to not iterate over any flow transport
      
      ASTERISK-29210 #close
      
      Change-Id: If28dc3a18bdcbd0a49598b09b7fe4404d45c996a
      3c8598ff
  3. Dec 31, 2020
  4. Dec 28, 2020
  5. Dec 23, 2020
  6. Dec 22, 2020
  7. Dec 17, 2020
    • Sean Bright's avatar
      app_chanspy: Spyee information missing in ChanSpyStop AMI Event · 13682210
      Sean Bright authored
      The documentation in the wiki says there should be spyee-channel
      information elements in the ChanSpyStop AMI event.
      
          https://wiki.asterisk.org/wiki/x/Xc5uAg
      
      However, this is not the case in Asterisk <= 16.10.0 Version. We're
      using these Spyee* arguments since Asterisk 11.x, so these arguments
      vanished in Asterisk 12 or higher.
      
      For maximum compatibility, we still send the ChanSpyStop event even if
      we are not able to find any 'Spyee' information.
      
      ASTERISK-28883 #close
      
      Change-Id: I81ce397a3fd614c094d043ffe5b1b1d76188835f
      13682210
    • Sungtae Kim's avatar
      res_ari: Fix wrong media uri handle for channel play · 4b450b43
      Sungtae Kim authored
      Fixed wrong null object handle in
      /channels/<channel_id>/play request handler.
      
      ASTERISK-29188
      
      Change-Id: I6691c640247a51ad15f23e4a203ca8430809bafe
      4b450b43
    • Pirmin Walthert's avatar
      res_pjsip_nat.c: Create deep copies of strings when appropriate · 7a6cfde4
      Pirmin Walthert authored
      In rewrite_uri asterisk was not making deep copies of strings when
      changing the uri. This was in some cases causing garbage in the route
      header and in other cases even crashing asterisk when receiving a
      message with a record-route header set. Thanks to Ralf Kubis for
      pointing out why this happens. A similar problem was found in
      res_pjsip_transport_websocket.c. Pjproject needs as well to be patched
      to avoid garbage in CANCEL messages.
      
      ASTERISK-29024 #close
      
      Change-Id: Ic5acd7fa2fbda3080f5f36ef12e46804939b198b
      7a6cfde4
    • George Joseph's avatar
      logger.c: Automatically add a newline to formats that don't have one · ccb4951b
      George Joseph authored
      Scope tracing allows you to not specify a format string or
      variable, in which case it just prints the indent, file,
      function, and line number.  The trace output automatically
      adds a newline to the end in this case.  If you also have
      debugging turned on for the module, a debug message is
      also printed but the standard log functionality which
      prints it doesn't add the newline so you have messages
      that don't break correctly.
      
       * format_log_message_ap(), which is the common log
         message formatter for all channels, now adds a
         newline to the end of format strings that don't
         already have a newline.
      
      ASTERISK-29209
      Reported by: Alexander Traud
      
      Change-Id: I994a7df27f88df343b7d19f3e81a4b562d9d41da
      ccb4951b
  8. Dec 16, 2020
  9. Dec 15, 2020
  10. Dec 09, 2020
    • Joshua C. Colp's avatar
      pjsip: Match lifetime of INVITE session to our session. · 5b4e71fa
      Joshua C. Colp authored
      In some circumstances it was possible for an INVITE
      session to be destroyed while we were still using it.
      This occurred due to the reference on the INVITE session
      being released internally as a result of its state
      changing to DISCONNECTED.
      
      This change adds a reference to the INVITE session
      which is released when our own session is destroyed,
      ensuring that the INVITE session remains valid for
      the lifetime of our session.
      
      ASTERISK-29022
      
      Change-Id: I300c6d9005ff0e6efbe1132daefc7e47ca6228c9
      5b4e71fa
    • lvl's avatar
      Introduce astcachedir, to be used for temporary bucket files · 92fcd4ed
      lvl authored
      As described in the issue, /tmp is not a suitable location for a
      large amount of cached media files, since most distributions make
      /tmp a RAM-based tmpfs mount with limited capacity.
      
      I opted for a location that can be configured separately, as opposed
      to using a subdirectory of spooldir, given the different storage
      profile (transient files vs files that might stay there indefinitely).
      
      This commit just makes the cache directory configurable, but leaves
      it at /tmp by default, to ensure backwards compatibility.
      
      A future commit that only targets master could change the default
      location to something more sensible such as /var/tmp/asterisk. At
      that point, the cachedir could be created and cleaned up during
      uninstall by the Makefile script.
      
      ASTERISK-29143
      
      Change-Id: Ic54e95199405abacd9e509cef5f08fa14c510b5d
      92fcd4ed
  11. Dec 03, 2020
    • Sean Bright's avatar
      res_http_media_cache.c: Set reasonable number of redirects · f39d5ea7
      Sean Bright authored
      By default libcurl does not follow redirects, so we explicitly enable
      it by setting CURLOPT_FOLLOWLOCATION. Once that is enabled, libcurl
      will follow up to CURLOPT_MAXREDIRS redirects, which by default is
      configured to be unlimited.
      
      This patch sets CURLOPT_MAXREDIRS to a more reasonable default (8). If
      we determine at some point that this needs to be increased on
      configurable it is a trivial change.
      
      ASTERISK-29173 #close
      
      Change-Id: I4925ebbcf0c7d728bb9252b3795b3479ae225b30
      f39d5ea7
    • Sean Bright's avatar
      media_cache: Fix reference leak with bucket file metadata · f9438e64
      Sean Bright authored
      Change-Id: Ia0e4124110df613ce5fdfa9ef8780016ebaa52c6
      f9438e64
  12. Dec 01, 2020
    • Stanislav's avatar
      res_pjsip_stir_shaken: Fix module description · 6a85dc86
      Stanislav authored
      the 'J' is missing in module description.
      "PSIP STIR/SHAKEN Module for Asterisk" -> "PJSIP STIR/SHAKEN Module for Asterisk"
      
      ASTERISK-29175 #close
      
      Change-Id: I17da008540ee2e8496b644d05f995b320b54ad7a
      6a85dc86
    • Joshua C. Colp's avatar
      voicemail: add option 'e' to play greetings as early media · fd57fae0
      Joshua C. Colp authored
      When using this option, answering the channel is deferred until
      all prompts/greetings have been played and the caller is about
      to leave their message.
      
      ASTERISK-29118 #close
      
      Change-Id: I41b9f0428783c0bd697c8c994f906d1e75ce9ddb
      fd57fae0
  13. Nov 20, 2020
  14. Nov 19, 2020
    • Alexander Greiner-Baer's avatar
      res_pjsip: set Accept-Encoding to identity in OPTIONS response · c79bd583
      Alexander Greiner-Baer authored
      
      RFC 3261 says that the Accept-Encoding header should be present
      in an options response. Permitted values according to RFC 2616
      are only compression algorithms like gzip or the default identity
      encoding. Therefore "text/plain" is not a correct value here.
      As long as the header is hard coded, it should be set to "identity".
      
      Without this fix an Alcatel OmniPCX periodically logs warnings like
      "[sip_acceptIncorrectHeader] Header Accept-Encoding is malformed"
      on a SIP Trunk.
      
      ASTERISK-29165 #close
      
      Change-Id: I0aa2211ebf0b4c2ed554ac7cda794523803a3840
      c79bd583
    • Alexander Traud's avatar
      chan_sip: Remove unused sip_socket->port. · e884d935
      Alexander Traud authored
      12 years ago, with ASTERISK_12115 the last four get/uses of socket.port
      vanished. However, the struct member itself and all seven set/uses
      remained as dead code.
      
      ASTERISK-28798
      
      Change-Id: Ib90516a49eca3d724a70191278aaf2144fb58c59
      e884d935
  15. Nov 18, 2020
    • Boris P. Korzun's avatar
      bridge_basic: Fixed setup of recall channels · 33e35421
      Boris P. Korzun authored
      Fixed a bug (like a typo) in retransfer_enter()
      at main/bridge_basic.c:2641. common_recall_channel_setup() setups
      common things on the recalled transfer target, but used same target
      as source instead trasfered.
      
      ASTERISK-29161 #close
      
      Change-Id: Ieb549654a621c38b1ad5e9d15b9f18823d9cc31f
      33e35421
  16. Nov 16, 2020
  17. Nov 12, 2020
    • George Joseph's avatar
      app_queue: Fix deadlock between update and show queues · 24135987
      George Joseph authored
      Operations that update queues when shared_lastcall is set lock the
      queue in question, then have to lock the queues container to find the
      other queues with the same member. On the other hand, __queues_show
      (which is called by both the CLI and AMI) does the reverse. It locks
      the queues container, then iterates over the queues locking each in
      turn to display them.  This creates a deadlock.
      
      * Moved queue print logic from __queues_show to a separate function
        that can be called for a single queue.
      
      * Updated __queues_show so it doesn't need to lock or traverse
        the queues container to show a single queue.
      
      * Updated __queues_show to snap a copy of the queues container and iterate
        over that instead of locking the queues container and iterating over
        it while locked.  This prevents us from having to hold both the
        container lock and the queue locks at the same time.  This also
        allows us to sort the queue entries.
      
      ASTERISK-29155
      
      Change-Id: I78d4dc36728c2d7bc187b97d82673fc77f2bcf41
      24135987
    • Asterisk Development Team's avatar
  18. Nov 10, 2020
    • George Joseph's avatar
      res_pjsip_outbound_registration.c: Use our own scheduler and other stuff · 860e40dd
      George Joseph authored
      * Instead of using the pjproject timer heap, we now use our own
        pjsip_scheduler.  This allows us to more easily debug and allows us to
        see times in "pjsip show/list registrations" as well as being able to
        see the registrations in "pjsip show scheduled_tasks".
      
      * Added the last registration time, registration interval, and the next
        registration time to the CLI output.
      
      * Removed calls to pjsip_regc_info() except where absolutely necessary.
        Most of the calls were just to get the server and client URIs for log
        messages so we now just save them on the client_state object when we
        create it.
      
      * Added log messages where needed and updated most of the existong ones
        to include the registration object name at the start of the message.
      
      Change-Id: I4534a0fc78c7cb69f23b7b449dda9748c90daca2
      860e40dd
  19. Nov 09, 2020
    • George Joseph's avatar
      pjsip_scheduler.c: Add type ONESHOT and enhance cli show command · 569fc289
      George Joseph authored
      * Added a ONESHOT type that never reschedules.
      
      * Added "like" capability to "pjsip show scheduled_tasks" so you can do
        the following:
      
        CLI> pjsip show scheduled_tasks like outreg
        PJSIP Scheduled Tasks:
      
        Task Name                                     Interval  Times Run ...
        ============================================= ========= ========= ...
        pjsip/outreg/testtrunk-reg-0-00000074            50.000   oneshot ...
        pjsip/outreg/voipms-reg-0-00000073              110.000   oneshot ...
      
      * Fixed incorrect display of "Next Start".
      
      * Compacted the displays of times in the CLI.
      
      * Added two new functions (ast_sip_sched_task_get_times2,
        ast_sip_sched_task_get_times_by_name2) that retrieve the interval,
        next start time, and next run time in addition to the times already
        returned by ast_sip_sched_task_get_times().
      
      Change-Id: Ie718ca9fd30490b8a167bedf6b0b06d619dc52f3
      569fc289
    • Alexei Gradinari's avatar
      sched: AST_SCHED_REPLACE_UNREF can lead to use after free of data · da0f2ea9
      Alexei Gradinari authored
      The data can be freed if the old object '_data' is the same object as
      new 'data'. Because at first the object is unreferenced which can lead
      to destroying it.
      
      This could happened in res_pjsip_pubsub when the publication is updated
      which could lead to segfault in function publish_expire.
      
      Change-Id: I0164f57c387243510bdbd2f8dcf33377b6c202da
      da0f2ea9
    • Alexander Traud's avatar
      res_pjsip/config_transport: Load and run without OpenSSL. · 5a603777
      Alexander Traud authored
      ASTERISK-28933
      Reported-by: Walter Doekes
      
      Change-Id: I65eac49e5b0a79261ea80e2b9b38a836886ed59f
      5a603777
    • Alexander Traud's avatar
      res_stir_shaken: Include OpenSSL headers where used actually. · be54c7e9
      Alexander Traud authored
      This avoids the inclusion of the OpenSSL headers in the public header,
      which avoids one external library dependency in res_pjsip_stir_shaken.
      
      Change-Id: I6a07e2d81d2b5442e24e99b8cc733a99f881dcf4
      be54c7e9
  20. Nov 06, 2020
    • Dovid Bender's avatar
      func_curl.c: Allow user to set what return codes constitute a failure. · c635c782
      Dovid Bender authored
      Currently any response from res_curl where we get an answer from the
      web server, regardless of what the response is (404, 403 etc.) Asterisk
      currently treats it as a success. This patch allows you to set which
      codes should be considered as a failure by Asterisk. If say we set
      failurecodes=404,403 then when using curl in realtime if a server gives
      a 404 error Asterisk will try to failover to the next option set in
      extconfig.conf
      
      ASTERISK-28825
      
      Reported by: Dovid Bender
      Code by: Gobinda Paul
      
      Change-Id: I94443e508343e0a3e535e51ea6e0562767639987
      c635c782
  21. Nov 05, 2020
    • Kevin Harwell's avatar
      AST-2020-001 - res_pjsip: Return dialog locked and referenced · 6baa4b53
      Kevin Harwell authored
      pjproject returns the dialog locked and with a reference. However,
      in Asterisk the method that handles this decrements the reference
      and removes the lock prior to returning. This makes it possible,
      under some circumstances, for another thread to free said dialog
      before the thread that created it attempts to use it again. Of
      course when the thread that created it tries to use a freed dialog
      a crash can occur.
      
      This patch makes it so Asterisk now returns the newly created
      dialog both locked, and with an added reference. This allows the
      caller to de-reference, and unlock the dialog when it is safe to
      do so.
      
      In the case of a new SIP Invite the lock, and reference are now
      held for the entirety of the new invite handling process.
      Otherwise it's possible for the dialog, or its dependent objects,
      like the transaction, to disappear. For example if there is a TCP
      transport error.
      
      ASTERISK-29057 #close
      
      Change-Id: I5ef645a47829596f402cf383dc02c629c618969e
      6baa4b53
    • Ben Ford's avatar
      AST-2020-002 - res_pjsip: Stop sending INVITEs after challenge limit. · 82325ba5
      Ben Ford authored
      If Asterisk sends out and INVITE and receives a challenge with a
      different nonce value each time, it will continually send out INVITEs,
      even if the call is hung up. The endpoint must be configured for
      outbound authentication in order for this to occur. A limit has been set
      on outbound INVITEs so that, once reached, Asterisk will stop sending
      INVITEs and the transaction will terminate.
      
      ASTERISK-29013
      
      Change-Id: I2d001ca745b00ca8aa12030f2240cd72363b46f7
      82325ba5
    • Sean Bright's avatar
      sip_to_pjsip.py: Handle #include globs and other fixes · fe540d03
      Sean Bright authored
      * Wildcards in #includes are now properly expanded
      
      * Implement operators for Section class to allow sorting
      
      ASTERISK-29142 #close
      
      Change-Id: I9b9cd95f4cbe5c24506b75d17173c5aa1a83e5df
      fe540d03
  22. Nov 03, 2020
    • Alexander Traud's avatar
      Compiler fixes for GCC with -Og · e0ee53dc
      Alexander Traud authored
      ASTERISK-29144
      
      Change-Id: I2a72c072083b4492a223c6f9d73d21f4f424db62
      e0ee53dc
    • Alexander Traud's avatar
      Compiler fixes for GCC with -Os · 2dacadd9
      Alexander Traud authored
      ASTERISK-29145
      
      Change-Id: I9af705f2b9725c53141aef5d0ff512a1800f073c
      2dacadd9
    • Alexander Traud's avatar
      Compiler fixes for GCC when printf %s is NULL · f86af1fb
      Alexander Traud authored
      ASTERISK-29146
      
      Change-Id: Ib04bdad87d729f805f5fc620ef9952f58ea96d41
      f86af1fb
    • Alexander Traud's avatar
      chan_sip: On authentication, pick MD5 for sure. · 5b25c75d
      Alexander Traud authored
      RFC 8760 added new digest-access-authentication schemes. Testing
      revealed that chan_sip does not pick MD5 if several schemes are offered
      by the User Agent Server (UAS). This change does not implement any of
      the new schemes like SHA-256. This change makes sure, MD5 is picked so
      UAS with SHA-2 enabled, like the service www.linphone.org/freesip, can
      still be used. This should have worked since day one because SIP/2.0
      already envisioned several schemes (see RFC 3261 and its augmented BNF
      for 'algorithm' which includes 'token' as third alternative; note: if
      'algorithm' was not present, MD5 is still assumed even in RFC 7616).
      
      Change-Id: I61ca0b1f74b5ec2b5f3062c2d661cafeaf597fcd
      5b25c75d
  23. Oct 29, 2020
    • Walter Doekes's avatar
      main/say: Work around gcc 9 format-truncation false positive · fb3b14ab
      Walter Doekes authored
      Version: gcc (Ubuntu 9.3.0-10ubuntu2) 9.3.0
      Warning:
        say.c:2371:24: error: ‘%d’ directive output may be truncated writing
          between 1 and 11 bytes into a region of size 10
          [-Werror=format-truncation=]
        2371 |     snprintf(buf, 10, "%d", num);
        say.c:2371:23: note: directive argument in the range [-2147483648, 9]
      
      That's not possible though, as the if() starts out checking for (num < 0),
      making this Warning a false positive.
      
      (Also replaced some else<TAB>if with else<SP>if while in the vicinity.)
      
      Change-Id: Ic7a70120188c9aa525a6d70289385bfce878438a
      fb3b14ab
Loading