Commit Graph

32518 Commits

Author SHA1 Message Date
George Joseph
54cd865946 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 13:58:35 -06:00
Joshua Colp
3efeb147bb Merge "res_pjsip_messaging: Allow Content-Type to be overridden" into 17 2020-02-03 06:11:56 -06:00
Friendly Automation
e7e65588e4 Merge "res_stasis: trigger cleanup after update" into 17 2020-01-30 10:02:40 -06:00
George Joseph
2c72e26478 Merge "res_pjsip_pubsub: Increment persistence data ref when recreating." into 17 2020-01-30 09:22:21 -06:00
Friendly Automation
82eb8e7097 Merge "stasis/app: don't lock an app before a call to send" into 17 2020-01-30 09:14:56 -06:00
Sean Bright
646789106f 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:15:02 -06:00
Sean Bright
8b8c1dd07f 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 07:15:41 -06:00
Friendly Automation
e86c32b878 Merge "res_pjsip_messaging: Ensure MESSAGE_SEND_STATUS is set properly" into 17 2020-01-28 10:22:09 -06:00
Joshua C. Colp
35c9332edf 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 09:24:33 -06:00
Sean Bright
ef5702cef1 res_pjsip_messaging: Allow Content-Type to be overridden
ASTERISK-26082 #close
Reported by: Alex

Change-Id: I6549e90932016349bc72b0f053432dc25286f4fb
2020-01-28 08:16:40 -06:00
Friendly Automation
5192a045f6 Merge "chan_sip: Always process updated SDP on media source change" into 17 2020-01-27 18:27:52 -06:00
Kevin Harwell
737bd8365e 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:11:21 -06:00
Kevin Harwell
7031c3b7bd 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:13 -06:00
Sean Bright
69cf67d8c6 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:06 -06:00
Walter Doekes
be6eec7b25 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:29:09 -06:00
Sean Bright
ace97a3786 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:21:52 -06:00
Asterisk Development Team
a0f44b1052 Update CHANGES and UPGRADE.txt for 17.2.0 2020-01-23 11:15:46 -05:00
Friendly Automation
6747dd31b4 Merge "http: Add ability to disable /httpstatus URI" into 17 2020-01-23 08:48:37 -06:00
George Joseph
f34a4d5a77 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 12:13:44 -07:00
Sean Bright
1e79bf44fc 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:59 -06:00
Friendly Automation
f7e0b6baf8 Merge "func_odbc.conf.sample: Add example lookup" into 17 2020-01-22 09:21:57 -06:00
Friendly Automation
f556efe0b9 Merge "res_statsd: Document that res_statsd does nothing on its own" into 17 2020-01-22 08:43:01 -06:00
Friendly Automation
c8dc9365a4 Merge "translate.c: Fix silk 24kHz truncation in 'core show translation'" into 17 2020-01-22 07:51:05 -06:00
Joshua Colp
73cd259895 Merge "chan_dahdi: Change 999999 to INT_MAX to better reflect "no timeout"" into 17 2020-01-22 07:49:04 -06:00
Friendly Automation
d6a4560016 Merge "chan_sip.c: Stop handling continuation lines after reading headers" into 17 2020-01-21 08:25:33 -06:00
Andrew Siplas
1c5116f842 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:11:40 -05:00
Sean Bright
687890f734 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:16 -06:00
Sean Bright
d33cd39260 func_odbc.conf.sample: Add example lookup
Change-Id: Ia05aab1f579597963d2ea23920d2210cfcb97c84
2020-01-20 15:26:34 -06:00
Sean Bright
deed0f5706 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:59:08 -06:00
Friendly Automation
503cac85ee Merge "queue_log: Add alembic script for generate db table for queue_log" into 17 2020-01-20 11:31:12 -06:00
Joshua Colp
7a9a4575bc Merge "app_voicemail, say: Fix various leading whitespace problems" into 17 2020-01-20 09:33:00 -06:00
Friendly Automation
88e3f5c315 Merge "app_voicemail: Prevent crash when saving message with realtime voicemail" into 17 2020-01-20 09:19:52 -06:00
Rodrigo Ramírez Norambuena
7b32763190 queue_log: Add alembic script for generate db table for queue_log
Change-Id: I35b928a6251f9da9a1742b2cd14c63a00c3d0f0c
2020-01-20 09:16:54 -06:00
Joshua Colp
68b7ef924e Merge "pbx.c: Include filesystem cache in free memory calculation" into 17 2020-01-20 07:10:47 -06:00
Joshua Colp
cf37de8a5d Merge "res_realtime: Fix 'realtime update2' argument handling" into 17 2020-01-17 08:53:19 -06:00
Joshua Colp
f132679193 Merge "app_voicemail: Set globals to default values when voicemail.conf missing" into 17 2020-01-17 08:37:19 -06:00
Sean Bright
cb6f106d76 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:25 -06:00
Sean Bright
9ff062f994 pbx.c: Include filesystem cache in free memory calculation
ASTERISK-28695 #close
Reported by: Kevin Flyn

