]> git.ipfire.org Git - thirdparty/asterisk.git/log
thirdparty/asterisk.git
5 years agoCI: Create generic jenkinsfile
George Joseph [Wed, 4 Mar 2020 21:45:40 +0000 (14:45 -0700)] 
CI: Create generic jenkinsfile

This is a generic jenkinsfile to build Asterisk and optionally
perform one or more of the following:
 * Publish the API docs to the wiki
 * Run the Unit tests
 * Run Testsuite Tests

This job can be triggered manually from Jenkins or be triggered
automatically on a schedule based on a cron string.

Change-Id: Id9d22a778a1916b666e0e700af2b9f1bacda0852

5 years agores_rtp_asterisk: Send correct sender SSRC when p2p bridge in use
Torrey Searle [Fri, 6 Mar 2020 16:13:34 +0000 (17:13 +0100)] 
res_rtp_asterisk: Send correct sender SSRC when p2p bridge in use

bridge_p2p_rtp_write will forward rtp to the bridged rtp instance
without modifying the ssrc.  However, it is not updating the SSRC
in the bridged rtp.  Thus, when SSRC packets are generated, they
have the correct SSRC for the sender.

ASTERISK-28773 #close

Change-Id: I39f923bde28ebb4f0fddc926b92494aed294a478

5 years agoMerge "res_pjsip_sdp_rtp: Don't wait for ICE if not negotiated" into 17
George Joseph [Tue, 10 Mar 2020 18:36:49 +0000 (13:36 -0500)] 
Merge "res_pjsip_sdp_rtp: Don't wait for ICE if not negotiated" into 17

5 years agoMerge "chan_pjsip: Check audio frame when remote SSRC changes." into 17
George Joseph [Tue, 10 Mar 2020 17:00:09 +0000 (12:00 -0500)] 
Merge "chan_pjsip: Check audio frame when remote SSRC changes." into 17

5 years agoMerge "enum.c: Make ast_get_txt() actually do something." into 17
George Joseph [Mon, 9 Mar 2020 15:14:48 +0000 (10:14 -0500)] 
Merge "enum.c: Make ast_get_txt() actually do something." into 17

5 years agoMerge "enum.c: Add support for regular expression flag in NAPTR record" into 17
George Joseph [Mon, 9 Mar 2020 15:02:27 +0000 (10:02 -0500)] 
Merge "enum.c: Add support for regular expression flag in NAPTR record" into 17

5 years agoMerge "res_rtp_asterisk: Add 'rtp show settings' cli command" into 17
Joshua Colp [Mon, 9 Mar 2020 13:57:22 +0000 (08:57 -0500)] 
Merge "res_rtp_asterisk: Add 'rtp show settings' cli command" into 17

5 years agores_pjsip_sdp_rtp: Don't wait for ICE if not negotiated
Torrey Searle [Thu, 5 Mar 2020 09:08:54 +0000 (10:08 +0100)] 
res_pjsip_sdp_rtp: Don't wait for ICE if not negotiated

If ICE support is enabled but not negotiated, the rtp->ice structure is
not being destroyed. This leads to Asterisk waiting for ICE to complete
instead of immediately starting the DTLS handshake, resulting in the
call leg having no RTP.

ASTERISK-28769 #close

Change-Id: I17c137546dc9ecfb9583c24dcf4c2ced8bbd7a27

5 years agochan_pjsip: Check audio frame when remote SSRC changes.
Paulo Vicentini [Wed, 26 Feb 2020 00:30:04 +0000 (01:30 +0100)] 
chan_pjsip: Check audio frame when remote SSRC changes.

If the SSRC of a received RTP packet differed from the previous SSRC
an SSRC change control frame would be queued ahead of the media
frame. In the case of audio this would result in the format of the
audio frame not being checked, and if it differed or was not allowed
then it could cause the call to drop due to failure to set up a
translation path.

The chan_pjsip module will now no longer assume the first frame
will be the audio frame and instead goes through the complete list
to find it.

ASTERISK-28759

Change-Id: I6d854cc523f343e299a615636fc65bdbd5f809ec

5 years agoenum.c: Add support for regular expression flag in NAPTR record
Sean Bright [Fri, 6 Mar 2020 20:59:37 +0000 (15:59 -0500)] 
enum.c: Add support for regular expression flag in NAPTR record

A regular expression in a NAPTR response record can have a trailing
'i' flag to indicate that the expression should be evaluated in a
case-insensitive way. We were not checking for that flag which caused
the record parsing to fail on otherwise valid input.

Although this change will initially go into Asterisk 13, 16, and 17,
it is my intention to replace the majority of this code in 16 and up -
including this fix - by changing enum.c to consume the new DNS API
which duplicates most of this logic already. Asterisk 13 doesn't have
the DNS API, so this fix will be as good as it gets.

ASTERISK-26711 #close
Reported by: Vitold

Change-Id: I33943a5b3e7539c6dca3a5079982ee15a08186f0

5 years agoindications.conf.sample: Add indication tones for Indonesia
Jared Smith [Fri, 6 Mar 2020 12:10:11 +0000 (12:10 +0000)] 
indications.conf.sample: Add indication tones for Indonesia

These tones come from http://www.itu.int/ITU-T/inr/forms/files/tones-0203.pdf

ASTERISK-23407

Change-Id: I48e2285f1e5bb29b3335f762006f66c423d0fcb8

5 years agores_rtp_asterisk: Add 'rtp show settings' cli command
Rodrigo Ramírez Norambuena [Tue, 3 Mar 2020 14:42:16 +0000 (14:42 +0000)] 
res_rtp_asterisk: Add 'rtp show settings' cli command

This change introduce a CLI command for the RTP to display the general
configuration.

In the first step add the follow fields of the configurations:
  - rtpstart
  - rtpend
  - dtmftimeout
  - rtpchecksum
  - strictrtp
  - learning_min_sequential
  - icesupport

Change-Id: Ibe5450898e2c3e1ed68c10993aa1ac6bf09b821f

5 years agoUpdate CHANGES and UPGRADE.txt for 17.3.0
Asterisk Development Team [Thu, 5 Mar 2020 17:23:58 +0000 (12:23 -0500)] 
Update CHANGES and UPGRADE.txt for 17.3.0

