Commit Graph

28689 Commits

Author SHA1 Message Date
Joshua Colp aa1482aed4 Merge "channel: Fix issues in hangup scenarios caused by frame deferral" into 14 2016-11-16 16:55:39 -06:00
Joshua Colp caa207bc4f Merge "Revert "Revert "Add API for channel frame deferral.""" into 14 2016-11-16 16:55:32 -06:00
zuul fdea7fe9e4 Merge "res/ari/resource_bridges: Add the ability to manipulate the video source" into 14 2016-11-16 16:48:03 -06:00
George Joseph 42254406ad Merge "cli: Fix ast_el_read_char to work with libedit >= 3.1" into 14 2016-11-16 14:15:21 -06:00
George Joseph d6f9e2b54a file.c/__ast_file_read_dirs: Fix issues on filesystems without d_type
One of the code paths in __ast_file_read_dirs will only get executed if
the OS doesn't support dirent->d_type OR if the filesystem the
particular file is on doesn't support it.  So, while standard Linux
systems support the field, some filesystems like XFS do not.  In this
case, we need to call stat() to determine whether the directory entry
is a file or directory so we append the filename to the supplied
directory path and call stat.  We forgot to truncate path back to just
the directory afterwards though so we were passing a complete file name
to the callback in the dir_name parameter instead of just the directory
name.

The logic has been re-written to only create a full_path if we need to
call stat() or if we need to descend into another directory.

Change-Id: I54e4228bd8355fad65200c6df3ec4c9c8a98dfba
2016-11-15 21:21:28 -05:00
zuul 69bf9a01cd Merge "manager: Bump AMI version number." into 14 2016-11-15 19:08:03 -06:00
Joshua Colp 617b43cdaa Merge "res_ari: Add support for channel variables in ARI events." into 14 2016-11-15 13:49:51 -06:00
Joshua Colp f1359c7dc8 manager: Bump AMI version number.
During the development of Asterisk 14 the behavior of
the Command AMI action was altered such that the result
was returned on lines with a prefix of "Output: ". While
this was documented in the UPGRADE.txt file it is also
reasonable that this should bump the AMI version number.

ASTERISK-26556

Change-Id: Idf1bf01608e53f7bfdf43ddb4d0683e53f74ee42
2016-11-15 15:02:32 +00:00
Matt Jordan 62cbcb2e54 res/ari/resource_bridges: Add the ability to manipulate the video source
In multi-party bridges, Asterisk currently supports two video modes:
 * Follow the talker, in which the speaker with the most energy is shown
   to all participants but the speaker, and the speaker sees the
   previous video source
 * Explicitly set video sources, in which all participants see a locked
   video source

Prior to this patch, ARI had no ability to manipulate the video source.
This isn't important for two-party bridges, in which Asterisk merely
relays the video between the participants. However, in a multi-party
bridge, it can be advantageous to allow an external application to
manipulate the video source.

This patch provides two new routes to accomplish this:
(1) setVideoSource: POST /bridges/{bridgeId}/videoSource/{channelId}
    Sets a video source to an explicit channel
(2) clearVideoSource: DELETE /bridges/{bridgeId}/videoSource
    Removes any explicit video source, and sets the video mode to talk
    detection

ASTERISK-26595 #close

Change-Id: I98e455d5bffc08ea5e8d6b84ccaf063c714e6621
2016-11-14 15:56:45 -06:00
George Joseph ac6051c302 channel: Fix issues in hangup scenarios caused by frame deferral
ASTERISK-26343

Change-Id: I06dbf7366e26028251964143454a77d017bb61c8
(cherry picked from commit 0be46aaf6b)
(cherry picked from commit 7263a17ca0)
(cherry picked from commit ebf8d94eb2)
2016-11-14 13:47:14 -07:00
George Joseph 88111da235 Revert "Revert "Add API for channel frame deferral.""
This reverts commit b640f18a44.

