Commit Graph

33767 Commits

Author SHA1 Message Date
George Joseph 3127baec78 SECURITY.md: Update with correct documentation URL
(cherry picked from commit d10d4d9ddd)
2024-01-12 18:29:19 +00:00
Naveen Albert 4d928ee975 func_lock: Add missing see-also refs to documentation.
Resolves: #423
(cherry picked from commit 12b353eae0)
2024-01-12 18:29:19 +00:00
Matthew Fredrickson eac9ad69a8 app_followme.c: Grab reference on nativeformats before using it
Fixes a crash due to a lack of proper reference on the nativeformats
object before passing it into ast_request().  Also found potentially
similar use case bugs in app_chanisavail.c, bridge.c, and bridge_basic.c

Fixes: #388
(cherry picked from commit 275f7911b5)
2024-01-12 18:29:19 +00:00
Naveen Albert 52388f11f8 configs: Improve documentation for bandwidth in iax.conf.
This improves the documentation for the bandwidth setting
in iax.conf by making it clearer what the ramifications
of this setting are. It also changes the sample default
from low to high, since only high is compatible with good
codecs that people will want to use in the vast majority
of cases, and this is a common gotcha that trips up new users.

Resolves: #425
(cherry picked from commit 1f19227eab)
2024-01-12 18:29:19 +00:00
Naveen Albert 0007625ad0 logger: Add channel-based filtering.
This adds the ability to filter console
logging by channel or groups of channels.
This can be useful on busy systems where
an administrator would like to analyze certain
calls in detail. A dialplan function is also
included for the purpose of assigning a channel
to a group (e.g. by tenant, or some other metric).

ASTERISK-30483 #close

Resolves: #242

UserNote: The console log can now be filtered by
channels or groups of channels, using the
logger filter CLI commands.

(cherry picked from commit a0fc8d1b5f)
2024-01-12 18:29:19 +00:00
Sean Bright c2680f63c5 chan_iax2.c: Don't send unsanitized data to the logger.
This resolves an issue where non-printable characters could be sent to
the console/log files.

(cherry picked from commit d2afb10eed)
2024-01-12 18:29:19 +00:00
George Joseph 1d87c27cab codec_ilbc: Disable system ilbc if version >= 3.0.0
Fedora 37 started shipping ilbc 3.0.4 which we don't yet support.
configure.ac now checks the system for "libilbc < 3" instead of
just "libilbc".  If true, the system version of ilbc will be used.
If not, the version included at codecs/ilbc will be used.

Resolves: #84
(cherry picked from commit d819a6bccb)
2024-01-12 18:29:19 +00:00
Sean Bright da35b6a244 resource_channels.c: Explicit codec request when creating UnicastRTP.
Fixes #394

(cherry picked from commit a83c761c95)
2024-01-12 18:29:19 +00:00
Sean Bright fb7d39db6d doc: Update IP Quality of Service links.
Fixes #328

(cherry picked from commit 26918d05f4)
2024-01-12 18:29:19 +00:00
George Joseph 94f931a6d7 chan_pjsip: Add PJSIPHangup dialplan app and manager action
See UserNote below.

Exposed the existing Hangup AMI action in manager.c so we can use
all of it's channel search and AMI protocol handling without
duplicating that code in dialplan_functions.c.

Added a lookup function to res_pjsip.c that takes in the
string represenation of the pjsip_status_code enum and returns
the actual status code.  I.E.  ast_sip_str2rc("DECLINE") returns
603.  This allows the caller to specify PJSIPHangup(decline) in
the dialplan, just like Hangup(call_rejected).

Also extracted the XML documentation to its own file since it was
almost as large as the code itself.

UserNote: A new dialplan app PJSIPHangup and AMI action allows you
to hang up an unanswered incoming PJSIP call with a specific SIP
response code in the 400 -> 699 range.

(cherry picked from commit cd77953172)
2024-01-12 18:29:19 +00:00
Sean Bright f96d7ef7b5 chan_iax2.c: Ensure all IEs are displayed when dumping frame contents.
When IAX2 debugging was enabled (`iax2 set debug on`), if the last IE
in a frame was one that may not have any data - such as the CALLTOKEN
IE in an NEW request - it was not getting displayed.