Change-Id: Ief098bb6eb77378daeace8f97ba30701c8de55b8
2020-01-16 12:38:03 -06:00
Sean Bright
7c137ebbd4 chan_sip.c: Stop handling continuation lines after reading headers
lws2sws() does not stop trying to handle header continuation lines
even after all headers have been found. This is problematic if the
first character of a SIP message body is a space or tab character, so
we update to recognize the end of the message header.

ASTERISK-28693 #close
Reported by: Frank Matano

Change-Id: Idec8fa58545cd3fd898cbe0075d76c223f8d33df
2020-01-16 09:17:24 -06:00
Sean Bright
d1cd27ba1f app_voicemail: Prevent crash when saving message with realtime voicemail
ast_store_realtime() is not NULL tolerant, so we need to initialize
the field values we pass to it to the empty string to avoid a crash.

ASTERISK-23739 #close
Reported by: Stas Kobzar

Change-Id: I756c5dd0299c77f4274368f7c99eb0464367466c
2020-01-15 15:52:17 -06:00
Joshua Colp
8cad8db7d3 Merge "app_queue: Deprecate the QueueMemberPause.Reason field" into 17 2020-01-15 07:03:49 -06:00
Friendly Automation
af4e503005 Merge "res_pjsip_notify: Only allow a single Event header to be added to a NOTIFY" into 17 2020-01-15 06:41:09 -06:00
Sean Bright
b60dfac98e app_voicemail: Set globals to default values when voicemail.conf missing
If voicemail.conf exists but is empty, the config parsing process will
default a number of global variables to non-zero values. On the other
hand, if voicemail.conf is missing (arguably semantically equivalent
to an empty file), this process is skipped and the globals are
defaulted to 0.

Set the globals to the same values they would be set to if a
configuration were present. This allows voicemail configuration to be
done completely by Realtime without the need to create an empty
voicemail.conf file.

ASTERISK-27622 #close
Reported by: Jim Van Meggelen

Change-Id: Id907d280f310f12e542ca527e6a025432b9fb409
2020-01-14 16:31:33 -06:00
Sean Bright
62e5fa400e app_queue: Deprecate the QueueMemberPause.Reason field
The QueueMemberPause AMI event includes two fields that return the
reason a member was paused.

* In release branches, deprecate Reason in favor of PausedReason.
* In master, remove the Reason field entirely.

ASTERISK-28349 #close
Reported by: Niksa Baldun

Change-Id: I01da58f2b0ab927baeee754870f62b51b7b3d296
2020-01-14 13:51:41 -06:00
Joshua Colp
0bd7cd562e Merge "res_pjsip_endpoint_identifier_ip: Document support for hostnames" into 17 2020-01-14 12:39:08 -06:00
Friendly Automation
acbe620d41 Merge "func_curl: Add 'followlocation' option to CURLOPT()" into 17 2020-01-14 12:31:49 -06:00
Sean Bright
3779e76b68 res_realtime: Fix 'realtime update2' argument handling
The change in 9b99ef50b5 updated the
syntax of the 'realtime update2' CLI command but did not correctly
update the calls to ast_update2_realtime().

The issue this addresses was originally opened because we aren't
allowing a SQL NULL to be set as part of the update, but this is a
limitation of the Realtime API and is not a bug.

Additionally, this patch:

* Corrects the example in the command documentation to reflect
  'update2' instead of 'update.'

* Fixes the leading spacing of the command documentation.

* Checks that the required 'NULL' literal argument is present where we
  expect it to be.

ASTERISK-21794 #close
Reported by: Cédric Bassaget

Change-Id: Idda63a5dc50d5f9bcb34c27ea3238d90f733b2cd
2020-01-14 10:07:12 -06:00
Joshua Colp
65bc8d70e3 Merge "app_record: Do not hang up if beep audio is missing" into 17 2020-01-14 09:10:45 -06:00
Sean Bright
a810025782 func_curl: Add 'followlocation' option to CURLOPT()
We allow for 'maxredirs' to be set, but this value is ignored when
followlocation is not enabled which, by default, it is not.

ASTERISK-17491 #close
Reported by: candrews

Change-Id: I96a4ab0142f2fb7d2e96ff976f6cf7b2982c761a
2020-01-13 08:26:48 -06:00
Sean Bright
28275609b3 res_pjsip_endpoint_identifier_ip: Document support for hostnames
ASTERISK-25429 #close
Reported by: Joshua C. Colp

Change-Id: I7cdfc6026821636acc2465094b7fcde8471a3824
2020-01-10 15:15:52 -06:00