Change-Id: I4ad8e7f66b3e6457ac07e7965822ae39ac08464d
2016-11-14 13:44:43 -07:00
zuul 2401e27023 Merge "res_pjsip.c: Rework endpt_send_request() req_wrapper code." into 14 2016-11-14 13:08:58 -06:00
Sebastien Duthil eb5077fb26 res_ari: Add support for channel variables in ARI events.
This works the same as for AMI manager variables. Set
"channelvars=foo,bar" in your ari.conf general section, and then the
channel variables "foo" and "bar" (along with their values), will
appear in every Stasis websocket channel event.

ASTERISK-26492 #close
patches:
  ari_vars.diff submitted by Mark Michelson

Change-Id: I5609ba239259577c0948645df776d7f3bc864229
2016-11-14 14:00:54 -05:00
George Joseph e2046bfaf3 cli: Fix ast_el_read_char to work with libedit >= 3.1
Libedit 3.1 is not build with unicode on as a default and so the
prototype for the el_gets callback changed from expecting a char buffer
to accepting a wchar buffer.  If ast_el_read_char isn't changed,
the cli reads garbage from teh terminal.

Added a configure test for (*el_rfunc_t)(EditLine *, wchar_t *) and
updated ast_el_read_char to use the HAVE_ define to detemrine whether
to use char or wchar.

ASTERISK-26592 #close

Change-Id: I9099b46f68e06d0202ff80e53022a2b68b08871a
2016-11-14 11:16:03 -07:00
Joshua Colp 223ce4890c Merge "Fix closing rtp ports after call finished in chan_unistim." into 14 2016-11-14 07:35:18 -06:00
Joshua Colp 2fcb86d374 Merge "res_pjsip: Fix tdata leaks in off nominal paths." into 14 2016-11-14 07:12:41 -06:00
Igor Goncharovskiy ba09e7a23f Fix closing rtp ports after call finished in chan_unistim.
Fix ASTERISK-26565 by adding ast_rtp_instance_stop before
rtp instance destroy for chan_unistim. Also several fixes
for displayed text translation.

Change-Id: If42a03eea09bd1633471406bdc829cf98bf6affc
2016-11-11 23:01:47 -05:00
Joshua Colp cc4a2c8c76 res_pjsip_sdp_rtp: Reject offer of required SRTP without res_srtp.
When optimistic SRTP was on it was possible for us to still
set up a call without an audio stream if an offer was received
with required SRTP.

This change makes it so this scenario will now fail with a 488
response.

ASTERISK-26575

Change-Id: I7d14187037681f48879bd20319ac79d0877318f3
2016-11-11 08:17:47 -05:00
Joshua Colp bb32bb3939 Merge "res_pjsip: Perform resolution when explicit IPv6 transport is used." into 14 2016-11-11 04:37:07 -06:00
Joshua Colp bb0a172902 Merge "build: Fix default values for some SANITIZER options" into 14 2016-11-11 04:36:52 -06:00
Richard Mudgett d36695e0bb res_pjsip.c: Rework endpt_send_request() req_wrapper code.
* Don't hold the req_wrapper lock too long in endpt_send_request().  We
could block the PJSIP monitor thread if the timeout timer expires.
sip_get_tpselector_from_endpoint() does a sorcery access that could take
awhile accessing a database.  pjsip_endpt_send_request() might take awhile
if selecting a transport.

* Shorten the time that the req_wrapper lock is held in the callback
functions.

* Simplify endpt_send_request() req_wrapper->timeout code.

* Removed some redundant req_wrapper->timeout_timer->id assignments.

Change-Id: I3195e3a8e0207bb8e7f49060ad2742cf21a6e4c9
2016-11-10 17:19:11 -05:00
Richard Mudgett add253cbd0 res_pjsip: Fix tdata leaks in off nominal paths.
Change-Id: Ie83e06e88c2d60157775263b07e40b61718ac97b
2016-11-10 17:15:48 -05:00
Richard Mudgett 49dd637047 res_pjsip_registrar_expire.c: Remove extra linefeed in debug message.
Change-Id: I1f9adb911f23376503396ec8867e8005b755eb94
2016-11-10 16:59:30 -05:00
Joshua Colp 119e1fd6cf res_pjsip: Perform resolution when explicit IPv6 transport is used.
This change fixes the SIP resolver such that if an IPv6 transport
is explicitly used it will resolve NAPTR, SRV, and AAAA records.

