Commit Graph

32231 Commits

Author SHA1 Message Date
George Joseph
bfd0e05e59 ExternalMedia: Change return object from ExternalMedia to Channel
When we created the External Media addition to ARI we created an
ExternalMedia object to be returned from the channels/externalMedia
REST endpoint.  This object contained the channel object that was
created plus local_address and local_port attributes (which are
also in the Channel variables).  At the time, we thought that
creating an ExternalMedia object would give us more flexibility
in the future but as we created the sample speech to text
application, we discovered that it doesn't work so well with ARI
client libraries that a) don't have the ExternalMedia object
defined and/or b) can't promote the embedded channel structure
to a first-class Channel object.

This change causes the channels/externalMedia REST endpoint to
return a Channel object (like channels/create and channels/originate)
instead of the ExternalMedia object.

Change-Id: If280094debd35102cf21e0a31a5e0846fec14af9
2019-10-18 07:03:07 -06:00
George Joseph
a339c3fdc5 Merge "res_pjsip_mwi: potential double unref, and potential unwanted double link" into 16 2019-10-14 13:32:57 -05:00
Friendly Automation
e7e03e0e2e Merge "pbx: deadlock when outgoing dialed channel hangs up too quickly" into 16 2019-10-14 06:49:46 -05:00
Friendly Automation
7895389a57 Merge "cdr_pgsql cel_pgsql res_config_pgsql: compatibility with PostgreSQL 12" into 16 2019-10-14 06:29:13 -05:00
Christoph Moench-Tegeder
6c54bd704e cdr_pgsql cel_pgsql res_config_pgsql: compatibility with PostgreSQL 12
PostgreSQL 12 finally removed column adsrc from table pg_catalog.pg_attrdef
(column default values), which has been deprecated since version 8.0.
Since then, the official/correct/supported way to retrieve the column
default value from the catalog is function pg_catalog.pg_get_expr().

This change breaks compatibility with pre-8.0 PostgreSQL servers,
but has reached end-of-support more than a decade ago.
cdr_pgsql and res_config_pgsql still have support for pre-7.3
servers, but cleaning that up is perhaps a topic for a major release,
not this bugfix.

ASTERISK-28571

Change-Id: I834cb3addf1937e19e87ede140bdd16cea531ebe
2019-10-14 05:07:15 -05:00
Friendly Automation
d04ed09e57 Merge "pjproject_bundled: Replace earlier reverts with official fixes." into 16 2019-10-11 09:30:26 -05:00
George Joseph
ab8835b8b7 Merge "test_taskprocessor.c: Fix test failure on Ubuntu" into 16 2019-10-11 08:42:53 -05:00
Kevin Harwell
17e71b6abe res_pjsip_mwi: potential double unref, and potential unwanted double link
When creating an unsolicited MWI aggregate subscription it was possible for
the subscription object to be double unref'ed. This patch removes the explicit
unref as it is not needed since the RAII_VAR will handle it at function end.

Less concerning there was also a bug that could potentially allow the aggregate
subscription object to be added to the unsolicited container twice. This patch
ensures it is added only once.

ASTERISK-28575

Change-Id: I9ccfdb5ea788bc0c3618db183aae235e53c12763
2019-10-10 15:30:05 -05:00
csavinovich
867c8b2879 test_taskprocessor.c: Fix test failure on Ubuntu
Fixes a failure in /main/taskprocesor unit test, only occurring in Ubuntu.
Newer versions of GCC require variable initialization.

Change-Id: I2994d8aab9307a8c2c7330584f287a27144a580c
2019-10-10 15:21:30 -05:00
Friendly Automation
6b8423821f Merge "Revert "app_voicemail: Cleanup stale lock files on module load"" into 16 2019-10-10 10:06:45 -05:00
George Joseph
7f0fc630ae Merge changes from topic "pjsip_shutdown" into 16
* changes:
  res_pjsip_mwi: use an ao2_global object for mwi containers
  res_pjsip/res_pjsip_mwi: use centralized serializer pools
2019-10-10 09:14:25 -05:00
George Joseph
4e44ffc623 Merge "serializer: move/add asterisk serializer pool functionality" into 16 2019-10-10 09:10:09 -05:00
Friendly Automation
983bebb680 Merge "chan_pjsip: Prevent segfault when running PlayDTMF on hungup channel" into 16 2019-10-10 07:26:20 -05:00
George Joseph
cb6e0d36ae pjproject_bundled: Replace earlier reverts with official fixes.
Issues in pjproject 2.9 caused us to revert some of their changes
as a work around.  This introduced another issue where pjproject
wouldn't build with older gcc versions such as that found on
CentOS 6.  This commit replaces the reverts with the official
fixes for the original issues and allows pjproject to be built
on CentOS 6 again.

