Skip to content
Snippets Groups Projects
  1. Nov 16, 2020
  2. 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
  3. 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
  4. 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
  5. 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
  6. 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
  7. 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
  8. 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
  9. Oct 28, 2020
    • Kevin Harwell's avatar
      res_pjsip, res_pjsip_session: initialize local variables · 439f7bb8
      Kevin Harwell authored
      This patch initializes a couple of local variables to some default values.
      Interestingly, in the 'pj_status_t dlg_status' case the value not being
      initialized caused memory to grow, and not be recovered, in the off nominal
      path (at least on my machine).
      
      Change-Id: I22ee65e1e1bff8efacea8a167c6c8428898523f7
      439f7bb8
    • Alexander Traud's avatar
      install_prereq: Add GMime 3.0. · f89531cb
      Alexander Traud authored
      Ubuntu 20.10 does not come with GMime 2.6. Ubuntu 16.04 LTS does not
      come with GMime 3.0. aptitude ignores any missing package. Therefore,
      it installs the correct package(s). However, in Ubuntu 18.04 LTS and
      Ubuntu 20.04 LTS, both versions are installed alongside although only
      one is really needed.
      
      Change-Id: Ic58aa9f2e131d94671f286f17dbd61e1ccbabcb7
      f89531cb
    • Nick French's avatar
      res_pjsip_session: Restore calls to ast_sip_message_apply_transport() · f041763e
      Nick French authored
      Commit 44bb0858 ("debugging: Add enough
      to choke a mule") accidentally removed calls to
      ast_sip_message_apply_transport when it was attempting to just add
      debugging code.
      
      The kiss of death was saying that there were no functional changes in
      the commit comment.
      
      This makes outbound calls that use the 'flow' transport mechanism fail,
      since this call is used to relay headers into the outbound INVITE
      requests.
      
      ASTERISK-29124 #close
      
      Change-Id: I0f3e32c2e8ac415e30b1d29966d75a1546f0526a
      f041763e
    • Alexander Traud's avatar
      BuildSystem: Enable Lua 5.4. · 2773f931
      Alexander Traud authored
      Note to maintainers: Lua 5.4, Lua 5.3, and Lua 5.2 have not been tested
      at runtime with pbx_lua. Until then, use the lowest available version
      of Lua, if you enabled the module pbx_lua at all.
      
      Change-Id: Ie5270448b11fcb4e2a53d899e4fe7fea793ce7e0
      2773f931
  10. Oct 22, 2020
  11. Oct 14, 2020
  12. Oct 13, 2020
    • Joshua C. Colp's avatar
      res_pjsip: Adjust outgoing offer call pref. · 412b385d
      Joshua C. Colp authored
      This changes the outgoing offer call preference
      default option to match the behavior of previous
      versions of Asterisk.
      
      The additional advanced codec negotiation options
      have also been removed from the sample configuration
      and marked as reserved for future functionality in
      XML documentation.
      
      The codec preference options have also been fixed to
      enforce local codec configuration.
      
      ASTERISK-29109
      
      Change-Id: Iad19347bd5f3d89900c15ecddfebf5e20950a1c2
      412b385d
  13. Oct 12, 2020
    • Kevin Harwell's avatar
      Logging: Add debug logging categories · 6255e797
      Kevin Harwell authored
      Added debug logging categories that allow a user to output debug
      information based on a specified category. This lets the user limit,
      and filter debug output to data relevant to a particular context,
      or topic. For instance the following categories are now available for
      debug logging purposes:
      
        dtls, dtls_packet, ice, rtcp, rtcp_packet, rtp, rtp_packet,
        stun, stun_packet
      
      These debug categories can be enable/disable via an Asterisk CLI command.
      
      While this overrides, and outputs debug data, core system debugging is
      not affected by this patch. Statements still output at their appropriate
      debug level. As well backwards compatibility has been maintained with
      past debug groups that could be enabled using the CLI (e.g. rtpdebug,
      stundebug, etc.).
      
      ASTERISK-29054 #close
      
      Change-Id: I6e6cb247bb1f01dbf34750b2cd98e5b5b41a1849
      (cherry picked from commit 56028426)
      6255e797
  14. Oct 08, 2020
  15. Oct 06, 2020
  16. Oct 02, 2020
    • Sean Bright's avatar
      app_voicemail.c: Document VMSayName interruption behavior · abee4906
      Sean Bright authored
      ASTERISK-26424 #close
      
      Change-Id: I797ad0ed302d0b3d2c90543eff5b7207ed08ecf0
      abee4906
    • Sean Bright's avatar
      pbx.c: On error, ast_add_extension2_lockopt should always free 'data' · 5a0b19a4
      Sean Bright authored
      In the event that the desired extension already exists,
      ast_add_extension2_lockopt() will free the 'data' it is passed before
      returning an error, so we should not be freeing it ourselves.
      
      Additionally, there were two places where ast_add_extension2_lockopt()
      could return an error without also freeing the 'data' pointer, so we
      add that.
      
      ASTERISK-29097 #close
      
      Change-Id: I904707aae55169feda050a5ed7c6793b53fe6eae
      5a0b19a4
    • George Joseph's avatar
      app_confbridge/bridge_softmix: Add ability to force estimated bitrate · 4a049ad5
      George Joseph authored
      app_confbridge now has the ability to set the estimated bitrate on an
      SFU bridge.  To use it, set a bridge profile's remb_behavior to "force"
      and set remb_estimated_bitrate to a rate in bits per second.  The
      remb_estimated_bitrate parameter is ignored if remb_behavior is something
      other than "force".
      
      Change-Id: Idce6464ff014a37ea3b82944452e56cc4d75ab0a
      4a049ad5
  17. Sep 30, 2020
    • Jasper van der Neut's avatar
      channels: Don't dereference NULL pointer · 08ccfd45
      Jasper van der Neut authored
      Check result of ast_translator_build_path against NULL before dereferencing.
      
      ASTERISK-29091
      
      Change-Id: Ia3538ea190bd371f70c9dd49984b021765691b29
      08ccfd45
    • Holger Hans Peter Freyther's avatar
      res_pjsip_sdp_rtp: Fix accidentally native bridging calls · 4499fbc8
      Holger Hans Peter Freyther authored
      Stop advertising RFC2833 support on the rtp_engine when DTMF mode is
      auto but no tel_event was found inside SDP file.
      
      On an incoming call create_rtp will be called and when session->dtmf is
      set to AST_SIP_DTMF_AUTO, the AST_RTP_PROPERTY_DTMF will be set without
      looking at the SDP file.
      
      Once get_codecs gets called we move the DTMF mode from RFC2833 to INBAND
      but continued to advertise RFC2833 support.
      
      This meant the native_rtp bridge would falsely consider the two channels
      as compatible. In addition to changing the DTMF mode we now set or
      remove the AST_RTP_PROPERTY_DTMF.
      
      The property is checked in ast_rtp_dtmf_compatible and called by
      native_rtp_bridge_compatible.
      
      ASTERISK-29051 #close
      
      Change-Id: I1e0c1e324598a437932c0b7836bcb626aba8e287
      4499fbc8
  18. Sep 29, 2020
  19. Sep 28, 2020
  20. Sep 23, 2020
    • Sean Bright's avatar
      dsp.c: Update calls to ast_format_cmp to check result properly · 9b08eddf
      Sean Bright authored
      ASTERISK-28311 #close
      
      Change-Id: Ib1ce8fc1a8752751f5bf3615c59245532dfd9aa2
      9b08eddf
    • Sean Bright's avatar
      res_musiconhold: Start playlist after initial announcement · d0644faa
      Sean Bright authored
      Only track our sample offset if we are playing a non-announcement file,
      otherwise we will skip that number of samples when we start playing the
      first MoH file.
      
      ASTERISK-24329 #close
      
      Change-Id: Ib6b3c84fcaa1063889ab38ba7e7fc50050a3ccfc
      d0644faa
    • Joshua C. Colp's avatar
      res_pjsip_session: Fix stream name memory leak. · 9eeb40af
      Joshua C. Colp authored
      When constructing a stream name based on the media type
      and position the allocated name was not being freed
      causing a leak.
      
      Change-Id: I52510863b24a2f531f0a55b440bb2c81844029de
      9eeb40af
    • Sean Bright's avatar
      func_curl.c: Prevent crash when using CURLOPT(httpheader) · 28c88e8f
      Sean Bright authored
      Because we use shared thread-local cURL instances, we need to ensure
      that the state of the cURL instance is correct before each invocation.
      
      In the case of custom headers, we were not resetting cURL's internal
      HTTP header pointer which could result in a crash if subsequent
      requests do not configure custom headers.
      
      ASTERISK-29085 #close
      
      Change-Id: I8b4ab34038156dfba613030a45f10e932d2e992d
      28c88e8f
    • Joshua C. Colp's avatar
      res_pjsip_session: Fix session reference leak. · 957aff75
      Joshua C. Colp authored
      The ast_sip_dialog_get_session function returns the session
      with reference count increased. This was not taken into
      account and was causing sessions to remain around when they
      should not be.
      
      ASTERISK-29089
      
      Change-Id: I430fa721b0a824311a59effec6056e9ec528e3e8
      957aff75
Loading