]> git.ipfire.org Git - thirdparty/asterisk.git/log
thirdparty/asterisk.git
4 years agores_musiconhold: Start playlist after initial announcement
Sean Bright [Fri, 18 Sep 2020 20:02:27 +0000 (16:02 -0400)] 
res_musiconhold: Start playlist after initial announcement

Only track our sample offset if we are playing a non-announcement file,
otherwise we will skip that number of samples when we start playing the
first MoH file.

ASTERISK-24329 #close

Change-Id: Ib6b3c84fcaa1063889ab38ba7e7fc50050a3ccfc

4 years agores_stasis.c: Add compare function for bridges moh container
Michal Hajek [Wed, 16 Sep 2020 13:01:07 +0000 (15:01 +0200)] 
res_stasis.c: Add compare function for bridges moh container

Sometimes not play MOH on bridge.

ASTERISK-29081
Reported-by: Michal Hajek <michal.hajek@daktela.com>
Change-Id: I760c73e0c9be1d340303b5d1c18a00c4759e8232

4 years agofunc_curl.c: Prevent crash when using CURLOPT(httpheader)
Sean Bright [Fri, 18 Sep 2020 13:09:59 +0000 (09:09 -0400)] 
func_curl.c: Prevent crash when using CURLOPT(httpheader)

Because we use shared thread-local cURL instances, we need to ensure
that the state of the cURL instance is correct before each invocation.

In the case of custom headers, we were not resetting cURL's internal
HTTP header pointer which could result in a crash if subsequent
requests do not configure custom headers.

ASTERISK-29085 #close

Change-Id: I8b4ab34038156dfba613030a45f10e932d2e992d

4 years agores_pjsip_diversion: implement support for History-Info
Torrey Searle [Thu, 13 Aug 2020 08:34:55 +0000 (10:34 +0200)] 
res_pjsip_diversion: implement support for History-Info

Implemention of History-Info capable of interworking with Diversion
Header following RFC7544

ASTERISK-29027 #close

Change-Id: I2296369582d4b295c5ea1e60bec391dd1d318fa6
(cherry picked from commit 5a12463c0709513514abd42a48039d62ca9a6155)

4 years agoformat_cap: Perform codec lookups by pointer instead of name
Sean Bright [Mon, 14 Sep 2020 18:23:27 +0000 (14:23 -0400)] 
format_cap: Perform codec lookups by pointer instead of name

ASTERISK-28416 #close

Change-Id: I069420875ebdbcaada52d92599a5f7de3cb2cdf4

4 years agorealtime: Increased reg_server character size
Sungtae Kim [Mon, 31 Aug 2020 12:21:09 +0000 (14:21 +0200)] 
realtime: Increased reg_server character size

Currently, the ps_contacts table's reg_server column in realtime database type is varchar(20).
This is fine for normal cases, but if the hostname is longer than 20, it returns error and then
failed to register the contact address of the peer.

Normally, 20 characters limitation for the hostname is fine, but with the cloud env.
So, increased the size to 255.

ASTERISK-29056

Change-Id: Iac52c8c35030303cfa551bb39f410b33bffc507d

4 years agores_stasis.c: Added video_single option for bridge creation
Sungtae Kim [Sun, 30 Aug 2020 20:42:06 +0000 (22:42 +0200)] 
res_stasis.c: Added video_single option for bridge creation

Currently, it was not possible to create bridge with video_mode single.
This made hard to put the bridge in a vidoe_single mode.
So, added video_single option for Bridge creation using the ARI.
This allows create a bridge with video_mode single.

ASTERISK-29055

Change-Id: I43e720e5c83fc75fafe10fe22808ae7f055da2ae

4 years agoBridging: Use a ref to bridge_channel's channel to prevent crash.
Ben Ford [Mon, 31 Aug 2020 16:14:20 +0000 (11:14 -0500)] 
Bridging: Use a ref to bridge_channel's channel to prevent crash.

There's a race condition with bridging where a bridge can be torn down
causing the bridge_channel's ast_channel to become NULL when it's still
needed. This particular case happened with attended transfers, but the
crash occurred when trying to publish a stasis message. Now, the
bridge_channel is locked, a ref to the ast_channel is obtained, and that
ref is passed down the chain.

Change-Id: Ic48715c0c041615d17d286790ae3e8c61bb28814

4 years agoUpdate CHANGES and UPGRADE.txt for 13.37.0
Asterisk Development Team [Wed, 9 Sep 2020 14:00:34 +0000 (09:00 -0500)] 
Update CHANGES and UPGRADE.txt for 13.37.0

4 years agores_pjsip_session: Deferred re-INVITE without SDP send a=sendrecv instead of a=sendonly
Patrick Verzele [Tue, 1 Sep 2020 13:43:46 +0000 (14:43 +0100)] 
res_pjsip_session: Deferred re-INVITE without SDP send a=sendrecv instead of a=sendonly

Building on ASTERISK-25854. When the device requests hold by sending SDP with attribute recvonly, asterisk places the session in sendonly mode. When the device later requests to resume the call by using a re-INVITE excluding SDP, asterisk needs to change the sendonly mode to sendrecv again.

Change-Id: I60341ce3d87f95869f3bc6dc358bd3e8286477a6

4 years agoapp_queue: Fix leave-empty not recording a call as abandoned
Kfir Itzhak [Wed, 26 Aug 2020 09:58:21 +0000 (12:58 +0300)] 
app_queue: Fix leave-empty not recording a call as abandoned

This fixes a bug introduced mistakenly in ASTERISK-25665:
If leave-empty is enabled, a call may sometimes be removed from
a queue without recording it as abandoned.
This causes Asterisk to not generate an abandon event for that
call, and for the queue abandoned counter to be incorrect.

ASTERISK-29043 #close

Change-Id: I1a71b81df78adff59af587f1d8483cf57df430c7

4 years agoast_coredumper: Fix issues with naming
George Joseph [Fri, 28 Aug 2020 14:34:09 +0000 (08:34 -0600)] 
ast_coredumper: Fix issues with naming

If you run ast_coredumper --tarball-coredumps in the same directory
as the actual coredump, tar can fail because the link to the
actual coredump becomes recursive.  The resulting tarball will
have everything _except_ the coredump (which is usually what
you need)

There's also an issue that the directory name in the tarball
is the same as the coredump so if you extract the tarball the
directory it creates will overwrite the coredump.

So:

 * Made the link to the coredump use the absolute path to the
   file instead of a relative one.  This prevents the recursive
   link and allows tar to add the coredump.

 * The tarballed directory is now named <coredump>.output instead
   of just <coredump> so if you expand the tarball it won't
   overwrite the coredump.

Change-Id: I8b3eeb26e09a577c702ff966924bb0a2f9a759ea

4 years agoparking: Copy parker UUID as well.
Joshua C. Colp [Fri, 28 Aug 2020 09:29:23 +0000 (06:29 -0300)] 
parking: Copy parker UUID as well.

When fixing issues uncovered by GCC10 a copy of the parker UUID
was removed accidentally. This change restores it so that the
subscription has the data it needs.

