Skip to content
Snippets Groups Projects
  1. Feb 23, 2021
  2. Feb 17, 2021
    • Ben Ford's avatar
      core_unreal: Fix T.38 faxing when using local channels. · 62e2dd48
      Ben Ford authored
      After some changes to streams and topologies, receiving fax through
      local channels stopped working. This change adds a stream topology with
      a stream of type IMAGE to the local channel pair and allows fax to be
      received.
      
      ASTERISK-29035 #close
      
      Change-Id: Id103cc5c9295295d8e68d5628e76220f8f17e9fb
      62e2dd48
  3. Jan 27, 2021
    • Dan Cropp's avatar
      chan_pjsip, app_transfer: Add TRANSFERSTATUSPROTOCOL variable · 08881628
      Dan Cropp authored
      When a Transfer/REFER is executed, TRANSFERSTATUSPROTOCOL variable is
      0 when no protocl specific error
      SIP example of failure, 3xx-6xx for the SIP error code received
      
      This allows applications to perform actions based on the failure
      reason.
      
      ASTERISK-29252 #close
      Reported-by: Dan Cropp
      
      Change-Id: Ia6a94784b4925628af122409cdd733c9f29abfc4
      08881628
  4. 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
  5. Dec 09, 2020
    • 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
  6. 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_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
  7. 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
  8. 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
  9. Oct 02, 2020
    • 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
  10. Sep 22, 2020
  11. Sep 16, 2020
  12. Sep 15, 2020
  13. Sep 11, 2020
    • George Joseph's avatar
      debugging: Add enough to choke a mule · ad4f2a8c
      George Joseph authored
      Added to:
       * bridges/bridge_softmix.c
       * channels/chan_pjsip.c
       * include/asterisk/res_pjsip_session.h
       * main/channel.c
       * res/res_pjsip_session.c
      
      There NO functional changes in this commit.
      
      Change-Id: I06af034d1ff3ea1feb56596fd7bd6d7939dfdcc3
      ad4f2a8c
    • George Joseph's avatar
      res_pjsip_session: Handle multi-stream re-invites better · d4f3b17d
      George Joseph authored
      When both Asterisk and a UA send re-invites at the same time, both
      send 491 "Transaction in progress" responses to each other and back
      off a specified amount of time before retrying. When Asterisk
      prepares to send its re-invite, it sets up the session's pending
      media state with the new topology it wants, then sends the
      re-invite.  Unfortunately, when it received the re-invite from the
      UA, it partially processed the media in the re-invite and reset
      the pending media state before sending the 491 losing the state it
      set in its own re-invite.
      
      Asterisk also was not tracking re-invites received while an existing
      re-invite was queued resulting in sending stale SDP with missing
      or duplicated streams, or no re-invite at all because we erroneously
      determined that a re-invite wasn't needed.
      
      There was also an issue in bridge_softmix where we were using a stream
      from the wrong topology to determine if a stream was added.  This also
      caused us to erroneously determine that a re-invite wasn't needed.
      
      Regardless of how the delayed re-invite was triggered, we need to
      reconcile the topology that was active at the time the delayed
      request was queued, the pending topology of the queued request,
      and the topology currently active on the session.  To do this we
      need a topology resolver AND we need to make stream named unique
      so we can accurately tell what a stream has been added or removed
      and if we can re-use a slot in the topology.
      
      Summary of changes:
      
       * bridge_softmix:
         * We no longer reset the stream name to "removed" in
           remove_all_original_streams().  That was causing  multiple streams
           to have the same name and wrecked the checks for duplicate streams.
      
         * softmix_bridge_stream_sources_update() was checking the old_stream
           to see if it had the softmix prefix and not considering the stream
           as "new" if it did.  If the stream in that slot has something in it
           because another re-invite happened, then that slot in old might
           have a softmix stream but the same stream in new might actually
           be a new one.  Now we check the new_stream's name instead of
           the old_stream's.
      
       * stream:
         * Instead of using plain media type name ("audio", "video", etc) as
           the default stream name, we now append the stream position to it
           to make it unique.  We need to do this so we can distinguish multiple
           streams of the same type from each other.
      
         * When we set a stream's state to REMOVED, we no longer reset its
           name to "removed" or destroy its metadata.  Again, we need to
           do this so we can distinguish multiple streams of the same
           type from each other.
      
       * res_pjsip_session:
         * Added resolve_refresh_media_states() that takes in 3 media states
           and creates an up-to-date pending media state that includes the changes
           that might have happened while a delayed session refresh was in the
           delayed queue.
      
         * Added is_media_state_valid() that checks the consistency of
           a media state and returns a true/false value. A valid state has:
           * The same number of stream entries as media session entries.
               Some media session entries can be NULL however.
           * No duplicate streams.
           * A valid stream for each non-NULL media session.
           * A stream that matches each media session's stream_num
             and media type.
      
         * Updated handle_incoming_sdp() to set the stream name to include the
           stream position number in the name to make it unique.
      
         * Updated the ast_sip_session_delayed_request structure to include both
           the pending and active media states and updated the associated delay
           functions to process them.
      
         * Updated sip_session_refresh() to accept both the pending and active
           media states that were in effect when the request was originally queued
           and to pass them on should the request need to be delayed again.
      
         * Updated sip_session_refresh() to call resolve_refresh_media_states()
           and substitute its results for the pending state passed in.
      
         * Updated sip_session_refresh() with additional debugging.
      
         * Updated session_reinvite_on_rx_request() to simply return PJ_FALSE
           to pjproject if a transaction is in progress.  This stops us from
           creating a partial pending media state that would be invalid later on.
      
         * Updated reschedule_reinvite() to clone both the current pending and
           active media states and pass them to delay_request() so the resolver
           can tell what the original intention of the re-invite was.
      
         * Added a large unit test for the resolver.
      
      ASTERISK-29014
      
      Change-Id: Id3440972943c611a15f652c6c569fa0e4536bfcb
      d4f3b17d
  14. Sep 09, 2020
    • Ben Ford's avatar
      Bridging: Use a ref to bridge_channel's channel to prevent crash. · 7eaae4e7
      Ben Ford authored
      There's a race condition with bridging where a bridge can be torn down
      causing the bridge_channel's ast_channel to become NULL when it's still
      needed. This particular case happened with attended transfers, but the
      crash occurred when trying to publish a stasis message. Now, the
      bridge_channel is locked, a ref to the ast_channel is obtained, and that
      ref is passed down the chain.
      
      Change-Id: Ic48715c0c041615d17d286790ae3e8c61bb28814
      7eaae4e7
  15. Sep 02, 2020
  16. Aug 25, 2020
    • Sean Bright's avatar
      bridge_channel: Ensure text messages are zero terminated · 5ec70993
      Sean Bright authored
      T.140 data in RTP is not zero terminated, so when we are queuing a text
      frame on a bridge we need to ensure that we are passing a zero
      terminated string.
      
      ASTERISK-28974 #close
      
      Change-Id: Ic10057387ce30b2094613ea67e3ae8c5c431dda3
      5ec70993
    • George Joseph's avatar
      scope_trace: Added debug messages and added additional macros · c4c72d55
      George Joseph authored
      The SCOPE_ENTER and SCOPE_EXIT* macros now print debug messages
      at the same level as the scope level.  This allows the same
      messages to be printed to the debug log when AST_DEVMODE
      isn't enabled.
      
      Also added a few variants of the SCOPE_EXIT macros that will
      also call ast_log instead of ast_debug to make it easier to
      use scope tracing and still print error messages.
      
      Change-Id: I7fe55f7ec28069919a0fc0b11a82235ce904cc21
      c4c72d55
  17. Aug 20, 2020
    • George Joseph's avatar
      stream.c: Added 2 more debugging utils and added pos to stream string · d26ab7f8
      George Joseph authored
       * Added ast_stream_to_stra and ast_stream_topology_to_stra() macros
         which are shortcuts for
            ast_str_tmp(256, ast_stream_to_str(stream, &STR_TMP))
      
       * Added the stream position to the string representation of the
         stream.
      
       * Fixed some formatting in ast_stream_to_str().
      
      Change-Id: Idaf4cb0affa46d4dce58a73a111f35435331cc4b
      d26ab7f8
  18. Aug 18, 2020
    • George Joseph's avatar
      ACN: Changes specific to the core · 6faf7630
      George Joseph authored
      Allow passing a topology from the called channel back to the
      calling channel.
      
       * Added a new function ast_queue_answer() that accepts a stream
         topology and queues an ANSWER CONTROL frame with it as the
         data.  This allows the called channel to indicate its resolved
         topology.
      
       * Added a new virtual function to the channel tech structure
         answer_with_stream_topology() that allows the calling channel
         to receive the called channel's topology.  Added
         ast_raw_answer_with_stream_topology() that invokes that virtual
         function.
      
       * Modified app_dial.c and features.c to grab the topology from the
         ANSWER frame queued by the answering channel and send it to
         the calling channel with ast_raw_answer_with_stream_topology().
      
       * Modified frame.c to automatically cleanup the reference
         to the topology on ANSWER frames.
      
      Added a few debugging messages to stream.c.
      
      Change-Id: I0115d2ed68d6bae0f87e85abcf16c771bdaf992c
      6faf7630
  19. Aug 10, 2020
    • Sean Bright's avatar
      vector.h: Fix implementation of AST_VECTOR_COMPACT() for empty vectors · da8a617d
      Sean Bright authored
      The assumed behavior of realloc() - that it was effectively a free() if
      its second argument was 0 - is Linux specific behavior and is not
      guaranteed by either POSIX or the C specification.
      
      Instead, if we want to resize a vector to 0, do it explicitly.
      
      Change-Id: Ife31d4b510ebab41cb5477fdc7ea4e3138ca8b4f
      da8a617d
  20. Aug 06, 2020
    • Ben Ford's avatar
      utils.c: NULL terminate ast_base64decode_string. · 769a9611
      Ben Ford authored
      With the addition of STIR/SHAKEN, the function ast_base64decode_string
      was added for convenience since there is a lot of converting done during
      the STIR/SHAKEN process. This function returned the decoded string for
      you, but did not NULL terminate it, causing some issues (specifically
      with MALLOC_DEBUG). Now, the returned string is NULL terminated, and the
      documentation has been updated to reflect this.
      
      Change-Id: Icdd7d05b323b0c47ff6ed43492937a03641bdcf5
      769a9611
    • George Joseph's avatar
      ACN: Configuration renaming for pjsip endpoint · 802aa97f
      George Joseph authored
      This change renames the codec preference endpoint options.
      incoming_offer_codec_prefs becomes codec_prefs_incoming_offer
      to keep the options together when showing an endpoint.
      
      Change-Id: I6202965b4723777f22a83afcbbafcdafb1d11c8d
      802aa97f
  21. Jul 28, 2020
    • Sean Bright's avatar
      utf8.c: Add UTF-8 validation and utility functions · d9ae902f
      Sean Bright authored
      There are various places in Asterisk - specifically in regards to
      database integration - where having some kind of UTF-8 validation would
      be beneficial. This patch adds:
      
      * Functions to validate that a given string contains only valid UTF-8
        sequences.
      
      * A function to copy a string (similar to ast_copy_string) stopping when
        an invalid UTF-8 sequence is encountered.
      
      * A UTF-8 validator that allows for progressive validation.
      
      All of this is based on the excellent UTF-8 decoder by Björn Höhrmann.
      More information is available here:
      
          https://bjoern.hoehrmann.de/utf-8/decoder/dfa/
      
      The API was written in such a way that should allow us to replace the
      implementation later should we determine that we need something more
      comprehensive.
      
      Change-Id: I3555d787a79e7c780a7800cd26e0b5056368abf9
      d9ae902f
  22. Jul 24, 2020
  23. Jul 10, 2020
    • Ben Ford's avatar
      res_stir_shaken: Add stir_shaken option and general improvements. · 5fbed5af
      Ben Ford authored
      Added a new configuration option for PJSIP endpoints - stir_shaken. If
      set to yes, then STIR/SHAKEN support will be added to inbound and
      outbound INVITEs. The default is no. Alembic has been updated to include
      this option.
      
      Previously the dialplan function was not trimming the whitespace from
      the parameters it recieved. Now it does.
      
      Also added a conditional that, when TEST_FRAMEWORK is enabled, the
      timestamp in the identity header will be overlooked. This is just for
      testing, since the testsuite will rely on a SIPp scenario with a preset
      identity header to trigger the MISMATCH result.
      
      Change-Id: I43d67f1489b8c1c5729ed3ca8d71e35ddf438df1
      5fbed5af
  24. Jul 08, 2020
    • George Joseph's avatar
      ACN: Add tracing to existing code · 9bd1d686
      George Joseph authored
      Prior to making any modifications to the pjsip infrastructure
      for ACN, I've added the tracing functions to the existing code.
      This should make the final commit easier to review, but we can also
      now run a "before and after" trace.
      
      No functional changes were made with this commit.
      
      Change-Id: Ia83a1a2687ccb96f2bc8a2a3928a5214c4be775c
      9bd1d686
    • George Joseph's avatar
      ACN: res_pjsip endpoint options · 2d22e342
      George Joseph authored
      This commit adds the endpoint options required to control
      Advanced Codec Negotiation.
      
      incoming_offer_codec_prefs
      outgoing_offer_codec_prefs
      incoming_answer_codec_prefs
      outgoing_answer_codec_prefs
      
      The documentation may need tweaking and some additional edits
      added, especially for the "answer" prefs.  That'll be handled
      when things finalize.
      
      This commit is safe to merge as it doens't alter any existing
      functionality nor does it alter the previous codec negotiation
      work which may now be obsolete.
      
      Change-Id: I920ba925d7dd36430dfd2ebd9d82d23f123d0e11
      2d22e342
  25. Jul 07, 2020
    • George Joseph's avatar
      frame.c: Make debugging easier · d093e44b
      George Joseph authored
       * ast_frame_subclass2str() and ast_frame_type2str() now return
         a pointer to the buffer that was passed in instead of void.
         This makes it easier to use these functions inline in
         printf-style debugging statements.
      
       * Added many missing control frame entries in
         ast_frame_subclass2str.
      
      Change-Id: Ifd0d6578e758cd644c96d17a5383ff2128c572fc
      d093e44b
    • George Joseph's avatar
      Scope Trace: Make it easier to trace through synchronous tasks · 955b7b4f
      George Joseph authored
      Tracing through synchronous tasks was a little troublesome because
      the new thread's stack counter reset to 0.  This change allows
      a synchronous task to set its trace level to be the same as the
      thread that pushed the task.  For now, the task's level has to be
      passed in the task's data structure but a future enhancement to the
      taskprocessor subsystem could automatically set the trace level
      of the servant to be that of the caller.
      
      This doesn't really make sense for async tasks because you never
      know when they're going to run anyway.
      
      Change-Id: Ib8049c0b815063a45d8c7b0cb4e30b7b87b1d825
      955b7b4f
  26. Jul 06, 2020
    • Kevin Harwell's avatar
      manager - Add Content-Type parameter to the SendText action · cfed0ea0
      Kevin Harwell authored
      This patch allows a user of AMI to now specify the type of message
      content contained within by setting the 'Content-Type' parameter.
      
      Note, the AMI version has been bumped for this change.
      
      ASTERISK-28945 #close
      
      Change-Id: Ibb5315702532c6b954e1498beddc8855fabdf4bb
      cfed0ea0
  27. Jul 01, 2020
    • George Joseph's avatar
      Streams: Add features for Advanced Codec Negotiation · 8d1064ea
      George Joseph authored
      The Streams API becomes the home for the core ACN capabilities.
      These include...
      
       * Parsing and formatting of codec negotation preferences.
       * Resolving pending streams and topologies with those configured
         using configured preferences.
       * Utility functions for creating string representations of
         streams, topologies, and negotiation preferences.
      
      For codec negotiation preferences:
       * Added ast_stream_codec_prefs_parse() which takes a string
         representation of codec negotiation preferences, which
         may come from a pjsip endpoint for example, and populates
         a ast_stream_codec_negotiation_prefs structure.
       * Added ast_stream_codec_prefs_to_str() which does the reverse.
       * Added many functions to parse individual parameter name
         and value strings to their respectrive enum values, and the
         reverse.
      
      For streams:
       * Added ast_stream_create_resolved() which takes a "live" stream
         and resolves it with a configured stream and the negotiation
         preferences to create a new stream.
       * Added ast_stream_to_str() which create a string representation
         of a stream suitable for debug or display purposes.
      
      For topology:
       * Added ast_stream_topology_create_resolved() which takes a "live"
         topology and resolves it, stream by stream, with a configured
         topology stream and the negotiation preferences to create a new
         topology.
       * Added ast_stream_topology_to_str() which create a string
         representation of a topology suitable for debug or display
         purposes.
       * Renamed ast_format_caps_from_topology() to
         ast_stream_topology_get_formats() to be more consistent with
         the existing ast_stream_get_formats().
      
      Additional changes:
       * A new function ast_format_cap_append_names() appends the results
         to the ast_str buffer instead of replacing buffer contents.
      
      Change-Id: I2df77dedd0c72c52deb6e329effe057a8e06cd56
      8d1064ea
  28. Jun 30, 2020
    • George Joseph's avatar
      Scope Trace: Add some new tracing macros and an ast_str helper · 7440fd03
      George Joseph authored
      Created new SCOPE_ functions that don't depend on RAII_VAR.  Besides
      generating less code, the use of the explicit SCOPE_EXIT macros
      capture the line number where the scope exited.  The RAII_VAR
      versions can't do that.
      
       * SCOPE_ENTER(level, ...): Like SCOPE_TRACE but doesn't use
         RAII_VAR and therefore needs needs one of...
      
       * SCOPE_EXIT(...): Decrements the trace stack counter and optionally
         prints a message.
      
       * SCOPE_EXIT_EXPR(__expr, ...): Decrements the trace stack counter,
         optionally prints a message, then executes the expression.
         SCOPE_EXIT_EXPR(break, "My while got broken\n");
      
       * SCOPE_EXIT_RTN(, ...): Decrements the trace stack counter,
         optionally prints a message, then returns without a value.
         SCOPE_EXIT_RTN("Bye\n");
      
       * SCOPE_EXIT_RTN_VALUE(__return_value, ...): Decrements the trace
         stack counter, optionally prints a message, then returns the value
         specified.
         SCOPE_EXIT_RTN_VALUE(rc, "Returning with RC: %d\n", rc);
      
      Create an ast_str helper ast_str_tmp() that allocates a temporary
      ast_str that can be passed to a function that needs it, then frees
      it.  This makes using the above macros easier.  Example:
      
         SCOPE_ENTER(1, Format Caps 1: %s  Format Caps 2: %s\n",
             ast_str_tmp(32, ast_format_cap_get_names(cap1, &STR_TMP),
             ast_str_tmp(32, ast_format_cap_get_names(cap2, &STR_TMP));
      
      The calls to ast_str_tmp create an ast_str of the specified initial
      length which can be referenced as STR_TMP.  It then calls the
      expression, which must return a char *, ast_strdupa's it, frees
      STR_TMP, then returns the ast_strdupa'd string.  That string is
      freed when the function returns.
      
      Change-Id: I44059b20d55a889aa91440d2f8a590865998be51
      7440fd03
  29. Jun 18, 2020
    • Ben Ford's avatar
      res_stir_shaken: Add outbound INVITE support. · 12741171
      Ben Ford authored
      Integrated STIR/SHAKEN support with outgoing INVITEs. When an INVITE is
      sent, the caller ID will be checked to see if there is a certificate
      that corresponds to it. If so, that information will be retrieved and an
      Identity header will be added to the SIP message. The format is:
      
      header.payload.signature;info=<public_key_url>alg=ES256;ppt=shaken
      
      Header, payload, and signature are all BASE64 encoded. The public key
      URL is retrieved from the certificate. Currently the algorithm and ppt
      are ES256 and shaken, respectively. This message is signed and can be
      used for verification on the receiving end.
      
      Two new configuration options have been added to the certificate object:
      attestation and origid. The attestation is required and must be A, B, or
      C. origid is the origination identifier.
      
      A new utility function has been added as well that takes a string,
      allocates space, BASE64 encodes it, then returns it, eliminating the
      need to calculate the size yourself.
      
      Change-Id: I1f84d6a5839cb2ed152ef4255b380cfc2de662b4
      12741171
  30. Jun 16, 2020
    • Kevin Harwell's avatar
      pjproject: Upgrade bundled version to pjproject 2.10 · 415b55af
      Kevin Harwell authored
      This patch makes the usual necessary changes when upgrading to a new
      version pjproject. For instance, version number bump, patches removed
      from third-party, new *.md5 file added, etc..
      
      This patch also includes a change to the Asterisk pjproject Makefile to
      explicitly create the 'source/pjsip-apps/lib' directory. This directory
      is no longer there by default so needs to be added so the Asterisk
      malloc debug can be built.
      
      This patch also includes some minor changes to Asterisk that were a result
      of the upgrade. Specifically, there was a backward incompatibility change
      made in 2.10 that modified the "expires header" variable field from a
      signed to an unsigned value. This potentially effects comparison. Namely,
      those check for a value less than zero. This patch modified a few locations
      in the Asterisk code that may have been affected.
      
      Lastly, this patch adds a new macro PJSIP_MINVERSION that can be used to
      check a minimum version of pjproject at compile time.
      
      ASTERISK-28899 #close
      
      Change-Id: Iec8821c6cbbc08c369d0e3cd2f14e691b41d0c81
      415b55af
Loading