(cherry picked from commit 0e126b3841)
2024-01-12 18:29:19 +00:00
Naveen Albert e75aebc9bc chan_dahdi: Warn if nonexistent cadence is requested.
If attempting to ring a channel using a nonexistent cadence,
emit a warning, before falling back to the default cadence.

Resolves: #409
(cherry picked from commit 4b9a4483fc)
2024-01-12 18:29:19 +00:00
Holger Hans Peter Freyther 7699af00e1 stasis: Update the snapshot after setting the redirect
The previous commit added the caller_rdnis attribute. Make it
avialble during a possible ChanngelHangupRequest.

(cherry picked from commit 56733c73b4)
2024-01-12 18:29:19 +00:00
Holger Hans Peter Freyther 28f52d35f3 ari: Provide the caller ID RDNIS for the channels
Provide the caller ID RDNIS when available. This will allow an
application to follow the redirect.

(cherry picked from commit 157389bc59)
2024-01-12 18:29:19 +00:00
Brad Smith 089ddaaaed main/utils: Implement ast_get_tid() for OpenBSD
Implement the ast_get_tid() function for OpenBSD. OpenBSD supports
getting the TID via getthrid().

(cherry picked from commit e7943dd4d9)
2024-01-12 18:29:19 +00:00
Brad Smith fb3067dd71 res_rtp_asterisk.c: Fix runtime issue with LibreSSL
The module will fail to load. Use proper function DTLS_method() with LibreSSL.

(cherry picked from commit 65d38c8104)
2024-01-12 18:29:19 +00:00
Naveen Albert 6a4fe8bdab app_directory: Add ADSI support to Directory.
This adds optional ADSI support to the Directory
application, which allows callers with ADSI CPE
to navigate the Directory system significantly
faster than is possible using the audio prompts.
Callers can see the directory name (and optionally
extension) on their screenphone and confirm or
reject a match immediately rather than waiting
for it to be spelled out, enhancing usability.

Resolves: #356
(cherry picked from commit 5046620fa3)
2024-01-12 18:29:19 +00:00
Naveen Albert b47a403b80 core_local: Fix local channel parsing with slashes.
Currently, trying to call a Local channel with a slash
in the extension will fail due to the parsing of characters
after such a slash as being dial modifiers. Additionally,
core_local is inconsistent and incomplete with
its parsing of Local dial strings in that sometimes it
uses the first slash and at other times it uses the last.

For instance, something like DAHDI/5 or PJSIP/device
is a perfectly usable extension in the dialplan, but Local
channels in particular prevent these from being called.

This creates inconsistent behavior for users, since using
a slash in an extension is perfectly acceptable, and using
a Goto to accomplish this works fine, but if specified
through a Local channel, the parsing prevents this.

This fixes this by explicitly parsing options from the
last slash in the extension, rather than the first one,
which doesn't cause an issue for extensions with slashes.

ASTERISK-30013 #close

Resolves: #248
(cherry picked from commit 2191a0d33f)
2024-01-12 18:29:19 +00:00
Mark Murawski 3b70dfcced Remove files that are no longer updated
Fixes: #360
(cherry picked from commit 2ed8daa3cb)
2024-01-12 18:29:19 +00:00
Naveen Albert b5eb5e19c3 app_voicemail: Add AMI event for mailbox PIN changes.
This adds an AMI event that is emitted whenever a
mailbox password is successfully changed, allowing
AMI consumers to process these.

UserNote: The VoicemailPasswordChange event is
now emitted whenever a mailbox password is updated,
containing the mailbox information and the new
password.

Resolves: #398
(cherry picked from commit cf9d7fa9f6)
2024-01-12 18:29:19 +00:00
Sean Bright 3ded0c95fc app_queue.c: Emit unpause reason with PauseQueueMember event.
Fixes #395