ASTERISK-28574
Reported-by: Niklas Larsson

Change-Id: I06f8507bea553d1a01b0b8874197d35b9d47ec4c
2019-10-10 06:43:00 -05:00
Kevin Harwell
a66848c92f pbx: deadlock when outgoing dialed channel hangs up too quickly
Here's the basic scenario that occurred when executing an AMI fast originate
while at the same time something else locks the channels container, and also
wants a lock on the dialed channel:

1. pbx_outgoing_attempt obtains a lock on a dialed channel
2. concurrently another thread obtains a lock on the channels container, and
   subsequently requests a lock on the dialed channel. It waits on #1. For
   instance, "core show channel <dialed channel"
3. the outgoing call does not fail, but ends before the pbx_outgoing_attempt
   function exits
4. pbx_outgoing_attempt function exits, the outgoing structure destructs, and
   attempts to hang up the dialed channel
5. hang up tries to obtain the channels container lock, but can't due to #2.
6. Asterisk is deadlocked.

The solution was to allow the pbx_outgoing_exec function to "steal" ownership
of the dialed channel, and handle hanging it up. The channel now is either hung
up prior to it being potentially locked by the initiating thread, or if locked
the hang up takes place in a different thread, thus alleviating the deadlock.

ASTERISK-28561
patches:
  iliketrains.diff submitted by Joshua Colp (license 5000)

Change-Id: I51b42b92dde8f2215b69bb509e28667ee3a3853a
2019-10-09 16:06:50 -05:00
George Joseph
ff293d0ff0 Merge "cdr_mysql: Don't clean up on unload unless we can unregister from CDRs" into 16 2019-10-08 08:24:40 -05:00
Sean Bright
68855f6a7b Revert "app_voicemail: Cleanup stale lock files on module load"
This reverts commit fd2e8d0da7.

Reason for revert: Problematic for users who store their voicemail
on network storage devices, or share voicemail storage between
multiple Asterisk instances.

ASTERISK-28567 #close

Change-Id: I3ff4ca983d8e753fe2971f3439bd154705693c41
2019-10-08 06:34:44 -05:00
Kevin Harwell
3f12cd7711 res_pjsip_mwi: use an ao2_global object for mwi containers
On shutdown it's possible for the unsolicited mwi container to be freed before
other dependent threads are done using it. This patch ensures this can no
longer happen by wrapping the container in an ao2_global object. The solicited
container was also changed too.

ASTERISK-28552

Change-Id: I8f812286dc19a34916acacd71ce2ec26e1042047
2019-10-07 16:49:39 -05:00
Kevin Harwell
afc10c25ac serializer: move/add asterisk serializer pool functionality
Serializer pools have previously existed in Asterisk. However, for the most
part the code has been duplicated across modules. This patch abstracts the
code into an 'ast_serializer_pool' object. As well the code is now centralized
in serializer.c/h.

In addition serializer pools can now optionally be monitored by a shutdown
group. This will prevent the pool from being destroyed until all serializers
have completed.

Change-Id: Ib1e906144b90ffd4d5ed9826f0b719ca9c6d2971
2019-10-07 16:49:39 -05:00
Kevin Harwell
931ef77e21 res_pjsip/res_pjsip_mwi: use centralized serializer pools
Both res_pjsip and res_pjsip_mwi made use of serializer pools. However, they
both implemented their own serializer pool functionality that was pretty much
identical in each of the source files. This patch removes the duplicated code,
and uses the new 'ast_serializer_pool' object instead.

Additionally res_pjsip_mwi enables a shutdown group on the pool since if the
timing was right the module could be unloaded while taskprocessor threads still
needed to execute, thus causing a crash.

Change-Id: I959b0805ad024585bbb6276593118be34fbf6e1d
2019-10-07 16:49:39 -05:00
Friendly Automation
6ef806ca60 Merge "channel/chan_pjsip: add dialplan function for music on hold" into 16 2019-10-07 07:55:33 -05:00
Sean Bright
495bc77a6a cdr_mysql: Don't clean up on unload unless we can unregister from CDRs
ASTERISK-28566 #close