5 years agoMerge "res_pjsip_refer: ensure refer progress is still sent after Proceeding()" into 17
Kevin Harwell [Thu, 5 Mar 2020 17:03:18 +0000 (11:03 -0600)] 
Merge "res_pjsip_refer: ensure refer progress is still sent after Proceeding()" into 17

5 years agoenum.c: Make ast_get_txt() actually do something.
Sean Bright [Wed, 4 Mar 2020 22:53:57 +0000 (17:53 -0500)] 
enum.c: Make ast_get_txt() actually do something.

The ast_get_txt() API function (and by extension, the TXTCIDNAME
dialplan function) were broken in
65b8381550a9f46fdce84de79960073e9d51b05d such that we would never
actually make a DNS TXT query as described.

This patch restores the documented behavior.

ASTERISK-19460 #close
Reported by: George Joseph

Change-Id: I1b19aea711488cb1ecd63843cddce05010e39376

5 years agoMerge "check_expr2: fix cross-compile/hardening issues" into 17
Joshua Colp [Wed, 4 Mar 2020 12:57:05 +0000 (06:57 -0600)] 
Merge "check_expr2: fix cross-compile/hardening issues" into 17

5 years agoMerge "message & stasis/messaging: make text message variables work in ARI" into 17
Joshua Colp [Wed, 4 Mar 2020 12:11:11 +0000 (06:11 -0600)] 
Merge "message & stasis/messaging: make text message variables work in ARI" into 17

5 years agores_pjsip_refer: ensure refer progress is still sent after Proceeding()
lvl [Tue, 3 Mar 2020 16:57:27 +0000 (16:57 +0000)] 
res_pjsip_refer: ensure refer progress is still sent after Proceeding()

ASTERISK-28766 #close

Change-Id: I5ce2210062f9325db762edbf6e46075079bb2cd1

5 years agocheck_expr2: fix cross-compile/hardening issues
Sebastian Kemper [Sun, 12 Jan 2020 11:37:46 +0000 (12:37 +0100)] 
check_expr2: fix cross-compile/hardening issues

When building check_expr2 with ASLR PIE hardening enabled the linker
fails. This is resolved by adding the regular compiler flags when
building the object files from ast_expr2f.c and ast_expr2.c.

Note: The STANDALONE define is removed because it is already defined in
_ASTCFLAGS. YY_NO_INPUT is defined so that the compile survives
'--enable-dev-mode'.

Also, a Makefile variable "CROSS_COMPILING" is added so that the
build system doesn't try to run check_expr2 when cross-compiling,
because that will fail the build as will.

ASTERISK-28685 #close

Signed-off-by: Sebastian Kemper <sebastian_ml@gmx.net>
Change-Id: If435b7db9f9ad8266245bda51c81c220f9658915

5 years agores_rtp_asterisk: Improve video performance in certain networks.
Joshua C. Colp [Thu, 20 Feb 2020 17:33:42 +0000 (17:33 +0000)] 
res_rtp_asterisk: Improve video performance in certain networks.

The receive buffer will now grow if we end up flushing the
receive queue after not receiving the expected packet in time.
This is done in hopes that if this is encountered again the
extra buffer size will allow more time to pass and any missing
packets to be received.

The send buffer will now grow if we are asked for packets and
can't find them. This is done in hopes that the packets are
from the past and have simply been expired. If so then in
the future with the extra buffer space the packets should be
available.

Sequence number cycling has been handled so that the
correct sequence number is calculated and used in
various places, including for sorting packets and
for determining if a packet is old or not.

NACK sending is now more aggressive. If a substantial number
of missing sequence numbers are added a NACK will be sent
immediately. Afterwards once the receive buffer reaches 25%
a single NACK is sent. If the buffer continues to grow and
reaches 50% or greater a NACK will be sent for each received
future packet to aggressively ask the remote endpoint to
retransmit.

ASTERISK-28764

Change-Id: I97633dfa8a09a7889cef815b2be369f3f0314b41

5 years agoMerge "res/res_pjsip_sdp_rtp: Fix MOH transitions" into 17
Kevin Harwell [Mon, 2 Mar 2020 20:17:27 +0000 (14:17 -0600)] 
Merge "res/res_pjsip_sdp_rtp: Fix MOH transitions" into 17

5 years agomessage & stasis/messaging: make text message variables work in ARI
Kevin Harwell [Fri, 28 Feb 2020 18:54:14 +0000 (12:54 -0600)] 
message & stasis/messaging: make text message variables work in ARI

When a text message was received any associated variable was not written to
the ARI TextMessageReceived event. This occurred because Asterisk only wrote
out "send" variables. However, even those "send" variables would fail ARI
validation due to a TextMessageVariable formatting bug.

Since it seems the TextMessageReceived event has never been able to include
actual variables it was decided to remove the TextMessageVariable object type
from ARI, and simply return a JSON object of key/value pairs for variables.
This aligns more with how the ARI sendMessage handles variables, and other
places in ARI.

That being the case, and since this is technically an API breaking change (no
one should really be affected since things never really worked) the ARI version
was updated to reflect that.

ASTERISK-28755 #close

Change-Id: Ia6051c01a53b30cf7edef84c27df4ed4479b8b6f

5 years agoMerge "addons/res_config_mysql: silense warnings about printf format errors." into 17
Kevin Harwell [Thu, 27 Feb 2020 20:44:43 +0000 (14:44 -0600)] 
Merge "addons/res_config_mysql: silense warnings about printf format errors." into 17

5 years agoMerge "app_queue: Refactor odd placement of if's around say_position" into 17
Kevin Harwell [Thu, 27 Feb 2020 20:42:26 +0000 (14:42 -0600)] 
Merge "app_queue: Refactor odd placement of if's around say_position" into 17

5 years agores/res_pjsip_sdp_rtp: Fix MOH transitions
Torrey Searle [Mon, 24 Feb 2020 15:00:08 +0000 (16:00 +0100)] 
res/res_pjsip_sdp_rtp: Fix MOH transitions

Update the state of remote_hold immediately on receipt of remote
SDP so that the information is available when building the SDP
answer

