## Change Log for Release asterisk-22.2.0 ### Links: - [Full ChangeLog](https://downloads.asterisk.org/pub/telephony/asterisk/releases/ChangeLog-22.2.0.md) - [GitHub Diff](https://github.com/asterisk/asterisk/compare/22.1.1...22.2.0) - [Tarball](https://downloads.asterisk.org/pub/telephony/asterisk/asterisk-22.2.0.tar.gz) - [Downloads](https://downloads.asterisk.org/pub/telephony/asterisk) ### Summary: - Commits: 53 - Commit Authors: 20 - Issues Resolved: 19 - Security Advisories Resolved: 0 ### User Notes: - #### sig_analog: Add Last Number Redial feature. Users can now redial the last number called if the lastnumredial setting is set to yes. Resolves: #437 - #### Add SHA-256 and SHA-512-256 as authentication digest algorithms The SHA-256 and SHA-512-256 algorithms are now available for authentication as both a UAS and a UAC. - #### Upgrade bundled pjproject to 2.15.1 Resolves: asterisk#1016 Bundled pjproject has been upgraded to 2.15.1. For more information visit pjproject Github page: https://github.com/pjsip/pjproject/releases/tag/2.15.1 - #### res_pjsip: Add new AOR option "qualify_2xx_only" The pjsip.conf AOR section now has a "qualify_2xx_only" option that can be set so that only 2XX responses to OPTIONS requests used to qualify a contact will mark the contact as available. - #### app_queue: allow dynamically adding a queue member in paused state. use the p option of AddQueueMember() for paused member state. Optionally, use the r(reason) option to specify a custom reason for the pause. - #### manager.c: Add Processed Call Count to CoreStatus output The current processed call count is now returned as CoreProcessedCalls from the CoreStatus AMI Action. - #### func_curl.c: Add additional CURL options for SSL requests The following new configuration options are now available in the res_curl.conf file, and the CURL() function: 'ssl_verifyhost' (CURLOPT_SSL_VERIFYHOST), 'ssl_cainfo' (CURLOPT_CAINFO), 'ssl_capath' (CURLOPT_CAPATH), 'ssl_cert' (CURLOPT_SSLCERT), 'ssl_certtype' (CURLOPT_SSLCERTTYPE), 'ssl_key' (CURLOPT_SSLKEY), 'ssl_keytype', (CURLOPT_SSLKEYTYPE) and 'ssl_keypasswd' (CURLOPT_KEYPASSWD). See the libcurl documentation for more details. - #### res_stir_shaken: Allow sending Identity headers for unknown TNs You can now set the "unknown_tn_attest_level" option in the attestation and/or profile objects in stir_shaken.conf to enable sending Identity headers for callerid TNs not explicitly configured. ### Upgrade Notes: - #### alembic: Database updates required. 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. ### Commit Authors: - Abdelkader Boudih: (3) - Alexey Khabulyak: (1) - Alexey Vasilyev: (1) - Allan Nathanson: (2) - Artem Umerov: (1) - George Joseph: (17) - Jaco Kroon: (1) - James Terhune: (1) - Joshua C. Colp: (1) - Kent: (1) - Maksim Nesterov: (1) - Maximilian Fridrich: (1) - Mike Pultz: (3) - Naveen Albert: (6) - Sean Bright: (6) - Sperl Viktor: (2) - Stanislav Abramenkov: (2) - Steffen Arntz: (1) - Tinet-Mucw: (1) - Viktor Litvinov: (1) ## Issue and Commit Detail: ### Closed Issues: - 437: [new-feature]: sig_analog: Add Last Number Redial - 851: [bug]: unable to read audiohook both side when packet lost on one side of the call - 921: [bug]: Stir-Shaken doesn’t allow B or C attestation for unknown callerid which is allowed by ATIS-1000074.v003, §5.2.4 - 927: [bug]: no audio when media source changed during the call - 948: [improvement]: Support SHA-256 algorithm on REGISTER and INVITE challenges - 993: [bug]: sig_analog: Feature Group D / E911 no longer work - 999: [bug]: Crash when setting a global variable with invalid UTF8 characters - 1007: [improvement]: Cannot dynamically add queue member in paused state from dialplan or command line - 1013: [improvement]: chan_pjsip: Send VIDUPDATE RTP frames for H.264 streams on endpoints without WebRTC - 1021: [improvement]: proper queue_log paused state when member added dynamically - 1023: [improvement]: Improve PJSIP_MEDIA_OFFER documentation - 1028: [bug]: "pjsip show endpoints" shows some identifies on endpoints that shouldn't be there - 1029: [bug]: chan_dahdi: Wrong channel state set when RINGING received - 1054: [bug]: chan_iax2: Frames unnecessarily backlogged with jitterbuffer if no voice frames have been received yet - 1058: [bug]: Asterisk fails to compile following commit 71a2e8c on Ubuntu 20.04 - 1064: [improvement]: ast_tls_script: Add option to skip passphrase for CA private key - 1075: [bug]: res_prometheus does not set Content-Type header in HTTP response - 1095: [bug]: res_pjsip missing "Failed to authenticate" log entry for unknown endpoint - 1097: [bug]: res_pjsip/pjsip_options. ODBC: Unknown column 'qualify_2xx_only' ### Commits By Author: - #### Abdelkader Boudih (3): - normalize contrib/ast-db-manage/queue_log.ini.sample - res_config_pgsql: normalize database connection option with cel and cdr by sup.. - samples: Use "asterisk" instead of "postgres" for username - #### Alexey Khabulyak (1): - format_gsm.c: Added mime type - #### Alexey Vasilyev (1): - res_rtp_asterisk.c: Fix bridged_payload matching with sample rate for DTMF - #### Allan Nathanson (2): - config.c: retain leading whitespace before comments - config.c: fix #tryinclude being converted to #include on rewrite - #### Artem Umerov (1): - logger.h: Fix build when AST_DEVMODE is not defined. - #### George Joseph (17): - res_stir_shaken: Allow sending Identity headers for unknown TNs - Allow C++ source files (as extension .cc) in the main directory - Add ability to pass arguments to unit tests from the CLI - Header fixes for compiling C++ source files - gcc14: Fix issues caught by gcc 14 - Add C++ Standard detection to configure and fix a new C++20 compile issue - Add SHA-256 and SHA-512-256 as authentication digest algorithms - docs: Enable since/version handling for XML, CLI and ARI documentation - docs: Various XML fixes - res_pjsip_authenticator_digest: Fix issue with missing auth and DONT_OPTIMIZE - docs: Add version information to configObject and configOption XML elements - README.md, asterisk.c: Update Copyright Dates - docs: Add version information to manager event instance XML elements - docs: Add version information to application and function XML elements - res_pjsip: Fix startup/reload memory leak in config_auth. - alembic: Database updates required. - res_pjsip_authenticator_digest: Make correct error messages appear again. - #### Jaco Kroon (1): - res_odbc: release threads from potential starvation. - #### James Terhune (1): - main/stasis_channels.c: Fix crash when setting a global variable with invalid .. - #### Joshua C. Colp (1): - LICENSE: Update company name, email, and address. - #### Kent (1): - res_pjsip: Add new AOR option "qualify_2xx_only" - #### Maksim Nesterov (1): - func_uuid: Add a new dialplan function to generate UUIDs - #### Maximilian Fridrich (1): - chan_pjsip: Send VIDUPDATE RTP frame for all H.264 streams - #### Mike Pultz (3): - func_curl.c: Add additional CURL options for SSL requests - manager.c: Add Processed Call Count to CoreStatus output - res_curl.conf.sample: clean up sample configuration and add new SSL options - #### Naveen Albert (6): - sig_analog: Fix regression with FGD and E911 signaling. - chan_iax2: Add log message for rejected calls. - chan_dahdi: Fix wrong channel state when RINGING recieved. - sig_analog: Add Last Number Redial feature. - chan_iax2: Avoid unnecessarily backlogging non-voice frames. - ast_tls_cert: Add option to skip passphrase for CA private key. - #### Sean Bright (6): - config.c: Fix off-nominal reference leak. - manager.c: Rename restrictedFile to is_restricted_file. - manager: Add `` tags for all AMI actions. - dialplan_functions_doc.xml: Document PJSIP_MEDIA_OFFER's `media` argument. - strings.c: Improve numeric detection in `ast_strings_match()`. - res_prometheus.c: Set Content-Type header on /metrics response. - #### Sperl Viktor (2): - app_queue: allow dynamically adding a queue member in paused state. - app_queue: indicate the paused state of a dynamically added member in queue_log. - #### Stanislav Abramenkov (2): - Upgrade bundled pjproject to 2.15.1 Resolves: asterisk#1016 - res_pjproject: Fix typo (OpenmSSL->OpenSSL) - #### Steffen Arntz (1): - logger.c fix: malformed JSON template - #### Tinet-mucw (1): - audiohook.c: resolving the issue with audiohook both reading when packet loss .. - #### Viktor Litvinov (1): - res_rtp_asterisk.c: Set Mark on rtp when timestamp skew is too big ### Commit List: - res_pjsip_authenticator_digest: Make correct error messages appear again. - alembic: Database updates required. - res_pjsip: Fix startup/reload memory leak in config_auth. - docs: Add version information to application and function XML elements - docs: Add version information to manager event instance XML elements - LICENSE: Update company name, email, and address. - res_prometheus.c: Set Content-Type header on /metrics response. - README.md, asterisk.c: Update Copyright Dates - docs: Add version information to configObject and configOption XML elements - res_pjsip_authenticator_digest: Fix issue with missing auth and DONT_OPTIMIZE - ast_tls_cert: Add option to skip passphrase for CA private key. - chan_iax2: Avoid unnecessarily backlogging non-voice frames. - config.c: fix #tryinclude being converted to #include on rewrite - sig_analog: Add Last Number Redial feature. - docs: Various XML fixes - strings.c: Improve numeric detection in `ast_strings_match()`. - docs: Enable since/version handling for XML, CLI and ARI documentation - logger.h: Fix build when AST_DEVMODE is not defined. - dialplan_functions_doc.xml: Document PJSIP_MEDIA_OFFER's `media` argument. - samples: Use "asterisk" instead of "postgres" for username - manager: Add `` tags for all AMI actions. - logger.c fix: malformed JSON template - manager.c: Rename restrictedFile to is_restricted_file. - res_pjproject: Fix typo (OpenmSSL->OpenSSL) - Add SHA-256 and SHA-512-256 as authentication digest algorithms - config.c: retain leading whitespace before comments - config.c: Fix off-nominal reference leak. - normalize contrib/ast-db-manage/queue_log.ini.sample - Add C++ Standard detection to configure and fix a new C++20 compile issue - chan_dahdi: Fix wrong channel state when RINGING recieved. - Upgrade bundled pjproject to 2.15.1 Resolves: asterisk#1016 - gcc14: Fix issues caught by gcc 14 - Header fixes for compiling C++ source files - Add ability to pass arguments to unit tests from the CLI - res_pjsip: Add new AOR option "qualify_2xx_only" - res_odbc: release threads from potential starvation. - Allow C++ source files (as extension .cc) in the main directory - format_gsm.c: Added mime type - func_uuid: Add a new dialplan function to generate UUIDs - app_queue: allow dynamically adding a queue member in paused state. - chan_iax2: Add log message for rejected calls. - chan_pjsip: Send VIDUPDATE RTP frame for all H.264 streams - res_curl.conf.sample: clean up sample configuration and add new SSL options - res_rtp_asterisk.c: Set Mark on rtp when timestamp skew is too big - res_rtp_asterisk.c: Fix bridged_payload matching with sample rate for DTMF - manager.c: Add Processed Call Count to CoreStatus output - func_curl.c: Add additional CURL options for SSL requests - sig_analog: Fix regression with FGD and E911 signaling. - res_stir_shaken: Allow sending Identity headers for unknown TNs ### Commit Details: #### res_pjsip_authenticator_digest: Make correct error messages appear again. Author: George Joseph Date: 2025-01-28 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 #### alembic: Database updates required. Author: George Joseph Date: 2025-01-28 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. #### res_pjsip: Fix startup/reload memory leak in config_auth. Author: George Joseph Date: 2025-01-23 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(). #### docs: Add version information to application and function XML elements Author: George Joseph Date: 2025-01-23 * 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 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 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 #### docs: Add version information to manager event instance XML elements Author: George Joseph Date: 2025-01-20 * Do a git blame on the embedded XML managerEvent elements. * From the commit hash, grab the summary line. * Do a git log --grep 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 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. #### LICENSE: Update company name, email, and address. Author: Joshua C. Colp Date: 2025-01-21 #### res_prometheus.c: Set Content-Type header on /metrics response. Author: Sean Bright Date: 2025-01-21 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 #### README.md, asterisk.c: Update Copyright Dates Author: George Joseph Date: 2025-01-20 #### docs: Add version information to configObject and configOption XML elements Author: George Joseph Date: 2025-01-16 Most of the configObjects and configOptions that are implemented with ACO or Sorcery now have `/` 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 ` 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 ` 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 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. #### res_pjsip_authenticator_digest: Fix issue with missing auth and DONT_OPTIMIZE Author: George Joseph Date: 2025-01-17 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. #### ast_tls_cert: Add option to skip passphrase for CA private key. Author: Naveen Albert Date: 2025-01-14 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 #### chan_iax2: Avoid unnecessarily backlogging non-voice frames. Author: Naveen Albert Date: 2025-01-09 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 73103bdcd5b342ce5dfa32039333ffadad551151 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 #### config.c: fix #tryinclude being converted to #include on rewrite Author: Allan Nathanson Date: 2024-09-16 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 #### sig_analog: Add Last Number Redial feature. Author: Naveen Albert Date: 2023-11-10 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 #### docs: Various XML fixes Author: George Joseph Date: 2025-01-15 * 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". #### strings.c: Improve numeric detection in `ast_strings_match()`. Author: Sean Bright Date: 2025-01-15 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 #### docs: Enable since/version handling for XML, CLI and ARI documentation Author: George Joseph Date: 2025-01-09 * Added the "since" element to the XML configObject and configOption elements in appdocsxml.dtd. * Added the "Since" section to the following CLI output: ``` config show help config show help