Commit Graph

34175 Commits

Author SHA1 Message Date
Joshua Elson
2f6578925d fix: Correct default flag for tcp_keepalive_enable option
Resolves an issue where the tcp_keepalive_enable option was not properly enabled in the sample configuration due to an incorrect default flag setting.

Fixes: #1149
2025-03-13 13:13:16 +00:00
Naveen Albert
f0f220b369 config.c: Fix inconsistent pointer logic in ast_variable_update.
Commit 3cab4e7ab4 introduced a
regression by causing the wrong pointers to be used in certain
(more complex) cases. We now take care to ensure the exact
same pointers are used as before that commit, and simplify
by eliminating the unnecessary second for loop.

Resolves: #1147
2025-03-11 13:28:45 +00:00
Sean Bright
c7db162844 docs: AMI documentation fixes.
Most of this patch is adding missing PJSIP-related event
documentation, but the one functional change was adding a sorcery
to-string handler for endpoint's `redirect_method` which was not
showing up in the AMI event details or `pjsip show endpoint
<endpoint>` output.

The rest of the changes are summarized below:

* app_agent_pool.c: Typo fix Epoche -> Epoch.
* stasis_bridges.c: Add missing AttendedTransfer properties.
* stasis_channels.c: Add missing AgentLogoff properties.
* pjsip_manager.xml:
  - Add missing AorList properties.
  - Add missing AorDetail properties.
  - Add missing ContactList properties.
  - Add missing ContactStatusDetail properties.
  - Add missing EventDetail properties.
  - Add missing AuthList properties.
  - Add missing AuthDetail properties.
  - Add missing TransportDetail properties.
  - Add missing EndpointList properties.
  - Add missing IdentifyDetail properties.
* res_pjsip_registrar.c: Add missing InboundRegistrationDetail documentation.
* res_pjsip_pubsub.c:
  - Add missing ResourceListDetail documentation.
  - Add missing InboundSubscriptionDetail documentation.
  - Add missing OutboundSubscriptionDetail documentation.
* res_pjsip_outbound_registration.c: Add missing OutboundRegistrationDetail documentation.
2025-03-07 16:53:19 +00:00
Allan Nathanson
9277311f93 config.c: #include of non-existent file should not crash
Corrects a segmentation fault when a configuration file has a #include
statement that referenced a file that does not exist.

Resolves: https://github.com/asterisk/asterisk/issues/1139
2025-03-06 15:40:12 +00:00
George Joseph
1e469a5e06 manager.c: Check for restricted file in action_createconfig.
The `CreateConfig` manager action now ensures that a config file can
only be created in the AST_CONFIG_DIR unless `live_dangerously` is set.

Resolves: #1122
2025-03-06 15:04:18 +00:00
George Joseph
5470a23b48 swagger_model.py: Fix invalid escape sequence in get_list_parameter_type().
Recent python versions complain when backslashes in strings create invalid
escape sequences.  This causes issues for strings used as regex patterns like
`'^List\[(.*)\]$'` where you want the regex parser to treat `[` and `]`
as literals.  Double-backslashing is one way to fix it but simply converting
the string to a raw string `re.match(r'^List\[(.*)\]$', text)` is easier
and less error prone.
2025-03-05 21:43:02 +00:00
Maximilian Fridrich
e02de88e4e Revert "res_rtp_asterisk.c: Set Mark on rtp when timestamp skew is too big"
This reverts commit f30ad96b3f.

The original change was not RFC compliant and caused issues because it
set the RTP marker bit in cases when it shouldn't be set. See the
linked issue #1135 for a detailed explanation.

Fixes: #1135.
2025-03-03 19:29:51 +00:00
Sean Bright
9665903d4b res_rtp_asterisk.c: Use correct timeout value for T.140 RED timer.
Found while reviewing #1128
2025-03-03 14:11:59 +00:00
Luz Paz
2d7948fa48 docs: Fix typos in cdr/
Found via codespell
2025-02-20 21:49:11 +00:00
Luz Paz
d65af637ac docs: Fix various typos in channels/
Found via `codespell -q 3 -S "./CREDITS,*.po" -L abd,asent,atleast,cachable,childrens,contentn,crypted,dne,durationm,enew,exten,inout,leapyear,mye,nd,oclock,offsetp,ot,parm,parms,preceeding,pris,ptd,requestor,re-use,re-used,re-uses,ser,siz,slanguage,slin,thirdparty,varn,varns,ues`
2025-02-20 21:46:40 +00:00
Luz Paz
e3ad4cea4e docs: Fix various typos in main/
Found via `codespell -q 3 -S "./CREDITS" -L abd,asent,atleast,childrens,contentn,crypted,dne,durationm,exten,inout,leapyear,nd,oclock,offsetp,ot,parm,parms,requestor,ser,slanguage,slin,thirdparty,varn,varns,ues`
2025-02-20 21:46:35 +00:00
George Joseph
076799be15 bridging: Fix multiple bridging issues causing SEGVs and FRACKs.
Issues:

* The bridging core allowed multiple bridges to be created with the same
  unique bridgeId at the same time.  Only the last bridge created with the
  duplicate name was actually saved to the core bridges container.

* The bridging core was creating a stasis topic for the bridge and saving it
  in the bridge->topic field but not increasing its reference count.  In the
  case where two bridges were created with the same uniqueid (which is also
  the topic name), the second bridge would get the _existing_ topic the first
  bridge created.  When the first bridge was destroyed, it would take the
  topic with it so when the second bridge attempted to publish a message to
  it it either FRACKed or SEGVd.

* The bridge destructor, which also destroys the bridge topic, is run from the
  bridge manager thread not the caller's thread.  This makes it possible for
  an ARI developer to create a new one with the same uniqueid believing the
  old one was destroyed when, in fact, the old one's destructor hadn't
  completed. This could cause the new bridge to get the old one's topic just
  before the topic was destroyed.  When the new bridge attempted to publish
  a message on that topic, asterisk could either FRACK or SEGV.

* The ARI bridges resource also allowed multiple bridges to be created with
  the same uniqueid but it kept the duplicate bridges in its app_bridges
  container.  This created a situation where if you added two bridges with
  the same "bridge1" uniqueid, all operations on "bridge1" were performed on
  the first bridge created and the second was basically orphaned.  If you
  attempted to delete what you thought was the second bridge, you actually
  deleted the first one created.

Changes:

* A new API `ast_bridge_topic_exists(uniqueid)` was created to determine if
  a topic already exists for a bridge.

* `bridge_base_init()` in bridge.c and `ast_ari_bridges_create()` in
  resource_bridges.c now call `ast_bridge_topic_exists(uniqueid)` to check
  if a bridge with the requested uniqueid already exists and will fail if it
  does.

* `bridge_register()` in bridges.c now checks the core bridges container to
  make sure a bridge doesn't already exist with the requested uniqueid.
  Although most callers of `bridge_register()` will have already called
  `bridge_base_init()`, which will now fail on duplicate bridges, there
  is no guarantee of this so we must check again.

* The core bridges container allocation was changed to reject duplicate
  uniqueids instead of silently replacing an existing one. This is a "belt
  and suspenders" check.

* A global mutex was added to bridge.c to prevent concurrent calls to
  `bridge_base_init()` and `bridge_register()`.

* Even though you can no longer create multiple bridges with the same uniqueid
  at the same time, it's still possible that the bridge topic might be
  destroyed while a second bridge with the same uniqueid was trying to use
  it. To address this, the bridging core now increments the reference count
  on bridge->topic when a bridge is created and decrements it when the
  bridge is destroyed.

* `bridge_create_common()` in res_stasis.c now checks the stasis app_bridges
  container to make sure a bridge with the requested uniqueid doesn't already
  exist.  This may seem like overkill but there are so many entrypoints to
  bridge creation that we need to be safe and catch issues as soon in the
  process as possible.

* The stasis app_bridges container allocation was changed to reject duplicate
  uniqueids instead of adding them. This is a "belt and suspenders" check.

* The `bridge show all` CLI command now shows the bridge name as well as the
  bridge id.

* Response code 409 "Conflict" was added as a possible response from the ARI
  bridge create resources to signal that a bridge with the requested uniqueid
  already exists.

* Additional debugging was added to multiple bridging and stasis files.

Resolves: #211
2025-02-20 18:34:33 +00:00
George Joseph
4075d35ed3 .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:40:04 -07:00
Mike Bradeen
d63c3e80fc bridge_channel: don't set cause code on channel during bridge delete if already set
Due to a potential race condition via ARI when hanging up a channel hangup with cause
while also deleting a bridge containing that channel, the bridge delete can over-write
the hangup cause code resulting in Normal Call Clearing instead of the set value.

With this change, bridge deletion will only set the hangup code if it hasn't been
previously set.