ASTERISK-29042

Change-Id: I7d396a14ea648bd26d3c363dd78e78bd386b544a

4 years agofollowme: allow disabling callee prompt
Tzafrir Cohen [Tue, 3 May 2016 16:11:20 +0000 (19:11 +0300)] 
followme: allow disabling callee prompt

Add the option 'enable_callee_prompt' to followme.conf. Enabled by
default. If disabled, a callee is not prompted to accept or reject
the forwarded call.

ASTERISK-29010 #close

Change-Id: Ic15a2bac4f16d0fce7a1b5e7b375f9bafee37aa4
Signed-off-by: Tzafrir Cohen <tzafrir.cohen@xorcom.com>
4 years agoapp_voicemail: Fix pollmailboxes
Sean Bright [Wed, 26 Aug 2020 13:55:37 +0000 (09:55 -0400)] 
app_voicemail: Fix pollmailboxes

The name of the voicemail context was overwriting the name of the
subscribed mailbox. Fix by simplifying how we create the MWI
subscription.

ASTERISK-29029 #close

Change-Id: Ie8a7db6a0b68f3995b0846bbb733a21909ba44e5

4 years agosip_nat_settings: Update script for latest Linux.
Alexander Traud [Wed, 26 Aug 2020 15:43:13 +0000 (17:43 +0200)] 
sip_nat_settings: Update script for latest Linux.

With the latest Linux, 'ifconfig' is not installed on default anymore.
Furthermore, the output of the current net-tools 'ifconfig' changed.
Therefore, parsing failed. This update uses 'ip addr show' instead.
Finally, the service for the external IP changed.

Change-Id: I9b1a7c3f457e3553b50a3e9a55524e40d70245a0

4 years agosamples: Fix keep_alive_interval default in pjsip.conf.
Alexander Traud [Wed, 26 Aug 2020 15:19:55 +0000 (17:19 +0200)] 
samples: Fix keep_alive_interval default in pjsip.conf.

Since ASTERISK_27978 the default is not off but 90 seconds. That change
happened because ASTERISK_27347 disabled the keep-alives in the bundled
PJProject and Asterisk should behave the same as before.

Change-Id: Ie63dc558ade6a5a2b969c30a4bd492d63730dc46

4 years agochan_pjsip: disallow PJSIP_SEND_SESSION_REFRESH pre-answer execution
Kevin Harwell [Mon, 24 Aug 2020 21:26:23 +0000 (16:26 -0500)] 
chan_pjsip: disallow PJSIP_SEND_SESSION_REFRESH pre-answer execution

This patch makes it so if the PJSIP_SEND_SESSION_REFRESH dialplan function
is called on a channel prior to answering a warning is issued and the
function returns unsuccessful.

ASTERISK-28878 #close

Change-Id: I053f767d10cf3b2b898fa9e3e7c35ff07e23c9bb

4 years agopbx: Fix hints deadlock between reload and ExtensionState.
Joshua C. Colp [Thu, 27 Aug 2020 10:31:40 +0000 (07:31 -0300)] 
pbx: Fix hints deadlock between reload and ExtensionState.

When the ExtensionState AMI action is executed on a pattern matched
hint it can end up adding a new hint if one does not already exist.
This results in a locking order of contexts -> hints -> contexts.

If at the same time a reload is occurring and adding its own hint
it will have a locking order of hints -> contexts.

This results in a deadlock as one thread wants a lock on contexts
that the other has, and the other thread wants a lock on hints
that the other has.

This change enforces a hints -> contexts locking order by explicitly
locking hints in the places where a hint is added when queried for.
This matches the order seen through normal adding of hints.

ASTERISK-29046

Change-Id: I49f027f4aab5d2d50855ae937bcf5e2fd8bfc504

4 years agores_speech: Bump reference on format object
Nickolay Shmyrev [Fri, 21 Aug 2020 21:53:04 +0000 (23:53 +0200)] 
res_speech: Bump reference on format object

Properly bump reference on format object to avoid memory corruption on double free

ASTERISK-29040 #close

Change-Id: Ic5a7faabfe2ef965ddb024186e1de7ca4542e2a3

4 years agores_pjsip_diversion: handle 181
Torrey Searle [Wed, 22 Jul 2020 08:45:57 +0000 (10:45 +0200)] 
res_pjsip_diversion: handle 181

Adapt the response handler so it also called when 181 is received.
In the case 181 is received, also generate the 181 response.

ASTERISK-29001 #close

Change-Id: I73cfee46a8ca85371280ebdb38674f8fde7510df

4 years agoapp_voicemail: Process urgent messages with mailcmd
Sean Bright [Fri, 21 Aug 2020 14:17:59 +0000 (10:17 -0400)] 
app_voicemail: Process urgent messages with mailcmd

Rather than putting messages into INBOX and then moving them to Urgent
later, put them directly in to the Urgent folder. This prevents
mailcmd from being skipped.

ASTERISK-27273 #close

Change-Id: I49934e093290d308506ab8d45a40ef705c5ae4f5

4 years agores_pjsip_session: Don't aggressively terminate on failed re-INVITE.
Joshua C. Colp [Tue, 18 Aug 2020 09:36:05 +0000 (06:36 -0300)] 
res_pjsip_session: Don't aggressively terminate on failed re-INVITE.

Per the RFC when an outgoing re-INVITE is done we should
only terminate the dialog if a 481 or 408 is received.

ASTERISK-29033

Change-Id: I6c3ff513aa41005d02de0396ba820083e9b18503

4 years agoscope_trace: Updated macro stubs to match other branches
George Joseph [Thu, 20 Aug 2020 13:57:27 +0000 (07:57 -0600)] 
scope_trace: Updated macro stubs to match other branches

Although scope tracing isn't actually implemented in this branch,
macro stubs had been added to allow code that used scope tracing
to be cherry-picked to this branch without modification.

To match the other branches, the following changes were made
to the stubs...

The SCOPE_ENTER and SCOPE_EXIT* macros now print debug messages
at the same level as the scope level.  This allows the same
messages to be printed to the debug log when AST_DEVMODE
isn't enabled.

Also added a few variants of the SCOPE_EXIT macros that will
also call ast_log instead of ast_debug to make it easier to
use scope tracing and still print error messages.

Change-Id: Ifc281793a5b91c84a4f1633db9d07006d31585ed

4 years agobridge_channel: Ensure text messages are zero terminated
Sean Bright [Wed, 19 Aug 2020 17:29:51 +0000 (13:29 -0400)] 
bridge_channel: Ensure text messages are zero terminated

T.140 data in RTP is not zero terminated, so when we are queuing a text
frame on a bridge we need to ensure that we are passing a zero
terminated string.

ASTERISK-28974 #close

Change-Id: Ic10057387ce30b2094613ea67e3ae8c5c431dda3

4 years agochan_sip: Clear ToHost property on peer when changing to dynamic host
Dennis Buteyn [Tue, 18 Feb 2020 12:30:31 +0000 (14:30 +0200)] 
chan_sip: Clear ToHost property on peer when changing to dynamic host

