Commit Graph

33831 Commits

Author SHA1 Message Date
Asterisk Development Team ced56f2ff0 Update for 18.22.0 2024-03-18 13:18:36 +00:00
Asterisk Development Team 8377116721 Update for 18.22.0-rc2 2024-03-11 17:17:02 +00:00
George Joseph 0931795620 res_pjsip_stir_shaken.c: Add checks for missing parameters
* Added checks for missing session, session->channel and rdata
  in stir_shaken_incoming_request.

* Added checks for missing session, session->channel and tdata
  in stir_shaken_outgoing_request.

Resolves: #645
2024-03-11 11:07:00 -06:00
Asterisk Development Team 03e2659375 Update for 18.22.0-rc1 2024-03-07 14:16:50 +00:00
Naveen Albert 74bf9821a3 app_dial: Add dial time for progress/ringing.
Add a timeout option to control the amount of time
to wait if no early media is received before giving
up. This allows aborting early if the destination
is not being responsive.

Resolves: #588

UserNote: The timeout argument to Dial now allows
specifying the maximum amount of time to dial if
early media is not received.

(cherry picked from commit 17d6a08beb)
2024-03-07 14:16:39 +00:00
Naveen Albert aacf779b32 app_voicemail: Properly reinitialize config after unit tests.
Most app_voicemail unit tests were not properly cleaning up
after themselves after running. This led to test mailboxes
lingering around in the system. It also meant that if any
unit tests in app_voicemail that create mailboxes were executed
and the module was not unloaded/loaded again prior to running
the test_voicemail_vm_info unit test, Asterisk would segfault
due to an attempt to copy a NULL string.

The load_config test did actually have logic to reinitialize
the config after the test. However, this did not work in practice
since load_config() would not reload the config since voicemail.conf
had not changed during the test; thus, additional logic has been
added to ensure that voicemail.conf is truly reloaded, after any
unit tests which modify the users list.

This prevents the SEGV due to invalid mailboxes lingering around,
and also ensures that the system state is restored to what it was
prior to the tests running.

Resolves: #629
(cherry picked from commit 564d22acc6)
2024-03-07 14:16:39 +00:00
Shaaah 742440029c app_queue.c : fix "queue add member" usage string
Fixing bracket placement in the "queue add member" cli usage string.

(cherry picked from commit 157dff87b3)
2024-03-07 14:16:38 +00:00
Naveen Albert 11d7b9d224 app_voicemail: Allow preventing mark messages as urgent.
This adds an option to allow preventing callers from leaving
messages marked as 'urgent'.

Resolves: #619

UserNote: The leaveurgent mailbox option can now be used to
control whether callers may leave messages marked as 'Urgent'.

(cherry picked from commit 166fc3c3d0)
2024-03-07 14:16:38 +00:00
Sean Bright d271e0ba5b res_pjsip: Use consistent type for boolean columns.
This migrates the relevant schema objects from the `('yes', 'no')`
definition to the `('0', '1', 'off', 'on', 'false', 'true', 'yes', 'no')`
one.

Fixes #617

(cherry picked from commit 39199aac56)
2024-03-07 14:16:38 +00:00
George Joseph 72fc1e6b2e .github: Remove timeout-minutes from gatetests
(cherry picked from commit a6070e39ec)
2024-03-07 14:16:38 +00:00
George Joseph 0c879c691b attestation_config.c: Use ast_free instead of ast_std_free
In as_check_common_config, we were calling ast_std_free on
raw_key but raw_key was allocated with ast_malloc so it
should be freed with ast_free.

Resolves: #636
(cherry picked from commit 54464321a8)
2024-03-07 14:16:38 +00:00
George Joseph 684312b2f8 Makefile: Add stir_shaken/cache to directories created on install
The default location for the stir_shaken cache is
/var/lib/asterisk/keys/stir_shaken/cache but we were only creating
/var/lib/asterisk/keys/stir_shaken on istall.  We now create
the cache sub-directory.

Resolves: #634
(cherry picked from commit 5a734afdde)
2024-03-07 14:16:38 +00:00
George Joseph 669da8b53f .github: Pass only single GATETEST_COMMAND to AsteriskGateComposite
(cherry picked from commit 224182b898)
2024-03-07 14:16:38 +00:00
George Joseph c5f1bf2ab0 Stir/Shaken Refactor
Why do we need a refactor?