ASTERISK-28754 #close

Change-Id: I7026032a807e9c95081cb8f060400b05deb4836f

5 years agoMerge "say: Remove unused "plural" option from main/say" into 17
Kevin Harwell [Thu, 27 Feb 2020 19:43:04 +0000 (13:43 -0600)] 
Merge "say: Remove unused "plural" option from main/say" into 17

5 years agoMerge "format_cap: make function parameters 'const'" into 17
Kevin Harwell [Thu, 27 Feb 2020 19:16:23 +0000 (13:16 -0600)] 
Merge "format_cap: make function parameters 'const'" into 17

5 years agoMerge "pjsip: Update ACLs on named ACL changes." into 17
Kevin Harwell [Thu, 27 Feb 2020 18:53:08 +0000 (12:53 -0600)] 
Merge "pjsip: Update ACLs on named ACL changes." into 17

5 years agosay: Remove unused "plural" option from main/say
Walter Doekes [Mon, 24 Feb 2020 14:39:51 +0000 (15:39 +0100)] 
say: Remove unused "plural" option from main/say

There are exceptions for plural objects, but they are detected using the
supplied NUMBER, not using an extra option.

Change-Id: I95d1d1b2796b1aba92048a2dbae8a3856ed8a113

5 years agoapp_queue: Refactor odd placement of if's around say_position
Walter Doekes [Tue, 25 Feb 2020 09:51:29 +0000 (10:51 +0100)] 
app_queue: Refactor odd placement of if's around say_position

Change-Id: Icba97905e331812f129e5966e91a59b104c7a748

5 years agoformat_cap: make function parameters 'const'
Kevin Harwell [Mon, 24 Feb 2020 18:44:43 +0000 (12:44 -0600)] 
format_cap: make function parameters 'const'

There were a couple places where the format cap function parameter was not
'const' when it should have been. This patch makes them 'const'.

Change-Id: Ife753fb16a962d842a6b44f45363a61a66bfdb2e

5 years agoaddons/res_config_mysql: silense warnings about printf format errors.
Jaco Kroon [Thu, 20 Feb 2020 12:52:06 +0000 (14:52 +0200)] 
addons/res_config_mysql: silense warnings about printf format errors.

Warnings without this:

res_config_mysql.c: In function 'update2_mysql':
res_config_mysql.c:741:15: warning: format '%llu' expects argument of type
    'long long unsigned int', but argument 6 has type 'my_ulonglong'
    {aka 'long unsigned int'} [-Wformat=]
ast_debug(1, "MySQL RealTime: Updated %llu rows on table: %s\n",
    numrows, tablename);

(reformatted for readability within line-wrap)

Change-Id: I2af4d419a37c1a7eeee750cf9ae4a9a2b3a37fd3

5 years agoMerge "tcptls.c: Log more informative OpenSSL errors" into 17
George Joseph [Fri, 21 Feb 2020 15:01:38 +0000 (09:01 -0600)] 
Merge "tcptls.c: Log more informative OpenSSL errors" into 17

5 years agoMerge "bridging: Add better support for adding/removing streams." into 17
George Joseph [Thu, 20 Feb 2020 19:43:36 +0000 (13:43 -0600)] 
Merge "bridging: Add better support for adding/removing streams." into 17

5 years agoMerge "ast_tls_cert: Allow private key size to be set on command line" into 17
George Joseph [Thu, 20 Feb 2020 16:52:26 +0000 (10:52 -0600)] 
Merge "ast_tls_cert: Allow private key size to be set on command line" into 17

5 years agoMerge "app_mixmonitor: Set MIXMONITOR_FILENAME to correct value when wav49 is used...
George Joseph [Thu, 20 Feb 2020 15:25:20 +0000 (09:25 -0600)] 
Merge "app_mixmonitor: Set MIXMONITOR_FILENAME to correct value when wav49 is used" into 17

5 years agoMerge "RTP/ICE: Send on first valid pair." into 17
George Joseph [Thu, 20 Feb 2020 15:23:48 +0000 (09:23 -0600)] 
Merge "RTP/ICE: Send on first valid pair." into 17

5 years agopjsip: Update ACLs on named ACL changes.
Joshua C. Colp [Tue, 18 Feb 2020 13:10:16 +0000 (13:10 +0000)] 
pjsip: Update ACLs on named ACL changes.

This change extends the Sorcery API to allow a wizard to be
told to explicitly reload objects or a specific object type
even if the wizard believes that nothing has changed.

This has been leveraged by res_pjsip and res_pjsip_acl to
reload endpoints and PJSIP ACLs when a named ACL changes.

ASTERISK-28697

Change-Id: Ib8fee9bd9dd490db635132c479127a4114c1ca0b

5 years agotcptls.c: Log more informative OpenSSL errors
Sean Bright [Wed, 19 Feb 2020 19:20:18 +0000 (14:20 -0500)] 
tcptls.c: Log more informative OpenSSL errors

Dump OpenSSL's error stack to the error log when things fail.

ASTERISK-28750 #close
Reported by: Martin Zeh

Change-Id: Ib63cd0df20275586e68ac4c2ddad222ed7bd9c0a

5 years agoast_tls_cert: Allow private key size to be set on command line
Sean Bright [Wed, 19 Feb 2020 14:38:31 +0000 (09:38 -0500)] 
ast_tls_cert: Allow private key size to be set on command line

The default size in release branches will be 1024 but we'll use 2048 in master.

ASTERISK~28750

Change-Id: I435cea18bdd58824ed2b55259575c7ec7133842a

5 years agores_pjsip_outbound_registration: Fix SRV failover on timeout
George Joseph [Thu, 13 Feb 2020 19:39:58 +0000 (12:39 -0700)] 
res_pjsip_outbound_registration: Fix SRV failover on timeout

In order to retry outbound registrations for some situations, we
need access to the tdata from the original request.  For instance,
for 401/407 responses we need it to properly construct the
subsequent request with the authentication.  We also need it if
we're iterating over a DNS SRV response record set so we can skip
entries we've already tried.

