asterisk/asterisk.git
4 months 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

4 months agoMerge "res_pjsip_messaging: Ensure MESSAGE_SEND_STATUS is set properly"
Friendly Automation [Tue, 28 Jan 2020 16:22:20 +0000 (10:22 -0600)]
Merge "res_pjsip_messaging: Ensure MESSAGE_SEND_STATUS is set properly"

4 months agoMerge "chan_sip: Always process updated SDP on media source change"
Friendly Automation [Tue, 28 Jan 2020 00:29:34 +0000 (18:29 -0600)]
Merge "chan_sip: Always process updated SDP on media source change"

4 months 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

4 months 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

4 months 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

4 months agoMerge "http: Add ability to disable /httpstatus URI"
George Joseph [Thu, 23 Jan 2020 15:34:48 +0000 (09:34 -0600)]
Merge "http: Add ability to disable /httpstatus URI"

4 months agoMerge "cdr.c: Set event time on party b when leaving a parking bridge"
Joshua Colp [Thu, 23 Jan 2020 14:47:06 +0000 (08:47 -0600)]
Merge "cdr.c: Set event time on party b when leaving a parking bridge"

4 months agoMerge "app_voicemail: Remove MessageExists and MESSAGE_EXISTS()"
Friendly Automation [Wed, 22 Jan 2020 21:46:35 +0000 (15:46 -0600)]
Merge "app_voicemail: Remove MessageExists and MESSAGE_EXISTS()"

4 months 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

4 months 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

4 months agoMerge "func_odbc.conf.sample: Add example lookup"
Joshua Colp [Wed, 22 Jan 2020 15:28:19 +0000 (09:28 -0600)]
Merge "func_odbc.conf.sample: Add example lookup"

4 months agoMerge "res_statsd: Document that res_statsd does nothing on its own"
Friendly Automation [Wed, 22 Jan 2020 14:41:08 +0000 (08:41 -0600)]
Merge "res_statsd: Document that res_statsd does nothing on its own"

4 months agoMerge "translate.c: Fix silk 24kHz truncation in 'core show translation'"
Joshua Colp [Wed, 22 Jan 2020 14:33:54 +0000 (08:33 -0600)]
Merge "translate.c: Fix silk 24kHz truncation in 'core show translation'"

4 months agoMerge "chan_dahdi: Change 999999 to INT_MAX to better reflect "no timeout""
Joshua Colp [Wed, 22 Jan 2020 13:48:49 +0000 (07:48 -0600)]
Merge "chan_dahdi: Change 999999 to INT_MAX to better reflect "no timeout""

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

4 months 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

4 months 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

4 months 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

4 months 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

4 months agoMerge "queue_log: Add alembic script for generate db table for queue_log"
Joshua Colp [Mon, 20 Jan 2020 17:32:51 +0000 (11:32 -0600)]
Merge "queue_log: Add alembic script for generate db table for queue_log"

4 months agoMerge "app_voicemail, say: Fix various leading whitespace problems"
Joshua Colp [Mon, 20 Jan 2020 16:07:13 +0000 (10:07 -0600)]
Merge "app_voicemail, say: Fix various leading whitespace problems"

4 months agoMerge "app_voicemail: Prevent crash when saving message with realtime voicemail"
Joshua Colp [Mon, 20 Jan 2020 15:31:42 +0000 (09:31 -0600)]
Merge "app_voicemail: Prevent crash when saving message with realtime voicemail"

4 months agoMerge "pbx.c: Include filesystem cache in free memory calculation"
Joshua Colp [Mon, 20 Jan 2020 13:10:07 +0000 (07:10 -0600)]
Merge "pbx.c: Include filesystem cache in free memory calculation"

4 months agoMerge "res_realtime: Fix 'realtime update2' argument handling"
George Joseph [Fri, 17 Jan 2020 15:19:54 +0000 (09:19 -0600)]
Merge "res_realtime: Fix 'realtime update2' argument handling"

4 months agoMerge "app_voicemail: Set globals to default values when voicemail.conf missing"
Joshua Colp [Fri, 17 Jan 2020 14:37:34 +0000 (08:37 -0600)]
Merge "app_voicemail: Set globals to default values when voicemail.conf missing"

4 months agoapp_voicemail: Remove MessageExists and MESSAGE_EXISTS()
Sean Bright [Thu, 16 Jan 2020 21:29:25 +0000 (16:29 -0500)]
app_voicemail: Remove MessageExists and MESSAGE_EXISTS()