The original stir/shaken implementation was started over 3 years ago
when little was understood about practical implementation.  The
result was an implementation that wouldn't actually interoperate
with any other stir-shaken implementations.

There were also a number of stir-shaken features and RFC
requirements that were never implemented such as TNAuthList
certificate validation, sending Reason headers in SIP responses
when verification failed but we wished to continue the call, and
the ability to send Media Key(mky) grants in the Identity header
when the call involved DTLS.

Finally, there were some performance concerns around outgoing
calls and selection of the correct certificate and private key.
The configuration was keyed by an arbitrary name which meant that
for every outgoing call, we had to scan the entire list of
configured TNs to find the correct cert to use.  With only a few
TNs configured, this wasn't an issue but if you have a thousand,
it could be.

What's changed?

* Configuration objects have been refactored to be clearer about
  their uses and to fix issues.
    * The "general" object was renamed to "verification" since it
      contains parameters specific to the incoming verification
      process.  It also never handled ca_path and crl_path
      correctly.
    * A new "attestation" object was added that controls the
      outgoing attestation process.  It sets default certificates,
      keys, etc.
    * The "certificate" object was renamed to "tn" and had it's key
      change to telephone number since outgoing call attestation
      needs to look up certificates by telephone number.
    * The "profile" object had more parameters added to it that can
      override default parameters specified in the "attestation"
      and "verification" objects.
    * The "store" object was removed altogther as it was never
      implemented.

* We now use libjwt to create outgoing Identity headers and to
  parse and validate signatures on incoming Identiy headers.  Our
  previous custom implementation was much of the source of the
  interoperability issues.

* General code cleanup and refactor.
    * Moved things to better places.
    * Separated some of the complex functions to smaller ones.
    * Using context objects rather than passing tons of parameters
      in function calls.
    * Removed some complexity and unneeded encapsuation from the
      config objects.

Resolves: #351
Resolves: #46

UserNote: Asterisk's stir-shaken feature has been refactored to
correct interoperability, RFC compliance, and performance issues.
See https://docs.asterisk.org/Deployment/STIR-SHAKEN for more
information.

UpgradeNote: The stir-shaken refactor is a breaking change but since
it's not working now we don't think it matters. The
stir_shaken.conf file has changed significantly which means that
existing ones WILL need to be changed.  The stir_shaken.conf.sample
file in configs/samples/ has quite a bit more information.  This is
also an ABI breaking change since some of the existing objects
needed to be changed or removed, and new ones added.  Additionally,
if res_stir_shaken is enabled in menuselect, you'll need to either
have the development package for libjwt v1.15.3 installed or use
the --with-libjwt-bundled option with ./configure.

(cherry picked from commit 181edcc3a3)
2024-03-07 14:16:38 +00:00
Sean Bright 93eca84347 alembic: Synchronize alembic heads between supported branches.
This adds a dummy migration to 18 and 20 so that our alembic heads are
synchronized across all supported branches.

In this case the migration we are stubbing (24c12d8e9014) is:

775352ee6c
(cherry picked from commit 6c3eaba7c6)
2024-03-07 14:16:38 +00:00
Sebastian Jennen 0967234e79 translate.c: implement new direct comp table mode
The new mode lists for each codec translation the actual real cost in cpu microseconds per second translated audio.
This allows to compare the real cpu usage of translations and helps in evaluation of codec implementation changes regarding performance (regression testing).

- add new table mode
- hide the 999999 comp values, as these only indicate an issue with transcoding
- hide the 0 values, as these also do not contain any information (only indicate a multistep transcoding)

Resolves: #601
(cherry picked from commit fe623aa081)
2024-03-07 14:16:38 +00:00
Shyju Kanaprath 114f9cfd60 README.md: Removed outdated link
Removed outdated link http://www.quicknet.net from README.md

cherry-pick-to: 18
cherry-pick-to: 20
cherry-pick-to: 21
(cherry picked from commit 5e1309f89a)
2024-03-07 14:16:38 +00:00
Sean Bright 68f14664a6 strings.h: Ensure ast_str_buffer(…) returns a 0 terminated string.
If a dynamic string is created with an initial length of 0,
`ast_str_buffer(…)` will return an invalid pointer.