We've been getting the tdata from the server response rdata and
transaction but that only works for the failures where there was
actually a response (4XX, 5XX, etc).  For timeouts there's no
response and therefore no rdata or transaction from which to get
the tdata.  When processing a single A/AAAA record for a server,
this wasn't an issue as we just retried that same server after the
retry timer expired.  If we got an SRV record set for the server
though, without the state from the tdata, we just kept trying the
first entry in the set repeatedly instead of skipping to the next
one in the list.

* Added a "last_tdata" member to the client state structure to keep
  track of the sent tdata.

* Updated registration_client_send() to save the tdata it used into
  the client_state.

* Updated sip_outbound_registration_response_cb() to use the tdata
  saved in client_state when we don't get a response from the
  server. We still use the tdata from the transaction when we DO
  get a response from the server so we can properly handle 4XX
  responses where our new request depends on it.

General note on timeouts:

Although res_pjsip_outbound_registration skips to the next record
immediately when a timeout occurs during SRV set traversal, it's
pjproject that determines how long to wait before a timeout is
declared.  As with other SIP message types, pjproject will continue
trying the same server at an interval specified by "timer_t1" until
"timer_b" expires.  Both of those timers are set in the pjsip.conf
"system" section.

ASTERISK-28746

Change-Id: I199b8274392d17661dd3ce3b4d69a3968368fa06

5 years agobridging: Add better support for adding/removing streams.
Joshua C. Colp [Sun, 5 Jan 2020 00:11:20 +0000 (00:11 +0000)] 
bridging: Add better support for adding/removing streams.

This change adds support to bridge_softmix to allow the addition
and removal of additional video source streams. When such a change
occurs each participant is renegotiated as needed to reflect the
update. If another video source is added then each participant
gets another source. If a video source is removed then it is
removed from each participant. This functionality allows you to
have both your webcam and screenshare providing video if you
desire, or even more streams. Mapping has been changed to use
the topology index on the source channel as a unique identifier
for outgoing participant streams, this will never change and
provides an easy way to establish the mapping.

The bridge_simple and bridge_native_rtp modules have also been
updated to renegotiate when the stream topology of a party changes
allowing the same behavior to occur as added to bridge_softmix.
If a screen share is added then the opposite party is renegotiated.
If that screen share is removed then the opposite party is
renegotiated again.

Some additional fixes are also included in here. Stream state is
now conveyed in SDP so sendonly/recvonly/inactive streams can
be requested. Removed streams now also remove previous state
from themselves so consumers don't get confused.

ASTERISK-28733

Change-Id: I93f41fb41b85646bef71408111c17ccea30cb0c5

5 years agoMerge "res_pjsip_sdp_rtp: implement hold state handling on moh_passthrough" into 17
George Joseph [Tue, 18 Feb 2020 16:08:55 +0000 (10:08 -0600)] 
Merge "res_pjsip_sdp_rtp: implement hold state handling on moh_passthrough" into 17

5 years agoRTP/ICE: Send on first valid pair.
Ben Ford [Thu, 23 Jan 2020 19:17:06 +0000 (13:17 -0600)] 
RTP/ICE: Send on first valid pair.

When handling ICE negotiations, it's possible that there can be a delay
between STUN binding requests which in turn will cause a delay in ICE
completion, preventing media from flowing. It should be possible to send
media when there is at least one valid pair, preventing this scenario
from occurring.

A change was added to PJPROJECT that adds an optional callback
(on_valid_pair) that will be called when the first valid pair is found
during ICE negotiation. Asterisk uses this to start the DTLS handshake,
allowing media to flow. It will only be called once, either on the first
valid pair, or when ICE negotiation is complete.

ASTERISK-28716

Change-Id: Ia7b68c34f06d2a1d91c5ed51627b66fd0363d867

5 years agoMerge "res_rtp_asterisk: bad audio (static) due to incomplete dtls/srtp setup" into 17
George Joseph [Mon, 17 Feb 2020 17:28:22 +0000 (11:28 -0600)] 
Merge "res_rtp_asterisk: bad audio (static) due to incomplete dtls/srtp setup" into 17

5 years agoapp_mixmonitor: Set MIXMONITOR_FILENAME to correct value when wav49 is used
Sean Bright [Mon, 17 Feb 2020 14:05:16 +0000 (09:05 -0500)] 
app_mixmonitor: Set MIXMONITOR_FILENAME to correct value when wav49 is used

When opening a file for writing, Asterisk silently converts filenames
ending with 'wav49' to 'WAV.' We aren't taking that in to account when
setting the MIXMONITOR_FILENAME variable in MixMonitor.

* If the user wants to write to a wav49 file, make sure that it is
  reflected properly in MIXMONITOR_FILENAME.

* Add a note to the documentation describing this behavior.

* Add a note in main/file.c indicating that app_mixmonitor needs to be
  changed if the logic in build_filename was changed.

ASTERISK-24798 #close
Reported by: xrobau

Change-Id: I384691ce624eb55c80a125b9ca206d2d691c574c

5 years agores_pjsip_sdp_rtp: implement hold state handling on moh_passthrough
Torrey Searle [Wed, 12 Feb 2020 16:05:11 +0000 (17:05 +0100)] 
res_pjsip_sdp_rtp: implement hold state handling on moh_passthrough

When moh_passthrough is used, asterisk is only generating invites
of type sendonly and sendrecv instead of taking fully into account
the on hold state of the local and remote parties

ASTERISK-28738 #close

Change-Id: Iaaad9fbc033cb14803d433b8a4071bc337047761

5 years agostasis: Use format specifier for size_t.
Joshua C. Colp [Sat, 15 Feb 2020 14:01:34 +0000 (10:01 -0400)] 
stasis: Use format specifier for size_t.

Change-Id: Ic9b4afcc5398e7f46314419fc3c90433d818e35c

5 years agores_rtp_asterisk: bad audio (static) due to incomplete dtls/srtp setup
Kevin Harwell [Thu, 13 Feb 2020 21:08:10 +0000 (15:08 -0600)] 
res_rtp_asterisk: bad audio (static) due to incomplete dtls/srtp setup

There was a race condition between client initiated DTLS setup, and handling
of server side ice completion that caused the underlying SSL object to get
cleared during DTLS initialization. If this happened Asterisk would be left
in a partial DTLS setup state. RTP packets were sent and received, but were
not being encrypted and decrypted. This resulted in no audio, or static.