* The MailboxExists dialplan application was deprecated on 2006-09-26
  in Asterisk 1.6.0 (commit ec83b111831fe865753f5b1c382ab73750685e50)

* The MAILBOX_EXISTS dialplan function was deprecated on 2011-12-06 in
  Asterisk 11.0.0 (commit fd64bb66f94f1a7bb47e17319512b14e522353ec)

Change-Id: I71cfc9d7b9217a37b802f4cc6ef2d57900b7398f

4 months agoapp_voicemail, say: Fix various leading whitespace problems
Sean Bright [Thu, 16 Jan 2020 19:47:01 +0000 (14:47 -0500)]
app_voicemail, say: Fix various leading whitespace problems

In af90afd90c64c5183c2207d061f9aa15138081b2, 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

4 months agopbx.c: Include filesystem cache in free memory calculation
Sean Bright [Thu, 16 Jan 2020 13:32:34 +0000 (08:32 -0500)]
pbx.c: Include filesystem cache in free memory calculation

ASTERISK-28695 #close
Reported by: Kevin Flyn

Change-Id: Ief098bb6eb77378daeace8f97ba30701c8de55b8

4 months agochan_sip.c: Stop handling continuation lines after reading headers
Sean Bright [Thu, 16 Jan 2020 15:09:47 +0000 (10:09 -0500)]
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

4 months agoapp_voicemail: Prevent crash when saving message with realtime voicemail
Sean Bright [Wed, 15 Jan 2020 20:29:00 +0000 (15:29 -0500)]
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

4 months agoMerge "feat: AudioSocket channel, application, and ARI support."
Friendly Automation [Wed, 15 Jan 2020 13:22:08 +0000 (07:22 -0600)]
Merge "feat: AudioSocket channel, application, and ARI support."

4 months agoMerge "res_pjsip_notify: Only allow a single Event header to be added to a NOTIFY"
Joshua Colp [Wed, 15 Jan 2020 12:44:41 +0000 (06:44 -0600)]
Merge "res_pjsip_notify: Only allow a single Event header to be added to a NOTIFY"

4 months agoMerge "app_queue: Deprecate the QueueMemberPause.Reason field"
Friendly Automation [Wed, 15 Jan 2020 12:42:24 +0000 (06:42 -0600)]
Merge "app_queue: Deprecate the QueueMemberPause.Reason field"

4 months agoapp_voicemail: Set globals to default values when voicemail.conf missing
Sean Bright [Tue, 14 Jan 2020 22:20:21 +0000 (17:20 -0500)]
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

4 months agoMerge "res_pjsip_endpoint_identifier_ip: Document support for hostnames"
Friendly Automation [Tue, 14 Jan 2020 19:14:25 +0000 (13:14 -0600)]
Merge "res_pjsip_endpoint_identifier_ip: Document support for hostnames"

4 months agoMerge "func_curl: Add 'followlocation' option to CURLOPT()"
Joshua Colp [Tue, 14 Jan 2020 18:35:36 +0000 (12:35 -0600)]
Merge "func_curl: Add 'followlocation' option to CURLOPT()"

4 months agores_realtime: Fix 'realtime update2' argument handling
Sean Bright [Mon, 13 Jan 2020 22:37:00 +0000 (17:37 -0500)]
res_realtime: Fix 'realtime update2' argument handling

The change in 9b99ef50b5d01ee8111d26efa7b926bdfaf3f980 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

4 months agoMerge "netsock2: ast_addressfamily_to_sockaddrsize and ast_sockaddr_from_sockaddr."
Friendly Automation [Tue, 14 Jan 2020 15:48:22 +0000 (09:48 -0600)]
Merge "netsock2: ast_addressfamily_to_sockaddrsize and ast_sockaddr_from_sockaddr."

4 months agofeat: AudioSocket channel, application, and ARI support.
Seán C McCord [Thu, 18 Jul 2019 00:47:50 +0000 (20:47 -0400)]
feat: AudioSocket channel, application, and ARI support.