The ToHost parameter was not cleared when a peer's host value was
changed to dynamic. This causes invites to be sent to the original host.

ASTERISK-29011 #close

Change-Id: I9678d512741f71baca8f131a65b7523020b07d5c

4 years agostasis_bridge.c: Fixed wrong video_mode shown
sungtae kim [Fri, 10 Jul 2020 23:14:53 +0000 (01:14 +0200)] 
stasis_bridge.c: Fixed wrong video_mode shown

Currently, if the bridge has created by the ARI, the video_mode
parameter was
not shown in the BridgeCreated event correctly.

Fixed it and added video_mode shown in the 'bridge show <bridge id>'
cli.

ASTERISK-28987

Change-Id: I8c205126724e34c2bdab9380f523eb62478e4295

4 years agores_musiconhold.c: Prevent crash with realtime MoH
Sean Bright [Thu, 6 Aug 2020 14:58:22 +0000 (10:58 -0400)] 
res_musiconhold.c: Prevent crash with realtime MoH

The MoH class internal file vector is potentially being manipulated by
multiple threads at the same time without sufficient locking. Switch to
a reference counted list and operate on copies where necessary.

ASTERISK-28927 #close

Change-Id: I479c5dcf88db670956e8cac177b5826c986b0217

4 years agovector.h: Fix implementation of AST_VECTOR_COMPACT() for empty vectors
Sean Bright [Tue, 4 Aug 2020 15:51:16 +0000 (11:51 -0400)] 
vector.h: Fix implementation of AST_VECTOR_COMPACT() for empty vectors

The assumed behavior of realloc() - that it was effectively a free() if
its second argument was 0 - is Linux specific behavior and is not
guaranteed by either POSIX or the C specification.

Instead, if we want to resize a vector to 0, do it explicitly.

Change-Id: Ife31d4b510ebab41cb5477fdc7ea4e3138ca8b4f

5 years agopjproject: clone sdp to protect against (nat) modifications
Michael Neuhauser [Tue, 30 Jun 2020 15:40:41 +0000 (17:40 +0200)] 
pjproject: clone sdp to protect against (nat) modifications