This was a secondary discovery when fixing #65.

(cherry picked from commit 164001b05c)
2024-03-07 14:16:38 +00:00
George Joseph d993b82375 .github: Add force_cherry_pick option to Releaser
(cherry picked from commit e62939b183)
2024-03-07 14:16:38 +00:00
George Joseph 9aef214d62 .github: Remove start_version from Releaser
(cherry picked from commit d7de14600e)
2024-03-07 14:16:38 +00:00
romryz 4e11eef81a res_rtp_asterisk.c: Correct coefficient in MOS calculation.
Media Experience Score relies on incorrect pseudo_mos variable
calculation. According to forming an opinion section of the
documentation, calculation relies on ITU-T G.107 standard:

    https://docs.asterisk.org/Deployment/Media-Experience-Score/#forming-an-opinion

ITU-T G.107 Annex B suggests to calculate MOS with a coefficient
"seven times ten to the power of negative six", 7 * 10^(-6). which
would mean 6 digits after the decimal point. Current implementation
has 7 digits after the decimal point, which downrates the calls.

Fixes: #597
(cherry picked from commit be96652612)
2024-03-07 14:16:38 +00:00
Naveen Albert d140a4c2df dsp.c: Fix and improve potentially inaccurate log message.
If ast_dsp_process is called with a codec besides slin, ulaw,
or alaw, a warning is logged that in-band DTMF is not supported,
but this message is not always appropriate or correct, because
ast_dsp_process is much more generic than just DTMF detection.

This logs a more generic message in those cases, and also improves
codec-mismatch logging throughout dsp.c by ensuring incompatible
codecs are printed out.

Resolves: #595
(cherry picked from commit c6f6d1a3ac)
2024-03-07 14:16:38 +00:00
George Joseph f3c3c5720d pjsip show channelstats: Prevent possible segfault when faxing
Under rare circumstances, it's possible for the original audio
session in the active_media_state default_session to be corrupted
instead of removed when switching to the t38/image media session
during fax negotiation.  This can cause a segfault when a "pjsip
show channelstats" attempts to print that audio media session's
rtp statistics.  In these cases, the active_media_state
topology is correctly showing only a single t38/image stream
so we now check that there's an audio stream in the topology
before attempting to use the audio media session to get the rtp
statistics.

Resolves: #592
(cherry picked from commit 1aaf9e6a1d)
2024-03-07 14:16:38 +00:00
George Joseph d9e4b080f2 Reduce startup/shutdown verbose logging
When started with a verbose level of 3, asterisk can emit over 1500
verbose message that serve no real purpose other than to fill up
logs. When asterisk shuts down, it emits another 1100 that are of
even less use. Since the testsuite runs asterisk with a verbose
level of 3, and asterisk starts and stops for every one of the 700+
tests, the number of log messages is staggering.  Besides taking up
resources, it also makes it hard to debug failing tests.

This commit changes the log level for those verbose messages to 5
instead of 3 which reduces the number of log messages to only a
handful. Of course, NOTICE, WARNING and ERROR message are
unaffected.

There's also one other minor change...
ast_context_remove_extension_callerid2() logs a DEBUG message
instead of an ERROR if the extension you're deleting doesn't exist.
The pjsip_config_wizard calls that function to clean up the config
and has been triggering that annoying error message for years.

Resolves: #582
(cherry picked from commit 57d30c17b3)
2024-03-07 14:16:38 +00:00
Naveen Albert 461411338b configure: Rerun bootstrap on modern platform.
The last time configure was run, it was run on a system that
did not enable -std=gnu11 by default, which meant that the
restrict qualifier would not be recognized on certain platforms.
This regenerates the configure files from running bootstrap.sh,
so that these should be recognized on all supported platforms.

Resolves: #586
(cherry picked from commit 72f4cf6798)
2024-03-07 14:16:38 +00:00
Ben Ford 49ff608674 Upgrade bundled pjproject to 2.14.
Fixes: #406

UserNote: Bundled pjproject has been upgraded to 2.14. For more
information on what all is included in this change, check out the
pjproject Github page: https://github.com/pjsip/pjproject/releases