This commit adds support for
[AudioSocket](
https://wiki.asterisk.org/wiki/display/AST/AudioSocket),
a very simple bidirectional audio streaming protocol. There are both
channel and application interfaces.

A description of the protocol can be found on the above referenced
GitHub page.  A short talk about the reasons and implementation can be
found on [YouTube](https://www.youtube.com/watch?v=tjduXbZZEgI), from
CommCon 2019.

ARI support has also been added via the existing "externalMedia" ARI
functionality. The UUID is specified using the arbitrary "data" field.

ASTERISK-28484 #close

Change-Id: Ie866e6c4fa13178ec76f2a6971ad3590a3a588b5

4 months agoMerge "app_record: Do not hang up if beep audio is missing"
Joshua Colp [Tue, 14 Jan 2020 15:10:30 +0000 (09:10 -0600)]
Merge "app_record: Do not hang up if beep audio is missing"

4 months agofunc_curl: Add 'followlocation' option to CURLOPT()
Sean Bright [Fri, 10 Jan 2020 19:30:20 +0000 (14:30 -0500)]
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

4 months agoapp_queue: Deprecate the QueueMemberPause.Reason field
Sean Bright [Sat, 11 Jan 2020 13:29:46 +0000 (08:29 -0500)]
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

4 months agores_pjsip_endpoint_identifier_ip: Document support for hostnames
Sean Bright [Fri, 10 Jan 2020 21:13:49 +0000 (16:13 -0500)]
res_pjsip_endpoint_identifier_ip: Document support for hostnames

ASTERISK-25429 #close
Reported by: Joshua C. Colp

Change-Id: I7cdfc6026821636acc2465094b7fcde8471a3824

4 months agores_pjsip_notify: Only allow a single Event header to be added to a NOTIFY
Sean Bright [Fri, 10 Jan 2020 20:43:24 +0000 (15:43 -0500)]
res_pjsip_notify: Only allow a single Event header to be added to a NOTIFY

ASTERISK-27775 #close
Reported by: AvayaXAsterisk

Change-Id: Iad158e908e34675ad98f74d09c5e73024e50c257

4 months agoMerge "ARI: Ability to inhibit COLP frames when adding channels to a bridge"
Friendly Automation [Fri, 10 Jan 2020 18:03:35 +0000 (12:03 -0600)]
Merge "ARI: Ability to inhibit COLP frames when adding channels to a bridge"

4 months agonetsock2: ast_addressfamily_to_sockaddrsize and ast_sockaddr_from_sockaddr.
Jaco Kroon [Tue, 3 Dec 2019 18:27:38 +0000 (20:27 +0200)]
netsock2: ast_addressfamily_to_sockaddrsize and ast_sockaddr_from_sockaddr.

ast_addressfamily_to_sockaddrize will determine the size that's
required, and ast_sockaddr_from_sockaddr then wraps this new function
and ast_sockaddr_copy_sockaddr to copy arbitrary sockaddr's (without
knowing the address family) into the ast_sockaddr structure.

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

4 months agoMerge "res_pjsip_pubsub: Add ability to persist generator state information."
Friendly Automation [Thu, 9 Jan 2020 22:23:40 +0000 (16:23 -0600)]
Merge "res_pjsip_pubsub: Add ability to persist generator state information."

4 months agoMerge "res_pjsip_endpoint_identifier_ip.c: Add port matching support"
Joshua Colp [Thu, 9 Jan 2020 21:08:04 +0000 (15:08 -0600)]
Merge "res_pjsip_endpoint_identifier_ip.c: Add port matching support"

4 months agoMerge "CI: Update buildAsterisk.sh to do a "make full""
Friendly Automation [Thu, 9 Jan 2020 20:28:27 +0000 (14:28 -0600)]
Merge "CI: Update buildAsterisk.sh to do a "make full""

4 months agoapp_record: Do not hang up if beep audio is missing
Corey Farrell [Thu, 9 Jan 2020 10:37:08 +0000 (05:37 -0500)]
app_record: Do not hang up if beep audio is missing

Additionally alter the warning to mention that it was "beep" which could
not be streamed to give admins a better clue about what the warning
means.

ASTERISK-28682

Change-Id: If5aed21226a173117ed17589f44826dd1ba6576e

4 months agoapp_agent_pool: Update XML docs for AgentLogin
Kevin Harwell [Wed, 8 Jan 2020 19:54:44 +0000 (13:54 -0600)]
app_agent_pool: Update XML docs for AgentLogin

This patch fixes some wrongly formatted documentation for the AgentLogin
application. A couple of "see also" links should contain only the function
name, and no parameters.

Change-Id: I3f788b47dce3292e311f8a9856938d59a0bd0661

4 months agoCI: Update buildAsterisk.sh to do a "make full"
George Joseph [Wed, 8 Jan 2020 18:11:26 +0000 (11:11 -0700)]
CI: Update buildAsterisk.sh to do a "make full"

If you do a "make all" when building Asterisk the xml documentation
produced will be missing certain AMI events where their
documentation is located not at the top of the c source file but
embedded further down next to the event's manager_event()
registration call.  See main/manager_mwi.c for an example.

"make full" does produce the correct documentation so we're changing
it in the build script.  A separate commit/issue will address the
problem with "make all".

ASTERISK-28507
Reported by: David Lee

Change-Id: I4a22635d6eef99eacecc0efb69e28360eebdb86c

4 months agores_pjsip_pubsub: Add ability to persist generator state information.
Joshua C. Colp [Mon, 6 Jan 2020 15:02:54 +0000 (15:02 +0000)]
res_pjsip_pubsub: Add ability to persist generator state information.

Some body generators, such as dialog-info+xml, require storing state
information which is then conveyed in the NOTIFY request itself. Up
until now there was no way for such body generators to persist this
information.

Two new API calls have been added to allow body generators to set and
get persisted data. This data is persisted out alongside the normal
persistence information and allows the body generator to restore
state information or to simply use this for normal storage of state.
State is stored in the form of JSON and it is up to the body
generator to interpret this as needed.

The dialog-info+xml body generator has been updated to take advantage
of this to persist the version number.

ASTERISK-27759

Change-Id: I5fda56c624fd13c17b3c48e0319b77079e9e27de

4 months agoMerge "sig_pri: Fix deadlock caused by sig_pri_queue_hangup"
Joshua Colp [Wed, 8 Jan 2020 15:42:05 +0000 (09:42 -0600)]
Merge "sig_pri:  Fix deadlock caused by sig_pri_queue_hangup"

4 months agoMerge "stasis.c: Use correct topic name in stasis_topic_pool_delete_topic"
Joshua Colp [Wed, 8 Jan 2020 15:41:18 +0000 (09:41 -0600)]
Merge "stasis.c:  Use correct topic name in stasis_topic_pool_delete_topic"

4 months agores_pjsip_endpoint_identifier_ip.c: Add port matching support
Sean Bright [Tue, 24 Dec 2019 15:16:23 +0000 (10:16 -0500)]
res_pjsip_endpoint_identifier_ip.c: Add port matching support

Adds source port matching support when IP matching is used:

  [example]
  type = identify
  match = 1.2.3.4:5060/32, 1.2.3.4:6000/32, asterisk.org:4444

If the IP matches but the source port does not, we reject and search for
alternatives. SRV lookups are still performed if enabled (srv_lookups = yes),
unless the configured FQDN includes a port number in which case just a host
lookup is performed.

ASTERISK-28639 #close
Reported by: Mitch Claborn

Change-Id: I256d5bd5d478b95f526e2f80ace31b690eebba92

4 months agoMerge "app_bridgeaddchan.c: Make BridgeAdd be more like Bridge"
George Joseph [Tue, 7 Jan 2020 20:29:27 +0000 (14:29 -0600)]
Merge "app_bridgeaddchan.c: Make BridgeAdd be more like Bridge"

4 months agoMerge "app_chanisavail.c: Simplify dialplan using ChanIsAvail."
George Joseph [Tue, 7 Jan 2020 20:28:55 +0000 (14:28 -0600)]
Merge "app_chanisavail.c: Simplify dialplan using ChanIsAvail."

4 months agoMerge "res_pjsip_config_wizard: Fix change detection for wizard settings"
George Joseph [Tue, 7 Jan 2020 19:05:52 +0000 (13:05 -0600)]
Merge "res_pjsip_config_wizard: Fix change detection for wizard settings"

4 months agoMerge "features.c: Make Bridge application tolerate unspecified channel."
George Joseph [Tue, 7 Jan 2020 19:03:50 +0000 (13:03 -0600)]
Merge "features.c: Make Bridge application tolerate unspecified channel."

4 months agoMerge "app_dial.c: Simplify dialplan using Dial."
Friendly Automation [Tue, 7 Jan 2020 17:48:57 +0000 (11:48 -0600)]
Merge "app_dial.c: Simplify dialplan using Dial."

4 months agoMerge "app_page.c: Simplify dialplan using Page."
Friendly Automation [Tue, 7 Jan 2020 17:40:57 +0000 (11:40 -0600)]
Merge "app_page.c: Simplify dialplan using Page."

4 months agoMerge "app_softhangup.c: Reduce unnecessary warning to verbose message."
Joshua Colp [Tue, 7 Jan 2020 17:14:48 +0000 (11:14 -0600)]
Merge "app_softhangup.c: Reduce unnecessary warning to verbose message."

4 months agoMerge "app_chanspy.c: Reduce log message level from notice to verbose."
Friendly Automation [Tue, 7 Jan 2020 16:41:38 +0000 (10:41 -0600)]
Merge "app_chanspy.c: Reduce log message level from notice to verbose."

4 months agoMerge "websocket: Consider pending SSL data when waiting for socket input"
Friendly Automation [Tue, 7 Jan 2020 16:02:18 +0000 (10:02 -0600)]
Merge "websocket: Consider pending SSL data when waiting for socket input"

4 months agoMerge "contrib/valgrind: Fix use of frame-level suppression"
George Joseph [Tue, 7 Jan 2020 15:58:42 +0000 (09:58 -0600)]
Merge "contrib/valgrind: Fix use of frame-level suppression"

4 months agosig_pri: Fix deadlock caused by sig_pri_queue_hangup
George Joseph [Mon, 30 Dec 2019 17:04:23 +0000 (10:04 -0700)]
sig_pri:  Fix deadlock caused by sig_pri_queue_hangup

The change to add setting hangupsource to sig_pri_queue_hangup()
made in https://gerrit.asterisk.org/c/asterisk/+/12857 casued
deadlocks when a hangup request was received from the core at the
same time a hanguprequest was received from the remote end via the
D channel.

Although the PRI's channel private structure was being unlocked
before setting the hangupsource, the PRI's own lock was still being
held during the process.  If channel actions were also coming from
the core, a deadlock on the PRI could result.  This deadlock could
then escalate to the entire DAHDI subsystem via DAHDI's global
interface list lock, especially if someone used the PRI CLI commands.

Fix:

* We now unlock the PRI as well as the PRI's channel private
  structure before setting the hangupsource, then relock both
  afterwards.

ASTERISK-28605
Reported by: Dirk Wendland

Change-Id: Id74aaa5d4e3746063dbe9deed188eb65193cb9c9

4 months agoapp_chanisavail.c: Simplify dialplan using ChanIsAvail.
Richard Mudgett [Mon, 30 Dec 2019 19:13:46 +0000 (13:13 -0600)]
app_chanisavail.c: Simplify dialplan using ChanIsAvail.

Dialplan has to be careful about passing an empty device list or empty
positions in the list.  As a result, dialplan has to check for these
conditions before using ChanIsAvail.  Simplify dialplan by making
ChanIsAvail handle these conditions gracefully.

* Made tolerate empty positions in the device list.

* Simplified the code and eliminated some unnecessary indention.

ASTERISK-28638

Change-Id: I9e4b67e2cbf26b2417c2d03485b8568e898931d3

4 months agostasis.c: Use correct topic name in stasis_topic_pool_delete_topic
George Joseph [Thu, 2 Jan 2020 20:25:33 +0000 (13:25 -0700)]
stasis.c:  Use correct topic name in stasis_topic_pool_delete_topic

When a topic is created for an object, its name is only
<object>:<uniqueid>
For example:
bridge:cb68b3a8-fce7-4738-8a17-d7847562f020

When a topic is added to a pool, its name has the pool's topic
name prepended.  For example:
bridge:all/bridge:cb68b3a8-fce7-4738-8a17-d7847562f020

The topic_pool_entry's name however, is only what was passed
in to stasis_topic_pool_get_topic which is
bridge:cb68b3a8-fce7-4738-8a17-d7847562f020
That's actually correct because the entry is qualified by the
pool that's in.

When you're ready to delete the entry from the pool, you retrieve
the tropic name from the object but since it now has the pool's
topic name prepended, it won't be found in the pool container.

Fix:

* Modified stasis_topic_pool_delete_topic() to skip past the
pool topic's name, if it was prepended to the topic name,
before searching the container for a pool entry.

ASTERISK-28633
Reported by: Joeran Vinzens

Change-Id: I4396aa69dd83e4ab84c5b91b39293cfdbcf483e6

5 months agoapp_bridgeaddchan.c: Make BridgeAdd be more like Bridge
Richard Mudgett [Mon, 30 Dec 2019 21:05:44 +0000 (15:05 -0600)]
app_bridgeaddchan.c: Make BridgeAdd be more like Bridge

* Made BridgeAdd not hangup the call if there is a problem.
* Reduced message level from warning to verbose for normal exception
cases.
* Added a loop safety check to BridgeAdd.
* Made BridgeAdd set BRIDGERESULT with the status when dialplan is
resumed.

Change-Id: I374d39b8a3edcc794eeb5c6b9f31a01424cdc426

5 months agoapp_dial.c: Simplify dialplan using Dial.
Richard Mudgett [Mon, 30 Dec 2019 04:38:05 +0000 (22:38 -0600)]
app_dial.c: Simplify dialplan using Dial.

Dialplan has to be careful about passing an empty destination list or
empty positions in the list.  As a result, dialplan has to check for
these conditions before using Dial.  Simplify dialplan by making Dial
handle these conditions gracefully.

* Made tolerate empty positions in the dialed device list.

* Reduced some message log levels from notice to verbose.

ASTERISK-28638

Change-Id: I6edc731aff451f8bdfaee5498078dd18c3a11ab9

5 months agoapp_page.c: Simplify dialplan using Page.
Richard Mudgett [Mon, 30 Dec 2019 02:41:30 +0000 (20:41 -0600)]
app_page.c: Simplify dialplan using Page.

Dialplan has to be careful about passing an empty destination list or
empty positions in the list.  As a result, dialplan has to check for
these conditions before using Page.  Simplify dialplan by making Page
handle these conditions gracefully.

* Made tolerate empty positions in the paged device list.

* Reduced some warnings associated with the 's' option to verbose
messages.  The warning level for those messages really serves no purpose
as that is why the 's' option exists.

ASTERISK-28638

Change-Id: I95b64a6d6800cd1a25279c88889314ae60fc21e3

5 months agofeatures.c: Make Bridge application tolerate unspecified channel.
Richard Mudgett [Mon, 30 Dec 2019 00:36:54 +0000 (18:36 -0600)]
features.c: Make Bridge application tolerate unspecified channel.

The Bridge application was inconsistent if the channel to bridge with is
not specified.  If no parameters are given then a warning is issued and
the current channel is hung up.  If options are given but no channel is
specified then a warning is issued and the current channel is not hung up.

* Made the Bridge application give a verbose message instead of a warning
if the channel to bridge with is not specified and made not hang up the
current channel.  As a result dialplan no longer needs to check if a
channel name is passed before calling Bridge and simply needs to check the
BRIDGERESULT channel variable instead.  This is something you likely want
your dialplan to do anyway.

* Fixed up L() option warning message.  It is up to the caller to
determine if the channel is hung up because of the warning.  Dial() hangs
up the current channel while Bridge() does not.

Change-Id: I44349a8dc3912397f28852777de04f19e7bb9c73

5 months agoapp_chanspy.c: Reduce log message level from notice to verbose.
Richard Mudgett [Sun, 29 Dec 2019 23:48:55 +0000 (17:48 -0600)]
app_chanspy.c: Reduce log message level from notice to verbose.

Change-Id: Ica5f38ccd8cdc077aef14d0c50425e0b29ac7e0a

5 months agoapp_softhangup.c: Reduce unnecessary warning to verbose message.
Richard Mudgett [Sun, 29 Dec 2019 23:31:28 +0000 (17:31 -0600)]
app_softhangup.c: Reduce unnecessary warning to verbose message.

Why log a warning for something your dialplan explicitly asked for?

Change-Id: I167b90daf4c7d75dd4b7ef94849f6cef05aa43a7

5 months agores_pjsip_config_wizard: Fix change detection for wizard settings
Sean Bright [Sun, 5 Jan 2020 16:00:46 +0000 (11:00 -0500)]
res_pjsip_config_wizard: Fix change detection for wizard settings

ast_sorcery_changeset_create() is not commutative and will fail to detect
differences between two variable lists depending on what changed, so switch to
ast_variable_lists_match().

ASTERISK-28492 #close
Reported by: Jean-Denis Girard

Change-Id: I7b3256983ddfaa2138d3de92a444a53b5193a4e1

5 months agores_agi: Improve GET FULL VARIABLE documentation
Sean Bright [Fri, 3 Jan 2020 16:20:29 +0000 (11:20 -0500)]
res_agi: Improve GET FULL VARIABLE documentation

ASTERISK-28673 #close
Reported by: Jonathan Harris

Change-Id: I591afdec669622bfa19243aabec31b579652c92f

5 months agowebsocket: Consider pending SSL data when waiting for socket input
Sean Bright [Tue, 26 Nov 2019 19:24:10 +0000 (14:24 -0500)]
websocket: Consider pending SSL data when waiting for socket input

When TLS is in use, checking the readiness of the underlying FD is insufficient
for determining if there is data available to be read. So before polling the
FD, check if there is any buffered data in the TLS layer and use that first.

ASTERISK-28562 #close
Reported by: Robert Sutton

Change-Id: I95fcb3e2004700d5cf8e5ee04943f0115b15e10d

5 months agoMerge "func_odbc: acf_odbc_read() and cli_odbc_read() unicode support"
Joshua Colp [Thu, 2 Jan 2020 15:35:31 +0000 (09:35 -0600)]
Merge "func_odbc:  acf_odbc_read() and cli_odbc_read() unicode support"

5 months agoARI: Ability to inhibit COLP frames when adding channels to a bridge
Jean Aunis [Fri, 22 Nov 2019 14:32:42 +0000 (15:32 +0100)]
ARI: Ability to inhibit COLP frames when adding channels to a bridge

This patch adds a new flag "inhibitConnectedLineUpdates" to the 'addChannel'
operation in the Bridges REST API. When set, this flag avoids generating COLP
frames when the specified channels enter the bridge.

ASTERISK-28629

Change-Id: Ib995d4f0c6106279aa448b34b042b68f0f2ca5dc

5 months agoMerge "res_fax: wrap v21 detected Asterisk initiated negotiation with config option"
George Joseph [Thu, 2 Jan 2020 14:43:21 +0000 (08:43 -0600)]
Merge "res_fax: wrap v21 detected Asterisk initiated negotiation with config option"

5 months agoMerge "chan_sip: voice frames are no longer transmitted after emitting a COLP"
Friendly Automation [Mon, 30 Dec 2019 21:17:50 +0000 (15:17 -0600)]
Merge "chan_sip: voice frames are no longer transmitted after emitting a COLP"

5 months agodb: Initialize condition primitive before use
Sean Bright [Fri, 27 Dec 2019 23:29:45 +0000 (18:29 -0500)]
db: Initialize condition primitive before use

The db_init() function ultimately calls db_sync() which signals the
condition before it is initialized.

Change-Id: Id4a4e025b637bc4ac7d90557fcb71d56598892ab

5 months agoMerge "config.c: Skip UTF-8 BOMs if present when reading config files"
George Joseph [Fri, 27 Dec 2019 19:12:03 +0000 (13:12 -0600)]
Merge "config.c: Skip UTF-8 BOMs if present when reading config files"

5 months agoMerge "main/file.c: Limit media cache usage to remote files."
Joshua C. Colp [Fri, 20 Dec 2019 00:41:11 +0000 (18:41 -0600)]
Merge "main/file.c: Limit media cache usage to remote files."

5 months agoMerge "app_chanisavail/cdr: ChanIsAvail sometimes fails to deactivate CDR."
Joshua C. Colp [Fri, 20 Dec 2019 00:40:11 +0000 (18:40 -0600)]
Merge "app_chanisavail/cdr: ChanIsAvail sometimes fails to deactivate CDR."

5 months agoMerge "chan_sip: in case of tcp/tls, be less annoying about tx errors."
Friendly Automation [Thu, 19 Dec 2019 16:44:45 +0000 (10:44 -0600)]
Merge "chan_sip:  in case of tcp/tls, be less annoying about tx errors."

5 months agoMerge "confbridge: Add support for specifying maximum sample rate."
Friendly Automation [Thu, 19 Dec 2019 16:00:43 +0000 (10:00 -0600)]
Merge "confbridge: Add support for specifying maximum sample rate."

5 months agoconfig.c: Skip UTF-8 BOMs if present when reading config files
Sean Bright [Wed, 18 Dec 2019 15:13:21 +0000 (10:13 -0500)]
config.c: Skip UTF-8 BOMs if present when reading config files

ASTERISK-28667 #close

Change-Id: I4767ed365c98f3e1587b7653321048a31d8a53b2

5 months agomain/file.c: Limit media cache usage to remote files.
Kevin Reeves [Thu, 21 Nov 2019 18:48:42 +0000 (12:48 -0600)]
main/file.c: Limit media cache usage to remote files.

When testing for the existance of a file, the media cache is searched even if
the file has no chance of being in it.  This can cause performance issues
as the media cache size increases.

As a result, calls to applications like Read and Playback using local files
must scan through the media cache before playing.  Under load and with a
large cache, this can delay the playback of those files.

This patch updates the function that checks for the existance of a file to
only consult the media cache database if the requested file is a remote path.
It introduces a new is_remote_path() function in main/file.c.

ASTERISK-28625  #close
Reported-by: kevin@phoneburner.com

Change-Id: If91137493732d9034dafa381c081c69274a7dcc9

5 months agoMerge "res_rtp_asterisk: Add frame list cleanups to ast_rtp_read"
George Joseph [Wed, 18 Dec 2019 14:54:16 +0000 (08:54 -0600)]
Merge "res_rtp_asterisk:  Add frame list cleanups to ast_rtp_read"

5 months agoMerge "sip_to_pjsip.py: Fix trustrpid typo"
Friendly Automation [Wed, 18 Dec 2019 13:26:45 +0000 (07:26 -0600)]
Merge "sip_to_pjsip.py: Fix trustrpid typo"

5 months agoMerge "configure: Add check for MySQL client bool and my_bool type usage."
Joshua C. Colp [Wed, 18 Dec 2019 12:37:06 +0000 (06:37 -0600)]
Merge "configure: Add check for MySQL client bool and my_bool type usage."

5 months agoMerge "res_pjsip_session: Set stream state on created streams for incoming SDP."
Joshua C. Colp [Wed, 18 Dec 2019 11:38:29 +0000 (05:38 -0600)]
Merge "res_pjsip_session: Set stream state on created streams for incoming SDP."

5 months agocontrib/valgrind: Fix use of frame-level suppression
Snuffy [Wed, 18 Dec 2019 00:20:49 +0000 (11:20 +1100)]
contrib/valgrind: Fix use of frame-level suppression

Fix use of frame-level wildcard usage in suppression file.

ASTERISK-27243 #close
Reported-by: Richard Kenner

Change-Id: I1c0c64c5f305d2c9aa124e11f1f64a2eec52dc51

5 months agosip_to_pjsip.py: Fix trustrpid typo
Pascal Cadotte Michaud [Tue, 17 Dec 2019 13:38:45 +0000 (08:38 -0500)]
sip_to_pjsip.py: Fix trustrpid typo

ASTERISK-28664 #close

Change-Id: I6c28b1002fd7075ae0ed36f026f8c1855c9418a6

5 months agoapp_chanisavail/cdr: ChanIsAvail sometimes fails to deactivate CDR.
Frederic LE FOLL [Wed, 27 Nov 2019 17:34:24 +0000 (18:34 +0100)]
app_chanisavail/cdr: ChanIsAvail sometimes fails to deactivate CDR.

Temporary channel lifespan is very short and CDR deactivation request
through ast_cdr_set_property() may happen when CDR is not available
yet. Use CDR_PROP() dialplan function instead, it will first wait
for pending CDR insertion requests to be processed.

ASTERISK-28636

Change-Id: I1cbe09e8d2169c0962c1195133ff260d291f2074

5 months agoMerge "res_pjsip_nat: Restore original contact for REGISTER responses"
George Joseph [Mon, 16 Dec 2019 17:03:47 +0000 (11:03 -0600)]
Merge "res_pjsip_nat: Restore original contact for REGISTER responses"

5 months agoconfigure: Add check for MySQL client bool and my_bool type usage.
Joshua C. Colp [Mon, 16 Dec 2019 12:35:31 +0000 (08:35 -0400)]
configure: Add check for MySQL client bool and my_bool type usage.

Instead of trying to use the defined MySQL client version from the
header use a configure check to determine whether the bool or my_bool
type should be used for defining a boolean.

ASTERISK-28604

Change-Id: Id2225b3785115de074c50c123ff1a68005b4a9c7