PJSIP, UDP transport with external_media_address and session timers
enabled. Connected to SIP server that is not in local net. Asterisk
initiated the connection and is refreshing the session after 150s
(timeout 300s). The 2nd refresh-INVITE triggered by the pjsip timer has
a malformed IP address in its SDP (garbage string). This only happens
when the SDP is modified by the nat-code to replace the local IP address
with the configured external_media_address.
Analysis: the code to modify the SDP (in
res_pjsip_session.c:session_outgoing_nat_hook() and also (redundantly?)
in res_pjsip_sdp_rtp.c:change_outgoing_sdp_stream_media_address()) uses
the tdata->pool to allocate the replacement string. But the same
pjmedia_sdp_stream that was modified for the 1st refresh-INVITE is also
used for the 2nd refresh-INVITE (because it is stored in pjmedia's
pjmedia_sdp_neg structure). The problem is, that at that moment, the
tdata->pool that holds the stringified external_media_address from the
1. refresh-INVITE has long been reused for something else.
Fix by Sauw Ming of pjproject (see
https://github.com/pjsip/pjproject/pull/2476): the local, potentially
modified pjmedia_sdp_stream is cloned in
pjproject/source/pjsip/src/pjmedia/sip_neg.c:process_answer() and the
clone is stored, thereby detaching from the tdata->pool (which is only
released *after* process_answer())

ASTERISK-28973
Reported-by: Michael Neuhauser
Change-Id: I272ac22436076596e06aa51b9fa23fd1c7734a0e

5 years agores_pjsip_registrar: Don't specify an expiration for static contacts.
Joshua C. Colp [Wed, 22 Jul 2020 09:41:59 +0000 (06:41 -0300)] 
res_pjsip_registrar: Don't specify an expiration for static contacts.

Statically configured contacts on an AOR don't have an expiration
time so when adding them to the resulting 200 OK if an endpoint
registers ensure they are marked as such.

ASTERISK-28995

Change-Id: I9f0e45eb2ccdedc9a0df5358634a19ccab0ad596

5 years agoutf8.c: Add UTF-8 validation and utility functions
Sean Bright [Mon, 13 Jul 2020 20:06:14 +0000 (16:06 -0400)] 
utf8.c: Add UTF-8 validation and utility functions

There are various places in Asterisk - specifically in regards to
database integration - where having some kind of UTF-8 validation would
be beneficial. This patch adds:

* Functions to validate that a given string contains only valid UTF-8
  sequences.

* A function to copy a string (similar to ast_copy_string) stopping when
  an invalid UTF-8 sequence is encountered.

* A UTF-8 validator that allows for progressive validation.

All of this is based on the excellent UTF-8 decoder by Björn Höhrmann.
More information is available here:

    https://bjoern.hoehrmann.de/utf-8/decoder/dfa/

The API was written in such a way that should allow us to replace the
implementation later should we determine that we need something more
comprehensive.

Change-Id: I3555d787a79e7c780a7800cd26e0b5056368abf9

5 years agovector.h: Add AST_VECTOR_SORT()
Sean Bright [Mon, 20 Jul 2020 18:17:45 +0000 (14:17 -0400)] 
vector.h: Add AST_VECTOR_SORT()

Allows a vector to be sorted in-place, rather than only during
insertion.

Change-Id: I22cba9ddf556a7e44dacc53c4431bd81dd2fa780

5 years agoCI: Force publishAsteriskDocs to use python2
George Joseph [Thu, 16 Jul 2020 13:41:16 +0000 (07:41 -0600)] 
CI: Force publishAsteriskDocs to use python2

Change-Id: I7d951e75ad2d472fa096647dfb55670b11105e23

5 years agoacl.c: Coerce a NULL pointer into the empty string
Sean Bright [Mon, 13 Jul 2020 20:42:40 +0000 (16:42 -0400)] 
acl.c: Coerce a NULL pointer into the empty string

If an ACL is misconfigured in the realtime database (for instance, the
"rule" is blank) and Asterisk attempts to read the ACL, Asterisk will
crash.

ASTERISK-28978 #close

Change-Id: Ic1536c4df856231bfd2da00128f7822224d77610

5 years agopjsip: Include timer patch to prevent cancelling timer 0.
Joshua C. Colp [Mon, 13 Jul 2020 09:41:22 +0000 (06:41 -0300)] 
pjsip: Include timer patch to prevent cancelling timer 0.

I noticed this while looking at another issue and brought
it up with Teluu. It was possible for an uninitialized timer
to be cancelled, resulting in the invalid timer id of 0
being placed into the timer heap causing issues.

This change is a backport from the pjproject repository
preventing this from happening.

Change-Id: I1ba318b1f153a6dd7458846396e2867282b428e7

5 years agores_http_websocket: Avoid reading past end of string
Nickolay Shmyrev [Thu, 2 Jul 2020 22:19:50 +0000 (00:19 +0200)] 
res_http_websocket: Avoid reading past end of string

We read beyond the end of the buffer when copying the string out of the
buffer when we used ast_copy_string() because the original string was
not null terminated. Instead switch to ast_strndup() which does not
exhibit the same behavior.

ASTERISK-28975 #close

Change-Id: Ib4a75cffeb1eb8cf01136ef30306bd623e531a2a

5 years agoUpdate CHANGES and UPGRADE.txt for 13.35.0
Asterisk Development Team [Thu, 9 Jul 2020 15:27:42 +0000 (10:27 -0500)] 
Update CHANGES and UPGRADE.txt for 13.35.0

5 years agoScope Trace: Update stub defines
George Joseph [Mon, 6 Jul 2020 00:03:56 +0000 (18:03 -0600)] 
Scope Trace: Update stub defines

Reminder:  13 doesn't support scope tracing but we're keeping
the stub defines consistent across branches.

Change-Id: If00733a4d5a4e829cbb4c934bcc2f4c1a80dab81

5 years agores_pjsip.c: Added disable_rport option for pjsip.conf
sungtae kim [Tue, 23 Jun 2020 23:27:47 +0000 (01:27 +0200)] 
res_pjsip.c: Added disable_rport option for pjsip.conf

Currently when the pjsip making an outgoing request, it keep adding the
rport parameter in a request message as a default.

This causes unexpected rport handle at the other end.

Added option for disable this behaviour in the pjsip.conf.

This is a system option, but working as a gloabl option.

ASTERISK-28959

Change-Id: I9596675e52a742774738b5aad5d1fec32f477abc

5 years agores_http_websocket.c: Continue reading after ping/pong
Nickolay Shmyrev [Mon, 22 Jun 2020 17:16:15 +0000 (19:16 +0200)] 
res_http_websocket.c: Continue reading after ping/pong

Do not return error if the client received ping frame
while looking for a string and just wait for another frame.

ASTERISK-28958 #close

Change-Id: I4d06b4827bd71e56cbaafc011ffdcef9f0332922

5 years agoPJSIP_MEDIA_OFFER: override what's specified on configuration
Kevin Harwell [Tue, 30 Jun 2020 15:40:47 +0000 (10:40 -0500)] 
PJSIP_MEDIA_OFFER: override what's specified on configuration

When using the PSJIP_MEDIA_OFFER dialplan function it was not
overriding an endpoint's configured codecs unless they had a
shared codec between the two.

This patch makes it so whatever is set using PJSIP_MEDIA_OFFER
is used when creating the SDP definition no matter what.

ASTERISK-28878 #close

Change-Id: I0f7dc86fd0fb607c308e6f98ede303c54d1eacb6

5 years agomanager - Add Content-Type parameter to the SendText action
Kevin Harwell [Wed, 10 Jun 2020 21:58:24 +0000 (16:58 -0500)] 
manager - Add Content-Type parameter to the SendText action

This patch allows a user of AMI to now specify the type of message
content contained within by setting the 'Content-Type' parameter.

Note, the AMI version has been bumped for this change.

ASTERISK-28945 #close

Change-Id: Ibb5315702532c6b954e1498beddc8855fabdf4bb

5 years agologger: Fix scope trace defines
George Joseph [Mon, 29 Jun 2020 13:00:40 +0000 (07:00 -0600)] 
logger: Fix scope trace defines

Although not implemented in the 13 branch, we need to keep the
defines consistent across all branches.

Change-Id: Id88ad71ca36818a35f1f14a5acb450e240366301

5 years agores_pjsip: Apply AOR outbound proxy to static contacts.
Joshua C. Colp [Fri, 26 Jun 2020 10:18:55 +0000 (07:18 -0300)] 
res_pjsip: Apply AOR outbound proxy to static contacts.

The outbound proxy for an AOR was not being applied to
any statically configured Contacts. This resulted in the
OPTIONS requests being sent to the wrong target.

This change sets the outbound proxy on statically configured
contacts once the AOR configuration is done being
applied.

ASTERISK-28965

Change-Id: Ia60f3e93ea63f819c5a46bc8b54be2e588dfa9e0

5 years agomenuselect: Resolve infinite loop in dependency scenario.
Joshua C. Colp [Wed, 24 Jun 2020 10:25:47 +0000 (07:25 -0300)] 
menuselect: Resolve infinite loop in dependency scenario.

Given a scenario where a module has a dependency on both
an external library and a module if the external library was
available and the module was not an infinite loop would
occur. This happened due to the code changing the dependecy
status to no failure on each dependency checking loop
iteration, resulting in the code thinking that it had
gone from no failure to failure each time triggering another
dependency check.

This change makes it so that the old dependency status is
preserved throughout the dependency checking allowing it to
determine that after the first iteration the dependency
status does not transition from no failure to failure.

ASTERISK-28930

Change-Id: Iea06d45d9fd6d8bfd068882a0bb7e23a53ec3e84

5 years agochan_sip: chan_sip does not process 400 response to an INVITE.
Frederic LE FOLL [Mon, 22 Jun 2020 09:08:47 +0000 (11:08 +0200)] 
chan_sip: chan_sip does not process 400 response to an INVITE.

chan_sip handle_response() function, for a 400 response to an INVITE,
calls handle_response_invite() and does not generate ACK.
handle_response_invite() does not recognize 400 response and has no
default response processing for unexpected responses, thus it does not
generate ACK either.
The ACK on response repetition comes from handle_response() mechanism
"We must re-send ACKs to re-transmitted final responses".

According to code history, 400 response specific processing was
introduced with commit
"channels/chan_sip: Add improved support for 4xx error codes"
This commit added support for :
- 400/414/493 in handle_response_subscribe() handle_response_register()
  and handle_response().
- 414/493 only in handle_response_invite().

This fix adds 400 response support in handle_response_invite().

ASTERISK-28957

Change-Id: Ic71a087e5398dfc7273946b9ec6f9a36960218ad

5 years agores_corosync: Fix crash in huge distributed environment.
Università di Bologna - CESIA VoIP [Wed, 3 Jun 2020 10:05:20 +0000 (12:05 +0200)] 
res_corosync: Fix crash in huge distributed environment.

1) Fix memory-leaks
   Added code to release ast_events extracted from corosync and stasis messages

2) Clean stasis cache when a member of the corosync cluster leaves the group
   Added code to remove from the stasis cache of the members remained on the
   group all the messages with the EID of the left member.
   If the device states of the left member remain in the stasis cache of other
   members, they will not be updated anymore and high priority cached values,
   like BUSY, will take precedence over current device states.

3) Stop corosync event propagation when node is not joined to the group
   Updated dispatch_thread_handler code to detect when asterisk is not joined
   to the corosync group and added some condition in publish_event_to_corosync
   code to send corosync messages only when joined.
   When a node is not joined its corosync daemon can't send messages:
   the cpg_mcast_joined function append new messages to the FIFO buffer until
   it's full and then it blocks indefinitely.
   In this scenario if the stasis_message_cb callback, registered by
   res_corosync to handle stasis messages, try to send a corosync messages,
   the thread of the stasis thread-pool will be blocked until the node join
   the corosync cluster.

