]> git.ipfire.org Git - thirdparty/asterisk.git/log
thirdparty/asterisk.git
5 years 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

5 years 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."

5 years 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"

5 years 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"

5 years 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"

5 years 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()"

5 years 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."

5 years 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

5 years 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"

5 years 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

5 years 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

5 years 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

5 years 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

5 years 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"

5 years 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>
5 years 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."

5 years 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"

5 years 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""

5 years 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

5 years 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

5 years 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

5 years 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

5 years 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"

5 years 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"

5 years 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

5 years 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"

5 years 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."

5 years 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"

5 years 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."

5 years 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."

5 years 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."

5 years 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."

5 years 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."

5 years 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"

5 years 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"

5 years 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

5 years 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

5 years 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 years 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 years 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 years 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 years 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 years 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 years 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 years 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 years 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 years 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 years 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 years 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 years 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 years 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 years 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 years 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 years 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 years 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 years 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 years 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 years 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 years 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 years 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 years 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 years 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 years 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 years 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 years 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 years 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 years 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 years 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

5 years agoconfbridge: Add support for specifying maximum sample rate.
Joshua C. Colp [Thu, 12 Dec 2019 00:03:46 +0000 (00:03 +0000)] 
confbridge: Add support for specifying maximum sample rate.

ConfBridge has the ability to move between different sample
rates for mixing the conference bridge. Up until now there has
only been the ability to set the conference bridge to mix at
a specific sample rate, or to let it move between sample rates
as necessary. This change adds the ability to configure a
conference bridge with a maximum sample rate so it can move
between sample rates but only up to the configured maximum.

ASTERISK-28658

Change-Id: Idff80896ccfb8a58a816e4ce9ac4ebde785963ee

5 years agoMerge "PJSIP_CONTACT: add missing argument documentation"
Friendly Automation [Mon, 16 Dec 2019 12:56:16 +0000 (06:56 -0600)] 
Merge "PJSIP_CONTACT: add missing argument documentation"

5 years agores_pjsip_session: Set stream state on created streams for incoming SDP.
Joshua C. Colp [Mon, 16 Dec 2019 11:23:07 +0000 (07:23 -0400)] 
res_pjsip_session: Set stream state on created streams for incoming SDP.

A previous review, 13174, made a change whereby on an incoming offer SDP
the pending topology was initialized to the configured. This caused a problem
for bundle with WebRTC where bundle could reference a stream that did not
actually exist if the configuration had both audio and video but the
offer SDP only contained audio.

This change undoes that review and instead fixes the original problem it
sought to solve by setting the state of created streams based on the
contents of the offer SDP. This way the stream state is not inactive
until negotiation later completes.

ASTERISK-28659

Change-Id: Ic5ae5a86437d3e686ac5afd91d133cc916198355

5 years agores_fax: wrap v21 detected Asterisk initiated negotiation with config option
Kevin Harwell [Fri, 13 Dec 2019 19:46:17 +0000 (13:46 -0600)] 
res_fax: wrap v21 detected Asterisk initiated negotiation with config option

A previous patch:

Gerrit Change-Id: I73bb24799bfe1a48adae9c034a2edbae54cc2a39

made it so a T.38 Gateway tries to negotiate with both sides by sending T.38
negotiation request to both endpoints supported T.38 versus the previous
behavior of forwarding negotiation to the "other" channel once a preamble
was detected.

This had the unfortunate side effect of breaking some setups. Specifically
ones that set the max datagram option on an endpoint configuration (configured
max datagram was not propagated since Asterisk now initiates negotiations).

This patch adds a configuration option, "negotiate_both", that when enabled
makes it so Asterisk initiates the negotiation requests to both endpoints vs.
the previous behavior of waiting, and forwarding the request.

The default is disabled keeping with the old behavior.

ASTERISK-28660

Change-Id: I5deb875f3485e20bc75119ec743090655d864a1a

5 years agoACL: ast_apply_acl_nolog - identical to ast_apply_acl but without logging.
Jaco Kroon [Wed, 4 Dec 2019 08:35:52 +0000 (10:35 +0200)] 
ACL: ast_apply_acl_nolog - identical to ast_apply_acl but without logging.

Due to use in res_rtp_asterisk there is a need to be able to apply an
ACL without logging any invalid/denies.  It's probably sensible to at
least validate the ACL once directly after load and report invalid ACLs.