(cherry picked from commit fb937d1d89)
2024-01-12 18:29:19 +00:00
George Joseph e2f246c067 bridge_simple: Suppress unchanged topology change requests
In simple_bridge_join, we were sending topology change requests
even when the new and old topologies were the same.  In some
circumstances, this can cause unnecessary re-invites and even
a re-invite flood.  We now suppress those.

Resolves: #384
(cherry picked from commit f301d4559e)
2024-01-12 18:29:19 +00:00
Naveen Albert 120dbba2b3 res_pjsip: Include cipher limit in config error message.
If too many ciphers are specified in the PJSIP config,
include the maximum number of ciphers that may be
specified in the user-facing error message.

Resolves: #396
(cherry picked from commit 8d9d0d3738)
2024-01-12 18:29:19 +00:00
Mike Bradeen 0b4427d621 res_speech: allow speech to translate input channel
* Allow res_speech to translate the input channel if the
  format is translatable to a format suppored by the
  speech provider.

Resolves: #129

UserNote: res_speech now supports translation of an input channel
to a format supported by the speech provider, provided a translation
path is available between the source format and provider capabilites.

(cherry picked from commit c3e2bff36e)
2024-01-12 18:29:19 +00:00
Sean Bright ea74f942ce res_rtp_asterisk.c: Fix memory leak in ephemeral certificate creation.
Fixes #386

(cherry picked from commit deeb1acffe)
2024-01-12 18:29:19 +00:00
Sean Bright 58f78d2d0e res_pjsip_dtmf_info.c: Add 'INFO' to Allow header.
Fixes #376

(cherry picked from commit d4e4942cf5)
2024-01-12 18:29:19 +00:00
George Joseph 027c748e57 api.wiki.mustache: Fix indentation in generated markdown
The '*' list indicator for default values and allowable values for
path, query and POST parameters need to be indented 4 spaces
instead of 2.

Should resolve issue 38 in the documentation repo.

(cherry picked from commit b619b64137)
2024-01-12 18:29:19 +00:00
Sean Bright 93697458a6 pjsip_configuration.c: Disable DTLS renegotiation if WebRTC is enabled.
Per RFC8827:

    Implementations MUST NOT implement DTLS renegotiation and MUST
    reject it with a "no_renegotiation" alert if offered.

So we disable it when webrtc=yes is set.

Fixes #378

UpgradeNote: The dtls_rekey will be disabled if webrtc support is
requested on an endpoint. A warning will also be emitted.

(cherry picked from commit 9d329da346)
2024-01-12 18:29:19 +00:00
Samuel Olaechea 59181860ec configs: Fix typo in pjsip.conf.sample.
(cherry picked from commit ebc78a83be)
2024-01-12 18:29:19 +00:00
George Joseph e52175341e res_pjsip_exten_state,res_pjsip_mwi: Allow unload on shutdown
Commit f66f77f last year prevents the res_pjsip_exten_state and
res_pjsip_mwi modules from unloading due to possible pjproject
asserts if the modules are reloaded. A side effect of the
implementation is that the taskprocessors these modules use aren't
being released. When asterisk is doing a graceful shutdown, it
waits AST_TASKPROCESSOR_SHUTDOWN_MAX_WAIT seconds for all
taskprocessors to stop but since those 2 modules don't release
theirs, the shutdown hangs for that amount of time.

This change allows the modules to be unloaded and their resources to
be released when ast_shutdown_final is true.

Resolves: #379
(cherry picked from commit 9efc4bdfbc)
2024-01-12 18:29:19 +00:00
sungtae kim faf046ea86 res_pjsip: Expanding PJSIP endpoint ID and relevant resource length to 255 characters
This commit introduces an extension to the endpoint and relevant
resource sizes for PJSIP, transitioning from its current 40-character
constraint to a more versatile 255-character capacity. This enhancement
significantly overcomes limitations related to domain qualification and
practical usage, ultimately delivering improved functionality. In
addition, it includes adjustments to accommodate the expanded realm size
within the ARI, specifically enhancing the maximum realm length.

Resolves: #345

UserNote: With this update, the PJSIP realm lengths have been extended
to support up to 255 characters.