(cherry picked from commit e6140eac0c)
2024-03-07 14:16:38 +00:00
cmaj f89a394658 app_speech_utils.c: Allow partial speech results.
Adds 'p' option to SpeechBackground() application.
With this option, when the app timeout is reached,
whatever the backend speech engine collected will
be returned as if it were the final, full result.
(This works for engines that make partial results.)

Resolves: #572

UserNote: The SpeechBackground dialplan application now supports a 'p'
option that will return partial results from speech engines that
provide them when a timeout occurs.

(cherry picked from commit d2de6a2158)
2024-03-07 14:16:38 +00:00
Joshua C. Colp 64e8ac3f23 utils: Make behavior of ast_strsep* match strsep.
Given the scenario of passing an empty string to the
ast_strsep functions the functions would return NULL
instead of an empty string. This is counter to how
strsep itself works.

This change alters the behavior of the functions to
match that of strsep.

Fixes: #565
(cherry picked from commit 5e09e2afeb)
2024-03-07 14:16:38 +00:00
Mike Bradeen 86b3ed84a5 app_chanspy: Add 'D' option for dual-channel audio
Adds the 'D' option to app chanspy that causes the input and output
frames of the spied channel to be interleaved in the spy output frame.
This allows the input and output of the spied channel to be decoded
separately by the receiver.

If the 'o' option is also set, the 'D' option is ignored as the
audio being spied is inherently one direction.

Fixes: #569

UserNote: The ChanSpy application now accepts the 'D' option which
will interleave the spied audio within the outgoing frames. The
purpose of this is to allow the audio to be read as a Dual channel
stream with separate incoming and outgoing audio. Setting both the
'o' option and the 'D' option and results in the 'D' option being
ignored.

(cherry picked from commit f31b981d92)
2024-03-07 14:16:38 +00:00
George Joseph ac5967ce1d .github: Update github-script to v7 and fix a rest bug
Need to update the github-script to v7 to squash deprecation
warnings.

Also fixed the API name for github.rest.pulls.requestReviewers.

(cherry picked from commit 305111e954)
2024-03-07 14:16:38 +00:00
Naveen Albert c1a495002f app_if: Fix next priority calculation.
Commit fa3922a4d2 fixed
a branching issue but "overshoots" when calculating
the next priority. This fixes that; accompanying
test suite tests have also been extended.

Resolves: #560
(cherry picked from commit aa5b9d1d9f)
2024-03-07 14:16:38 +00:00
Sean Bright 080602c6a1 res_pjsip_t38.c: Permit IPv6 SDP connection addresses.
The existing code prevented IPv6 addresses from being properly parsed.

Fixes #558

(cherry picked from commit d32852ded9)
2024-03-07 14:16:38 +00:00
Brad Smith 14120485f1 BuildSystem: Bump autotools versions on OpenBSD.
Bump up to the more commonly used and modern versions of
autoconf and automake.

(cherry picked from commit d43d15b052)
2024-03-07 14:16:38 +00:00
Brad Smith e8c32a6d6b main/utils: Simplify the FreeBSD ast_get_tid() handling
FreeBSD has had kernel threads for 20+ years.

(cherry picked from commit 75dc596843)
2024-03-07 14:16:38 +00:00
Sean Bright c9c2c575b8 res_pjsip_session.c: Correctly format SDP connection addresses.
Resolves a regression identified by @justinludwig involving the
rendering of IPv6 addresses in outgoing SDP.

Also updates `media_address` on PJSIP endpoints so that if we are able
to parse the configured value as an IP we store it in a format that we
can directly use later. Based on my reading of the code it appeared
that one could configure `media_address` as:

```
[foo]
type = endpoint
...
media_address = [2001:db8::]
```

And that value would be blindly copied into the outgoing SDP without
regard to its format.

Fixes #541

(cherry picked from commit 72523f19a9)
2024-03-07 14:16:38 +00:00
Sean Bright 9954a3160e rtp_engine.c: Correct sample rate typo for L16/44100.
Fixes #555

(cherry picked from commit 0defd65e63)
2024-03-07 14:16:38 +00:00
Naveen Albert edf7b07040 manager.c: Fix erroneous reloads in UpdateConfig.
Currently, a reload will always occur if the
Reload header is provided for the UpdateConfig
action. However, we should not be doing a reload
if the header value has a falsy value, per the
documentation, so this makes the reload behavior
consistent with the existing documentation.

