Commit Graph

31985 Commits

Author SHA1 Message Date
Friendly Automation
4a871c4b79 Merge "json.c/strings.c - Add a couple of utility functions" into 16 2019-02-20 09:31:48 -06:00
Friendly Automation
3ae7dada41 Merge "chan_pjsip: Changed to continued after invalid media for pjsip show channelstats" into 16 2019-02-20 09:02:46 -06:00
George Joseph
c0e2a93e42 Merge "CI: Use tmpfs option to Docker instead of mount." into 16 2019-02-20 08:46:05 -06:00
Rodrigo Ramírez Norambuena
e806990be2 app_queue: Enable set the wrapuptime from AddQueueMember application
This change add ability to set the wrapuptime per-member using the
AddQueueMember application.

The feature to set wrapuptime per member was include in the issue
ASTERISK-27483 for static member by configuration file and was not
added to set from AddQueueMember.

ASTERISK-28055 #close

Change-Id: I7c7ee4a6f804922cd7c42cb02eea26eb3806c6cf
2019-02-19 20:47:43 -06:00
sungtae kim
08ba504e99 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 22:40:52 +01:00
Sungtae Kim
3fe40c0c05 res_pjsip_session Added rtcp stats result vector into the session
Currently, the Asterisk's pjsip_session module does not keeping the
rtcp's stats info after it was removed. But by adding the results
vector and keeping it until session is destroying, it can give more
useful information for other modules.

ASTERISK-28253

Change-Id: Ib25c2d3fc4da084aecfde2a82c1b1d733bd64fa5
2019-02-19 15:08:24 -06:00
Joshua Colp
3a2db0ee04 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 10:23:02 -06:00
Kevin Harwell
e85f92f37a 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:44:08 -06:00
Torrey Searle
01b781b4dc 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-19 01:37:20 -06:00
Chris Savinovich
b327b0bbda Revert "Test_cel: Fails when DONT_OPTIMIZE is off"
This reverts commit 05b79d16ab.

Change-Id: I2e64fc22c33b10cfd592681732fc67ae0669a301
2019-02-14 11:03:21 -06:00
George Joseph
aaee80adfe Merge "ci: Rerun unit tests when non-code changes occur." into 16 2019-02-11 09:28:24 -06:00
Joshua C. Colp
2070f62bb6 Merge "res_odbc: Add basic query logging." into 16 2019-02-11 08:39:31 -06:00
Joshua Colp
1084b6e1a1 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 07:10:23 -06:00
Kevin Harwell
2cf3931379 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:27:25 -06:00
Joshua Colp
44254d548b 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 08:23:04 -06:00
George Joseph
c0b7b60ba1 Merge "sounds: Sort 'core show sounds' output" into 16 2019-02-06 07:13:25 -06:00
George Joseph
7e366e4d4b Merge "main/cdr: Fixed cdr start overwriting" into 16 2019-02-06 07:12:38 -06:00
Sungtae Kim
e3e3027092 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:26:06 +01:00
Giuseppe Sucameli
419db481d1 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-02-05 10:14:36 -06:00
George Joseph
3d54ef5978 Merge "pjsip/config_global: regcontext context not created" into 16 2019-02-05 09:55:38 -06:00
George Joseph
29a77b337d Merge "Added ARI resource /ari/asterisk/ping" into 16 2019-02-05 08:41:20 -06:00
George Joseph
c925742e8b Merge "res_stasis: Auto-create context and extens on Stasis app launch." into 16 2019-02-05 08:26:35 -06:00
sungtae kim
19fc99a2fb 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:48 -06:00
Sean Bright
f29da72969 sounds: Sort 'core show sounds' output
Change-Id: Ib39052a745040f75eb635f15a042da15b20e22ab
2019-02-04 14:40:30 -06:00
Joshua C. Colp
ffe6ecb40f Merge "bundled-jansson: On OpenSuse Leap libjansson.a was placed in lib64" into 16 2019-02-04 11:30:24 -06:00
Ben Ford
1051e1dd18 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-02-04 09:52:52 -06:00
Joshua C. Colp
6ccf1155d1 Merge "media_index.c: Refactored so it doesn't cache the index" into 16 2019-02-04 09:02:24 -06:00
George Joseph
70fa6e6955 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 07:17:41 -06:00
Kevin Harwell
9c3b4dcf80 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:33:31 -06:00
George Joseph
603143bd5a 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.

"sounds" is no longer a valid target for the "module reload"
command.

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 13:28:22 -06:00
George Joseph
36a10a3672 Merge "codecs.conf.sample: update codec opus docs" into 16 2019-01-28 07:47:09 -06:00
George Joseph
d0087a8107 Merge "format_g726: add support for seeking" into 16 2019-01-28 07:45:56 -06:00
George Joseph
47a2b6d0f3 Merge "res_http_websocket: ensure control frames do not interfere with data" into 16 2019-01-28 07:22:18 -06:00
Kevin Harwell
f6452f9656 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:53 -06:00
Joshua C. Colp
e994dff064 Merge "build : Fix cross-compilation errors" into 16 2019-01-24 08:23:06 -06:00
eyalhasson
c1da2e94a3 format_g726: add support for seeking
Added support for the seek function in format_g726
so playback can start from anywhere.
Before the fix, playback of g726 files
always started from the beginning.