Change-Id: I256169229d945ca7c1bbf228fc492d91df345843
Signed-off-by: Jaco Kroon <jaco@uls.co.za>
5 years agoPJSIP_CONTACT: add missing argument documentation
Pascal Cadotte Michaud [Wed, 11 Dec 2019 16:52:31 +0000 (11:52 -0500)] 
PJSIP_CONTACT: add missing argument documentation

add missing argument "rtt" and "status" to the documentation

The change to the dtd file allow an enumlist to contain one or many
configOptionToEnum or enum.

This is different from the previous patch I submitted when you could have a
configOptionToEnum or (a configOptionToEnum followed by one or manu enums) or
(one or many enums)

ASTERISK-28626

Change-Id: Ia71743ee7ec813f40297b0ddefeee7909db63b6d

5 years agoMerge "Revert "PJSIP_CONTACT: add missing argument documentation""
George Joseph [Wed, 11 Dec 2019 16:36:58 +0000 (10:36 -0600)] 
Merge "Revert "PJSIP_CONTACT: add missing argument documentation""

5 years agoRevert "PJSIP_CONTACT: add missing argument documentation"
Joshua Colp [Wed, 11 Dec 2019 13:01:32 +0000 (07:01 -0600)] 
Revert "PJSIP_CONTACT: add missing argument documentation"

This reverts commit 7e3015d77913accad9b1dcd200ceec30e52bf445.

Reason for revert: Regression in XML validation.

validity error : Content model of enumlist is not determinist:
(configOptionToEnum | (configOptionToEnum , enum+) | enum+)

As we are preparing to do releases and this is not critical
I am reverting this for now until resolved.

Change-Id: I30c2295f9d7f0a0475674ee77071a7ebabf5b83f

5 years agores_rtp_asterisk: Add frame list cleanups to ast_rtp_read
George Joseph [Wed, 4 Dec 2019 21:01:22 +0000 (14:01 -0700)] 
res_rtp_asterisk:  Add frame list cleanups to ast_rtp_read

In Asterisk 16+, there are a few places in ast_rtp_read where we've
allocated a frame list but return a null frame instead of the list.
In these cases, any frames left in the list won't be freed.  In the
vast majority of the cases, the list is empty when we return so
there's nothing to free but there have been leaks reported in the
wild that can be traced back to frames left in the list before
returning.

The escape paths now all have logic to free frames left in the
list.

ASTERISK-28609
Reported by: Ted G

Change-Id: Ia1d7075857ebd26b47183c44b1aebb0d8f985f7a

5 years agoMerge "res_pjsip_registrar.c: Prevent potential double free if AOR is not found"
George Joseph [Mon, 9 Dec 2019 17:47:43 +0000 (11:47 -0600)] 
Merge "res_pjsip_registrar.c: Prevent potential double free if AOR is not found"

5 years agochan_sip: in case of tcp/tls, be less annoying about tx errors.
Jaco Kroon [Wed, 4 Dec 2019 14:35:35 +0000 (16:35 +0200)] 
chan_sip:  in case of tcp/tls, be less annoying about tx errors.

chan_sip.c:3782 __sip_xmit: sip_xmit of 0x7f1478069230 (len 600) to
213.150.203.60:1492 returned -2: Interrupted system call

returned -2 implies this wasn't actually an OS error, so errno makes no
sense either.  Internal error was already logged higher up, and -2
generally means that either there isn't a valid connection available, or
the pipe notification failed, and that is already correctly logged.

ASTERISK-28651 #close

Change-Id: I46eb82924beeff9dfd86fa6c7eb87d2651b950f2
Signed-off-by: Jaco Kroon <jaco@uls.co.za>
5 years agoMerge "app_queue: Fix old confusing comment about when the members are called"
Friendly Automation [Fri, 6 Dec 2019 19:33:26 +0000 (13:33 -0600)] 
Merge "app_queue: Fix old confusing comment about when the members are called"

5 years agores_pjsip_nat: Restore original contact for REGISTER responses
George Joseph [Mon, 26 Aug 2019 02:20:13 +0000 (20:20 -0600)] 
res_pjsip_nat: Restore original contact for REGISTER responses

RFC3261 Section 10 "Registrations", specifically paragraph
"10.2.4: Refreshing Bindings", states that a user agent compares
each contact address (in a 200 REGISTER response) to see if it
created the contact.  If the Asterisk endpoint has the
rewrite_contact option set however, the contact host and port sent
back in the 200 response will be the rewritten one and not the
one sent by the user agent.  This prevents the user agent from
matching its own contact.  Some user agents get very upset when
this happens and will not consider the registration successful.
While this is rare, it is acceptable behavior especially if more
than 1 user agent is allowed to register to a single endpoint/aor.

