Commit Graph

32218 Commits

Author SHA1 Message Date
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
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
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
Kevin Harwell
bd440fcaa5 Merge "app_voicemail: Fix module unload leak." into 16 2019-09-23 15:28:13 -05:00
Kevin Harwell
258f9e6ecc Merge "res_pjsip_mwi: Remove inappropriate topic unreference." into 16 2019-09-23 15:19:07 -05:00
Corey Farrell
fec6e1bd87 core: Add AO2_ALLOC_OPT_NO_REF_DEBUG option.
Previous to this patch passing a NULL tag to ao2_alloc or ao2_ref based
functions would result in the reference not being logged under
REF_DEBUG.  This could sometimes cause inaccurate logging if NULL was
accidentally passed to a reference action.  Now reference logging is
only disabled by option passed to the allocation method.

Change-Id: I3c17d867d901d53f9fcd512bef4d52e342637b54
2019-09-23 12:34:41 -05:00
Kevin Harwell
bd96a0b79d res_sorcery_memory_cache: stale item update leak
When a stale item was being updated the object was being retrieved, but its
reference was not being decremented after the update. This patch makes it so
the object is now appropriately de-referenced.

ASTERISK-28523

Change-Id: I9d8173d3a0416a242f4eba92fa0853279c500ec7
2019-09-23 11:01:36 -05:00
George Joseph
9c5a8066a6 astmm.c: Display backtrace with memory show allocations
You can currently capture backtraces of memory allocations but they
only get displayed when you stop asterisk and the atexit hooks
are enabled.  Now, if memory backtrace is on and you issue a
"memory show allocations" CLI command for a specific file, then
a backtrace will show for each allocation that occurred after
you turned "memory backtrace on".  The backtrace display is shown
only when a specific file's allocations are displayed to prevent
a massive CLI dump of every file's allocations.

Change-Id: Ic657afc1fc6ec7205e16eb36a97a611d235a2b4f
2019-09-23 06:23:05 -06:00
Corey Farrell
5b8c1ed0d3 stasis: refcounter.py can incorrectly report skewed objects.
It is possible for topic->name to be NULL, this causes the allocation
reference to not be logged.  Use the name variable instead which has
been verified to be a non-empty.

Change-Id: I3d0031d03c8356e4808f00cdf2d5428712575883
2019-09-20 09:34:22 -04:00
Corey Farrell
76d4a42ae1 res_pjsip_mwi: Remove inappropriate topic unreference.
ast_mwi_topic() returns a borrowed reference which should not be
unreferenced, doing so leads to a FRACK.  This was hidden by the fact
that stasis_cache.c leaked the result of cache_remove in
caching_topic_exec.

Change-Id: I51101bf7d07b8dc8ce8fc46b6cb31fbbd213fbc7
2019-09-19 15:30:58 -05:00
Corey Farrell
256db889f2 app_voicemail: Fix module unload leak.
Change-Id: Ib9a06565b9a178822d3bbb67eccf51432e12d84a
2019-09-19 11:15:32 -05:00
Friendly Automation
a687c7919d Merge "func_jitterbuffer: Add audio/video sync support." into 16 2019-09-19 08:10:52 -05:00
Joshua Colp
120f2fb5f9 Merge "core: Add H.265/HEVC passthrough support" into 16 2019-09-19 06:34:07 -05:00
Joshua Colp
6647be69ac func_jitterbuffer: Add audio/video sync support.
This change adds support to the JITTERBUFFER dialplan function
for audio and video synchronization. When enabled the RTCP SR
report is used to produce an NTP timestamp for both the audio and
video streams. Using this information the video frames are queued
until their NTP timestamp is equal to or behind the NTP timestamp
of the audio. The audio jitterbuffer acts as the leader deciding
when to shrink/grow the jitterbuffer when adaptive is in use. For
both adaptive and fixed the video buffer follows the size of the
audio jitterbuffer.

ASTERISK-28533

Change-Id: I3fd75160426465e6d46bb2e198c07b9d314a4492
2019-09-18 15:26:00 -05:00
Sean Bright
9f304170f6 res_musiconhold: Add new 'playlist' mode
Allow the list of files to be played to be provided explicitly in the
music class's configuration. The primary driver for this change is to
allow URLs to be used for MoH.

Change-Id: I9f43b80b43880980b18b2bee26ec09429d0b92fa
2019-09-18 14:07:37 -05:00
Friendly Automation
f9f17f3bfe Merge "chan_pjsip: Relock correct channel during "fax" redirect." into 16 2019-09-18 07:39:25 -05:00