UpgradeNote: As part of this update, the maximum allowable length
for PJSIP endpoints and relevant resources has been increased from
40 to 255 characters. To take advantage of this enhancement, it is
recommended to run the necessary procedures (e.g., Alembic) to
update your schemas.

(cherry picked from commit f89e56c178)
2024-01-12 18:29:19 +00:00
George Joseph 95656c409d .github: PRSubmitActions: Fix adding reviewers to PR
(cherry picked from commit be1e83a6ac)
2024-01-12 18:29:19 +00:00
George Joseph 13f2d126fd .github: New PR Submit workflows
The workflows that get triggered when PRs are submitted or updated
have been replaced with ones that are more secure and have
a higher level of parallelism.

(cherry picked from commit 289aa1840e)
2024-01-12 18:29:19 +00:00
George Joseph 2cb140f801 .github: New PR Submit workflows
The workflows that get triggered when PRs are submitted or updated
have been replaced with ones that are more secure and have
a higher level of parallelism.

(cherry picked from commit 0c1c6e9ada)
2024-01-12 18:29:19 +00:00
Mike Bradeen 0f2eb00a52 res_stasis: signal when new command is queued
res_statsis's app loop sleeps for up to .2s waiting on input
to a channel before re-checking the command queue. This can
cause delays between channel setup and bridge.

This change is to send a SIGURG on the sleeping thread when
a new command is enqueued. This exits the sleeping thread out
of the ast_waitfor() call triggering the new command being
processed on the channel immediately.

Resolves: #362

UserNote: Call setup times should be significantly improved
when using ARI.

(cherry picked from commit 79220e3f0c)
2024-01-12 18:29:19 +00:00
Holger Hans Peter Freyther 1f7e9bfad5 ari/stasis: Indicate progress before playback on a bridge
Make it possible to start a playback and the calling party
to receive audio on a bridge before the call is connected.

Model the implementation after play_on_channel and deliver a
AST_CONTROL_PROGRESS before starting the playback.

For a PJSIP channel this will result in sending a SIP 183
Session Progress.

(cherry picked from commit 1171dcee02)
2024-01-12 18:29:18 +00:00
Sean Bright d7a01afa50 func_curl.c: Ensure channel is locked when manipulating datastores.
(cherry picked from commit acb2348f90)
2024-01-12 18:29:18 +00:00
George Joseph fd487b48a3 .github: Fix job prereqs in PROpenedUpdated
(cherry picked from commit 20398e8e95)
2024-01-12 18:29:18 +00:00
George Joseph e1ce35c3f5 .github: Block PR tests until approved
(cherry picked from commit e9abf11a26)
2024-01-12 18:29:18 +00:00
Joshua C. Colp b7cc7e804b Update config.yml
(cherry picked from commit ef7b0f4c3b)
2024-01-12 18:29:18 +00:00
George Joseph f0edab9f3e logger.h: Add ability to change the prefix on SCOPE_TRACE output
You can now define the _TRACE_PREFIX_ macro to change the
default trace line prefix of "file:line function" to
something else.  Full documentation in logger.h.

(cherry picked from commit b52e07ee1b)
2024-01-12 18:29:18 +00:00
George Joseph 393d8cb947 Add libjwt to third-party
The current STIR/SHAKEN implementation is not currently usable due
to encryption issues. Rather than trying to futz with OpenSSL and
the the current code, we can take advantage of the existing
capabilities of libjwt but we first need to add it to the
third-party infrastructure already in place for jansson and
pjproject.

A few tweaks were also made to the third-party infrastructure as
a whole.  The jansson "dest" install directory was renamed "dist"
to better match convention, and the third-party Makefile was updated
to clean all product directories not just the ones currently in
use.

Resolves: #349
(cherry picked from commit a9d4175e1d)
2024-01-12 18:29:18 +00:00
Mike Bradeen 0df2848147 res_pjsip: update qualify_timeout documentation with DNS note
The documentation on qualify_timeout does not explicitly state that the timeout
includes any time required to perform any needed DNS queries on the endpoint.

If the OPTIONS response is delayed due to the DNS query, it can still render an
endpoint as Unreachable if the net time is enough for qualify_timeout to expire.

