Commit Graph

33384 Commits

Author SHA1 Message Date
George Joseph
0278f5bde1 pjproject: Update bundled to 2.15.1.
This resolves a security issue where RTP ports weren't being released
causing possible resource exhaustion issues.

Resolves: #GHSA-557q-795j-wfx2
2025-08-28 13:48:08 +00:00
George Joseph
6158cc7b8e .github: Update Releaser to use SES email 2025-08-20 12:05:11 -06:00
Mike Bradeen
cc68c53af1 res_pjsip_diversion: resolve race condition between Diversion header processing and redirect
Based on the firing order of the PJSIP call-backs on a redirect, it was possible for
the Diversion header to not be included in the outgoing 181 response to the UAC and
the INVITE to the UAS.

This change moves the Diversion header processing to an earlier PJSIP callback while also
preventing the corresponding update that can cause a duplicate 181 response when processing
the header at that time.

Resolves: #1349
2025-08-11 13:58:01 +00:00
ThatTotallyRealMyth
bca984ab5f safe_asterisk: Add ownership checks for /etc/asterisk/startup.d and its files.
UpgradeNote: The safe_asterisk script now checks that, if it was run by the
root user, the /etc/asterisk/startup.d directory and all the files it contains
are owned by root.  If the checks fail, safe_asterisk will exit with an error
and Asterisk will not be started.  Additionally, the default logging
destination is now stderr instead of tty "9" which probably won't exist
in modern systems.

Resolves: #GHSA-v9q8-9j8m-5xwp
2025-07-31 14:06:22 +00:00
George Joseph
1855f2a1c0 cdr.c: Set tenantid from party_a->base instead of chan->base.
The CDR tenantid was being set in cdr_object_alloc from the channel->base
snapshot.  Since this happens at channel creation before the dialplan is even
reached, calls to `CHANNEL(tenantid)=<something>` in the dialplan were being
ignored.  Instead we now take tenantid from party_a when
cdr_object_create_public_records() is called which is after the call has
ended and all channel snapshots rebuilt.  This is exactly how accountcode
and amaflags, which can also be set in tha dialplpan, are handled.

Resolves: #1259
2025-07-22 12:55:16 +00:00
George Joseph
0109e574be .github: Reduce number of inputs to Releaser to 10.
The max number of inputs supported by GitHub is 10 so
is_security and is_hotfix were factored into a single choice
entry.
2025-07-18 11:29:31 -06:00
George Joseph
1510abcf44 .github: Add skip-cherry-pick and skip-test-builds to Releaser. 2025-07-18 11:07:39 -06:00
George Joseph
3b8012d1d8 asterisk.c: Add option to restrict shell access from remote consoles.
UserNote: A new asterisk.conf option 'disable_remote_console_shell' has
been added that, when set, will prevent remote consoles from executing
shell commands using the '!' prefix.

Resolves: #GHSA-c7p6-7mvq-8jq2
2025-05-22 14:57:29 +00:00
George Joseph
c523539d59 res_pjsip_messaging.c: Mask control characters in received From display name
Incoming SIP MESSAGEs will now have their From header's display name
sanitized by replacing any characters < 32 (space) with a space.

Resolves: #GHSA-2grh-7mhv-fcfw
2025-05-22 14:24:26 +00:00
George Joseph
e1a205074b res_pjsip: Backport pjsip uri utilities.
The following utilities have been backported:

ast_sip_is_uri_sip_sips
ast_sip_is_allowed_uri
ast_sip_pjsip_uri_get_username
ast_sip_pjsip_uri_get_hostname
ast_sip_pjsip_uri_get_other_param

They were originally included in the commit for supporting TEL uris.
Support for TEL uris is NOT included here however.
2025-03-25 16:26:49 -06:00
George Joseph
fb966116fa build_tools: Backport from 18
There are several build fixes that never made it into certified/18.9.
Unfortunately the commits that contained the fixes also contained other
stuff that won't cherry-pick into cert so the build files had to be
just copied from 18.
2025-03-25 16:08:49 -06:00
Sean Bright
47c498bc72 chan_sip.c: Fix __sip_reliable_xmit build error
Fixes #954
2025-03-25 16:05:48 -06:00
Sean Bright
0b0f284684 chan_dahdi.c: Resolve a format-truncation build warning.
With gcc (Ubuntu 11.2.0-19ubuntu1) 11.2.0:

> chan_dahdi.c:4129:18: error: ‘%s’ directive output may be truncated
>   writing up to 255 bytes into a region of size between 242 and 252
>   [-Werror=format-truncation=]

This removes the error-prone sizeof(...) calculations in favor of just
doubling the size of the base buffer.

Change-Id: I2d276785286730d3d5d0a921bcea2e065dbf27c5
2025-03-25 15:39:38 -06:00
Sean Bright
ed12e22ad9 xml.c: Update deprecated libxml2 API usage.
Two functions are deprecated as of libxml2 2.12:

  * xmlSubstituteEntitiesDefault
  * xmlParseMemory

So we update those with supported API.

Additionally, `res_calendar_caldav` has been updated to use libxml2's
xmlreader API instead of the SAX2 API which has always felt a little
hacky (see deleted comment block in `res_calendar_caldav.c`).

The xmlreader API has been around since libxml2 2.5.0 which was
released in 2003.

Fixes #725
2025-03-25 15:39:00 -06:00
Ben Ford
53766c5a74 documentation: Update Gosub, Goto, and add new documentationtype.
Gosub and Goto were not displaying their syntax correctly on the docs
site. This change adds a new way to specify an optional context, an
optional extension, and a required priority that the xml stylesheet can
parse without having to know which optional parameters come in which
order. In Asterisk, it looks like this:

  parameter name="context" documentationtype="dialplan_context"
  parameter name="extension" documentationtype="dialplan_extension"
  parameter name="priority" documentationtype="dialplan_priority" required="true"

The stylesheet will ignore the context and extension parameters, but for
priority, it will automatically inject the following:

  [[context,]extension,]priority

This is the correct oder for applications such as Gosub and Goto.
2025-03-19 16:50:49 +00:00
George Joseph
7b54359793 README.md: Updates and Fixes
* Outdated information has been removed.
* New links added.
* Placeholder added for link to change logs.

Going forward, the release process will create HTML versions of the README
and change log and will update the link in the README to the current
change log for the branch...

* In the development branches, the link will always point to the current
  release on GitHub.
* In the "releases/*" branches and the tarballs, the link will point to the
  ChangeLogs/ChangeLog-<version>.html file in the source directory.
* On the downloads website, the link will point to the
  ChangeLog-<version>.html file in the same directory.

Resolves: #1131
2025-03-13 13:15:03 +00:00
Shyju Kanaprath
eca57e71fb 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
2025-03-11 09:42:10 -06:00
Naveen Albert
dc7b14dc88 general: Fix broken links.
This fixes a number of broken links throughout the
tree, mostly caused by wiki.asterisk.org being replaced
with docs.asterisk.org, which should eliminate the
need for sporadic fixes as in f28047db36.

Resolves: #430
2025-03-11 09:41:43 -06:00
Marcel Wagner
bd5cd70c56 documentation: Add information on running install_prereq script in readme
Adding information in the readme about running the install_preqreq script to install components that the ./configure script might indicate as missing.

ASTERISK-29976 #close

Change-Id: Ic287b46300168729838bddd8f9265e98fc22bce6
2025-03-11 09:41:28 -06:00
George Joseph
8f16bf9c8a .github: Change concurrency group ids so they're unique.
GitHub strikes again.  Apparently the github.ref context variable only
contains the PR number if the workflow is triggered by "pull_request" so
since we just changed the trigger to "pull_request_target" the variable
no longer contains the PR number and is therefore not unique and can't be
used as a concurrency group id.  We now use
`github.triggering_actor-github.head_ref`.
2025-02-20 10:45:13 -07:00
George Joseph
bff012d32a .github: Refactor Releaser to use reusable workflow 2025-02-16 16:30:35 -07:00
George Joseph
5f4a828056 .github: Change branch of reusable workflows to main. 2025-02-16 16:25:11 -07:00
George Joseph
c2c7d64538 .github: Refactor to use pull_request_target trigger.
After careful review, we believe we can now use the "pull_request_target"
workflow trigger instead of "pull_request" which required a separate
privliged workflow to add labels and comments to PRs when they are submitted
or updated.  This allows us to greatly streamline our workflows and remove
unneeded ones.