Resolves: #1124
2025-02-19 16:46:45 +00:00
George Joseph
461e9ac304 .github: Refactor Releaser to use reusable workflow 2025-02-16 16:30:00 -07:00
George Joseph
f7573df78c .github: Change branch of reusable workflows to main. 2025-02-16 16:24:27 -07:00
George Joseph
e65bf88bcf .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:18:39 -07:00
George Joseph
8f0613f010 res_config_pgsql: Fix regression that removed dbname config.
A recent commit accidentally removed the code that sets dbname.
This commit adds it back in.

Resolves: #1119
2025-02-11 23:34:45 +00:00
George Joseph
d558818ec1 res_stir_shaken: Allow missing or anonymous CID to continue to the dialplan.
The verification check for missing or anonymous callerid was happening before
the endpoint's profile was retrieved which meant that the failure_action
parameter wasn't available.  Therefore, if verification was enabled and there
was no callerid or it was "anonymous", the call was immediately terminated
instead of giving the dialplan the ability to decide what to do with the call.

* The callerid check now happens after the verification context is created and
  the endpoint's stir_shaken_profile is available.

* The check now processes the callerid failure just as it does for other
  verification failures and respects the failure_action parameter.  If set
  to "continue" or "continue_return_reason", `STIR_SHAKEN(0,verify_result)`
  in the dialplan will return "invalid_or_no_callerid".

* If the endpoint's failure_action is "reject_request", the call will be
  rejected with `433 "Anonymity Disallowed"`.

* If the endpoint's failure_action is "continue_return_reason", the call will
  continue but a `Reason: STIR; cause=433; text="Anonymity Disallowed"`
  header will be added to the next provisional or final response.

Resolves: #1112
2025-02-11 23:33:19 +00:00
George Joseph
3e74da3224 resource_channels.c: Fix memory leak in ast_ari_channels_external_media.
Between ast_ari_channels_external_media(), external_media_rtp_udp(),
and external_media_audiosocket_tcp(), the `variables` structure being passed
around wasn't being cleaned up properly when there was a failure.

* In ast_ari_channels_external_media(), the `variables` structure is now
  defined with RAII_VAR to ensure it always gets cleaned up.

* The ast_variables_destroy() call was removed from external_media_rtp_udp().

* The ast_variables_destroy() call was removed from
  external_media_audiosocket_tcp(), its `endpoint` allocation was changed to
  to use ast_asprintf() as external_media_rtp_udp() does, and it now
  returns an error on failure.

* ast_ari_channels_external_media() now checks the new return code from
  external_media_audiosocket_tcp() and sets the appropriate error response.

Resolves: #1109
2025-02-11 23:31:21 +00:00
Holger Hans Peter Freyther
9fc631d028 ari/pjsip: Make it possible to control transfers through ARI
Introduce a ChannelTransfer event and the ability to notify progress to
ARI. Implement emitting this event from the PJSIP channel instead of
handling the transfer in Asterisk when configured.

Introduce a dialplan function to the PJSIP channel to switch between the
"core" and "ari-only" behavior.

UserNote: Call transfers on the PJSIP channel can now be controlled by
ARI. This can be enabled by using the PJSIP_TRANSFER_HANDLING(ari-only)
dialplan function.
2025-02-11 22:05:28 +00:00
George Joseph
1f1fa06f69 .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:04:35 -07:00
Sean Bright
e200f51ea4 channel.c: Remove dead AST_GENERATOR_FD code.
Nothing ever sets the `AST_GENERATOR_FD`, so this block of code will
never execute. It also is the only place where the `generate` callback
is called with the channel lock held which made it difficult to reason
about the thread safety of `ast_generator`s.

In passing, also note that `AST_AGENT_FD` isn't used either.
2025-02-11 20:38:00 +00:00
George Joseph
d55b072a93 .github: Move PRChanged,PRChangedPriv,PRCPCheck,PRReCheck,PRMerge logic.
Moved to asterisk-ci-actions reusable workflows.
2025-02-11 11:13:15 -07:00
George Joseph
7597082312 .github: OnPRCherryPickTest,OnPRStateChanged,OnPRRecheck: Add job summaries.
...and refactor environment variables.
2025-02-10 13:15:04 -07:00
George Joseph
f0852a2465 .github: Clean up CreateDocs 2025-02-10 13:13:49 -07:00
George Joseph
75840bd4a5 func_strings.c: Prevent SEGV in HASH single-argument mode.
When in single-argument mode (very rarely used), a malformation of a column
name (also very rare) could cause a NULL to be returned when retrieving the
channel variable for that column.  Passing that to strncat causes a SEGV.  We
now check for the NULL and print a warning message.