Specifically, this occurred when '__rtp_recvfrom' was processing the handshake
sequence from the client to the server, and then 'ast_rtp_on_ice_complete'
gets called from another thread and clears the SSL object when calling the
'dtls_perform_setup' function. The timing had to be just right in the sense
that from the external SSL library perspective SSL initialization completed
(rtp recv), Asterisk clears/resets the SSL object (ice done), and then checks
to see if SSL is intialized (rtp recv). Since it was cleared, Asterisk thinks
it is not finished, thus not completing 'dtls_srtp_setup'.

This patch removes calls to 'dtls_perform_setup', which clears the SSL object,
in 'ast_rtp_on_ice_complete'. When ice completes, there is no reason to clear
the underlying SSL object. If an ice candidate changes a full protocol level
renegotiation occurs. Also, in the case of bundled ICE candidates are reused
when a stream is added. So no real reason to have to clear, and reset in this
instance.

Also, this patch adds a bit of extra logging to aid in diagnosis of any future
problems.

ASTERISK-28742 #close

Change-Id: I34c9e6bad5a39b087164646e2836e3e48fe6892f

5 years agoMerge "res_pjsip_session: Fix off-nominal session refreshes." into 17
Joshua Colp [Fri, 14 Feb 2020 01:02:22 +0000 (19:02 -0600)] 
Merge "res_pjsip_session: Fix off-nominal session refreshes." into 17

5 years agoMerge "res_musiconhold: Avoid spurious warning when 'format' is the empty string...
Joshua Colp [Fri, 14 Feb 2020 01:01:11 +0000 (19:01 -0600)] 
Merge "res_musiconhold: Avoid spurious warning when 'format' is the empty string" into 17

5 years agoMerge "doc: Fix CHANGES entries to have .txt suffix and update READMEs" into 17
George Joseph [Thu, 13 Feb 2020 14:29:33 +0000 (08:29 -0600)] 
Merge "doc: Fix CHANGES entries to have .txt suffix and update READMEs" into 17

5 years agores_musiconhold: Avoid spurious warning when 'format' is the empty string
Sean Bright [Tue, 11 Feb 2020 13:46:02 +0000 (08:46 -0500)] 
res_musiconhold: Avoid spurious warning when 'format' is the empty string

The change to res_config_odbc that allowed empty strings to be
returned to realtime consumers¹ causes a warning to be emitted when
loading MoH classes. So we need to treat an empty 'format' as if it
was not specified to avoid the warning.

ASTERISK-28735 #close
Reported by: Ross Beer

[1] https://gerrit.asterisk.org/c/asterisk/+/13722

Change-Id: I9a271d721e1a0973e80ebe7d75b46a0d8fa0e5a5

5 years agofunc_odbc: Prevent snprintf() truncation warning
Sean Bright [Mon, 10 Feb 2020 21:40:16 +0000 (16:40 -0500)] 
func_odbc: Prevent snprintf() truncation warning

For reasons that are not clear to me - this only appears for me when
_not_ building in dev-mode.

Change-Id: Ib45c54daaea8e0d571cb470cab1daaae2edba968

5 years agores_pjsip_session: Fix off-nominal session refreshes.
Joshua C. Colp [Mon, 10 Feb 2020 11:04:12 +0000 (07:04 -0400)] 
res_pjsip_session: Fix off-nominal session refreshes.

Given a scenario where session refreshes occur close to
each other while another is finishing it was possible for
the session refreshes to occur out of order. It was
also possible for session refreshes to be delayed for
quite some time if a session refresh did not result in
a topology change.

For the out of order session refreshes the first session
refresh would be queued due to a transaction in progress.
This transaction would then finish. When finished a
separate task to process the delayed requests queue
would be queued for handling. A second refresh would
be requested internally before this delayed request
queued task was processed. As no transaction was in
progress this session refresh would be immediately
handled before the queued session refresh.

The code will now check if any delayed requests exist
before allowing a session refresh to immediately occur.
If any exist then the session refresh is queued.

For the delayed session refreshes if a session refresh
did not result in a topology change the attempt would
be immediately stopped and no other delayed requests would
be processed.

The code will now go through the entire delayed requests
queue until a delayed request results in a request
actually being sent.

ASTERISK-28730

Change-Id: Ied640280133871f77d3f332be62265e754605088

5 years agodoc: Fix CHANGES entries to have .txt suffix and update READMEs
George Joseph [Fri, 7 Feb 2020 19:44:50 +0000 (12:44 -0700)] 
doc: Fix CHANGES entries to have .txt suffix and update READMEs

Although the wiki page for the new CHANGES and UPGRADE scheme
states that the files must have the ".txt" suffix, the READMEs
didn't.

Change-Id: I490306aa2cc24d6f014738e9ebbc78592efe0f05
(cherry picked from commit 7416703f04f12eb583a3427a3f64d06951c18c6e)

5 years agoMerge "pjproject_bundled: Allow brackets in via parameters" into 17
Joshua Colp [Fri, 7 Feb 2020 13:05:41 +0000 (07:05 -0600)] 
Merge "pjproject_bundled: Allow brackets in via parameters" into 17

5 years agoMerge "install_prereq: Install aptitude non-interactively" into 17
Joshua Colp [Thu, 6 Feb 2020 13:59:10 +0000 (07:59 -0600)] 
Merge "install_prereq: Install aptitude non-interactively" into 17

5 years agoMerge "chan_sip: Return 503 if we're out of RTP ports" into 17
Joshua Colp [Thu, 6 Feb 2020 13:23:48 +0000 (07:23 -0600)] 
Merge "chan_sip: Return 503 if we're out of RTP ports" into 17

5 years agopjproject_bundled: Allow brackets in via parameters
Sean Bright [Thu, 16 Jan 2020 15:50:01 +0000 (10:50 -0500)] 
pjproject_bundled: Allow brackets in via parameters

ASTERISK-26955 #close
Reported by: Peter Sokolov

Change-Id: Ib2803640905a77b65d0cee2d0ed2c7b310d470ac

