- Nov 29, 2022
-
-
Maximilian Fridrich authored
This PR contains two relatively separate changes in channel.c and res_pjsip_session.c which ensure that topology changes are not ignored in cases where they should be handled. For channel.c: The function ast_channel_request_stream_topology_change only triggers a stream topology request change indication, if the channel's topology does not equal the requested topology. However, a channel could be in a state where it is currently "negotiating" a new topology but hasn't updated it yet, so the topology request change would be lost. Channels need to be able to handle such situations internally and stream topology requests should therefore always be passed on. In the case of chan_pjsip for example, it queues a session refresh (re-INVITE) if it is currently in the middle of a transaction or has pending requests (among other reasons). Now, ast_channel_request_stream_topology_change always indicates a stream topology request change even if the requested topology equals the channel's topology. For res_pjsip_session.c: The function resolve_refresh_media_states does not process stream state changes if the delayed active state differs from the current active state. I.e. if the currently active stream state has changed between the time the sip session refresh request was queued and the time it is being processed, the session refresh is ignored. However, res_pjsip_session contains logic that ensures that session refreshes are queued and re-queued correctly if a session refresh is currently not possible. So this check is not necessary and led to some session refreshes being lost. Now, a session refresh is done even if the delayed active state differs from the current active state and it is checked whether the delayed pending state differs from the current active - because that means a refresh is necessary. Further, the unit test of resolve_refresh_media_states was adapted to reflect the new behavior. I.e. the changes to delayed pending are prioritized over the changes to current active because we want to preserve the original intention of the pending state. ASTERISK-30184 Change-Id: Icd0703295271089057717006730b555b9a1d4e5a
-
- Nov 08, 2022
-
-
Naveen Albert authored
The ModuleCheck XML documentation falsely claims that the module's version number is returned. This has not been the case since 14, since the version number is not available anymore, but the documentation was not changed at the time. It is now updated to reflect this. ASTERISK-30285 #close Change-Id: Idde2d1205a11f2623fa1ddab192faa3dc4081e91
-
- Nov 06, 2022
-
-
Naveen Albert authored
Adds an ignore case for wink since it should pass through with no warning. ASTERISK-30290 #close Change-Id: Ieb7e34daa717357ac5c93efb0059f6c2321f16ad
-
- Oct 31, 2022
-
-
Naveen Albert authored
write_openssl_error_to_log has been erroneously using ast_free instead of free, which will cause a crash when MALLOC_DEBUG is enabled since the memory was not allocated by Asterisk's memory manager. This changes it to use the actual free function directly to avoid this. ASTERISK-30278 #close Change-Id: Iac8b6468b718075809c45d8ad16b101af21a474d
-
- Oct 27, 2022
-
-
Frederic LE FOLL authored
race condition: ast_dial_join() may not cancel outgoing call, if function is called just after called party answer and before application execution (bit is_running_app not yet set). This fix adds ast_softhangup() calls in addition to existing pthread_kill() when is_running_app is not set. ASTERISK-30258 Change-Id: Idbdd5c15122159661aa8e996a42d5800083131e4
-
- Oct 26, 2022
-
-
Naveen Albert authored
Some logic in say.c for determining if we need to also add an ampersand for file seperation was faulty, as non-successful files would increment the count, causing a leading ampersand to be added improperly. This is fixed, and a unit test that captures this regression is also added. ASTERISK-30248 #close Change-Id: I02c1d3a11d82fe4ea8b462070cbd1effb5834d2b
-
- Oct 11, 2022
-
-
Mike Bradeen authored
Add enum to allow setting optional direction. If set to only one direction, only feed matching-direction frames to the associated slin factory. This prevents mangling the transcoder on non-mixed frames when the READ and WRITE frames would have otherwise required it. Also removes the need to mute or discard the un-wanted frames as they are no longer added in the first place. res_stasis_snoop is changed to use this addition to set direction on audiohook based on spy direction. If no direction is set, the ast_audiohook_init will init this enum to BOTH which maintains existing functionality. ASTERISK-30252 Change-Id: If8716bad334562a5d812be4eeb2a92e4f3be28eb
-
- Oct 10, 2022
-
-
Naveen Albert authored
Allows bridging, parking, and dial messages to be globally ignored for all CDRs such that only a single CDR record is generated per channel. This is useful when CDRs should endure for the lifetime of an entire channel and bridging and dial updates in the dialplan should not result in multiple CDR records being created for the call. With the ignore bridging option, bridging changes have no impact on the channel's CDRs. With the ignore dial state option, multiple Dials and their outcomes have no impact on the channel's CDRs. The last disposition on the channel is preserved in the CDR, so the actual disposition of the call remains available. These two options can reduce the amount of "CDR hacks" that have hitherto been necessary to ensure that CDR was not "spoiled" by these messages if that was undesired, such as putting a dummy optimization-disabled local channel between the caller and the actual call and putting the CDR on the channel in the middle to ensure that CDR would persist for the entire call and properly record start, answer, and end times. Enabling these options is desirable when calls correspond to the entire lifetime of channels and the CDR should reflect that. Current default behavior remains unchanged. ASTERISK-30091 #close Change-Id: I393981af42732ec5ac3ff9266444abb453b7c832
-
- Sep 26, 2022
-
-
Naveen Albert authored
The DBGetTree AMI action's ListItem previously always reported 1, regardless of the count. This is corrected to report the actual count. ASTERISK-30245 #close patches: gettreecount.diff submitted by Birger Harzenetter (license 5870) Change-Id: I46d8992710f1b8524426b1255f57d1ef4a4934d4
-
Naveen Albert authored
Adds the n "no answer" option to the Bridge application so that answer supervision can not automatically be provided when Bridge is executed. Additionally, a mechanism (dialplan variable) is added to prevent bridge targets (typically the target of a masquerade) from answering the channel when they enter the bridge. ASTERISK-30223 #close Change-Id: I76f73fcd8e403bcd18f2abb40c658f537ac1ba6d
-
Philip Prindeville authored
ASTERISK-30232 #close Change-Id: I2603e2cef8f93f6b0a6ef39f7eac744251bb3902
-
- Sep 22, 2022
-
-
Jaco Kroon authored
If we find that n_max (currently hard wired to 1) sessions were purged, schedule the next purge for 1ms into the future rather than 5000ms (as per current). This way we will purge up to 1000 sessions per second rather than 1 every 5 seconds. This mitigates a build-up of sessions should http sessions gets established faster than 1 per 5 seconds. Change-Id: I9820d39aa080109df44fe98c1325cafae48d54f5 Signed-off-by:
Jaco Kroon <jaco@uls.co.za>
-
- Sep 19, 2022
-
-
George Joseph authored
ASTERISK-30235 Change-Id: Ia1e326e7b52cd06fd5e6c9009e3e63193c92f6cd
-
- Sep 13, 2022
-
-
George Joseph authored
Fixed a segfault caused by var_list_from_loc_info() encountering an empty location info element. Fixed an issue in ast_strsep() where a value with only whitespace wasn't being preserved. Fixed an issue in ast_variable_list_from_quoted_string() where an empty value was considered a failure. ASTERISK-30215 Reported by: Dan Cropp Change-Id: Ieca64e061a6d9298f0196c694b60d986ef82613a
-
- Sep 12, 2022
-
-
Philip Prindeville authored
ASTERISK-30037 Change-Id: I4b6f7264c8c737c476c798d2352f3232b263bbdf
-
Philip Prindeville authored
ASTERISK-30037 Change-Id: Icbf84ce05addb197a458361c35d784e460d8d6c2
-
- Sep 11, 2022
-
-
Naveen Albert authored
Adds an AMI event to indicate that a deadlock has likely started, when Asterisk is compiled with DETECT_DEADLOCKS enabled. This can make it easier to perform automated deadlock detection and take appropriate action (such as doing a core dump). Unlike the deadlock warnings, the AMI event is emitted only once per deadlock. ASTERISK-30161 #close Change-Id: Ifc6ed3e390f8b4cff7f8077a50e4d7a5b54e42fb
-
Naveen Albert authored
Use const char for char arguments to pbx_substitute_variables_helper_full_location that can do so (context and exten). ASTERISK-30209 #close Change-Id: I001357177e9c3dca2b2b4eebc5650c1095b3da6f
-
- Sep 10, 2022
-
-
Naveen Albert authored
If "core show channels" is run before startup has completed, it is possible for bad ao2 refs to occur because the system is not yet fully initialized. This will lead to an assertion failing. To prevent this, initialization of CLI builtins is moved to be later along in the main load sequence. Core CLI commands are loaded at the same time, but channel-related commands are loaded later on. ASTERISK-29846 #close Change-Id: If6b3cde802876bd738c1b4cf2683bea6ddc615b6
-
- Sep 08, 2022
-
-
Naveen Albert authored
Adds additional control options over the transfer feature functionality to give users more control in how the transfer feature sounds and works. First, the "transfer" sound that plays when a transfer is initiated can now be customized by the user in features.conf, just as with the other transfer sounds. Secondly, the user can now specify the transfer extension in advance by using the TRANSFER_EXTEN variable. If a valid extension is contained in this variable, the call will automatically be transferred to this destination. Otherwise, it will fall back to collecting the extension from the user as is always done now. ASTERISK-29899 #close Change-Id: Ibff309caa459a2b958706f2ed0ca393b1ef502e3
-
- Aug 17, 2022
-
-
Naveen Albert authored
Fixes a few coding guideline violations: * Use of C99 comments * Opening brace on same line as function prototype ASTERISK-30163 #close Change-Id: I07771c4c89facd41ce8d323859f022ddbddf6ca7
-
- Aug 10, 2022
-
-
George Joseph authored
* Added processing for the 'confidence' element. * Added documentation to some APIs. * removed a lot of complex code related to the very-off-nominal case of needing to process multiple location info sources. * Create a new 'ast_geoloc_eprofile_to_pidf' API that just takes one eprofile instead of a datastore of multiples. * Plugged a huge leak in XML processing that arose from insufficient documentation by the libxml/libxslt authors. * Refactored stylesheets to be more efficient. * Renamed 'profile_action' to 'profile_precedence' to better reflect it's purpose. * Added the config option for 'allow_routing_use' which sets the value of the 'Geolocation-Routing' header. * Removed the GeolocProfileCreate and GeolocProfileDelete dialplan apps. * Changed the GEOLOC_PROFILE dialplan function as follows: * Removed the 'profile' argument. * Automatically create a profile if it doesn't exist. * Delete a profile if 'inheritable' is set to no. * Fixed various bugs and leaks * Updated Asterisk WiKi documentation. ASTERISK-30167 Change-Id: If38c23f26228e96165be161c2f5e849cb8e16fa0
-
- Aug 02, 2022
-
-
Naveen Albert authored
The manager XML documentation documents a "FilterList" action, but there is no such action. Therefore, this can lead to confusion when people try to use a documented action that does not, in fact, exist. This is removed as the action never did exist in the past, nor would it be trivial to add since we only store the regex_t objects, so the filter list can't actually be provided without storing that separately. Most likely, the documentation was originally added (around version 10) in anticipation of something that never happened. ASTERISK-29917 #close Change-Id: I846b16fd6f80a91d4ddc5d8a861b522d7c6f8f97
-
- Aug 01, 2022
-
-
Naveen Albert authored
Adjusts some logging levels to be more or less important, that is more prominent when actual problems occur and less prominent for less noteworthy things. ASTERISK-30153 #close Change-Id: Ifc8f7df427aa018627db462125ae744986d3261b
-
- Jul 26, 2022
-
-
Naveen Albert authored
When ast_func_read2 is used to read a function using its read function (as opposed to a native ast_str read2 function), the result is copied directly by the function into the ast_str buffer. As a result, the ast_str length remains initialized to 0, which is a bug because this is not the real string length. This can cascade and have issues elsewhere, such as when reading substrings of functions that only register read as opposed to read2 callbacks. In this case, since reading ast_str_strlen returns 0, the returned substring is empty as opposed to the actual substring. This has caused the ast_str family of functions to behave inconsistently and erroneously, in contrast to the pbx_variables substitution functions which work correctly. This fixes this issue by manually updating the ast_str length when the result is copied directly into the ast_str buffer. Additionally, an assertion and a unit test that previously exposed these issues are added, now that the issue is fixed. ASTERISK-29966 #close Change-Id: I4e2dba41410f9d4dff61c995d2ca27718248e07f
-
- Jul 20, 2022
-
-
Naveen Albert authored
Adds the DBGetTree action, which can be used to retrieve all of the DB keys beginning with a particular prefix, similar to the capability provided by the database show CLI command. ASTERISK-30136 #close Change-Id: I3be9425e53be71f24303fdd4d2923c14e84337e6
-
Naveen Albert authored
The global event filtering code was only in one possible execution path, so not all events were being properly filtered out if requested. This moves that into the universal AMI handling code so all events are properly handled. Additionally, the CLI listing of disabled events can also get truncated, so we now print out everything. ASTERISK-30137 #close Change-Id: If8c42edcb2abc5158552da7eba2a8ff6b20e1959
-
- Jul 14, 2022
-
-
Naveen Albert authored
There are several things wrong with analog Caller ID handling that are fixed by this commit: callerid.c's Caller ID generation function contains the logic to use the presentation to properly send the proper Caller ID. However, currently, DAHDI does not pass any presentation information to the Caller ID module, which means that presentation is completely ignored on all calls. This means that lines could be getting Caller ID information they aren't supposed to. Part of the reason this has been obscured is because the simple switch logic for handling the built in *67 and *82 is completely wrong. Rather than modifying the presentation for the call accordingly (which is what it's supposed to do), it simply blanks out the Caller ID or fills it in. This is wrong, so wrong that it makes a mockery of the specification. Additionally, it would leave to the "UNAVAILABLE" disposition being used for Caller ID generation as opposed to the "PRIVATE" disposition that it should have been using. This is now fixed to only update the presentation and not modify the number and name, so that the simple switch *67/*82 work correctly. Next, sig_analog currently only copies over the name and number, nothing else, when it is filling in a duplicated caller id structure. Thus, we also now copy over the presentation information so that is available for the Caller ID spill. Additionally, this meant that "valid" was implicitly 0, and as such presentation would always fail to "Unavailable". The validity is therefore also copied over so it can be used by ast_party_id_presentation. As part of this fix, new API is added so that all the relevant Caller ID information can be passed in to the Caller ID generation functions. Parameters that are also completely missing from the Caller ID spill have also been added, to enhance the compatibility, correctness, and completeness of the Asterisk Caller ID implementation. ASTERISK-29991 #close Change-Id: Icc44a5e09979916f4c18a440f96e10dc1c76ae15
-
- Jul 13, 2022
-
-
Sean Bright authored
Allocate all of the ast_context's character data in the structure's flexible array member and eliminate the clunky fake_context. This will simplify future changes to ast_context. Change-Id: I98357de75d8ac2b3c4c9f201223632e6901021ea
-
- Jul 12, 2022
-
-
Naveen Albert authored
ASTERISK-30089 #close Change-Id: I1f5db911fd05a3a211c522c13e990fa1d0e62275
-
- Jul 08, 2022
-
-
Trevor Peirce authored
The current documentation is out of date and does not reflect actual behaviour. This change makes documentation clearer and accurately reflect the purpose of relevant channel variables. ASTERISK-30123 Change-Id: I160d0b01fce862477ad55ac1aa708a730473eb6f
-
- Jul 07, 2022
-
-
George Joseph authored
* Added ast_variable_list_from_quoted_string() Parse a quoted string into an ast_variable list. * Added ast_str_substitute_variables_full2() Perform variable/function/expression substitution on an ast_str. * Added ast_strsep_quoted() Like ast_strsep except you can specify a specific quote character. Also added unit test. * Added ast_xml_find_child_element() Find a direct child element by name. * Added ast_xml_doc_dump_memory() Dump the specified document to a buffer * ast_datastore_free() now checks for a NULL datastore before attempting to destroy it. Change-Id: I5dcefed2f5f93a109e8b489e18d80d42e45244ec
-
- Jul 01, 2022
-
-
Naveen Albert authored
Currently, if using the CLI to delete a DB entry, "Database entry removed" is always returned, regardless of whether or not the entry actually existed in the first place. This meant that users were never told if entries did not exist. The same issue occurs if trying to delete a DB key using AMI. To address this, new API is added that is more stringent in deleting values from AstDB, which will not return success if the value did not exist in the first place, and will print out specific error details if available. ASTERISK-30001 #close Change-Id: Ic84e3eddcd66c7a6ed7fea91cdfd402568378b18
-
Naveen Albert authored
A corner case exists in CLI parsing where if a CLI user in a remote console ends with a backslash and then invokes command completion (using TAB or ?), then the console will freeze forever until a SIGQUIT signal is sent to the process, due to getting blocked forever reading the command completion. CTRL+C and other key combinations have no impact on the CLI session. This occurs because, in such cases, the CLI process is waiting for AST_CLI_COMPLETE_EOF to appear in the buffer from the main process, but instead the main process is confused by the funny syntax and thus prints out the CLI help. As a result, the CLI process is stuck on the read call, waiting for the completion that will never come. This prevents blocking forever by checking if the data from the main process starts with "Usage:". If it does, that means that CLI help was sent instead of the tab complete vector, and thus the CLI should bail out and not wait any longer. ASTERISK-29822 #close Change-Id: I9810ac59304fec162da701653c9c834f0ec8f670
-
- Jun 30, 2022
-
-
Naveen Albert authored
If the caller has hung up, break out of the play loop so we don't try to play remaining files and fail to do so. ASTERISK-30075 #close Change-Id: I55e85be28ee90b48c0fe4ce20ac136a7dbb49f14
-
Naveen Albert authored
Finding an application and executing it if found is a common task throughout Asterisk. This adds a helper function around pbx_exec to do this, to eliminate redundant code and make it easier for modules to substitute variables and execute applications by name. ASTERISK-30061 #close Change-Id: Ifee4d2825df7545fb515d763d393065675140c84
-
- Jun 16, 2022
-
-
Naveen Albert authored
A previous review fixing ASTERISK_22246 and ASTERISK_26582 got a couple of the options mixed up as to whether or not they are compatible with the remote console. This fixes those to the best of my knowledge. ASTERISK-30097 #close Change-Id: Id54166991aa79f04fb02699cc499bedda854253b
-
- Jun 07, 2022
-
-
Christof Efkemann authored
In function ast_say_date_with_format_de(), take special care when the hour is one o'clock. In this case, the German number "eins" must be inflected to its neutrum form, "ein". This is achieved by playing "digits/1N" instead of "digits/1". Fixes both 12- and 24-hour formats. ASTERISK-30092 Change-Id: Ica9b80125c0b317e378d89c1ea786816e2635510
-
- Jun 06, 2022
-
-
Naveen Albert authored
If tab completion using ast_module_helper is attempted during startup, deadlock will ensue because the CLI will attempt to lock the module list while it is already locked by the loader. This causes deadlock because when the loader tries to acquire the CLI lock, they are blocked on each other. Waiting for startup to complete is not feasible because the CLI lock is acquired while waiting, so deadlock will ensure regardless of whether or not a lock on the module list is attempted. To prevent deadlock, we immediately abort if tab completion is attempted on the module list before Asterisk is fully booted. ASTERISK-30039 #close Change-Id: Idd468906c512bb196631e366a8f597a0e2e9271d
-
- May 22, 2022
-
-
Moritz Fain authored
This change exposes the channel driver's unique id (i.e. the Call-ID for chan_sip/chan_pjsip based channels) to ARI channel resources as `protocol_id`. ASTERISK-30027 Reported by: Moritz Fain Tested by: Moritz Fain Change-Id: I7cc6e7a9d29efe74bc27811d788dac20fe559b87
-