Commit Graph

30809 Commits

Author SHA1 Message Date
George Joseph
4aa55a8ca6 res_mwi_devstate.c: New module to allow presence subs to VM boxes
This module allows presence subscriptions to voicemail boxes.  This
allows common BLF keys to act as voicemail waiting indicators.

ASTERISK-28301

Change-Id: I62a246c24f3d7d432e33e22d7a4a57c15c292fdd
2019-02-26 07:31:39 -07:00
Joshua C. Colp
600db408c7 Merge "http.c: Support separated HTTP request" into 13 2019-02-26 07:37:50 -06:00
Joshua C. Colp
9921262c85 Merge "taskprocessor: Enable subsystems and overload by subsystem" into 13 2019-02-26 07:03:54 -06:00
Joshua C. Colp
d4060756e7 Merge "res_ari_applications: Fix incorrect call to ao2_lock." into 13 2019-02-26 06:28:32 -06:00
Friendly Automation
55419d3996 Merge "Core: Increase AST_PBX_MAX_STACK to 512 if not LOW_MEMORY" into 13 2019-02-26 06:00:04 -06:00
Joshua C. Colp
9c94c027cd res_ari_applications: Fix incorrect call to ao2_lock.
When listing the applications the apps lock was incorrectly
locked twice instead of being locked and then unlocked.

ASTERISK-28302

Change-Id: If7d064592a9e88c0f1049214c50e02be6dabf79e
2019-02-25 08:10:59 -04:00
Sungtae Kim
148ddfba9a http.c: Support separated HTTP request
Currently, the Asterisk does not support seperated HTTP request.
This patch make the Asterisk enables to wait lest part of HTTP request.
Also increases acceptable HTTP body length to 40k to support more
larger request.

ASTERISK-28236

Change-Id: I48a401aa64a21c3b37bf3cb4e0486d64b7dd8aa1
2019-02-20 22:44:33 +01:00
George Joseph
23ffc3af5c Core: Increase AST_PBX_MAX_STACK to 512 if not LOW_MEMORY
The current settings AST_PBX_MAX_STACK is 128 entries which is
too low for some FreePBX installations with complex parking
arrangements.  Increased to 512 if LOW_MEMORY is not defined.

ASTERISK-28300

Change-Id: I7c4b540bc92e6642df0f3da639b003f7da8b1299
2019-02-20 11:51:25 -07:00
Joshua C. Colp
82758295df stasis: Store subscriber uniqueids with topic statistics.
This change provides an easier mechanism to determine which
subscribers are subscribed to a topic. Using this you can
inspect the specific subscribers for further details.

Change-Id: I8deea21703cd5c5357b85593b46c3eaf24e18c0c
2019-02-20 14:22:31 -04:00
George Joseph
bae3fd04c1 taskprocessor: Enable subsystems and overload by subsystem
To prevent one subsystem's taskprocessors from causing others
to stall, new capabilities have been added to taskprocessors.

* Any taskprocessor name that has a '/' will have the part
  before the '/' saved as its "subsystem".
  Examples:
  "sorcery/acl-0000006a" and "sorcery/aor-00000019"
  will be grouped to subsystem "sorcery".
  "pjsip/distributor-00000025" and "pjsip/distributor-00000026"
  will bn grouped to subsystem "pjsip".
  Taskprocessors with no '/' have an empty subsystem.

* When a taskprocessor enters high-water alert status and it
  has a non-empty subsystem, the subsystem alert count will
  be incremented.

* When a taskprocessor leaves high-water alert status and it
  has a non-empty subsystem, the subsystem alert count will be
  decremented.

* A new api ast_taskprocessor_get_subsystem_alert() has been
  added that returns the number of taskprocessors in alert for
  the subsystem.

* A new CLI command "core show taskprocessor alerted subsystems"
  has been added.

* A new unit test was addded.

REMINDER: The taskprocessor code itself doesn't take any action
based on high-water alerts or overloading.  It's up to taskprocessor
users to check and take action themselves.  Currently only the pjsip
distributor does this.

* A new pjsip/global option "taskprocessor_overload_trigger"
  has been added that allows the user to select the trigger
  mechanism the distributor uses to pause accepting new requests.
  "none": Don't pause on any overload condition.
  "global": Pause on ANY taskprocessor overload (the default and
  current behavior)
  "pjsip_only": Pause only on pjsip taskprocessor overloads.

* The core pjsip pool was renamed from "SIP" to "pjsip" so it can
  be properly grouped into the "pjsip" subsystem.