ASTERISK-28888
Reported by: Università di Bologna - CESIA VoIP

Change-Id: Ie8e99bc23f141a73c13ae6fb1948d148d4de17f2

5 years agores_http_websocket: Add payload masking to the websocket client
Moises Silva [Sat, 13 Jun 2020 16:29:13 +0000 (16:29 +0000)] 
res_http_websocket: Add payload masking to the websocket client

ASTERISK-28949

Change-Id: Id465030f2b1997b83d408933fdbabe01827469ca

5 years agochan_dadhi: Fix setvar in dahdi channels
Guido Falsi [Thu, 18 Jun 2020 10:14:26 +0000 (12:14 +0200)] 
chan_dadhi: Fix setvar in dahdi channels

The change to how setvar works for various channels performed in
ASTERISK~23756 missed some required change in the dahdi channel,
where the variables are actually set while reading configuration.
This change should fix the issue.

ASTERISK-28955

Change-Id: Ibfeb7f8cbdd735346dc4028de6a265f24f9df274

5 years agores_sorcery_memory_cache: Disallow per-object expire with full backend.
Joshua C. Colp [Wed, 10 Jun 2020 09:35:50 +0000 (06:35 -0300)] 
res_sorcery_memory_cache: Disallow per-object expire with full backend.

The AMI action and CLI command did not take into account the properties
of full backend caching. This resulted in an expired object remaining
removed until a full backend update occurred, instead of having the
object updated when needed.

This change makes it so that the AMI action and CLI command for object
expire will now fail instead of putting the cache into an undesired
state. If full backend caching is enabled then only operations
which act on the entire cache are available.

ASTERISK-28942

Change-Id: Id662d888f177ab566c8e802ad583083b742d21f4

5 years agoapp_queue: Read latest wrapuptime instead of (possibly stale) copy
Walter Doekes [Mon, 15 Jun 2020 11:55:37 +0000 (13:55 +0200)] 
app_queue: Read latest wrapuptime instead of (possibly stale) copy

Before this changeset, it was possible that a queue member (agent) was
called even though they just got out of a call, and wrapuptime seconds
hadn't passed yet.

This could happen if a member ended a call _between_ a new call attempt
and asterisk trying that particular member for a new call.

In that case, Asterisk would check the hangup time of the
call-before-the-last-call instead of the hangup time of the-last-call.

ASTERISK-28952

Change-Id: Ie0cab8f0e8d639c01cba633d4968ba19873d80b3

5 years agoapp_queue: Remove stale code in try_calling
Walter Doekes [Mon, 15 Jun 2020 11:53:31 +0000 (13:53 +0200)] 
app_queue: Remove stale code in try_calling

Because ring_entry() is not called, outgoing->chan is not touched here
either.

ASTERISK-28950
ASTERISK-28644

Change-Id: I564613715dfaf45af868251eb75a451f512af90f

5 years agores_pjsip: Include <pjsip_ua.h> instead of internal "pjsua-lib/pjsua.h"
Walter Doekes [Mon, 15 Jun 2020 12:09:19 +0000 (14:09 +0200)] 
res_pjsip: Include <pjsip_ua.h> instead of internal "pjsua-lib/pjsua.h"

Change-Id: I24b5453df412232cf7f9a171ea4a34b35ad3ae78

5 years agopjproject: Upgrade bundled version to pjproject 2.10
Kevin Harwell [Fri, 15 May 2020 21:08:20 +0000 (16:08 -0500)] 
pjproject: Upgrade bundled version to pjproject 2.10

This patch makes the usual necessary changes when upgrading to a new
version pjproject. For instance, version number bump, patches removed
from third-party, new *.md5 file added, etc..

This patch also includes a change to the Asterisk pjproject Makefile to
explicitly create the 'source/pjsip-apps/lib' directory. This directory
is no longer there by default so needs to be added so the Asterisk
malloc debug can be built.

This patch also includes some minor changes to Asterisk that were a result
of the upgrade. Specifically, there was a backward incompatibility change
made in 2.10 that modified the "expires header" variable field from a
signed to an unsigned value. This potentially effects comparison. Namely,
those check for a value less than zero. This patch modified a few locations
in the Asterisk code that may have been affected.

Lastly, this patch adds a new macro PJSIP_MINVERSION that can be used to
check a minimum version of pjproject at compile time.

ASTERISK-28899 #close

Change-Id: Iec8821c6cbbc08c369d0e3cd2f14e691b41d0c81

5 years agores_fax: Don't start a gateway if either channel is hung up
George Joseph [Wed, 3 Jun 2020 16:23:31 +0000 (10:23 -0600)] 
res_fax: Don't start a gateway if either channel is hung up

When fax_gateway_framehook is called and a gateway hasn't already
been started, the framehook gets the t38 state for both the current
channel and the peer.  That call trickles down to the channel
driver which determines the state.  If either channel is hung up
(or in the process of being hung up), the channel driver's tech_pvt
is going to be NULL which, in the case of chan_pjsip, will cause a
segfault.

* Added a hangup check for both the channel and peer channel
  before starting a fax gateway.

* Added a check for NULL tech_pvt to chan_pjsip_queryoption
  so we don't attempt to reference a tech_pvt that's already
  gone.

ASTERISK-28923
Reported by: Yury Kirsanov

Change-Id: I4e10e63b667bbb68c1c8623f977488f5d807897c

5 years agoCompiler fixes for gcc 10
Kevin Harwell [Wed, 3 Jun 2020 16:45:39 +0000 (11:45 -0500)] 
Compiler fixes for gcc 10

This patch fixes a few compile warnings/errors that now occur when using gcc
10+.

Also, the Makefile.rules check to turn off partial inlining in gcc versions
greater or equal to 8.2.1 had a bug where it only it only checked against
versions with at least 3 numbers (ex: 8.2.1 vs 10). This patch now ensures
any version above the specified version is correctly compared.

Change-Id: I54718496eb0c3ce5bd6d427cd279a29e8d2825f9

5 years agopjsip: Prevent invalid memory access when attempting to contact a non-sip URI
Walter Doekes [Fri, 5 Jun 2020 09:30:29 +0000 (11:30 +0200)] 
pjsip: Prevent invalid memory access when attempting to contact a non-sip URI

You cannot cast a pjsip_uri to a pjsip_sip_uri using pjsip_uri_get_uri,
without checking that it's a PJSIP_URI_SCHEME_IS_SIP(S).

ASTERISK-28936

Change-Id: I9f572b3677e4730458e9402719e580f8681afe2a

5 years agores_fax: Don't consume frames given to fax gateway on write.
Joshua C. Colp [Wed, 27 May 2020 08:47:07 +0000 (05:47 -0300)] 
res_fax: Don't consume frames given to fax gateway on write.