* The OnPRChanged workflow was...
  * Renamed to OnPRCheck
  * Changed to trigger on pull_request_target and the "recheckpr" label.
  * Changed to simply call reusable workflows in asterisk-ci-actions.
  * Changed to use better concurrency groups.
* The OnPRCPCheck and OnPRMergeApproved workflows were also...
  * Changed to simply call reusable workflows in asterisk-ci-actions.
  * Changed to use better concurrency groups.
* The NightlyTest and CreateDocs were also tweaked
2025-02-16 12:19:51 -07:00
George Joseph
f5f50b29e6 .github: Remove concurrency check in on-labelled workflows.
Apparently you can't use `${{ github.event.number }}` in a concurrency
block in a job that calls a reusable workflow. :(
2025-02-11 14:01:50 -07:00
George Joseph
d83b5be7dd .github: Move PRChanged,PRChangedPriv,PRCPCheck,PRReCheck,PRMerge logic.
Moved to asterisk-ci-actions reusable workflows.
2025-02-11 11:28:03 -07:00
George Joseph
3356a52fa0 .github: OnPRCherryPickTest,OnPRStateChanged,OnPRRecheck: Add job summaries.
...and refactor environment variables.
2025-02-10 13:20:21 -07:00
George Joseph
bd163881d4 .github: Clean up CreateDocs 2025-02-10 13:20:19 -07:00
Joshua C. Colp
eb3ee8bca4 LICENSE: Update company name, email, and address. 2025-01-23 15:40:29 +00:00
George Joseph
b4d8170101 README.md, asterisk.c: Update Copyright Dates 2025-01-23 13:34:26 +00:00
Sean Bright
27cc5f5071 manager.c: Rename restrictedFile to is_restricted_file.
Also correct the spelling of 'privileges.'
2025-01-10 18:09:23 +00:00
Ben Ford
5209eeaeb0 manager.c: Restrict ListCategories to the configuration directory.
When using the ListCategories AMI action, it was possible to traverse
upwards through the directories to files outside of the configured
configuration directory. This action is now restricted to the configured
directory and an error will now be returned if the specified file is
outside of this limitation.

Resolves: #GHSA-33x6-fj46-6rfh

UserNote: The ListCategories AMI action now restricts files to the
configured configuration directory.
2025-01-09 19:05:11 +00:00
George Joseph
ff94f597c0 .github: Set exit 0 in CherryPick and Recheck workflow Cleanup steps 2025-01-05 10:38:01 -07:00
George Joseph
d80361d6de gcc14: Fix issues caught by gcc 14
* reqresp_parser.c: Fix misuse of "static" with linked list definitions
* test_message.c: Fix segfaults caused by passing NULL as an sprintf fmt
2025-01-03 23:27:51 +00:00
George Joseph
bfce4ed473 .github: Change the run name for OnPRStateChangedPriv 2024-12-18 08:19:47 -07:00
George Joseph
b14fe81a4f res_pjsip: Change suppress_moh_on_sendonly to OPT_BOOL_T
The suppress_moh_on_sendonly endpoint option should have been
defined as OPT_BOOL_T in pjsip_configuration.c and AST_BOOL_VALUES
in the alembic script instead of OPT_YESNO_T and YESNO_VALUES.

Also updated contrib/ast-db-manage/README.md to indicate that
AST_BOOL_VALUES should always be used and provided an example.

Resolves: #995
2024-11-18 16:29:49 +00:00
George Joseph
1eb7d5258b res_pjsip: Add new endpoint option "suppress_moh_on_sendonly"
Normally, when one party in a call sends Asterisk an SDP with
a "sendonly" or "inactive" attribute it means "hold" and causes
Asterisk to start playing MOH back to the other party. This can be
problematic if it happens at certain times, such as in a 183
Progress message, because the MOH will replace any early media you
may be playing to the calling party. If you set this option
to "yes" on an endpoint and the endpoint receives an SDP
with "sendonly" or "inactive", Asterisk will NOT play MOH back to
the other party.

Resolves: #979

UserNote: The new "suppress_moh_on_sendonly" endpoint option
can be used to prevent playing MOH back to a caller if the remote
end sends "sendonly" or "inactive" (hold) to Asterisk in an SDP.
2024-11-13 16:05:35 +00:00
George Joseph
5a335b880d res_pjsip: Move tenantid to end of ast_sip_endpoint
The tenantid field was originally added to the ast_sip_endpoint
structure at the end of the AST_DECLARE_STRING_FIELDS block.  This
caused everything after it in the structure to move down in memory
and break ABI compatibility.  It's now at the end of the structure
as an AST_STRING_FIELD_EXTENDED.  Given the number of string fields
in the structure now, the initial string field allocation was
also increased from 64 to 128 bytes.

Resolves: #982
2024-11-12 20:16:37 +00:00
Ben Ford
47ce55885b app_mixmonitor: Add 'D' option for dual-channel audio.
Adds the 'D' option to app_mixmonitor that interleaves the input and
output frames of the channel being recorded in the monitor output frame.
This allows for two streams in the recording: the transmitted audio and
the received audio. The 't' and 'r' options are compatible with this.

Fixes: #945

UserNote: The MixMonitor application now has a new 'D' option which
interleaves the recorded audio in the output frames. This allows for
stereo recording output with one channel being the transmitted audio and
the other being the received audio. The 't' and 't' options are
compatible with this.
2024-11-04 20:09:27 +00:00
George Joseph
69a2bc15b5 .github: Redirect NightlyAdmin to AsteriskNightlyAdmin 2024-11-01 07:55:38 -06:00
George Joseph
3b51b1b294 .github: NightlyAdmin now calls external CloseStaleIssuesAndPRs 2024-11-01 07:53:42 -06:00
George Joseph
eecc0469c1 core_unreal.c: Fix memory leak in ast_unreal_new_channels()
When the channel tech is multistream capable, the reference to
chan_topology was passed to the new channel.  When the channel tech
isn't multistream capable, the reference to chan_topology was never
released.  "Local" channels are multistream capable so it didn't
affect them but the confbridge "CBAnn" and the bridge_media
"Recorder" channels are not so they caused a leak every time one
of them was created.

Also added tracing to ast_stream_topology_alloc() and
stream_topology_destroy() to assist with debugging.

Resolves: #938
2024-10-17 15:17:39 +00:00
George Joseph
cb2b263756 geolocation.sample.conf: Fix comment marker at end of file
Resolves: #937
2024-10-10 13:06:02 +00:00
George Joseph
b53034cf41 manager.c: Add unit test for Originate app and appdata permissions
This unit test checks that dialplan apps and app data specified
as parameters for the Originate action are allowed with the
permissions the user has.
2024-10-08 13:40:03 +00:00
Sean Bright
74df82e71c alembic: Drop redundant voicemail_messages index.
The `voicemail_messages_dir` index is a left prefix of the table's
primary key and therefore unnecessary.
2024-10-01 15:44:52 +00:00
Mike Bradeen
96d20e92bf 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
2024-10-01 08:57:14 -06:00
Sean Bright
8bdc2304bb res_pjsip_pubsub: Persist subscription 'generator_data' in sorcery
Fixes #895
2024-09-25 16:51:20 +00:00
George Joseph
9f73bba6f4 Fix application references to Background
The app is actually named "BackGround" but several references
in XML documentation were spelled "Background" with the lower
case "g".  This was causing documentation links to return
"not found" messages.
2024-09-25 16:32:26 +00:00
George Joseph
1892234069 .github: Fix realtime param on Weekly and Nightly tests and...
Rename the "Cleanup" job in the cherry-pick and recheck jobs
to "Summary".
2024-09-23 08:26:10 -06:00
George Joseph
c9450b49f5 .github: Add WeeklyTests and make Nightlies Monday-Saturday
...and add "realtime" option.
2024-09-20 09:28:48 -06:00
George Joseph
a444430a76 .github: Changes required to use cached builds and shorten names 2024-09-18 08:06:30 -06:00