5 years agoMerge "res_rtp_asterisk: Don't produce transport-cc if no packets." into 17
Friendly Automation [Thu, 6 Feb 2020 00:44:48 +0000 (18:44 -0600)] 
Merge "res_rtp_asterisk: Don't produce transport-cc if no packets." into 17

5 years agoMerge "chan_sip: Clarify in sample docs how directmediapermit/-acl should be used...
Friendly Automation [Wed, 5 Feb 2020 16:29:03 +0000 (10:29 -0600)] 
Merge "chan_sip: Clarify in sample docs how directmediapermit/-acl should be used" into 17

5 years agoMerge "res_config_odbc: Preserve empty strings returned by the database" into 17
Friendly Automation [Wed, 5 Feb 2020 15:49:22 +0000 (09:49 -0600)] 
Merge "res_config_odbc: Preserve empty strings returned by the database" into 17

5 years agoMerge "res_stasis_playback: Prevent media_index from going out of bounds" into 17
Friendly Automation [Wed, 5 Feb 2020 15:48:04 +0000 (09:48 -0600)] 
Merge "res_stasis_playback: Prevent media_index from going out of bounds" into 17

5 years agoinstall_prereq: Install aptitude non-interactively
Sylvain Afchain [Wed, 5 Feb 2020 08:26:58 +0000 (09:26 +0100)] 
install_prereq: Install aptitude non-interactively

Currently aptitude is installed using interactive mode. This patch
changes this to use the non-interactive mode as it can block
automatic dependencies installation, ex: CI, Docker build.

ASTERISK-28726 #close

Change-Id: I271ee00d230513a6f044810351a32d83b2181133
(cherry picked from commit 0c02d0a4500cbd4f657c26eb609928c110ebccb9)

5 years agochan_sip: Return 503 if we're out of RTP ports
Walter Doekes [Fri, 31 Jan 2020 12:58:30 +0000 (13:58 +0100)] 
chan_sip: Return 503 if we're out of RTP ports

If you're for some reason out of RTP ports, chan_sip would previously
responde to an INVITE with a 403, which will fail the call.

Now, it returns a 503, allowing the device/proxy to retry the call on a
different machine.

ASTERISK-28718

Change-Id: I968dcf6c1e30ecddcce397dcda36db727c83ca90

5 years agochan_sip: Clarify in sample docs how directmediapermit/-acl should be used
Walter Doekes [Tue, 28 Jan 2020 08:34:45 +0000 (09:34 +0100)] 
chan_sip: Clarify in sample docs how directmediapermit/-acl should be used

It said "restrict [...] which peers should be able to pass [audio]
to each other".

However, these settings are not global (for which you would expect
signaling IPs to be checked). These settings are available per peer
only, and the IPs being checked, are the RTP IPs.

Change-Id: I2a6c6cd7c2f5f30d1df4844e3e0308a077021660

5 years agores_rtp_asterisk: Don't produce transport-cc if no packets.
Joshua C. Colp [Tue, 4 Feb 2020 14:18:13 +0000 (10:18 -0400)] 
res_rtp_asterisk: Don't produce transport-cc if no packets.

The code assumed that when the transport-cc feedback
function was called at least one packet will have been
received. In practice this isn't always true, so now
we just reschedule the sending and do nothing.

Change-Id: Iabe7b358704da446fc3b0596b847bff8b8a0da6a

5 years agomessage.c: Add option to suppress the Message channel AMI and ARI events
George Joseph [Mon, 3 Feb 2020 16:24:58 +0000 (09:24 -0700)] 
message.c: Add option to suppress the Message channel AMI and ARI events

In order to reduce the amount of AMI and ARI events generated,
the global "Message/ast_msg_queue" channel can be set to suppress
it's normal channel housekeeping events such as "Newexten",
"VarSet", etc. This can greatly reduce load on the manager
and ARI applications when the Digium Phone Module for Asterisk
is in use.  To enable, set "hide_messaging_ami_events" in
asterisk.conf to "yes"  In Asterisk versions <18, the default
is "no" preserving existing behavior.  Beginning with
Asterisk 18, the option will default to "yes".

NOTE:  This change does not affect UserEvents or the ARI
TextMessageReceived events.

* Added the "hide_messaging_ami_events" option to asterisk.conf.

* Changed message.c to set the AST_CHAN_TP_INTERNAL property on
  the "Message/ast_msg_queue" channel if the option is set in
  asterisk.conf.  This suppresses the reporting of the events.

Change-Id: Ia2e3516d43f4e0df994fc6598565d6bba2d7018b

5 years agoMerge "res_pjsip_messaging: Allow Content-Type to be overridden" into 17
Joshua Colp [Mon, 3 Feb 2020 12:11:56 +0000 (06:11 -0600)] 
Merge "res_pjsip_messaging: Allow Content-Type to be overridden" into 17

5 years agoMerge "res_stasis: trigger cleanup after update" into 17
Friendly Automation [Thu, 30 Jan 2020 16:02:40 +0000 (10:02 -0600)] 
Merge "res_stasis: trigger cleanup after update" into 17

5 years agoMerge "res_pjsip_pubsub: Increment persistence data ref when recreating." into 17
George Joseph [Thu, 30 Jan 2020 15:22:21 +0000 (09:22 -0600)] 
Merge "res_pjsip_pubsub: Increment persistence data ref when recreating." into 17

5 years agoMerge "stasis/app: don't lock an app before a call to send" into 17
Friendly Automation [Thu, 30 Jan 2020 15:14:56 +0000 (09:14 -0600)] 
Merge "stasis/app: don't lock an app before a call to send" into 17

5 years agores_config_odbc: Preserve empty strings returned by the database
Sean Bright [Wed, 29 Jan 2020 14:57:38 +0000 (09:57 -0500)] 
res_config_odbc: Preserve empty strings returned by the database

When res_config_odbc (and perhaps other realtime backends) reads a SQL
NULL from the database, it coalesces the value to the empty string
which prevents it from being returned to the realtime core.

However, if it instead reads the empty string from the database, it
needs a way to encode that fact without having the value omitted
entirely. It does this by changing the value to a string with a single
space. The realtime code in main/config.c recognizes this special case
and _turns the string back into the empty string_ before passing it to
realtime API consumers.