In a particular fax gateway scenario whereby it would
have to translate using the read translation path on a
channel the frame being translated would be consumed.
When the frame is in the write path it is not permitted
to free the frame as the caller expects it to continue
to exist.

This change makes it so that the frame is only consumed
on the read path where it is acceptable to free it.

ASTERISK-28900

Change-Id: I011c321288a1b056d92b37c85e229f4a28ee737d

5 years agopjproject_bundled: Honor --without-pjproject.
Alexander Traud [Tue, 2 Jun 2020 11:24:11 +0000 (13:24 +0200)] 
pjproject_bundled: Honor --without-pjproject.

The previous change missed that 'make' uses 'PJPROJECT_BUNDLED' anyway.

ASTERISK-28929

Change-Id: I7ef0e78a06ea391b59d95b99d46bbed3fec4fed9

5 years agores_pjsip_logger: use the correct pointer when logging tx_messages to pcap
Pirmin Walthert [Thu, 4 Jun 2020 06:50:35 +0000 (08:50 +0200)] 
res_pjsip_logger: use the correct pointer when logging tx_messages to pcap

When writing tx messages to pcap files, Asterisk is using the wrong
pointer resulting in lots of wasted space. This patch fixes it to use
the correct pointer.

ASTERISK-28932 #close

Change-Id: I5b8253dd59a083a2ca2c81f232f1d14d33c6fd23

5 years agoScope Tracing: Add stubs to allow easier cherry-picking
George Joseph [Thu, 21 May 2020 13:20:28 +0000 (07:20 -0600)] 
Scope Tracing:  Add stubs to allow easier cherry-picking

Scope tracing isn't supported in Asterisk 13 due to changes made
to logging between 13 and 16 but since the scope tracing macros
may be present in the 16, 17 and master branches, those macros
are defined here as NOOPs so cherry-picking changes downward
to 13 can still be seamless.

Change-Id: I0390ce5651374d8f3e06d7620050acb22c5440a2

5 years agores_rtp_asterisk: Re-order RTP destruction.
Joshua C. Colp [Sun, 31 May 2020 22:10:29 +0000 (19:10 -0300)] 
res_rtp_asterisk: Re-order RTP destruction.

The destructor for RTP deallocated transport resources
before terminating the ICE support. This could result
in a crash as the thread handling ICE would access already
freed parts of the RTP data.

This change re-orders the destruction so that ICE is
stopped before destroying things.

ASTERISK-28885

Change-Id: Ie71add549f12b6cdea7e9dbf976d1bd1d2fc0bdc

5 years agores_pjsip_logger.c: correct the return value checks when writing to pcap
Pirmin Walthert [Fri, 29 May 2020 09:28:57 +0000 (11:28 +0200)] 
res_pjsip_logger.c: correct the return value checks when writing to pcap
files

fwrite() does return the number of elements written and not the
number of bytes. However asterisk is currently comparing the return
value to the size of the written element what means that asterisk logs
five WARNING messages on every packet written to the pcap file.

This patch changes the code to check for the correct value, which will
always be 1.

ASTERISK-28921 #close

Change-Id: I2455032d9cb4c5a500692923f9e2a22e68b08fc2

5 years agoUpdate CHANGES and UPGRADE.txt for 13.34.0
Asterisk Development Team [Thu, 28 May 2020 12:05:36 +0000 (07:05 -0500)] 
Update CHANGES and UPGRADE.txt for 13.34.0

5 years agores_pjsip: Use correct pool for storing the contact_user value.
Joshua C. Colp [Wed, 27 May 2020 14:35:42 +0000 (11:35 -0300)] 
res_pjsip: Use correct pool for storing the contact_user value.

When replacing the user portion of the Contact URI the code
was using the ephemeral pool instead of the tdata pool. This
could cause the Contact user value to become invalid after a
period of time.

The code will now use the tdata pool which persists for the
lifetime of the message instead.

ASTERISK-28794

Change-Id: I31e7b958e397cbdaeedd0ebb70bcf8dd2ed3c4d5

5 years agores_pjsip_nat.c: remove x-ast-orig-host from request URI and To header
Pirmin Walthert [Wed, 13 May 2020 12:06:19 +0000 (14:06 +0200)] 
res_pjsip_nat.c: remove x-ast-orig-host from request URI and To header

While asterisk is filtering out the x-ast-orig-host parameter from the
contact on response messages, it is not filtering it out from the
request URI and the to header on SIP requests (for example INVITE).

ASTERISK-28884 #close

Change-Id: Id032b33098a1befea9b243ca994184baecccc59e

5 years agores_sorcery_config: Always reload configuration on errors.
Joshua C. Colp [Tue, 19 May 2020 12:55:32 +0000 (09:55 -0300)] 
res_sorcery_config: Always reload configuration on errors.

When a configuration file in Asterisk is loaded
information about it is stored such that on a
reload it is not reloaded if nothing has changed.
This can be problematic when an error exists in
a configuration file in PJSIP since the error
will be output at start and not subsequently on
reload if the file is unchanged.

This change makes it so that if an error is
encountered when res_sorcery_config is loading
a configuration file a reload will always read
in the configuration file, allowing the error
to be seen easier.

Change-Id: If2e05a017570f1f5f4f49120da09601e9ecdf9ed

5 years agobridge_softmix: Always remove audio from mixed frame.
Joshua C. Colp [Tue, 19 May 2020 09:18:58 +0000 (06:18 -0300)] 
bridge_softmix: Always remove audio from mixed frame.

When receiving audio from a channel we determine if it
is talking or silence based on a threshold value. If
this threshold is met we always mix the audio into the
conference bridge. If this threshold is not met we also
mix the audio into the conference bridge UNLESS the
drop silence option is enabled.

The code that removed the audio from the mixed frame
assumed that it was always not present if it did not
meet the threshold to be considered talking. This is
incorrect. If it has been stated that the audio was
mixed into the mixed frame then it has been mixed into
the mixed frame. By not removing audio that was
considered non-talking it was possible for a channel
to receive a slight echo of audio of itself at times.

This change ensures that the audio is always removed
from the mixed frame going back to the channel so it
no longer receives the slight echo.

ASTERISK-28898

Change-Id: I7b1b582cc1bcdb318ecc60c9d2e3d87ae31d55cb

5 years agores_pjsip_logger: Expand functionality to improve logging.
Joshua C. Colp [Thu, 30 Apr 2020 22:57:08 +0000 (19:57 -0300)] 
res_pjsip_logger: Expand functionality to improve logging.

The PJSIP packet logger now has the following CLI commands:

pjsip set logger pcap <filename>

When used this will create a pcap file containing the incoming
and outgoing SIP packets, in unencrypted form.

pjsip set logger verbose <on / off>

This allows you to toggle logging to verbose on and off.

pjsip set logger host <IP/subnet mask> add

This allows you to add an additional IP address or subnet
mask to logging, allowing you to log multiple instead of
just a single IP address or all traffic.

The normal "pjsip set logger host" CLI command has also been
expanded to allow subnet masks as well.

ASTERISK-28895