Resolves: #352
(cherry picked from commit 933490b758)
2024-01-12 18:29:18 +00:00
Naveen Albert c06fd10f0a chan_dahdi: Clarify scope of callgroup/pickupgroup.
Internally, chan_dahdi only applies callgroup and
pickupgroup to FXO signalled channels, but this is
not documented anywhere. This is now documented in
the sample config, and a warning is emitted if a
user tries configuring these settings for channel
types that do not support these settings, since they
will not have any effect.

Resolves: #294
(cherry picked from commit 945babf25c)
2024-01-12 18:29:18 +00:00
Bastian Triller 7a1208410a func_json: Fix crashes for some types
This commit fixes crashes in JSON_DECODE() for types null, true, false
and real numbers.

In addition it ensures that a path is not deeper than 32 levels.

Also allow root object to be an array.

Add unit tests for above cases.

(cherry picked from commit e6d5b8d8cf)
2024-01-12 18:29:18 +00:00
Mike Bradeen c47a386cf2 res_speech_aeap: add aeap error handling
res_speech_aeap previously did not register an error handler
with aeap, so it was not notified of a disconnect. This resulted
in SpeechBackground never exiting upon a websocket disconnect.

Resolves: #303
(cherry picked from commit 8c934fb7ed)
2024-01-12 18:29:18 +00:00
Naveen Albert 0a834c8d75 app_voicemail: Disable ADSI if unavailable.
If ADSI is available on a channel, app_voicemail will repeatedly
try to use ADSI, even if there is no CPE that supports it. This
leads to many unnecessary delays during the session. If ADSI is
available but ADSI setup fails, we now disable it to prevent
further attempts to use ADSI during the session.

Resolves: #354
(cherry picked from commit c04923fcda)
2024-01-12 18:29:18 +00:00
Eduardo 7a2305a08b codec_builtin: Use multiples of 20 for maximum_ms
Some providers require a multiple of 20 for the maxptime or fail to complete calls,
e.g. Vivo in Brazil. To increase compatibility, only multiples of 20 are now used.

Resolves: #260
(cherry picked from commit 11d87713eb)
2024-01-12 18:29:18 +00:00
George Joseph 9afa54b3b3 lock.c: Separate DETECT_DEADLOCKS from DEBUG_THREADS
Previously, DETECT_DEADLOCKS depended on DEBUG_THREADS.
Unfortunately, DEBUG_THREADS adds a lot of lock tracking overhead
to all of the lock lifecycle calls whereas DETECT_DEADLOCKS just
causes the lock calls to loop over trylock in 200us intervals until
the lock is obtained and spits out log messages if it takes more
than 5 seconds.  From a code perspective, the only reason they were
tied together was for logging.  So... The ifdefs in lock.c were
refactored to allow DETECT_DEADLOCKS to be enabled without
also enabling DEBUG_THREADS.

Resolves: #321

UserNote: You no longer need to select DEBUG_THREADS to use
DETECT_DEADLOCKS.  This removes a significant amount of overhead
if you just want to detect possible deadlocks vs needing full
lock tracing.

(cherry picked from commit 7e2243f9e1)
2024-01-12 18:29:18 +00:00
George Joseph 97674e1d20 asterisk.c: Use the euid's home directory to read/write cli history
The CLI .asterisk_history file is read from/written to the directory
specified by the HOME environment variable. If the root user starts
asterisk with the -U/-G options, or with runuser/rungroup set in
asterisk.conf, the asterisk process is started as root but then it
calls setuid/setgid to set the new user/group. This does NOT reset
the HOME environment variable to the new user's home directory
though so it's still left as "/root". In this case, the new user
will almost certainly NOT have access to read from or write to the
history file.

* Added function process_histfile() which calls
  getpwuid(geteuid()) and uses pw->dir as the home directory
  instead of the HOME environment variable.
* ast_el_read_default_histfile() and ast_el_write_default_histfile()
  have been modified to use the new process_histfile()
  function.

Resolves: #337
(cherry picked from commit 07cf37531a)
2024-01-12 18:29:18 +00:00