* stasis taskprocessor names were changed to "stasis" as the
  subsystem.

* Sorcery core taskprocessor names were changed to "sorcery" to
  match the object taskprocessors.

Change-Id: I8c19068bb2fc26610a9f0b8624bdf577a04fcd56
2019-02-20 10:23:26 -07:00
Kevin Harwell
da93d17af8 ARI event type filtering
Event type filtering is now enabled, and configurable per application. An app is
now able to specify which events are sent to the application by configuring an
allowed and/or disallowed list(s). This can be done by issuing the following:

PUT /applications/{applicationName}/eventFilter

And then enumerating the allowed/disallowed event types as a body parameter.

ASTERISK-28106

Change-Id: I9671ba1fcdb3b6c830b553d4c5365aed5d588d5b
2019-02-20 09:56:45 -06:00
George Joseph
86bb86ce46 Merge "json.c/strings.c - Add a couple of utility functions" into 13 2019-02-20 09:53:15 -06:00
Friendly Automation
f4fd910d2e Merge "chan_pjsip: Changed to continued after invalid media for pjsip show channelstats" into 13 2019-02-20 09:04:56 -06:00
Friendly Automation
b298777458 Merge "CI: Use tmpfs option to Docker instead of mount." into 13 2019-02-20 08:16:55 -06:00
Joshua C. Colp
3de4d0c6c1 Merge "res/res_rtp_asterisk: clear smoother when local bridging" into 13 2019-02-20 04:46:20 -06:00
sungtae kim
f6689547ae chan_pjsip: Changed to continued after invalid media for pjsip show channelstats
Currently, the pjsip show channelstats cli does not show channel's
stats after hits the invalid channel info. This makes hard to use
this cli. Changed to keep iterate after hits the invalid channel
info.

ASTERISK-28292

Change-Id: I3efdff1c9e1b1efd3c971fb82ae77aa133a6f43c
2019-02-19 23:59:48 +01:00
Joshua Colp
46df13e2d0 CI: Use tmpfs option to Docker instead of mount.
Some tests require Asterisk to execute scripts which
are stored in /tmp. When mount is used for tmpfs there
is no ability to allow scripts to be executed from
that location.

This change switches to using tmpfs which can be told
to allow executables to be run from /tmp.

Change-Id: I0e598ca2b76af1f7f2d29f0da7b1731a214a291a
2019-02-19 16:22:46 +00:00
Kevin Harwell
b2d3c9d2de json.c/strings.c - Add a couple of utility functions
Added 'ast_json_object_string_get' to the JSON wrapper in order to make it a
little easier to retrieve a string field from the JSON object.

Also added an 'ast_strings_equal' function that safely checks (checks for NULLs)
for equality between two strings.

Change-Id: I26f0a16d61537505eb41b4b05ef2e6d67fc2541b
2019-02-19 09:43:40 -06:00
George Joseph
1ec00d205f Merge "Revert "Test_cel: Fails when DONT_OPTIMIZE is off"" into 13 2019-02-14 12:47:17 -06:00
Chris Savinovich
3e922adcc1 Revert "Test_cel: Fails when DONT_OPTIMIZE is off"
This reverts commit 9b85882f04.

Change-Id: I36cf159abb103502e48d6f8fd70d560d7f0bda56
2019-02-14 10:53:42 -06:00
Torrey Searle
7c17bc75ed res/res_rtp_asterisk: clear smoother when local bridging
p2p_write updates txformat but doesn't require a smoother.  If a smoother
was created by another bridge type the smoother could fall out of date causing
one way audio issues.  To prevent this the smoother is now destroyed on the
start of native bridge.

ASTERISK-28284 #close

Change-Id: I84e67f144963787fff9b4d79ac500514fb40cdc6
2019-02-13 08:48:55 -06:00
Paulo Vicentini
2db81ee2b4 res/res_pjsip: Resources (udptl fd) are leaking for T.38 calls
Fix unbalanced references for datastore t38_session_media

ASTERISK-28288

Change-Id: Id6dceceb06651b03f611bf33deb3061022fe5d0c
2019-02-13 15:23:17 +01:00
George Joseph
44914234ba Merge "ci: Rerun unit tests when non-code changes occur." into 13 2019-02-11 09:27:40 -06:00
Joshua C. Colp
3c632d81bc Merge "res_odbc: Add basic query logging." into 13 2019-02-11 08:39:19 -06:00
Joshua C. Colp
cb45aa1f9d Merge "res_pjsip_registrar: lock transport monitor when setting 'removing' flag" into 13 2019-02-08 09:34:35 -06:00
Joshua Colp
9a6464e54f ci: Rerun unit tests when non-code changes occur.
This change makes it so that even if non-code changes
occur (such as commit message changing) unit tests
will still be run and result in a verification.