Resolves: #551
(cherry picked from commit 57bb985b26)
2024-03-07 14:16:38 +00:00
Naveen Albert 454407ef5a res_calendar_icalendar: Print iCalendar error on parsing failure.
If libical fails to parse a calendar, print the error message it provdes.

Resolves: #492
(cherry picked from commit d1da985143)
2024-03-07 14:16:38 +00:00
Sean Bright 295ef9d052 app_confbridge: Don't emit warnings on valid configurations.
The numeric bridge profile options `internal_sample_rate` and
`maximum_sample_rate` are documented to accept the special values
`auto` and `none`, respectively. While these values currently work,
they also emit warnings when used which could be confusing for users.

In passing, also ensure that we only accept the documented range of
sample rate values between 8000 and 192000.

Fixes #546

(cherry picked from commit 9dd9615edf)
2024-03-07 14:16:38 +00:00
Mike Bradeen cf91d9f53d app_voicemail: add NoOp alembic script to maintain sync
Adding a NoOp alembic script for the voicemail database to maintain
version sync with other branches.

Fixes: #527
(cherry picked from commit d6c10075f8)
2024-03-07 14:16:38 +00:00
Naveen Albert a7dd513b5d chan_dahdi: Allow MWI to be manually toggled on channels.
This adds a CLI command to manually toggle the MWI status
of a channel, useful for troubleshooting or resetting
MWI devices, similar to the capabilities offered with
SIP messaging to manually control MWI status.

UserNote: The 'dahdi set mwi' now allows MWI on channels
to be manually toggled if needed for troubleshooting.

Resolves: #440
(cherry picked from commit 49ec57fc7c)
2024-03-07 14:16:38 +00:00
PeterHolik ea0cd51885 chan_rtp.c: MulticastRTP missing refcount without codec option
Fixes: #529
(cherry picked from commit 683da188c9)
2024-03-07 14:16:38 +00:00
PeterHolik ae747ba0ee chan_rtp.c: Change MulticastRTP nameing to avoid memory leak
Fixes: asterisk#536
(cherry picked from commit 9044dcc80a)
2024-03-07 14:16:38 +00:00
Naveen Albert c320c9959c func_frame_trace: Add CLI command to dump frame queue.
This adds a simple CLI command that can be used for
analyzing all frames currently queued to a channel.

A couple log messages are also adjusted to be more
useful in tracing bridging problems.

Resolves: #533
(cherry picked from commit 6b82ed819c)
2024-03-07 14:16:38 +00:00
Asterisk Development Team f2289e470b Update for 18.21.0 2024-01-25 16:17:00 +00:00
Asterisk Development Team edba366246 Update for 18.21.0-rc2 2024-01-18 16:41:20 +00:00
Naveen Albert b9373a206c logger: Fix linking regression.
Commit 008731b0a4
caused a regression by resulting in logger.xml
being compiled and linked into the asterisk
binary in lieu of logger.c on certain platforms
if Asterisk was compiled in dev mode.

To fix this, we ensure the file has a unique
name without the extension. Most existing .xml
files have been named differently from any
.c files in the same directory or did not
pose this issue.

channels/pjsip/dialplan_functions.xml does not
pose this issue but is also being renamed
to adhere to this policy.

Resolves: #539
2024-01-17 14:54:33 -07:00
Asterisk Development Team 14ba935ee1 Update for 18.21.0-rc1 2024-01-12 18:21:52 +00:00
George Joseph 67f98056da Revert "core & res_pjsip: Improve topology change handling."
This reverts commit 315eb551db.

Over the past year, we've had several reports of "topology storms"
occurring where 2 external facing channels connected by one or more
local channels and bridges will get themselves in a state where
they continually send each other topology change requests.  This
usually manifests itself in no-audio calls and a flood of
"Exceptionally long queue length" messages.  It appears that this
commit is the cause so we're reverting it for now until we can
determine a more appropriate solution.

Resolves: #530
(cherry picked from commit b71e338eea)
2024-01-12 18:21:33 +00:00
Naveen Albert efc79dba0c menuselect: Use more specific error message.
Instead of using the same error message for
missing dependencies and conflicts, be specific
about what actually went wrong.

Resolves: #520
(cherry picked from commit 494fb0b675)
2024-01-12 18:21:33 +00:00