Resolves: #1101
2025-02-04 14:24:46 +00:00
Sean Bright
03f1c24674 utils: Remove libdb and astdb conversion scripts.
These were included with Asterisk 10 when we switched astdb from libdb
to sqlite3.
2025-02-03 15:10:41 +00:00
George Joseph
453ddfce19 docs: Add version information to AGI command XML elements.
This process was a bit different than the others because everything
is in the same file, there's an array that contains the command
names and their handler functions, and the last command was created
over 15 years ago.

* Dump a `git blame` of res/res_agi.c from BEFORE the handle_* prototypes
  were changed.
* Create a command <> handler function xref by parsing the the agi_command
  array.
* For each entry, grep the function definition line "static int handle_*"
  from the git blame output and capture the commit.  This will be the
  commit the command was created in.
* Do a `git tag --contains <commit> | sort -V | head -1` to get the
  tag the function was created in.
* Add a single since/version element to the command XML.  Multiple versions
  aren't supported here because the branching and tagging scheme changed
  several times in the 2000's.
2025-01-29 17:07:06 +00:00
Jeremy Lainé
bedc4328cc docs: Fix minor typo in MixMonitor AMI action
The `Options` argument was erroneously documented as lowercase
`options`.
2025-01-29 15:17:23 +00:00
Naveen Albert
5c9dd380f5 utils: Disable old style definition warnings for libdb.
Newer versions of gcc now warn about old style definitions, such
as those in libdb, which causes compilation failure with DEVMODE
enabled. Ignore these warnings for libdb.

Resolves: #1085
2025-01-29 15:16:16 +00:00
fabriziopicconi
cd60142c76 rtp.conf.sample: Correct stunaddr example. 2025-01-29 15:15:54 +00:00
George Joseph
dfc8652b55 docs: Add version information to ARI resources and methods.
* Dump a git blame of each file in rest-api/api-docs.

* Get the commit for each "resourcePath" and "httpMethod" entry.

* Find the tags for each commit (same as other processes).

* Insert a "since" array after each "resourcePath" and "httpMethod" entry.
2025-01-29 14:47:36 +00:00
George Joseph
db8ae1912d res_pjsip_authenticator_digest: Make correct error messages appear again.
When an incoming request can't be matched to an endpoint, the "artificial"
auth object is used to create a challenge to return in a 401 response and we
emit a "No matching endpoint found" log message. If the client then responds
with an Authorization header but the request still can't be matched to an
endpoint, the verification will fail and, as before, we'll create a challenge
to return in a 401 response and we emit a "No matching endpoint found" log
message.  HOWEVER, because there WAS an Authorization header and it failed
verification, we should have also been emitting a "Failed to authenticate"
log message but weren't because there was a check that short-circuited that
it if the artificial auth was used.  Since many admins use the "Failed to
authenticate" message with log parsers like fail2ban, those attempts were not
being recognized as suspicious.

Changes:

* digest_check_auth() now always emits the "Failed to authenticate" log
  message if verification of an Authorization header failed even if the
  artificial auth was used.

* The verification logic was refactored to be clearer about the handling
  of the return codes from verify().

* Comments were added clarify what return codes digest_check_auth() should
  return to the distributor and the implications of changing them.

Resolves: #1095
2025-01-29 14:34:57 +00:00
George Joseph
014994b19f alembic: Database updates required.
This commit doesn't actually change anything.  It just adds the following
upgrade notes that were omitted from the original commits.

Resolves: #1097

UpgradeNote: Two commits in this release...
'Add SHA-256 and SHA-512-256 as authentication digest algorithms'
'res_pjsip: Add new AOR option "qualify_2xx_only"'
...have modified alembic scripts for the following database tables: ps_aors,
ps_contacts, ps_auths, ps_globals. If you don't use the scripts to update
your database, reads from those tables will succeeed but inserts into the
ps_contacts table by res_pjsip_registrar will fail.
2025-01-29 14:21:01 +00:00
Sean Bright
82bef2ed90 docs: Indent <since> tags.
Also updates the 'since' of applications/functions that existed before
XML documentation was introduced (1.6.2.0).
2025-01-29 14:18:25 +00:00
George Joseph
32e6a30952 res_pjsip: Fix startup/reload memory leak in config_auth.
An issue in config_auth.c:ast_sip_auth_digest_algorithms_vector_init() was
causing double allocations for the two supported_algorithms vectors to the
tune of 915 bytes.  The leak only happens on startup and when a reload is done
and doesn't get bigger with the number of auth objects defined.