ASTERISK-28251

Change-Id: I6491fff7c93e5d5cd8e41054486968bf66c4f608
2019-02-08 13:09:38 +00:00
Kevin Harwell
3974633c00 res_pjsip_registrar: lock transport monitor when setting 'removing' flag
A previous patch attempt to mitigate blocked threads on transport shutdown for
a given contact. It was thought that a second lock could be avoided by checking
the 'removing' flag on the transport monitor twice (once before and once after
the normal named aor locking). However as with usual threading issues if the
timing was right the original problem still occured.

This patch adds locking around the first 'removing' flag check and set, thus
nullifying the secondary check, so it was removed.

ASTERISK-28213

Change-Id: Iaa8e36e5311789549b76d8de42dfcea96013b2ed
2019-02-07 14:28:20 -06:00
Joshua Colp
a4d930c2ed res_odbc: Add basic query logging.
When Asterisk is connected and used with a database the response
time of the database can cause problems in Asterisk if it is long.
Normally the only way to see this problem would be to retrieve a
backtrace from Asterisk and examine where things are blocked, or
examine the database to see if there is any indication of a
problem.

This change adds some basic query logging to make it easier to
investigate such a problem. When logging is enabled res_odbc will
now keep track of the number of queries executed, as well as the
query that has taken the longest time to execute. There is also
an option which will cause a WARNING message to be output if a
query takes longer than a configurable amount of time to execute.

This makes it easier and clearer for users that their database may
be experiencing a problem that could impact Asterisk.

ASTERISK-28277

Change-Id: I173cf4928b10754478a6a8c27dfa96ede0f058a6
2019-02-07 14:11:13 +00:00
George Joseph
d496bf2099 Merge "sounds: Sort 'core show sounds' output" into 13 2019-02-06 07:13:50 -06:00
Sungtae Kim
f16d711679 main/cdr: Fixed cdr start overwriting
The CDR was overwriting the start time when the call continued the
dialplan from the ARI stasis or a Local channel was originated.

This change fixes this by no longer reinitializing the CDR when
transitioning out of the dialed pending state to the single state.

ASTERISK-28181

Change-Id: I921bc04064b6cff1deb2eea56a94d86489561cdc
2019-02-05 21:45:19 +01:00
George Joseph
1edcff6b03 Merge "Fix deadlock handling subscribe req during res_parking reload" into 13 2019-02-05 11:37:35 -06:00
George Joseph
5fb8d852f4 Merge "pjsip/config_global: regcontext context not created" into 13 2019-02-05 09:55:19 -06:00
Friendly Automation
1377cfc3c1 Merge "Added ARI resource /ari/asterisk/ping" into 13 2019-02-05 08:28:34 -06:00
George Joseph
33ebaae23f Merge "res_stasis: Auto-create context and extens on Stasis app launch." into 13 2019-02-05 08:26:55 -06:00
sungtae kim
67d587f47d Added ARI resource /ari/asterisk/ping
Added ARI resource.
GET /ari/asterisk/ping : It returns "pong" message with timestamp
and asterisk id. It would be useful for simple heath check.

Change-Id: I8d24e1dcc96f60f73437c68d9463ed746f688b29
2019-02-05 07:46:26 -06:00
Sean Bright
e70f8f7c20 sounds: Sort 'core show sounds' output
Change-Id: Ib39052a745040f75eb635f15a042da15b20e22ab
2019-02-04 15:40:02 -05:00
Friendly Automation
58eb82aa8a Merge "bundled-jansson: On OpenSuse Leap libjansson.a was placed in lib64" into 13 2019-02-04 11:26:31 -06:00
Joshua C. Colp
41da4ed8b2 Merge "media_index.c: Refactored so it doesn't cache the index" into 13 2019-02-04 09:02:13 -06:00
George Joseph
8222e8ee2f bundled-jansson: On OpenSuse Leap libjansson.a was placed in lib64
On OpenSuse Leap, libjansson.a is installed in
third-party/jansson/dest/lib64 instead of lib (which is where
the top-level makeopts looks).  This causes a link failure.

* Updated jansson/Makefile to add an explicit --libdir to force
  the installation to third-party/jansson/dest/lib.

ASTERISK-28271
Reported by: David Wilcox