You can explicitly use one by specifying it on an endpoint.

ASTERISK-26571

Change-Id: I2ed3ce81b43a6a8a937c0ebc1b8ed2da5ac2ef36
2016-11-10 15:10:56 +00:00
Joshua Colp 90389f6b7d app_queue: Add mention of 'ABANDON' variable to CHANGES.
ASTERISK-26558

Change-Id: I1127010181e79c8ac291f72f036cb8e430dc7f7e
2016-11-10 09:34:15 -05:00
Joshua Colp fb2d609bbc Merge "app_queue: new variable set when abandoned" into 14 2016-11-10 07:48:05 -06:00
George Joseph c7511029c3 Merge "Revert "AGI: Only defer frames when in an interception routine."" into 14 2016-11-10 07:40:26 -06:00
George Joseph 6384ac9f39 Merge "Revert "channel: Use frame deferral API for safe sleep."" into 14 2016-11-10 07:40:25 -06:00
George Joseph b55bdb0740 Merge "Revert "Add API for channel frame deferral."" into 14 2016-11-10 07:40:25 -06:00
George Joseph 588336b738 Merge "Revert "autoservice: Use frame deferral API"" into 14 2016-11-10 07:40:24 -06:00
George Joseph b640f18a44 Revert "Add API for channel frame deferral."
This reverts commit 4a8b1940b8.
Multiple testsuite failures were detected after the fact.

Change-Id: Ife9f86872d323adb9c068d2942339c7be9499257
2016-11-10 08:38:18 -05:00
George Joseph 7155020c96 Revert "AGI: Only defer frames when in an interception routine."
This reverts commit 8d8323b142.
Multiple testsuite failures were detected after the fact.

Change-Id: I322684ed82ba32cfce226a94fe19b87a4ec02567
2016-11-10 08:37:46 -05:00
George Joseph 8b9996a90c Revert "autoservice: Use frame deferral API"
This reverts commit 0288fba2f0.
Multiple testsuite failures were detected after the fact.

Change-Id: I9951207019a0f528787f735ccfed7c4b76335505
2016-11-10 08:37:31 -05:00
George Joseph 97679ee846 Revert "channel: Use frame deferral API for safe sleep."
This reverts commit 1db9e7886c.
Multiple testsuite failures were detected after the fact.

Change-Id: Ifd5817e90371e05c4011d5cc97da145c196d60fe
2016-11-10 08:37:19 -05:00
George Joseph dbcb958254 build: Fix default values for some SANITIZER options
2 of the sanitizers didn't have default values so in systems that
don't support sanitizers menuselect would spit out warnings.  They
were harmless but confusing.  They've now been set to "0".

Change-Id: I08dc495e3b83f1feac3160b421f538c375fc5d58
2016-11-09 19:26:16 -05:00
Sebastian Gutierrez abd41590d7 app_queue: new variable set when abandoned
sets the variable ABANDONED to TRUE if the call was not answered.

ASTERISK-26558

Change-Id: I4729af9bff4eba436d8a776afd3374065d0036d3
2016-11-09 13:31:56 -05:00
Mark Michelson 65a0b6bca2 res_pjsip_session: Do not call session supplements when it's too late.
res_pjsip_sesssion was hooking into transaction and invite state
changes. One of the reasons for doing so was due to the
PJSIP_EVENT_TX_MSG event. The idea was that we were hooking into the
message sending process, and so we should call session supplements to
alter the outgoing message.

In reality, this event was meant to indicate that the message either
a) had already been sent, or
b) required a DNS lookup and would be sent when the DNS query
completed.

In case (a), this meant we were altering an already-sent
request/response for no reason. In case (b), this potentially meant we
could be trying to alter a request/response at the same time that the
DNS resolution completed. In this case, it meant we might be stomping on
memory being used by the thread actually sending the message. This
caused potential crashes and memory corruption.