* Pre-initialized the two vectors in config_auth:auth_alloc().
* Removed the allocations in ast_sip_auth_digest_algorithms_vector_init().
* Added a note to the doc for ast_sip_auth_digest_algorithms_vector_init()
  noting that the vector passed in should be initialized and empty.
* Simplified the create_artificial_auth() function in pjsip_distributor.
* Set the vector initialization count to 0 in config_global:global_apply().
2025-01-27 17:20:23 +00:00
George Joseph
198b01c536 docs: Add version information to application and function XML elements
* Do a git blame on the embedded XML application or function element.

* From the commit hash, grab the summary line.

* Do a git log --grep <summary> to find the cherry-pick commits in all
  branches that match.

* Do a git patch-id to ensure the commits are all related and didn't get
  a false match on the summary.

* Do a git tag --contains <commit> to find the tags that contain each
  commit.

* Weed out all tags not ..0.

* Sort and discard any .0.0 and following tags where the commit
  appeared in an earlier branch.

* The result is a single tag for each branch where the application or function
  was defined.

The applications and functions defined in the following files were done by
hand because the XML was extracted from the C source file relatively recently.
* channels/pjsip/dialplan_functions_doc.xml
* main/logger_doc.xml
* main/manager_doc.xml
* res/res_geolocation/geoloc_doc.xml
* res/res_stir_shaken/stir_shaken_doc.xml
2025-01-23 18:11:58 +00:00
George Joseph
77d5550d14 docs: Add version information to manager event instance XML elements
* Do a git blame on the embedded XML managerEvent elements.

* From the commit hash, grab the summary line.

* Do a git log --grep <summary> to find the cherry-pick commits in all
  branches that match.

* Do a git patch-id to ensure the commits are all related and didn't get
  a false match on the summary.

* Do a git tag --contains <commit> to find the tags that contain each
  commit.

* Weed out all tags not ..0.

* Sort and discard any .0.0 and following tags where the commit
  appeared in an earlier branch.

* The result is a single tag for each branch where the application or function
  was defined.

The events defined in res/res_pjsip/pjsip_manager.xml were done by hand
because the XML was extracted from the C source file relatively recently.

Two bugs were fixed along the way...

* The get_documentation awk script was exiting after it processed the first
  DOCUMENTATION block it found in a file.  We have at least 1 source file
  with multiple DOCUMENTATION blocks so only the first one in them was being
  processed.  The awk script was changed to continue searching rather
  than exiting after the first block.

* Fixing the awk script revealed an issue in logger.c where the third
  DOCUMENTATION block contained a XML fragment that consisted only of
  a managerEventInstance element that wasn't wrapped in a managerEvent
  element.  Since logger_doc.xml already existed, the remaining fragments
  in logger.c were moved to it and properly organized.
2025-01-23 17:39:10 +00:00
Joshua C. Colp
53e7401f95 LICENSE: Update company name, email, and address. 2025-01-23 15:43:42 +00:00
Sean Bright
b460148163 res_prometheus.c: Set Content-Type header on /metrics response.
This should resolve the Prometheus error:

> Error scraping target: non-compliant scrape target
  sending blank Content-Type and no
  fallback_scrape_protocol specified for target.

Resolves: #1075
2025-01-23 14:22:14 +00:00
George Joseph
6384e8667c README.md, asterisk.c: Update Copyright Dates 2025-01-23 13:36:32 +00:00
George Joseph
316693ded9 docs: Add version information to configObject and configOption XML elements
Most of the configObjects and configOptions that are implemented with
ACO or Sorcery now have `<since>/<version>` elements added.  There are
probably some that the script I used didn't catch.  The version tags were
determined by the following...
 * Do a git blame on the API call that created the object or option.
 * From the commit hash, grab the summary line.
 * Do a `git log --grep <summary>` to find the cherry-pick commits in all
   branches that match.
 * Do a `git patch-id` to ensure the commits are all related and didn't get
   a false match on the summary.
 * Do a `git tag --contains <commit>` to find the tags that contain each
   commit.
 * Weed out all tags not <major>.<minor>.0.
 * Sort and discard any <major>.0.0 and following tags where the commit
   appeared in an earlier branch.
 * The result is a single tag for each branch where the API was last touched.