This commit updates res_pjsip_nat (where rewrite_contact is
implemented) to store the original incoming Contact header in
a new "x-ast-orig-host" URI parameter before rewriting it, and to
restore the original host and port to the Contact headers in the
outgoing response.

This is only done if the request is a REGISTER and rewrite_contact
is enabled.

pjsip_message_filter was also updated to ensure that if a request
comes in with any existing x-ast-* URI parameters, we remove them
so they don't conflict.  Asterisk will never send a request
with those headers in it but someone might just decide to add them
to a request they craft and send to Asterisk.

NOTE: If a device changes its contact address and registers again,
it's a NEW registration.  If the device didn't unregister the
original registration then all existing behavior based
on aor/remove_existing and aor/max_contacts apply.

ASTERISK-28502
Reported-by: Ross Beer
Change-Id: Idc263ad2d2d7bd8faa047e5804d96a5fe1cd282e

5 years agoMerge "res_pjsip_outbound_registration: add support for SRV failover"
Friendly Automation [Fri, 6 Dec 2019 15:30:20 +0000 (09:30 -0600)] 
Merge "res_pjsip_outbound_registration: add support for SRV failover"

5 years agoMerge "res_pjsip_registrar.c: Prevent possible buffer overflow with domain aliases"
Friendly Automation [Fri, 6 Dec 2019 15:17:49 +0000 (09:17 -0600)] 
Merge "res_pjsip_registrar.c: Prevent possible buffer overflow with domain aliases"

5 years agoMerge "channel.c: Resolve issue with receiving SIP INFO packets for DTMF"
Friendly Automation [Fri, 6 Dec 2019 14:46:26 +0000 (08:46 -0600)] 
Merge "channel.c: Resolve issue with receiving SIP INFO packets for DTMF"

5 years agoMerge "chan_sip+native_bridge_rtp: no directmedia for ptime other than default ptime."
Joshua Colp [Thu, 5 Dec 2019 13:53:56 +0000 (07:53 -0600)] 
Merge "chan_sip+native_bridge_rtp: no directmedia for ptime other than default ptime."

5 years agoMerge "PJSIP_CONTACT: add missing argument documentation"
Friendly Automation [Thu, 5 Dec 2019 00:25:19 +0000 (18:25 -0600)] 
Merge "PJSIP_CONTACT: add missing argument documentation"

5 years agoMerge "res_pjsip_session.c: Prevent use-after-free with TEST_FRAMEWORK enabled"
Kevin Harwell [Thu, 5 Dec 2019 00:03:18 +0000 (18:03 -0600)] 
Merge "res_pjsip_session.c: Prevent use-after-free with TEST_FRAMEWORK enabled"

5 years agoMerge "parking: Fall back to parker channel name even if it matches parkee."
Friendly Automation [Wed, 4 Dec 2019 23:19:24 +0000 (17:19 -0600)] 
Merge "parking: Fall back to parker channel name even if it matches parkee."

5 years agores_pjsip_registrar.c: Prevent potential double free if AOR is not found
Sean Bright [Wed, 4 Dec 2019 21:26:46 +0000 (16:26 -0500)] 
res_pjsip_registrar.c: Prevent potential double free if AOR is not found

The simple fix here is simply to NULL out username and password after we call
ast_free on them. Unfortunately, I noticed that we weren't checking for
allocation failures for username and password, and adding those checks made
things noisy and cumbersome.

So instead we partially rollback the recent LGTM patch, and move the alloca
calls into find_aor_name().

ASTERISK-28641 #close
Reported by: Ross Beer

Change-Id: Ic9d01624e717a020be0b0aee31f0814e7f1ffbe2

5 years agores_pjsip_registrar.c: Prevent possible buffer overflow with domain aliases
Sean Bright [Wed, 4 Dec 2019 21:12:39 +0000 (16:12 -0500)] 
res_pjsip_registrar.c: Prevent possible buffer overflow with domain aliases

We're appropriately sizing the id_domain_alias buffer, but then copying the data
into the id_domain one. We were then using the uninitialized id_domain_alias
buffer we just allocated.

This is ASTERISK~28641 adjacent, but significant enough to warrant its own
patch.

Change-Id: I81c38724d18deab8c6573153e2b99dbb6e2f33d9

5 years agochan_sip: voice frames are no longer transmitted after emitting a COLP
Jean Aunis [Tue, 3 Dec 2019 11:58:26 +0000 (12:58 +0100)] 
chan_sip: voice frames are no longer transmitted after emitting a COLP