This patch removes the calls to session supplements from the case where
the PJSIP_EVENT_TX_MSG event occurs. In all of these cases, trying to
alter the message at this point is too late, and it can cause nothing
but harm to try to do it. Because there were no longer any calls to the
handle_outgoing() function, it has been removed.

Change-Id: Ibcc223fb1c3a237927f38754e0429e80ee301e92
2016-11-09 11:48:09 -05:00
Joshua Colp c2b3f6eb10 Merge changes from topic 'ASTERISK-26343' into 14
* changes:
  channel: Use frame deferral API for safe sleep.
  autoservice: Use frame deferral API
  AGI: Only defer frames when in an interception routine.
  Add API for channel frame deferral.
2016-11-08 13:27:20 -06:00
George Joseph ea13d9c017 Merge "automon: restore mixing of the both channels after recording stops" into 14 2016-11-08 08:04:22 -06:00
Mark Michelson 1db9e7886c channel: Use frame deferral API for safe sleep.
This is another case where manual frame deferral can be replaced with
centralized routines instead.

Change-Id: I42cdf205f8f29a7977e599751a57efbaac07c30e
(cherry picked from commit d149c4b9e0)
2016-11-08 06:01:27 -07:00
Mark Michelson 0288fba2f0 autoservice: Use frame deferral API
Rather than use manual frame deferral, just let the channel API do it
for us.

ASTERISK-26343

Change-Id: I688386f36e765dbc07be863943a43f26bd5eac49
(cherry picked from commit 8ba3e2fc27)
2016-11-08 06:01:06 -07:00
Mark Michelson 8d8323b142 AGI: Only defer frames when in an interception routine.
AGI recently was modified to defer important frames. This was because
when AGI was used in a connected line interception routine, the
resulting connected line frame would end up getting discarded by the
AGI.

However, this caused bad behavior in other cases. Specifically, during a
transfer, if someone attempted to manually set the Caller ID on a
channel in an AGI, the deferred connected line frame would end up
overwriting what had been manually set in the AGI.

Since the initial issue was specific to interception routines, this
change removes the manual frame deferral from AGI and instead uses the
new frame deferral API in interception routines.

ASTERISK-26343 #close
Reported by Morton Tryfoss

Change-Id: Iab7d39436d0ee99bfe32ad55ef91e9bd88db4208
2016-11-08 06:00:13 -07:00
Mark Michelson 4a8b1940b8 Add API for channel frame deferral.
There are several places in Asterisk that have duplicated logic
for deferring important frames until later.

This commit adds a couple of API calls to facilitate this automatically.

ast_channel_start_defer_frames(): Future reads of deferrable frames on
this channel will be deferred until later.

ast_channel_stop_defer_frames(): Any frames that have been deferred get
requeued onto the channel.

ASTERISK-26343

Change-Id: I3e1b87bc6796f222442fa6f7d1b6a4706fb33641
2016-11-08 05:59:43 -07:00
Joshua Colp 5ad463581f Merge "res_stasis: Don't unsubscribe from a NULL bridge." into 14 2016-11-08 05:00:06 -06:00
Joshua Colp 5873438150 Merge "chan_ooh323: reset rrq count on gk registration" into 14 2016-11-08 04:58:57 -06:00
Joshua Colp 4c8b3babf7 Merge "chan_ooh323: Fixes to work right with Cisco devices" into 14 2016-11-08 04:58:30 -06:00
Joshua Colp 1be6c9d26a Merge "stasis_recording/stored: remove calls to deprecated readdir_r function." into 14 2016-11-08 04:57:36 -06:00
Joshua Colp d7175c58b8 Merge "res_http_websocket: Increase the buffer size for non-LOW_MEMORY systems" into 14 2016-11-07 16:04:32 -06:00
Joshua Colp b19d7e79e9 Merge "res_stasis: Set a video source mode on Stasis created bridges" into 14 2016-11-07 16:04:30 -06:00
Joshua Colp a4d145e465 Merge "main/bridge_channel: Fix channel reference leak on video source" into 14 2016-11-07 16:04:26 -06:00