ASTERISK-28246

Change-Id: I626235bc4642df1479050d3d06828412603a9b40
2019-01-24 07:59:32 -06:00
Joshua C. Colp
fe4c6434c1 Merge "app_voicemail: Add Mailbox Aliases" into 16 2019-01-24 06:23:57 -06:00
Joshua C. Colp
e2fb30245b Merge "res_pjsip_registrar: mitigate blocked threads on reliable transport shutdown" into 16 2019-01-24 05:49:53 -06:00
Joshua C. Colp
a40fb7fa7f Merge "Test_cel: Fails when DONT_OPTIMIZE is off" into 16 2019-01-23 12:06:10 -06:00
Jean Aunis
d3a6714158 build : Fix cross-compilation errors
Bundled pjproject and jansson must be configured with the host and build
parameters provided to the configure script.
Autotools do not permit to check for the existence of local header files, so
the control of hrirs.h must not be done when cross-compiling.

ASTERISK-28250

Change-Id: If0a76e52a87d4ab82b7d4c72d27d8759ca931880
2019-01-23 10:30:47 -06:00
Joshua C. Colp
6640ecfd39 Merge "manager_channels: Fix throwing of HangupHandler manager events" into 16 2019-01-23 09:51:38 -06:00
Jeremy Lainé
907d71b551 res_http_websocket: ensure control frames do not interfere with data
Control frames (PING / PONG / CLOSE) can be received in the middle of a
fragmented message. In order to ensure they do not interfere with the
reassembly buffer, we exit early and do not return the payload to the
caller.

ASTERISK-28257 #close

Change-Id: Ia5367144fe08ac6141bba3309517a48ec7f013bc
2019-01-23 09:02:02 -06:00
Joshua C. Colp
7d1736b59b Merge "stasis / manager / ari: Better filter messages." into 16 2019-01-22 18:59:11 -06:00
Joshua C. Colp
84bed54bd7 Merge "bridge_softmix: Use MSID:LABEL metadata as the cloned stream's appendix" into 16 2019-01-22 18:56:38 -06:00
Joshua C. Colp
fc28aa2de6 Merge "pjsip_transport_management: Shutdown transport immediately on disconnect" into 16 2019-01-22 18:55:05 -06:00
Xiemin Chen
f6cf837aed bridge_softmix: Use MSID:LABEL metadata as the cloned stream's appendix
To avoid the stream name collide if there're more than one video track
in one client. If client has multi video tracks, the name of ast_stream
which represents each video track may be the same. Use the MSID:LABEL
here because it's identifiable.

ASTERISK-28196 #close
Reported-by: xiemchen

Change-Id: Ib62b2886e8d3a30e481d94616b0ceaeab68a870b
2019-01-22 18:17:17 -06:00
Joshua C. Colp
ef43bd0b43 Merge "res_http_websocket: respond to CLOSE opcode" into 16 2019-01-22 18:16:08 -06:00
Gerald Schnabel
735bd4d185 manager_channels: Fix throwing of HangupHandler manager events
The type value extracted from stasis message data in channel_hangup_handler_cb
isn't compared against the valid values "run", "pop" and "push". Thus the
manager events HangupHandlerPush, HangupHandlerPop and HangupHandlerRun are
never thrown.

This regression was introduced by ASTERISK_21462.

ASTERISK-28252

Change-Id: I9956e35e18da1873113644df1ddc3c7cd37bf524
2019-01-22 17:29:58 -06:00
Chris-Savinovich
05b79d16ab Test_cel: Fails when DONT_OPTIMIZE is off
A bug in GCC causes TEST_CEL to return failure under the following
conditions:
1. TEST_FRAMEWORK on
2. DONT_OPTIMIZE off
3. Fedora and Ubuntu
4. GCC 8.2.1
5. Test name: test_cel_dial_pickup
6. There must exist a certain combination of multithreading.
The bug affects arithmetic calculations when the optimization level
is bigger than O1 and the -fpartial-inline flag is on. Provided these
conditions, function ast_str_to_lower() fails to convert to lower case
due to said function being of type force_inline.  The solution is to
remove the "force_inline" type declaration from function ast_str_to_lower()

Change-Id: Ied32e0071f12ed9d5f3b4cdd878b2532a1c769d7
2019-01-22 15:41:33 -06:00
George Joseph
dbef559e0b app_voicemail: Add Mailbox Aliases
You can now define an "aliases" context in voicemail.conf
whose entries point to actual mailboxes.  These can be used anywhere
the mailbox is specified.

Example:
[general]
aliasescontext = myaliases

[default]
1234 = yadayada

[myaliases]
4321@devices = 1234@default

Now you can use 4321@devices to refer to the 1234@default mailbox.

This can be useful to provide channel drivers with constant
mailbox specifications such as <extension>@devices leaving
app_voicemail to control exactly which mailbox the alias points to.
Now, only voicemail has to be reloaded to make changes instead of
individual channel drivers which are usually more expensive to
reload.

Change-Id: I395b9205c91523a334fe971be0d1de4522067b04
2019-01-22 13:32:00 -06:00