The SIP transaction state was reset when emitting an UPDATE or a re-INVITE
related to a COLP, preventing RTP packets to be emitted.

ASTERISK-28647

Change-Id: Ie7a30fa7a97f711e7ba6cc17f221a0993d48bd8b

5 years agochan_sip+native_bridge_rtp: no directmedia for ptime other than default ptime.
Frederic LE FOLL [Wed, 27 Nov 2019 18:11:33 +0000 (19:11 +0100)] 
chan_sip+native_bridge_rtp: no directmedia for ptime other than default ptime.

During capabilities selection (joint capabilities of us and peer,
configured capability for this peer, or general configured
capabilities), if sip_new() does not keep framing information,
then directmedia activation will fail for any framing different
from default framing.

ASTERISK-28637

Change-Id: I99257502788653c2816fc991cac7946453082466

5 years agoapp_queue: Fix old confusing comment about when the members are called
Walter Doekes [Wed, 4 Dec 2019 09:33:44 +0000 (10:33 +0100)] 
app_queue: Fix old confusing comment about when the members are called

ASTERISK-28644

Change-Id: I2771a931d00a8fc2b9f9a4d1a33ea8f1ad24e06b

5 years agores_pjsip_session.c: Prevent use-after-free with TEST_FRAMEWORK enabled
Sean Bright [Tue, 3 Dec 2019 21:42:00 +0000 (16:42 -0500)] 
res_pjsip_session.c: Prevent use-after-free with TEST_FRAMEWORK enabled

We need to copy the endpoint name before we call ao2_cleanup() on it,
otherwise we might try to access memory that has been reclaimed.

ASTERISK-28445 #close
Reported by: Bernhard Schmidt

Change-Id: I404b952608aa606e0babd3c4108346721fb726b3

5 years agoMerge "media_cache.c: Various CLI improvements"
George Joseph [Mon, 2 Dec 2019 22:01:57 +0000 (16:01 -0600)] 
Merge "media_cache.c: Various CLI improvements"

5 years agochannel.c: Resolve issue with receiving SIP INFO packets for DTMF
George Joseph [Fri, 22 Nov 2019 16:39:36 +0000 (09:39 -0700)] 
channel.c: Resolve issue with receiving SIP INFO packets for DTMF

The problem is essentially the same as in ASTERISK~28245. Besides
the direct media scenario we have an additional scenario where a
special client is involved. This device mutes audio by default in
transmit direction (no rtp frames) and activates audio only by a
foot switch. In this situation dtmf input (pin for conferences,
transfer features codes , etc) using SIP INFO mode is not
understood properly especially when SIP INFO messages are sent
quickly.

This patch ensures that SIP INFO frames are properly queued and
processed in the above scenario. The patch also corrects situations
where successive dtmf events are received quicker than the
signalled event duration (plus minimum gap/pause) allows, i.e. DTMF
events have to be buffered in the ast channel read queue and
emulation has to be processed asynchronously at slower speed.

Reported by: Thomas Arimont
patches:
  trigger_dtmf_emulation.patch submitted by Thomas Arimont (license 5525)

Change-Id: I309bf61dd065c9978c8e48f5b9a936ab47de64c2

5 years agoCI: Turn off shallow cloning altogether
George Joseph [Mon, 2 Dec 2019 12:48:01 +0000 (05:48 -0700)] 
CI: Turn off shallow cloning altogether

Change-Id: I73ed4aef33a92f20080128aafc34e19fd4457196

5 years agoMerge "core: Improve MALLOC_DEBUG for frames."
Joshua Colp [Mon, 2 Dec 2019 12:45:24 +0000 (06:45 -0600)] 
Merge "core: Improve MALLOC_DEBUG for frames."

5 years agoparking: Fall back to parker channel name even if it matches parkee.
Joshua Colp [Mon, 25 Nov 2019 12:55:27 +0000 (12:55 +0000)] 
parking: Fall back to parker channel name even if it matches parkee.

ASTERISK-28631

Change-Id: Ia74d084799fbb9bee3403e30d2391aacd46243cc

5 years agomedia_cache.c: Various CLI improvements
Sean Bright [Fri, 22 Nov 2019 21:31:29 +0000 (16:31 -0500)] 
media_cache.c: Various CLI improvements

* Use ast_cli_completion_add() to improve performance when large number of
  cached items are present.

* Only complete one URI for commands that only accept a single URI.

* Change command documentation to wrap at 80 characters to improve
  readability.

Change-Id: Iedb0a2c3541e49561bc231dca2dcc0ebd8612902