Commit Graph

32434 Commits

Author SHA1 Message Date
Sean Bright
1e94cfdf4c 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
2020-02-11 08:55:31 -05:00
Joshua Colp
b3360fa5df Merge "pjproject_bundled: Allow brackets in via parameters" into 16 2020-02-07 07:05:56 -06:00
Joshua Colp
ba8a9b5eed Merge "chan_sip: Return 503 if we're out of RTP ports" into 16 2020-02-06 07:24:24 -06:00
Friendly Automation
40751c2769 Merge "install_prereq: Install aptitude non-interactively" into 16 2020-02-06 07:22:36 -06:00
Friendly Automation
3d20251085 Merge "chan_sip: Clarify in sample docs how directmediapermit/-acl should be used" into 16 2020-02-05 10:25:10 -06:00
Friendly Automation
bb73edad37 Merge "res_config_odbc: Preserve empty strings returned by the database" into 16 2020-02-05 09:48:50 -06:00
Friendly Automation
98f451771f Merge "res_stasis_playback: Prevent media_index from going out of bounds" into 16 2020-02-05 09:45:09 -06:00
Sylvain Afchain
40b834ad8c 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 0c02d0a450)
2020-02-05 14:21:47 +01:00
Walter Doekes
34ce90a9e7 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
2020-02-05 06:32:59 -06:00
Walter Doekes
35b4f1686b 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
2020-02-05 06:27:06 -06:00
Joshua C. Colp
f4132eec19 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
2020-02-04 10:18:13 -04:00
George Joseph
d6574cb7c7 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
2020-02-03 12:57:59 -07:00
Friendly Automation
48d5433cdd Merge "res_pjsip_messaging: Allow Content-Type to be overridden" into 16 2020-02-03 06:06:56 -06:00
Friendly Automation
88e67b51f2 Merge "res_stasis: trigger cleanup after update" into 16 2020-01-30 10:02:16 -06:00
George Joseph
b5b00e5299 Merge "stasis/app: don't lock an app before a call to send" into 16 2020-01-30 09:24:24 -06:00
George Joseph
1e78b2cf0a Merge "res_pjsip_pubsub: Increment persistence data ref when recreating." into 16 2020-01-30 09:22:39 -06:00
Sean Bright
d8d989b9bf 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
2020-01-29 09:14:55 -06:00
Sean Bright
2a6b09e2e8 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
2020-01-29 08:11:18 -05:00
Friendly Automation
35a782d58a Merge "res_pjsip_messaging: Ensure MESSAGE_SEND_STATUS is set properly" into 16 2020-01-28 10:17:45 -06:00
Joshua C. Colp
4d32f5747c 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
2020-01-28 15:18:45 +00:00
Sean Bright
2a9a1789e7 res_pjsip_messaging: Allow Content-Type to be overridden
ASTERISK-26082 #close
Reported by: Alex

Change-Id: I6549e90932016349bc72b0f053432dc25286f4fb
2020-01-28 08:16:32 -06:00
Friendly Automation
de3b98fcc4 Merge "chan_sip: Always process updated SDP on media source change" into 16 2020-01-27 18:28:38 -06:00
Kevin Harwell
e103339f02 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
2020-01-27 12:01:15 -06:00
Kevin Harwell
dc9875815c 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
2020-01-27 11:59:27 -06:00
Sean Bright
4bbf24d2ff 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
2020-01-27 11:07:01 -06:00
Joshua Colp
57bb9dc83c Merge "chan_pjsip: Ignore RTP that we haven't negotiated" into 16 2020-01-27 06:05:06 -06:00
Walter Doekes
ad9a40a539 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
2020-01-24 10:28:44 -06:00
Asterisk Development Team
eb1ec0498d Update CHANGES and UPGRADE.txt for 16.8.0 2020-01-23 11:12:30 -05:00
Sean Bright
1532da3008 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
2020-01-23 10:53:07 -05:00
Joshua Colp
60d4230eec Merge "http: Add ability to disable /httpstatus URI" into 16 2020-01-23 08:47:38 -06:00
George Joseph
1b452ebb51 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
2020-01-22 13:08:36 -06:00
Sean Bright
a2a4e1026c 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
2020-01-22 10:09:54 -06:00
Friendly Automation
1b2d305178 Merge "func_odbc.conf.sample: Add example lookup" into 16 2020-01-22 08:44:18 -06:00
Friendly Automation
479781a582 Merge "res_statsd: Document that res_statsd does nothing on its own" into 16 2020-01-22 08:38:15 -06:00
Friendly Automation
567d572b98 Merge "chan_dahdi: Change 999999 to INT_MAX to better reflect "no timeout"" into 16 2020-01-22 07:48:38 -06:00
Joshua Colp
fe18c83296 Merge "translate.c: Fix silk 24kHz truncation in 'core show translation'" into 16 2020-01-22 07:45:41 -06:00
Friendly Automation
cfaf8dfc4d Merge "chan_sip.c: Stop handling continuation lines after reading headers" into 16 2020-01-21 08:27:26 -06:00
Andrew Siplas
9895e94dba 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
2020-01-21 09:08:37 -05:00
Sean Bright
efecc9d139 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
2020-01-20 15:58:08 -06:00
Sean Bright
a7aaca9eaa func_odbc.conf.sample: Add example lookup
Change-Id: Ia05aab1f579597963d2ea23920d2210cfcb97c84
2020-01-20 15:26:29 -06:00
Sean Bright
04c81f9748 res_statsd: Document that res_statsd does nothing on its own
ASTERISK-24484 #close
Reported by: Dan Jenkins

Change-Id: I05f298904511d6739aefb1486b6fcbee27efa9ec
2020-01-20 11:58:51 -06:00
Joshua Colp
c67de25d6c Merge "queue_log: Add alembic script for generate db table for queue_log" into 16 2020-01-20 11:32:32 -06:00
Joshua Colp
5166088628 Merge "app_voicemail, say: Fix various leading whitespace problems" into 16 2020-01-20 09:32:36 -06:00
Friendly Automation
f66885225a Merge "app_voicemail: Prevent crash when saving message with realtime voicemail" into 16 2020-01-20 09:20:49 -06:00
Rodrigo Ramírez Norambuena
f49517efb9 queue_log: Add alembic script for generate db table for queue_log
Change-Id: I35b928a6251f9da9a1742b2cd14c63a00c3d0f0c
2020-01-20 09:16:39 -06:00
Joshua Colp
766342eedc Merge "pbx.c: Include filesystem cache in free memory calculation" into 16 2020-01-20 07:11:04 -06:00
Friendly Automation
23515dea5c Merge "app_voicemail: Set globals to default values when voicemail.conf missing" into 16 2020-01-17 08:37:51 -06:00
Joshua Colp
18b0e81b61 Merge "res_realtime: Fix 'realtime update2' argument handling" into 16 2020-01-17 08:36:34 -06:00
Sean Bright
13fa33588f app_voicemail, say: Fix various leading whitespace problems
In af90afd90c, Japanese language support
was added to app_voicemail and main/say.c, but the leading whitespace
is not consistent with Asterisk coding guidelines. This patch fixes
that.

Whitespace only, no functional change.

ASTERISK~23324
Reported by: Kevin McCoy

Change-Id: I72c725f5930084673749bd7c9cc426a987f08e87
2020-01-16 13:55:18 -06:00
Sean Bright
f5a1e8b04d pbx.c: Include filesystem cache in free memory calculation
ASTERISK-28695 #close
Reported by: Kevin Flyn

Change-Id: Ief098bb6eb77378daeace8f97ba30701c8de55b8
2020-01-16 12:37:57 -06:00