Change-Id: Ibf8af75e5da13562105fcc39ed898c6ef0b5a5f3
2019-02-04 06:14:49 -07:00
Friendly Automation
762f40fca0 Merge "res/res_pjsip: Fix crash due to misuse of session->media between threads." into 13 2019-01-30 07:04:04 -06:00
Ben Ford
26a04477f4 res_stasis: Auto-create context and extens on Stasis app launch.
At AstriCon, there was a strong desire for the ability to completely
bypass dialplan when using ARI. This is possible through the automatic
creation of a context and a couple of extensions whenever an application
is started.

For example, if you have an application named 'ari-example', a context
named 'stasis-ari-example' will be automatically created whenever this
application is started as long as one does not already exist. Two
extensions (a match-all extension for Stasis and a 'h' extension) are
created within this context. Any endpoint that registers to Asterisk
within this context will send all calls to the corresponding Stasis
application. When the application is destroyed, the context is removed.

ASTERISK-28104 #close

Change-Id: Ie35bd93075e05b05e3ae129a83c9426931b7ebac
2019-01-29 12:19:22 -06:00
Kevin Harwell
5a0a4c2efa pjsip/config_global: regcontext context not created
The context specified by 'regcontext' was not being created, so when Asterisk
attempted to later dynamically add an extension it would fail. This patch now
creates the context if a 'regcontext' is specified.

ASTERISK-28238

Change-Id: I0f36cf4ab0a93ff4b1cc5548d617ecfd45e09265
2019-01-29 11:00:11 -06:00
George Joseph
66982824bf media_index.c: Refactored so it doesn't cache the index
Testing revealed that the cache added no benefit but that it could
consume excessive memory.

Two new index related functions were created:
ast_sounds_get_index_for_file() and ast_media_index_update_for_file()
which restrict index updating to specific sound files.

The original ast_sounds_get_index() and ast_media_index_update()
calls are still available but since they no longer cache the results
internally, developers should re-use an index they may already have
instead of calling ast_sounds_get_index() repeatedly.  If information
for only a single file is needed, ast_sounds_get_index_for_file()
should be called instead of ast_sounds_get_index().

The media_index directory scan code was elimininated in favor of
using the existing ast_file_read_dirs() function.

Since there's no more cache, ast_sounds_index_init now only
registers the sounds cli commands instead of generating the
initial index and subscribing to stasis format register/unregister
messages.

ast_sounds_reindex() is now a no-op but left for backwards
compatibility.

loader.c no longer registers "sounds" as a special reload target.

Both the sounds cli commands and the sounds ari resources were
refactored to only call ast_sounds_get_index() once per invocation
and to use ast_sounds_get_index_for_file() when a specific sound
file is requested.

Change-Id: I1cef327ba1b0648d85d218b70ce469ad07f4aa8d
2019-01-28 10:07:51 -07:00
Friendly Automation
a1d7d469a9 Merge "codecs.conf.sample: update codec opus docs" into 13 2019-01-28 07:43:27 -06:00
George Joseph
10cf12e7e0 Merge "format_g726: add support for seeking" into 13 2019-01-28 07:43:16 -06:00
George Joseph
c496fc2e28 Merge "res_http_websocket: ensure control frames do not interfere with data" into 13 2019-01-28 07:22:10 -06:00
Giuseppe Sucameli
a618d20ca4 Fix deadlock handling subscribe req during res_parking reload
Split destroy_hint method to separate hint removal and extension hint
state changed callback, the latter now called via stasis.
This avoids deadlock between res_parking reload that is removing the
parking lot and the related hint and subscribe requests coming for the
same parking lot.

ASTERISK-28173

Change-Id: I5b03c3455b3b12b6f83cea4cc34f4b4b20444f7e
2019-01-28 05:27:33 -06:00
Kevin Harwell
62faecd60d codecs.conf.sample: update codec opus docs
The option value "sdp" for some of the settings was removed a while back,
however the sample conf was not updated.

This patch removes any wording with regards to the old "sdp" option value,
and adjusts the defaults to what they are now.

ASTERISK-28263

Change-Id: I41bfa44e9f69446bcc5c8fd92e3675c676fdc445
2019-01-25 14:31:40 -06:00
Jean Aunis
e456600575 build : Fix cross-compilation errors
Bundled pjproject and jansson must be configured with the host and build
parameters provided to the configure script.

ASTERISK-28250

Change-Id: If0a76e52a87d4ab82b7d4c72d27d8759ca931880
2019-01-24 13:58:03 +01:00
Friendly Automation
9514829403 Merge "app_voicemail: Add Mailbox Aliases" into 13 2019-01-24 05:53:05 -06:00