configObjects and configOptions elements implemented with the base
ast_config APIs were just not possible to find due to the non-deterministic
way they are accessed.

Also note that if the API call was on modified after it was added, the
version will be the one it was last modified in.

Final note:  The configObject and configOption elements were introduced in
12.0.0 so options created before then may not have any XML documentation.
2025-01-20 21:49:50 +00:00
George Joseph
ff0fb401ae res_pjsip_authenticator_digest: Fix issue with missing auth and DONT_OPTIMIZE
The return code fom digest_check_auth wasn't explicitly being initialized.
The return code also wasn't explicitly set to CHALLENGE when challenges
were sent.  When optimization was turned off (DONT_OPTIMIZE), the compiler
was setting it to "0"(CHALLENGE) which worked fine.  However, with
optimization turned on, it was setting it to "1" (SUCCESS) so if there was
no incoming Authorization header, the function was returning SUCCESS to the
distributor allowing the request to incorrectly succeed.

The return code is now initialized correctly and is now explicitly set
to CHALLENGE when we send challenges.
2025-01-17 20:32:51 +00:00
Naveen Albert
cd97f4069d ast_tls_cert: Add option to skip passphrase for CA private key.
Currently, the ast_tls_cert file is hardcoded to use the -des3 option
for 3DES encryption, and the script needs to be manually modified
to not require a passphrase. Add an option (-e) that disables
encryption of the CA private key so no passphrase is required.

Resolves: #1064
2025-01-16 17:45:49 +00:00
Naveen Albert
f6e1c163bb chan_iax2: Avoid unnecessarily backlogging non-voice frames.
Currently, when receiving an unauthenticated call, we keep track
of the negotiated format in the chosenformat, which allows us
to later create the channel using the right format. However,
this was not done for authenticated calls. This meant that in
certain circumstances, if we had not yet received a voice frame
from the peer, only certain other types of frames (e.g. text),
there were no variables containing the appropriate frame.
This led to problems in the jitterbuffer callback where we
unnecessarily bailed out of retrieving a frame from the jitterbuffer.
This was logic intentionally added in commit 73103bdcd5
in response to an earlier regression, and while this prevents
crashes, it also backlogs legitimate frames unnecessarily.

The abort logic was initially added because at this point in the
code, we did not have the negotiated format available to us.
However, it should always be available to us as a last resort
in chosenformat, so we now pull it from there if needed. This
allows us to process frames the jitterbuffer even if voicefmt
and peerfmt aren't set and still avoid the crash. The failsafe
logic is retained, but now it shouldn't be triggered anymore.

Resolves: #1054
2025-01-16 16:31:33 +00:00
Allan Nathanson
217e696288 config.c: fix #tryinclude being converted to #include on rewrite
Correct an issue in ast_config_text_file_save2() when updating configuration
files with "#tryinclude" statements. The API currently replaces "#tryinclude"
with "#include". The API also creates empty template files if the referenced
files do not exist. This change resolves these problems.

Resolves: https://github.com/asterisk/asterisk/issues/920
2025-01-16 16:12:59 +00:00
Naveen Albert
78546868f9 sig_analog: Add Last Number Redial feature.
This adds the Last Number Redial feature to
simple switch.

UserNote: Users can now redial the last number
called if the lastnumredial setting is set to yes.

Resolves: #437
2025-01-16 15:47:29 +00:00
George Joseph
114fa12f05 docs: Various XML fixes
* channels/pjsip/dialplan_functions_doc.xml: Added xmlns:xi to docs element.

* main/bucket.c: Removed XML completely since the "bucket" and "file" objects
  are internal only with no config file.

* main/named_acl.c: Fixed the configFile element name. It was "named_acl.conf"
  and should have been "acl.conf"

* res/res_geolocation/geoloc_doc.xml: Added xmlns:xi to docs element.

* res/res_http_media_cache.c: Fixed the configFile element name. It was
  "http_media_cache.conf" and should have been "res_http_media_cache.conf".
2025-01-16 15:32:54 +00:00
Sean Bright
1047291662 strings.c: Improve numeric detection in ast_strings_match().
Essentially, we were treating 1234x1234 and 1234x5678 as 'equal'
because we were able to convert the prefix of each of these strings to
the same number.

Resolves: #1028
2025-01-16 08:14:32 -07:00