For all of this to work, we need to ensure that we actually pass the
single-space-string back to the realtime core, which is currently
failing because we are trimming the value before checking its
content. So instead we now special case the single-space-string case
so that empty values are returned properly.

ASTERISK-28719 #close
Reported by: EDV O-TON

Change-Id: I673ed8c31ad037aa224e80c78c7a1dc4e4a4e3de

5 years agores_stasis_playback: Prevent media_index from going out of bounds
Sean Bright [Tue, 28 Jan 2020 19:23:19 +0000 (14:23 -0500)] 
res_stasis_playback: Prevent media_index from going out of bounds

Incrementing stasis_app_playback.media_index directly in our playback
loop means that when we reach the end of our playlist the index into
the vector will be outside of the bounds of the vector.

Instead use a temporary variable and only assign when we're sure that
we are in bounds.

ASTERISK-28713 #close
Reported by: Sébastien Duthil

Change-Id: Ib53f7f156097e0607eb5871d9d78d246ed274928

5 years agoMerge "res_pjsip_messaging: Ensure MESSAGE_SEND_STATUS is set properly" into 17
Friendly Automation [Tue, 28 Jan 2020 16:22:09 +0000 (10:22 -0600)] 
Merge "res_pjsip_messaging: Ensure MESSAGE_SEND_STATUS is set properly" into 17

5 years agores_pjsip_pubsub: Increment persistence data ref when recreating.
Joshua C. Colp [Tue, 28 Jan 2020 15:18:45 +0000 (15:18 +0000)] 
res_pjsip_pubsub: Increment persistence data ref when recreating.

Each subscription needs to have a reference to the persisted data
for it, as well as the main JSON contained within the tree. When
recreating a subscription this did not occur and they both shared
the same reference.

ASTERISK-28714

Change-Id: I706abd49ea182ea367a4ac3feca2706460ae9f4a

5 years agores_pjsip_messaging: Allow Content-Type to be overridden
Sean Bright [Tue, 28 Jan 2020 01:58:53 +0000 (20:58 -0500)] 
res_pjsip_messaging: Allow Content-Type to be overridden

ASTERISK-26082 #close
Reported by: Alex

Change-Id: I6549e90932016349bc72b0f053432dc25286f4fb

5 years agoMerge "chan_sip: Always process updated SDP on media source change" into 17
Friendly Automation [Tue, 28 Jan 2020 00:27:52 +0000 (18:27 -0600)] 
Merge "chan_sip: Always process updated SDP on media source change" into 17

5 years agostasis/app: don't lock an app before a call to send
Kevin Harwell [Mon, 27 Jan 2020 18:01:15 +0000 (12:01 -0600)] 
stasis/app: don't lock an app before a call to send

Calling 'app_send' eventually calls the app's message handler. It's possible
for a handler to obtain a lock on another object, and then need/want to lock
the app object. If the caller of 'app_send' locks the app object prior to
calling then there's a potential for a deadlock, if another thread calls
'app_send' without locking.

This patch makes it so 'app_send' is not called with the app object locked in
the section of code doing such.

ASTERISK-28423 #close

Change-Id: I6767c6d0933c7db1b984018966eefca4c0638a27

5 years agores_stasis: trigger cleanup after update
Kevin Harwell [Mon, 27 Jan 2020 17:44:45 +0000 (11:44 -0600)] 
res_stasis: trigger cleanup after update

The cleanup code in stasis shuts down applications if they are in a deactivated
state, and no longer have explicit subscriptions. When registering an app the
cleanup code was running before calling 'update'. When it should be executed
after 'update' since a call to register may re-activate the app. We don't want
it to shutdown before the 'update' otherwise the app won't be re-activated,
or registered.

This patch makes it so the cleanup code is executed post 'update'.

ASTERISK-28679 #close

Change-Id: I8f2c0b17e33bb8128441567b97fd4c7bf74a327b

5 years agores_pjsip_messaging: Ensure MESSAGE_SEND_STATUS is set properly
Sean Bright [Mon, 27 Jan 2020 14:03:38 +0000 (09:03 -0500)] 
res_pjsip_messaging: Ensure MESSAGE_SEND_STATUS is set properly

We need to wait for the message sending callback to finish to know if
we succeeded or failed.

ASTERISK-25421 #close
Reported by:  Dmitriy Serov

Change-Id: I22b954398821d2caf4c6fe58f0607c8cfa378059

5 years agochan_sip: Always process updated SDP on media source change
Walter Doekes [Mon, 13 Jan 2020 10:13:41 +0000 (11:13 +0100)] 
chan_sip: Always process updated SDP on media source change

Fixes no-audio issues when the media source is changed and
strictrtp is enabled (default).

If the peer media source changes, the SDP session version also changes.
If it is lower than the one we had stored, chan_sip would ignore it.

This changeset keeps track of the remote media origin identifier,
comparing that as well. If it changes, the session version needn't be
higher for us to accept the SDP.

Common scenario where this would've caused problems: a separate media
gateway that informs the caller about premium rates before handing off
the call to the final destination.

(An alternative fix would be to set ignoresdpversion=yes on the peer.)

ASTERISK-28686

Change-Id: I88fdbc5aeb777b583e7738c084254c482a7776ee

5 years agochan_pjsip: Ignore RTP that we haven't negotiated
Sean Bright [Thu, 23 Jan 2020 15:06:35 +0000 (10:06 -0500)] 
chan_pjsip: Ignore RTP that we haven't negotiated

If chan_pjsip receives an RTP packet whose payload differs from the
channel's native format, and asymmetric_rtp_codec is disabled (the
default), Asterisk will switch the channel's native format to match
that of the incoming packet without regard to the negotiated payloads.

We now check that the received frame is in a format we have negotiated
before switching payloads which results in these packets being dropped
instead of causing the session to terminate.

ASTERISK-28139 #close
Reported by: Paul Brooks

Change-Id: Icc3b85cee1772026cee5dc1b68459bf9431c14a3

5 years agoUpdate CHANGES and UPGRADE.txt for 17.2.0
Asterisk Development Team [Thu, 23 Jan 2020 16:15:46 +0000 (11:15 -0500)] 
Update CHANGES and UPGRADE.txt for 17.2.0