Change-Id: I6daa4e5128e9406d04d3aed670c3bae98d38d40c
2019-10-04 16:00:37 -05:00
Joshua Colp
ce1e0714ba stasis: Pass bumped topic_all reference to proxy_dtor.
This avoids use of the global variable and ensures topic_all remains
active until all topics are freed.

ASTERISK-28553
patches:
  ASTERISK-28553.patch by coreyfarrell (license 5909)

Change-Id: I9a8cd8977f3c3a6aa00783f8336d2cfb9c2820f1
2019-10-01 14:01:17 +00:00
lvl
19565e0b90 chan_pjsip: Prevent segfault when running PlayDTMF on hungup channel
ASTERISK-28086 #close

Change-Id: Ib3baadc89b9f0477a6f25a63861433812368c5ea
2019-10-01 15:14:21 +02:00
George Joseph
82e8033e39 Merge "res_pjsip_pubsub: add endpoint to some warning" into 16 2019-10-01 06:32:52 -05:00
Torrey Searle
9a933c3adc channel/chan_pjsip: add dialplan function for music on hold
Add a new dialplan function PJSIP_MOH_PASSTHROUGH that allows
the on-hold behavior to be controlled on a per-call basis

ASTERISK-28542 #close

Change-Id: Iebe905b2ad6dbaa87ab330267147180b05a3c3a8
2019-10-01 02:05:34 -05:00
Sean Bright
1f10ca76da res_pjsip_transport_websocket: Don't put brackets around local_name if IPv6
ASTERISK-28544 #close

Change-Id: I8e62c444d107674c298f472e3545661de8a80dce
2019-09-27 13:07:35 -05:00
George Joseph
ac331bff34 Merge "pbx: Prevent Realtime switch crash on invalid priority" into 16 2019-09-27 08:58:51 -05:00
George Joseph
072c63f575 Merge "taskprocessor.c: Added "like" support to 'core show taskprocessors'" into 16 2019-09-27 08:55:40 -05:00
Friendly Automation
b62f156261 Merge "basic-pbx: Bring forward queue configuration from 13" into 16 2019-09-27 08:37:24 -05:00
Friendly Automation
1903dcb43d Merge "res_musiconhold: Add new 'playlist' mode" into 16 2019-09-27 07:44:52 -05:00
Alexei Gradinari
04f7d136d8 res_pjsip_pubsub: add endpoint to some warning
There are some warning messages which are not informative without endpoint:
"No registered subscribe handler for event presence.winfo"
"No registered publish handler for event presence"

This patch adds an endpoint name to these messages.

Change-Id: Ia2811ec226d8a12659b4f9d4d224b48289650827
2019-09-26 13:12:40 -04:00
root
d146ec7e83 Revert "Update CHANGES and UPGRADE.txt for 16.6.0-rc2"
This reverts commit a0844a9b9b.

Correcting/reverting accidental
upgrade on release process.

Change-Id: I08746eda578effa6e64054690fad48a17d2f42e7
2019-09-26 10:52:52 -05:00
Jonathan Rose
85c7326d08 basic-pbx: Bring forward queue configuration from 13
Original commit: cfbf5fbe91

Change-Id: I34a841d73c429ca8d944481f8dccb756ee231c9c
2019-09-26 09:20:36 -04:00
Joshua Colp
ddb2c90713 Merge "res_pjsip_registrar: Validate Contact URI before adding to responses" into 16 2019-09-26 04:49:39 -05:00
Sean Bright
0514559005 pbx: Prevent Realtime switch crash on invalid priority
pbx_extension_helper takes two 'context' arguments. One (con) is a
pointer directly to a 'struct ast_context' and the other (context) is
the name of the context. In all cases, one of these arguments is NULL
and the other is non-NULL.

Functions that are ultimately called by pbx_extension_helper expect that
'context' will be non-NULL, so we set it unconditionally on entry into
this function.

ASTERISK-28534 #close

Change-Id: Ifbbc5e71440afd80efd441f7a9d72e8b10b6f47d
2019-09-26 04:47:49 -05:00
Ben Ford
827dd754b2 taskprocessor.c: Added "like" support to 'core show taskprocessors'
Added "like" support for 'core show taskprocessors'. Now you
can specify a specific set of taskprocessors (or just one) by
adding the keyword "like" to the above command, followed by
your search criteria.