Change-Id: If5859161a72b0d7dd2d1f92d45bed88e0cd07d0e

5 years agores_rtp_asterisk.c: Fixed memory leak
sungtae kim [Mon, 18 May 2020 16:31:58 +0000 (16:31 +0000)] 
res_rtp_asterisk.c: Fixed memory leak

Added freeifaddrs() for memory releasing.

ASTERISK-28904

Change-Id: I109403866e85a30659351946903a679de9727a8f

5 years agopjproject: Fix race condition when building with parallel make
Guido Falsi [Fri, 8 May 2020 11:11:47 +0000 (13:11 +0200)] 
pjproject: Fix race condition when building with parallel make

Pjproject makefiles miss some dependencies which can cause race
conditions when building with parallel make processes. This patch
adds such dependencies correctly.

ASTERISK-28879 #close
Reported-by: Dmitry Wagin <dmitry.wagin@ya.ru>
Change-Id: Ie1b0dc365dafe4a84c5248097fe8d73804043c22

5 years agores_pjsip_history.c: Fix to stop SIGSEGV when IPv6 addresses are encountered.
Roger James [Sat, 9 May 2020 07:46:51 +0000 (08:46 +0100)] 
res_pjsip_history.c: Fix to stop SIGSEGV when IPv6 addresses are encountered.

Changed source and destination address fields in struct
pjsip_history_entry so that they are long enough to hold an IPv6
address.

ASTERISK-28854

Change-Id: Id65bb9aa961e9ecbcb500815e18170f774e34d3e

5 years agotcptls: Fix notice when TLS is enabled but not supported.
traud [Wed, 1 Apr 2020 13:50:28 +0000 (15:50 +0200)] 
tcptls: Fix notice when TLS is enabled but not supported.

ASTERISK-28797

Change-Id: Iab364a2c2519fd9d11d1c28293fda43d61b64c28

5 years agoapp_osplookup: Avoid a format truncation.
traud [Sat, 4 Apr 2020 09:28:06 +0000 (11:28 +0200)] 
app_osplookup: Avoid a format truncation.

Ensure that output buffers for the osp_convert_inout
function have sufficient space for additional data
such as brackets and ports.

ASTERISK-28804

Change-Id: Ie54c8241ff0cc653910539c2db00ff2a4869750b

5 years agoapp.c: make sure that no non-async-signal-safe syscalls are used after
Pirmin Walthert [Tue, 14 Apr 2020 16:02:19 +0000 (18:02 +0200)] 
app.c: make sure that no non-async-signal-safe syscalls are used after
fork before exec

Posix does only allow async-signal-safe syscalls after fork before exec.
As asterisk ignores this, functions like TrySystem or System sometimes
end up in a deadlocked child process. The patch prevents the use of
non-async-signal-safe syscalls.

ASTERISK-28776

Change-Id: Idc76365c0592ee3f3b3bd72a4f48f7a098978e8e

5 years agoapp_queue: track masquerades in app_queue to avoid leaked stasis subscriptions
Nathan Bruning [Wed, 8 Apr 2020 23:41:55 +0000 (01:41 +0200)] 
app_queue: track masquerades in app_queue to avoid leaked stasis subscriptions

Add a new "masquarade" channel event, and use it in app_queue to track unique id's.

Testcase is submitted as https://gerrit.asterisk.org/c/testsuite/+/14210

ASTERISK-28829 #close
ASTERISK-25844 #close

Change-Id: Ifc5f9f9fd70903f3c6e49738d3bc632b085d2df6

5 years agopjproject: Remove bashism from configure.m4 script
Guido Falsi [Sun, 3 May 2020 10:30:15 +0000 (12:30 +0200)] 
pjproject: Remove bashism from configure.m4 script

The configure.m4 script for pjproject contains some += syntax, which
is specific to bash, replacing it with string substitutions makes
the script compatible with traditional Bourne shells.

ASTERISK-28866 #close
Reported-by: Christoph Moench-Tegeder <cmt@FreeBSD.org>
Change-Id: I382a78160e028044598b7da83ec7e1ff42b91c05

5 years agoRemove #include <sys/cdefs.h>
Jaco Kroon [Mon, 4 May 2020 08:29:44 +0000 (10:29 +0200)] 
Remove #include <sys/cdefs.h>

These are not provided by standards, and as a result causes failure to
compile on musl.

https://wiki.musl-libc.org/faq.html#Q:-When-compiling-something-against-musl,-I-get-error-messages-about-%3Ccode%3Esys/cdefs.h%3C/code%3E

Change-Id: I6a357cefd106c72cfecafd898638f6b5692c2e05

5 years agoapp_voicemail: Add workaround for a gcc 10 issue with -Wrestrict
George Joseph [Thu, 30 Apr 2020 15:56:03 +0000 (09:56 -0600)] 
app_voicemail: Add workaround for a gcc 10 issue with -Wrestrict

The gcc 10 -Wrestrict option was causing "overlap" errors when
snprintf was copying one char[256] structure member to another
char[256] member in the same structure.

Using ast_alloca instead of declaring the structure inline
solves the issue.

Here's a link to the "enhancement":
https://gcc.gnu.org/legacy-ml/gcc-patches/2019-10/msg00570.html

We may follow up with a gcc bug report.

Change-Id: Ie0099adcb0a9727bd9aa99e024dd912a67eaf534

5 years agocore_local: Local calls are always secure.
Alexander Traud [Mon, 27 Apr 2020 15:28:01 +0000 (17:28 +0200)] 
core_local: Local calls are always secure.

In a Dialplan, the channel drivers 'chan_sip' and 'chan_iax2' support
the channel items 'secure_bridge_media' and 'secure_bridge_signaling'.
That way, a channel can be forced to use encryption even if not
specified in its configuration.

However, when the Local Proxy kicks in, for example, in case of a
forwarding (SIP status 302), Local Proxy stated it does not know those
items. Consequently, such a call could not be proxied how clever your
Dialplan was. Because local calls within Asterisk are always secure,
Local Proxy accepts such a request now.

ASTERISK-22920

Change-Id: I4c143bb70f686790953cc04c5a4b810bbb03636c

5 years agopjsip: Increase maximum ICE candidate count.
Joshua C. Colp [Tue, 28 Apr 2020 15:31:28 +0000 (12:31 -0300)] 
pjsip: Increase maximum ICE candidate count.

In practice it has been seen that some users come
close to our maximum ICE candidate count of 32.
In case people have gone over this increases the
count to 64, giving ample room.

ASTERISK-28859

Change-Id: I35cd68948ec0ada86c14eb53092cdaf8b62996cf

5 years agores_rtp_asterisk: Protect access to nochecksums with #ifdef
Guido Falsi [Sun, 26 Apr 2020 10:56:47 +0000 (12:56 +0200)] 
res_rtp_asterisk: Protect access to nochecksums with #ifdef

Recently code accessing nochecksums variable has been added without including #ifdef SO_NO_CHECK protection, while the variable is created only when such constant is defined.

ASTERISK-28852 #close

Change-Id: I381718893b80599ab8635f2b594a10c1000d595e

