Found in res_geolocation, but I believe others may have similar issues,
thus not linking to a specific issue.
Essentially gcc doesn't mark the stack for being non-executable unless
it's compiling the source, this informs ld via gcc to mark the object as
not requiring an executable stack (which a binary blob obviously
doesn't).
ASTERISK-30321
Change-Id: I71bcc2fd1fe0c82a28b3257405d6f2b566fd9bfc
Signed-off-by: Jaco Kroon <jaco@uls.co.za>
A memory leak was present in func_json due to
using ast_json_free, which just calls ast_free,
as opposed to recursively freeing the JSON
object as needed. This is now fixed to use the
right free functions.
ASTERISK-30293 #close
Change-Id: I982324dde841dc9147c8d8ad35c8719daf418b49
Removes the function mkstemp_file and uses
ast_file_mkftemp from file.h instead.
ASTERISK-30295 #close
Change-Id: I7412ec06f88c39ee353bcdb8c976c2fcac546609
The "RECORD FILE" command in res_agi has its own
implementation for actually doing the recording. This
has resulted in it not actually obeying the option
"transmit_silence" when recording.
This change causes it to now send silence if the
option is enabled.
ASTERISK-30314
Change-Id: Ib3a85601ff35d1b904f836691bad8a4b7e957174
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
Adds an option that allows MixMonitor to delete
its copy of any recording files before exiting.
This can be handy in conjunction with options
like m, which copy the file elsewhere, and the
original files may no longer be needed.
ASTERISK-30284 #close
Change-Id: Ida093679c67e300efc154a97b6d8ec0f104e581e
When gosub is executed on channels without a PBX, the context,
extension, and priority are initialized to the channel driver's
default location for that endpoint. As a result, the last Return
will restore this location and the Gosub logs will print out bogus
information about our exit point.
To fix this, on channels that don't have a PBX, the execution
location is left intact on the last return if there are no
further stack frames left. This allows the correct location
to be printed out to the user, rather than the bogus default
context.
ASTERISK-30076 #close
Change-Id: I1d42a99c9aa9e3708d32718863175158a894e414
(cherry picked from commit 12d18b0a40)
Fixed the specification of "outputdir" when calling ast_coredumper
so the txt files are saved in the correct place.
ASTERISK-30282
Change-Id: Ic631cb90c1e4c29d970c982dff45fda5e0eb15b6
unicast_rtp_request() was setting the channel variables like this:
pbx_builtin_setvar_helper(chan, "UNICASTRTP_LOCAL_ADDRESS",
ast_sockaddr_stringify_addr(&local_address));
ast_rtp_instance_get_local_address(instance, &local_address);
pbx_builtin_setvar_helper(chan, "UNICASTRTP_LOCAL_PORT",
ast_sockaddr_stringify_port(&local_address));
...which made it appear that UNICASTRTP_LOCAL_ADDRESS was being
set before local_address was set. In fact, the address part of
local_address was set earlier in the function, just not the port.
This was confusing however so ast_rtp_instance_get_local_address()
is now being called before setting UNICASTRTP_LOCAL_ADDRESS.
ASTERISK-30281
Change-Id: I872ac49477100f4eb33891d46efc6ca21ec81aa4
When a websocket (or potentially any stateful connection) is quickly
created then destroyed, it is possible that the qualify thread will
destroy the transaction before the initialzing thread is finished
with it.
Depending on the timing, this can cause an assertion within pjsip.
To prevent this, ast_send_stateful_response will now create the group
lock and add a reference to it before creating the transaction.
While this should resolve the crash, there is still the potential that
the contact will not be cleaned up properly, see:ASTERISK~29286. As a
result, the contact has to 'time out' before it will be removed.
ASTERISK-28689
Change-Id: Id050fded2247a04d8f0fc5b8a2cf3e5482cb8cee
Current registration code use pjsip_parse_uri to verify outbound_proxy
that is different from the reading this option for the endpoint. This
made value with multiple proxies invalid for registration pjsip settings.
Removing URI validation helps to use registration through multiple proxies.
ASTERISK-30217 #close
Change-Id: I064558e66f04b9f3260c46181812a01349761357
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
Fix compilation errors caused by using size_t
instead of uintmax_t and non-portable format
specifiers.
ASTERISK-30273 #close
Change-Id: I363e6057ef84d54b88af80d23ad6147eef9216ee
Currently chan_pjsip on receiving a re-INVITE without SDP will only
return the codecs that are previously negotiated and not offering
all enabled codecs.
This causes interoperability issues with different equipment (e.g.
from Cisco) for some of our customers and probably also in other
scenarios involving 3PCC infrastructure.
According to RFC 3261, section 14.2 we SHOULD return all codecs
on a re-INVITE without SDP
The PR proposes a new parameter to configure this behaviour:
all_codecs_on_empty_reinvite. It includes the code, documentation,
alembic migrations, CHANGES file and example configuration additions.
ASTERISK-30193 #close
Change-Id: I69763708d5039d512f391e296ee8a4d43a1e2148
Expands the pjsip logger to support the ability to filter
by SIP message method. This can make certain types of SIP debugging
easier by only logging messages of particular method(s).
ASTERISK-30146 #close
Co-authored-by: Sean Bright <sean@seanbright.com>
Change-Id: I9c8cbb6fc8686ef21190eb42e08bc9a9b147707f
The PJSIP notify CLI commands allow for using
"options" configured in pjsip_notify.conf.
This allows these same options to be used in
AMI actions as well.
Additionally, as part of this improvement,
some repetitive common code is refactored.
ASTERISK-30263 #close
Change-Id: Ie4496b322b63b61eaf9672183a959ab99a04b6b5
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
This fixes dahdi_request to properly set the cause
code to CONGESTION instead of BUSY if no channels
were actually available.
Currently, the cause is erroneously set to busy
if the channel itself is found, regardless of its
current state. However, if the channel is not available
(e.g. T1 down, card not operable, etc.), then the
channel itself may not be in a functional state,
in which case CHANUNAVAIL is the correct cause to use.
This adds a simple check to ensure that busy tone
is only returned if a channel is encountered that
has an owner, since that is the only possible way
that a channel could actually be busy.
ASTERISK-30274 #close
Change-Id: Iad5870223c081240c925b19df8d6af136953b994
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
pjproject does not provide any mechanism of removing
event packages, which means that once a subscription
handler is registered, it is effectively permanent.
pjproject will assert if the same event package is
ever registered again, so currently unloading and
loading any Asterisk modules that use subscriptions
will cause a crash that is beyond our control.
For that reason, we now prevent users from being
able to unload these modules, to prevent them
from ever being loaded twice.
ASTERISK-30264 #close
Change-Id: I7fdcb1a5e44d38b7ba10c44259fe98f0ae9bc12c
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
Adds support for detecting audible ringback tone
to the TONE_DETECT function using the p option.
ASTERISK-30254 #close
Change-Id: Ie2329ff245248768367d26749c285fbe823f6414
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
"fname" is passed in as a const char *, but strstr() mangles that
into a char *, and we were attempting to modify the string in place.
This is an unwanted (and undocumented) side-effect.
ASTERISK-30213
Change-Id: Ifa36d352aafeb7f9beec3f746332865c7d21e629
Also added a note to the geolocation.conf.sample file
and added a README to the res/res_geolocation/wiki
directory.
Change-Id: I89c3c5db8c0701b33127993622d5e4f904bddfbc
This patch adds support for mediasec SIP headers and SDP attributes.
These are defined in RFC 3329, 3GPP TS 24.229 and
draft-dawes-sipcore-mediasec-parameter. The new features are
implemented so that a backbone for RFC 3329 is present to streamline
future work on RFC 3329.
With this patch, Asterisk can communicate with Deutsche Telekom trunks
which require these fields.
ASTERISK-30032
Change-Id: Ia7f5b5ba42db18074fdd5428c4e1838728586be2
Avoid crashing by skipping invisible bridges and checking the
snapshot for a null pointer. In effect this is how the bridges
are enumerated in res/ari/resource_bridges.c already.
ASTERISK-30239
ASTERISK-30237
Change-Id: I58ef9f44036feded5966b5fc70ae754f8182883d
If geolocation is not in use for an endpoint, the NOTICE
log level is currently spammed with messages about this,
even though nothing is wrong and these messages provide
no real value. These log messages are therefore changed
to debugs.
ASTERISK-30241 #close
Change-Id: I656b355d812f67cc0f0fdf09b00b0e1458598bb4
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
The IF function currently emits warnings if both IF branches
are empty. However, there is no actual necessity that either
branch be non-empty as, unlike other conditional applications/
functions, nothing is inherently done with IF, and both
sides could legitimately be empty. The warning is thus turned
into a debug message.
ASTERISK-30243 #close
Change-Id: I5250625dd720f95e1859b5dfb933905d7e7a730e
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
Adds the n option to not answer the channel when calling
BridgeWait, so the application can be used without
forcing answer supervision.
ASTERISK-30216 #close
Change-Id: I6b85ef300b1f7b5170f8537e2b10889cc2e6605a
Adds an option that will play an audio file
to the party while AMD is running on the
channel, so the called party does not just
hear silence.
ASTERISK-30179 #close
Change-Id: I4af306274552b61b3d9f0883c33f698abd4699b6
Adds the EXPORT function, which allows write
access to variables and functions on other
channels.
ASTERISK-29432 #close
Change-Id: I7492645ae4307553d0f586d78e13a4f586231fdf
This patch adds a new option to the 100rel parameter for pjsip
endpoints called "peer_supported". When an endpoint with this option
receives an incoming request and the request indicated support for the
100rel extension, then Asterisk will send 1xx responses reliably. If
the request did not indicate 100rel support, Asterisk sends 1xx
responses normally.
ASTERISK-30158
Change-Id: Id6d95ffa8f00dab118e0b386146e99f254f287ad
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>
Adds TRIM, LTRIM, and RTRIM, which can be used
for trimming leading and trailing whitespace
from strings.
ASTERISK-30222 #close
Change-Id: I50fb0c40726d044a7a41939fa9026f3da4872554
Adding user=phone to local-side uri's when user_eq_phone=yes is set for
an endpoint. Previously this would only add the header to the To and R-URI.
ASTERISK-30178
Change-Id: Id3bfb5d225d762e7d2668c023fe09e4541ae8600