Change-Id: I021e740201e9ba487204b5451e46feb0e3222464
2019-09-25 14:01:34 -05:00
Asterisk Development Team
a0844a9b9b Update CHANGES and UPGRADE.txt for 16.6.0-rc2 2019-09-25 12:53:26 -05:00
George Joseph
28542da3dc Merge "res_pjsip_pubsub: change warning to debug" into 16 2019-09-25 11:34:59 -05:00
Friendly Automation
0b34551af0 Merge "core: Fix ABI mismatch of ao2_global_obj." into 16 2019-09-25 07:41:35 -05:00
George Joseph
cce4dd2e71 Merge "taskprocessor.c: Add CLI commands to reset taskprocessor stats." into 16 2019-09-25 06:24:45 -05:00
Sean Bright
41cd1ff454 res_pjsip_registrar: Validate Contact URI before adding to responses
If a permanent contact URI associated with an AOR is invalid, we add a
Contact header to REGISTER responses with a NULL URI, causing a crash.

ASTERISK-28463 #close

Change-Id: Id2b643e58b975bc560aab1c111e6669d54db9102
2019-09-25 06:20:55 -05:00
George Joseph
d799217867 Merge "core: Add AO2_ALLOC_OPT_NO_REF_DEBUG option." into 16 2019-09-25 06:03:45 -05:00
George Joseph
e929b21368 Merge "pjproject_bundled: Revert pjproject 2.9 commits causing leaks" into 16 2019-09-24 15:38:04 -05:00
Kevin Harwell
9ff11c2f00 res_pjsip_pubsub: change warning to debug
The following message:

"Subscription request from endpoint <blah> rejected. Expiration of 0 is invalid"

Would sometimes spam the log with warnings if Asterisk restarted and a bunch
of clients sent unsubscribes. This patch changes it from a warning to a debug
message.

Change-Id: I841ec42f65559f3135e037df0e55f89b6447a467
2019-09-24 11:21:12 -05:00
Corey Farrell
cd51f5b876 core: Fix ABI mismatch of ao2_global_obj.
astobj2.c declares DEBUG_THREADS_LOOSE_ABI to avoid overhead of debug
threads tracking information in the internal structures of astobj2.
Unfortunately this means that ao2_global_obj contains the statically
allocated debug threads tracking fields which are used by initialization
and cleanup but main/astobj2.c believed those fields and associated
space did not exist.

Change-Id: Icef41ad97d88a8c1d1515e034ec8133cab3b1527
2019-09-24 11:20:21 -05:00
Ben Ford
5ea667e03a taskprocessor.c: Add CLI commands to reset taskprocessor stats.
Added two new CLI commands to reset stats for taskprocessors. You can
reset stats for a single, specific taskprocessor ('core reset
taskprocessor <taskprocessor>'), or you can reset all taskprocessors
('core reset taskprocessors'). These commands will reset the counter for
the number of tasks processed as well as the max queue size.

Change-Id: Iaf17fc4ae29396ab0c6ac92408fc7bdc2f12362d
2019-09-24 10:42:08 -05:00
Friendly Automation
2bb6334098 Merge "res_sorcery_memory_cache: stale item update leak" into 16 2019-09-24 08:44:49 -05:00
George Joseph
b41e1e8928 Merge "astmm.c: Display backtrace with memory show allocations" into 16 2019-09-24 08:28:19 -05:00
George Joseph
789c51ac8a pjproject_bundled: Revert pjproject 2.9 commits causing leaks
We've found a connection re-use regression in pjproject 2.9
introduced by commit
"Close #1019: Support for multiple listeners."
https://trac.pjsip.org/repos/changeset/6002
https://trac.pjsip.org/repos/ticket/1019

Normally, multiple SSL requests should reuse the same connection
if one already exists to the remote server.  When a transport
error occurs, the next request should establish a new connection
and any following requests should use that same one.  With this
patch, when a transport error occurs, every new request creates
a new connection so you can wind up with thousands of open tcp
sockets, possibly exhausting file handles, and increasing memory
usage.

Reverting pjproject commit 6002 (and related 6021) restores the
expected behavior.

We also found a memory leak in SSL processing that was introduced by
commit
"Fixed #2204: Add OpenSSL remote certificate chain info"
https://trac.pjsip.org/repos/changeset/6014
https://trac.pjsip.org/repos/ticket/2204

Apparently the remote certificate chain is continually recreated
causing the leak.

Reverting pjproject commit 6014 (and related 6022) restores the
expected behavior.

Both of these issues have been acknowledged by Teluu.

ASTERISK-28521

Change-Id: I8ae7233c3ac4ec29a3b991f738e655dabcaba9f1
2019-09-24 08:16:01 -05:00