5 years agochan_mobile: Add smoother to make SIP/RTP endpoints happy.
Peter Turczak [Fri, 17 Apr 2020 07:39:09 +0000 (08:39 +0100)] 
chan_mobile: Add smoother to make SIP/RTP endpoints happy.

In contrast to RFC 3551, section 4.2, several SIP/RTP clients misbehave
severly (up to crashing). This patch adds another smoother for the audio
received via bt. Therefore the audio frames sent to the core will be
CHANNEL_FRAME_SIZE.

ASTERISK-28832 #close

Change-Id: Ic5f9e2f35868ae59cc9356afbd1388b779a1267f

5 years agoUpdate CHANGES and UPGRADE.txt for 13.33.0
Asterisk Development Team [Thu, 23 Apr 2020 16:01:09 +0000 (11:01 -0500)] 
Update CHANGES and UPGRADE.txt for 13.33.0

5 years agores_ari_channels: Fixed endpoint 80 characters limit
sungtae kim [Tue, 21 Apr 2020 15:40:14 +0000 (15:40 +0000)] 
res_ari_channels: Fixed endpoint 80 characters limit

Fixed it to copy the entire string from the requested endpoint body except tech-prefix.

ASTERISK-28847

Change-Id: I91b5f6708a1200363f3267b847dd6a0915222c25

5 years agores_pjsip: Fixed format of IPv6 addresses for external media addresses
DanielYK [Wed, 15 Apr 2020 20:13:39 +0000 (22:13 +0200)] 
res_pjsip: Fixed format of IPv6 addresses for external media addresses

ASTERISK-28835

Change-Id: I66289afd164c5cdd6c5caa39e79d629a467e7a26

5 years agochan_sip: externhost/externaddr with non-default TCP/TLS ports.
Alexander Traud [Mon, 20 Apr 2020 18:11:42 +0000 (20:11 +0200)] 
chan_sip: externhost/externaddr with non-default TCP/TLS ports.

ASTERISK-28372
Reported by: Anton Satskiy

ASTERISK-24428
Reported by: sstream

Change-Id: I2b7432a9bf3b09dc8515297ff955636db7a6224c

5 years agocurl: Add build-time dependency.
Alexander Traud [Fri, 17 Apr 2020 11:51:31 +0000 (13:51 +0200)] 
curl: Add build-time dependency.

ASTERISK-28838

Change-Id: I34724e799e1ffaf723eb2c358abe8934dbadcd52

5 years agores_pjsip_refer: Add build-time dependency.
Alexander Traud [Fri, 17 Apr 2020 09:18:25 +0000 (11:18 +0200)] 
res_pjsip_refer: Add build-time dependency.

ASTERISK-28838

Change-Id: Ic693c3f464e35ec0db242afdb0a1415806af4e25

5 years agoapp_getcpeid: Add build-time dependency.
Alexander Traud [Fri, 17 Apr 2020 10:25:42 +0000 (12:25 +0200)] 
app_getcpeid: Add build-time dependency.

ASTERISK-28838

Change-Id: I68b78e7e4718be82507247433127ce3992a5ba96

5 years agores_pjsip: Add build-time dependency.
Alexander Traud [Fri, 17 Apr 2020 09:55:32 +0000 (11:55 +0200)] 
res_pjsip: Add build-time dependency.

ASTERISK-28838

Change-Id: Icb08304744ae3f34dce6ccb76f94379b8382a074

5 years agopjproject_bundled: Honor --without-pjproject.
Alexander Traud [Wed, 15 Apr 2020 18:01:58 +0000 (20:01 +0200)] 
pjproject_bundled: Honor --without-pjproject.

ASTERISK-28837

Change-Id: Id057324912a3cfe6f50af372675626bb515907d9

5 years agochan_sip: DiffServ/ToS not only on UDP but also on TCP and TLS sockets.
Alexander Traud [Wed, 15 Apr 2020 06:20:46 +0000 (08:20 +0200)] 
chan_sip: DiffServ/ToS not only on UDP but also on TCP and TLS sockets.

ASTERISK-27195
Reported by: Joshua Roys

Change-Id: I6e72ecb874200dec7a3865c7babaf5ac0d3101de

5 years agoinstall_prereq: Add libcap for high bits in DiffServ/ToS.
Alexander Traud [Wed, 15 Apr 2020 12:16:00 +0000 (14:16 +0200)] 
install_prereq: Add libcap for high bits in DiffServ/ToS.

works automatically; see Mantis 7047 (now ASTERISK-6863)

Change-Id: I27d2c109180bd857b6757fd532de48eddb78aee6

5 years agoBuildSystem: Only if found LibPRI, check its optional parts.
Alexander Traud [Wed, 15 Apr 2020 11:09:11 +0000 (13:09 +0200)] 
BuildSystem: Only if found LibPRI, check its optional parts.

Change-Id: If8445f899ee4ce0c606c484943d4ce0c8e43b5da

5 years agoBuildSystem: Only if found external PJProject, check its optional parts.
Alexander Traud [Wed, 15 Apr 2020 07:38:23 +0000 (09:38 +0200)] 
BuildSystem: Only if found external PJProject, check its optional parts.

Change-Id: I11d5693d25c166c99d8cebffc16184d58f6362de

5 years agores_rtp_asterisk.c: Check for first DTMF having timestamp set to 0
bernard merindol [Wed, 8 Apr 2020 10:29:42 +0000 (12:29 +0200)] 
res_rtp_asterisk.c: Check for first DTMF having timestamp set to 0

When the first DTMF receive in RF2833 codec have TimeStamp at 0
is not processed.

ASTERISK-28812

Change-Id: I3196803a062dd2daee4938c9a778c3810cb7e504

5 years agofunc_volume: Accept decimal number as argument
Jean Aunis [Tue, 7 Apr 2020 12:05:22 +0000 (14:05 +0200)] 
func_volume: Accept decimal number as argument

Allow voice volume to be multiplied or divided by a floating point number.

ASTERISK-28813

Change-Id: I5b42b890ec4e1f6b0b3400cb44ff16522b021c8c

5 years agores_rtp_asterisk: iterate all local addresses looking to populate ICE.
Jaco Kroon [Tue, 3 Dec 2019 18:35:20 +0000 (20:35 +0200)] 
res_rtp_asterisk: iterate all local addresses looking to populate ICE.

By using pjproject to give us a list of candidates, and then filtering,
if the host has >32 addresses configured, then it is possible that we
end up filtering out all 32 of those, and ending up with no candidates
at all.  Instead, get getifaddrs (which pjsip is using underlying
anyway) to retrieve all local addresses, and iterate those, adding the
first 32 addresses not excluded by the ICE ACL.

In our setup at any point in time We've got between 6 and 328 addresses
on any given system.  The lower limit is the lower limit but the upper
limit is growing on a near daily basis currently.

Change-Id: I109eaffc3e2b432f00bf958e3caa0f38cacb4edb
Signed-off-by: Jaco Kroon <jaco@uls.co.za>