5 years agoMerge "http: Add ability to disable /httpstatus URI" into 17
Friendly Automation [Thu, 23 Jan 2020 14:48:37 +0000 (08:48 -0600)] 
Merge "http: Add ability to disable /httpstatus URI" into 17

5 years agocdr.c: Set event time on party b when leaving a parking bridge
George Joseph [Wed, 22 Jan 2020 18:56:38 +0000 (11:56 -0700)] 
cdr.c: Set event time on party b when leaving a parking bridge

When Alice calls Bob and Bob does a blind transfer to Charlie,
Bob's bridge leave event generates a finalize on both the party_a
and party_b CDRs but while the party_a CDR has the correct end time
set from the event time, party_b's leg did not. This caused that
CDR's end time to be equal to the answered time and resulted in a
billsec of 0.

* We now pass the bridge leave message event time to
cdr_object_party_b_left_bridge_cb() and set it on that CDR before
calling cdr_object_finalize() on it.

NOTE:  This issue affected transfers using chan_sip most of the
time but also occasionally affected chan_pjsip probably due to
message timing.

ASTERISK-28677
Reported by: Maciej Michno

Change-Id: I790720f1e7326f9b8ce8293028743b0ef0fb2cca

5 years agohttp: Add ability to disable /httpstatus URI
Sean Bright [Wed, 22 Jan 2020 15:39:47 +0000 (10:39 -0500)] 
http: Add ability to disable /httpstatus URI

Add a new configuration option 'enable_status' which allows the
/httpstatus URI handler to be administratively disabled.

We also no longer unconditionally register the /static and /httpstatus
URI handlers, but instead do it based upon configuration.

Behavior change: If enable_static was turned off, the URI handler was
still installed but returned a 403 when it was accessed. Because we
now register/unregister the URI handlers as appropriate, if the
/static URI is disabled we will return a 404 instead.

Additionally:

* Change 'enablestatic' to 'enable_static' but keep the former for
  backwards compatibility.
* Improve some internal variable names

ASTERISK-28710 #close

Change-Id: I647510f796473793b1d3ce1beb32659813be69e1

5 years agoMerge "func_odbc.conf.sample: Add example lookup" into 17
Friendly Automation [Wed, 22 Jan 2020 15:21:57 +0000 (09:21 -0600)] 
Merge "func_odbc.conf.sample: Add example lookup" into 17

5 years agoMerge "res_statsd: Document that res_statsd does nothing on its own" into 17
Friendly Automation [Wed, 22 Jan 2020 14:43:01 +0000 (08:43 -0600)] 
Merge "res_statsd: Document that res_statsd does nothing on its own" into 17

5 years agoMerge "translate.c: Fix silk 24kHz truncation in 'core show translation'" into 17
Friendly Automation [Wed, 22 Jan 2020 13:51:05 +0000 (07:51 -0600)] 
Merge "translate.c: Fix silk 24kHz truncation in 'core show translation'" into 17

5 years agoMerge "chan_dahdi: Change 999999 to INT_MAX to better reflect "no timeout"" into 17
Joshua Colp [Wed, 22 Jan 2020 13:49:04 +0000 (07:49 -0600)] 
Merge "chan_dahdi: Change 999999 to INT_MAX to better reflect "no timeout"" into 17

5 years agoMerge "chan_sip.c: Stop handling continuation lines after reading headers" into 17
Friendly Automation [Tue, 21 Jan 2020 14:25:33 +0000 (08:25 -0600)] 
Merge "chan_sip.c: Stop handling continuation lines after reading headers" into 17

5 years agochan_dahdi: Change 999999 to INT_MAX to better reflect "no timeout"
Andrew Siplas [Sat, 18 Jan 2020 21:54:01 +0000 (16:54 -0500)] 
chan_dahdi: Change 999999 to INT_MAX to better reflect "no timeout"

The no-entry timeout set to 999999 == 16⅔ minutes, change to INT_MAX
to match behavior of "no timeout" defined in comment.

ASTERISK-28702 #close

Change-Id: I4ea015986e061374385dba247b272f7aac60bf11

5 years agotranslate.c: Fix silk 24kHz truncation in 'core show translation'
Sean Bright [Mon, 20 Jan 2020 19:53:46 +0000 (14:53 -0500)] 
translate.c: Fix silk 24kHz truncation in 'core show translation'

SILK @ 24kHz is not shown in the 'core show translation' output because of an
off-by-one-error. Discovered while looking into ASTERISK~19871.

ASTERISK-28706
Reported by: Sean Bright

Change-Id: Ie1a551a8a484e07b45c8699cc0c90f1061029510

5 years agofunc_odbc.conf.sample: Add example lookup
Sean Bright [Mon, 20 Jan 2020 21:26:14 +0000 (16:26 -0500)] 
func_odbc.conf.sample: Add example lookup

Change-Id: Ia05aab1f579597963d2ea23920d2210cfcb97c84

5 years agores_statsd: Document that res_statsd does nothing on its own
Sean Bright [Mon, 20 Jan 2020 17:18:17 +0000 (12:18 -0500)] 
res_statsd: Document that res_statsd does nothing on its own

ASTERISK-24484 #close
Reported by: Dan Jenkins

Change-Id: I05f298904511d6739aefb1486b6fcbee27efa9ec

5 years agoMerge "queue_log: Add alembic script for generate db table for queue_log" into 17
Friendly Automation [Mon, 20 Jan 2020 17:31:12 +0000 (11:31 -0600)] 
Merge "queue_log: Add alembic script for generate db table for queue_log" into 17

5 years agoMerge "app_voicemail, say: Fix various leading whitespace problems" into 17
Joshua Colp [Mon, 20 Jan 2020 15:33:00 +0000 (09:33 -0600)] 
Merge "app_voicemail, say: Fix various leading whitespace problems" into 17

5 years agoMerge "app_voicemail: Prevent crash when saving message with realtime voicemail"...
Friendly Automation [Mon, 20 Jan 2020 15:19:52 +0000 (09:19 -0600)] 
Merge "app_voicemail: Prevent crash when saving message with realtime voicemail" into 17