Commit Graph

32173 Commits

Author SHA1 Message Date
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
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
Friendly Automation
f9f17f3bfe Merge "chan_pjsip: Relock correct channel during "fax" redirect." into 16 2019-09-18 07:39:25 -05:00
George Joseph
51e315765b Merge "res_rtp_asterisk.c: Send RTCP as compound packets." into 16 2019-09-17 09:26:40 -05:00
Joshua Colp
49e1346185 chan_pjsip: Relock correct channel during "fax" redirect.
When fax detection occurs on an outbound PJSIP channel the
redirect operation will result in a masquerade occurring and
the underlying channel on the session changing. The code
incorrectly relocked the new channel instead of the old
channel when returning. This resulted in the new channel
being locked indefinitely. The code now always acts on the
expected channel.

ASTERISK-28538

Change-Id: I2b2e60d07e74383ae7e90d752c036c4b02d6b3a3
2019-09-16 08:42:16 -05:00
Guido Falsi
448b8c9bc2 chan_dahdi: Fix build with clang/llvm
On FreeBSD using the clang/llvm compiler build fails to build due
to the switch statement argument being a non integer type expression.
Switch to an if/else if/else construct to sidestep the issue.

ASTERISK-28536 #close

Change-Id: Idf4a82cc1e94580a2d017fe9e351c226f23e20c8
2019-09-14 10:10:30 -05:00
Ben Ford
a95cef7140 res_rtp_asterisk.c: Send RTCP as compound packets.
According to RFC3550, ALL RTCP packets must be sent in a compond packet
of at least two individual packets, including SR/RR and SDES. REMB,
FIR, and NACK were not following this format, and as a result, would
fail the packet check in ast_rtcp_interpret. This was found from writing
unit tests for RTCP. The browser would accept the way we were
constructing these RTCP packets, but when sending directly from one
Asterisk instance to another, the above mentioned problem would occur.

Change-Id: Ieb140e9c22568a251a564cd953dd22cd33244605
2019-09-13 09:48:17 -05:00
George Joseph
913c8b48b7 Merge "channels: Allow updating variable value" into 16 2019-09-13 09:43:58 -05:00
George Joseph
c2dbba39a6 Merge "res_rtp: Add unit tests for RTCP stats." into 16 2019-09-13 07:05:08 -05:00
Asterisk Development Team
688908fe7a Update CHANGES and UPGRADE.txt for 16.6.0 2019-09-12 16:04:11 -05:00
Sean Bright
518b6bfb5c channels: Allow updating variable value
When modifying an already defined variable in some channel drivers they
add a new variable with the same name to the list, but that value is
never used, only the first one found.

Introduce ast_variable_list_replace() and use it where appropriate.

ASTERISK-23756 #close
Patches:
  setvar-multiplie.patch submitted by Michael Goryainov

Change-Id: Ie1897a96c82b8945e752733612ee963686f32839
2019-09-12 15:58:49 -05:00
Florian Floimair
f85631cf82 core: Add H.265/HEVC passthrough support
This change adds H.265/HEVC as a known codec and creates a cached
"h265" media format for use.

Note that RFC 7798 section 7.2 also describes additional SDP
parameters. Handling of these is not yet supported.

ASTERISK-28512

Change-Id: I26d262cc4110b4f7e99348a3ddc53bad0d2cd1f2
2019-09-12 11:16:09 +02:00
Joshua Colp
cb90d1cd7c Merge "ChanIsAvail() generates a CDR when unanswered=yes in cdr.conf." into 16 2019-09-11 09:26:59 -05:00
George Joseph
c49696462a Merge "res_musiconhold: Added unregister realtime moh class" into 16 2019-09-11 09:02:44 -05:00
Friendly Automation
ce5029a4db Merge "chan_dahdi: set CHANNEL(hangupsource) when a PRI channel hangs up" into 16 2019-09-11 07:07:32 -05:00
sungtae kim
b478f46d59 res_musiconhold: Added unregister realtime moh class
This fix allows a realtime moh class to be unregistered from the command
line. This is useful when the contents of a directory referenced by a
realtime moh class have changed.
The realtime moh class is then reloaded on the next request and uses the
new directory contents.

ASTERISK-17808

Change-Id: Ibc4c6834592257c4bb90601ee299682d15befbce
2019-09-11 02:31:08 -05:00
Friendly Automation
a30e2ea305 Merge "codec_resample: Ensure OUTSIDE_SPEEX is defined when necessary" into 16 2019-09-10 18:55:08 -05:00
Ben Ford
922d3e02df res_rtp: Add unit tests for RTCP stats.
Added unit tests for RTCP video stats. These tests include NACK, REMB,
FIR/FUR/PLI, SR/RR/SDES, and packet loss statistics. The REMB and FIR
tests are currently disabled due to a bug. We expect to receive a
compound packet, but the code sends this out as a single packet, which
the browser accepts, but makes Asterisk upset.

While writing these tests, I noticed an issue with NACK as well. Where
it is handling a received NACK request, it was reading in only the first
8 bits of following packets that were also lost. This has been changed
to the correct value of 16 bits.

Also made a minor fix to the data buffer unit test.

Change-Id: I56107c7411003a247589bbb6086d25c54719901b
2019-09-10 13:10:34 -05:00
Friendly Automation
55fbf9b2c3 Merge "ARI: External Media" into 16 2019-09-10 11:56:38 -05:00
George Joseph
d566314e38 ARI: External Media
The Channel resource has a new sub-resource "externalMedia".
This allows an application to create a channel for the sole purpose
of exchanging media with an external server.  Once created, this
channel could be placed into a bridge with existing channels to
allow the external server to inject audio into the bridge or
receive audio from the bridge.
See https://wiki.asterisk.org/wiki/display/AST/External+Media+and+ARI
for more information.

Change-Id: I9618899198880b4c650354581b50c0401b58bc46
2019-09-10 09:44:04 -06:00
George Joseph
f4726e8b16 Merge "chan_unistim: Fix clang warning: variable sized type not at end of a struct" into 16 2019-09-10 08:41:42 -05:00
Friendly Automation
c4cefb8073 Merge "test_utils.c: Skip test adsi_loaded_test if module not loaded." into 16 2019-09-10 08:37:07 -05:00
Sean Bright
bf527810ef codec_resample: Ensure OUTSIDE_SPEEX is defined when necessary
ASTERISK-28511

Change-Id: If0d58598ce14aad3c786a1c0127b5f7b200b737d
2019-09-08 11:52:42 -04:00
Frederic LE FOLL
c6b17b5212 chan_dahdi: set CHANNEL(hangupsource) when a PRI channel hangs up
When the remote ISDN party ends an ISDN call on a PRI link
(DISCONNECT), CHANNEL(hangupsource) information is not available.

chan_dahdi already contains an ast_set_hangupsource() in
__dahdi_exception() function but it seems that ISDN message processing
does not use this part of code.

Two other channel modules associate ast_queue_hangup() and
ast_set_hangupsource() functions calls:
- chan_pjsip in chan_pjsip_session_end() function,
- chan_sip in sip_queue_hangup_cause() function.
chan_iax2 separates them, in iax2_queue_hangup()/iax2_destroy() and
set_hangup_source_and_cause().

Thus, I propose to add ast_set_hangupsource() beside
ast_queue_hangup() in sig_pri_queue_hangup(), like chan_pjsip and
chan_sip already do.

ASTERISK-28525

Change-Id: I0f588a4bcf15ccd0648fd69830d1b801c3f21b7c
2019-09-05 20:20:15 +02:00
Frederic LE FOLL
c8cf3ad389 ChanIsAvail() generates a CDR when unanswered=yes in cdr.conf.
ChanIsAvail() creates a temporary channel with ast_request() to test
resource availability. It should not generate a CDR when it hangs up
this temporary channel.

This patch disables CDR generation for the temporary channel with
ast_cdr_set_property().

ASTERISK-28527

Change-Id: I7b0555c6909c7d322e452dde97c9ea5b111552d1
2019-09-05 18:09:28 +02:00
George Joseph
1158411f53 Merge "AST-2019-005 - translate: Don't assume all frames will have a src." into 16 2019-09-05 07:52:49 -05:00
Joshua Colp
2691ee7e10 AST-2019-005 - translate: Don't assume all frames will have a src.
This change removes the assumption that a frame will always have
a src set on it. This assumption is incorrect.

Given a scenario where an RTP packet is received with no payload
the resulting audio frame will have no samples. If this frame goes
through a signed linear translation path an interpolated frame can
be created (if generic packet loss concealment is enabled) that has
minimal data on it, including no src. If this frame is given to a
translation path a crash will occur due to the lack of src.

ASTERISK-28499

Change-Id: I024d10dd98207eb8a6b35b59880bcdf1090538f8
2019-09-05 05:28:12 -05:00
Kevin Harwell
965df3c228 AST-2019-004 - res_pjsip_t38.c: Add NULL checks before using session media
After receiving a 200 OK with a declined stream in response to a T.38
initiated re-invite Asterisk would crash when attempting to dereference
a NULL session media object.

This patch checks to make sure the session media object is not NULL before
attempting to use it.

ASTERISK-28495
patches:
  ast-2019-004.patch submitted by Alexei Gradinari (license 5691)

Change-Id: I168f45f4da29cfe739acf87e597baa2aae7aa572
2019-09-05 05:16:08 -05:00
Chris-Savinovich
a321225fa4 test_utils.c: Skip test adsi_loaded_test if module not loaded.
Module res_adsi.so is deprecated, therefore it does not load by default.
Module not loaded causes it to yield a FAIL when tested by tests/test_utils.c.
This fix checks if the corresponding module is loaded at the start of the test,
and if not, it passes the test and exits with a message.

This fix is applied to all versions where the module is marked deprecated.

Change-Id: I52be64c8f6af222e15148a856d1f10cb113e1e94
2019-09-04 16:49:49 -05:00
Igor Goncharovsky
92261d60c8 chan_unistim: Fix clang warning: variable sized type not at end of a struct
On reading information about initial client packet unistim use dirty
implementation of destination ip address retrieval. This fix uses
CMSG_*(..) to get ip address and make clang compile without warning.

ASTERISK-25592 #close
Reported-by: Alexander Traud

Change-Id: Ic1fd34c2c2bcc951da65bf62e3f7a8adff8351b1
2019-09-03 22:59:38 -05:00
George Joseph
260969f5ad Merge "res_pjsip_mwi: add better handling of solicited vs unsolicited subscriptions" into 16 2019-09-03 05:34:29 -05:00
George Joseph
cc1b57a51d Merge "chan_unistim: Fix code, causing all incoming DTMF sent back to asterisk" into 16 2019-09-03 05:31:25 -05:00
George Joseph
712bf5edee Merge "codec_resample: Upgrade speex_resample to fix up-sampling bug" into 16 2019-08-30 07:45:56 -05:00
Kevin Harwell
7db5f5df6a res_pjsip_mwi: add better handling of solicited vs unsolicited subscriptions
res_pjsip_mwi allows both solicited and unsolicited MWI subscription types.
While both can be set in the configuration for a given endpoint/aor, only
one is allowed. Precedence is given to unsolicited. Meaning if an endpoint/aor
is configured to allow both types then the solicited subscription is rejected
when it comes in. However, there is a configuration option to override that
behavior:

mwi_subscribe_replaces_unsolicited

When set to "yes" then when a solicited subscription comes in instead of
rejecting it Asterisk is suppose to replace the unsolicited one if it exists.
Prior to this patch there was a bug in Asterisk that allowed the solicted one
to be added, but did not remove the unsolicited. As a matter of fact a new
unsolicited subscription got added everytime a SIP register was received.
Over time this eventually could "flood" a phone with SIP notifies.

This patch fixes that behavior to now make it work as expected. If configured
to do so a solicited subscription now properly replaces the unsolicited one.
As well when an unsubscribe is received the unsolicited subscription is
restored. Logic was also put in to handle reloads, and any configuration changes
that might result from that. For instance, if a solicited subscription had
previously replaced an unsolicited one, but after reload it was configured to
not allow that then the solicited one needs to be shutdown, and the unsolicited
one added.

ASTERISK-28488

Change-Id: Iec2ec12d9431097e97ed5f37119963aee41af7b1
2019-08-28 18:21:26 -05:00
Igor Goncharovsky
78d00c277c chan_unistim: Fix code, causing all incoming DTMF sent back to asterisk
Current implementation of ast_channel_tech send_digit_begin hook uses
same function for tone playback as key press handler. This cause every
incoming dtmf send back to asterisk. In case of two unistim phones
connected to each other, it'll cause indefinite DTMF loop. Fix add
separate function for dtmf tone phone play.

Change-Id: I5795db468df552f0c89c7576b6b3858b26c4eab4
2019-08-27 02:52:50 -05:00
Igor Goncharovsky
821b7561f8 chan_unistim: Fix RTP port byte order for big-endian arch
This patch fixes one-way oudio that users expirienced on
big-endian architechtires. RTP port number bytes was stored
in improper order and phone sent RTP to wrong RTP port.

Reported-by: Andrey Ionov
Change-Id: I9a9ca7f26e31a67bbbceff12923baa10dfb8a3be
2019-08-26 04:48:44 -05:00
Sean Bright
cdbb9800e3 codec_resample: Upgrade speex_resample to fix up-sampling bug
ASTERISK-28511 #close

Change-Id: Idd07bf341e89ac999c7f5701d9b72b8a9cb11e82
2019-08-23 17:36:32 -04:00
Friendly Automation
94dfb9c7ac Merge "Fix misname 'res_external_mwi' to 'res_mwi_external' in comments." into 16 2019-08-23 07:56:31 -05:00
Friendly Automation
d29e16ce52 Merge "pjproject: Configurable setting for cnonce to include hyphens or not" into 16 2019-08-22 19:55:07 -05:00
George Joseph
b5eb13c23b Merge "chan_rtp: Accept hostname as well as ip address as destination" into 16 2019-08-22 19:01:49 -05:00
George Joseph
38d1d0726c Merge "dns_core: Create new API ast_dns_resolve_ipv6_and_ipv4" into 16 2019-08-22 19:00:21 -05:00
Alexei Gradinari
aaaa1695ca Fix misname 'res_external_mwi' to 'res_mwi_external' in comments.
Change-Id: Ic784be8500e5cb75dcb34bae9f03cfd93b6b34fb
2019-08-22 14:26:24 -04:00
George Joseph
c00a010fe8 chan_rtp: Accept hostname as well as ip address as destination
The UnicastRTP channel driver provided by chan_rtp now accepts
"<hostname>:<port>" as an alternative to "<ip_address>:<port>"
in the destination. The first AAAA (preferred) or A record resolved
will be used as the destination. The lookup is synchronous so beware
of possible dialplan delays if you specify a hostname.

Change-Id: Ie6f95b983a8792bf0dacc64c7953a41032dba677
2019-08-22 06:36:51 -06:00
George Joseph
6407ccd2d9 dns_core: Create new API ast_dns_resolve_ipv6_and_ipv4
The new function takes in a pointer to an ast_sockaddr structure,
a hostname and an optional port and then dispatches parallel
"AAAA" and "A" record queries.  If an "AAAA" record is returned,
it's parsed into the ast_sockaddr structure along with the port
if it was supplied.  If no "AAAA" record was returned, the
first "A" record returned (if any) is parsed instead.

This is a synchronous call.  If you need asynchronous lookups,
use ast_dns_query_set_resolve_async and roll your own.

Change-Id: I194b0b0e73da94b35cc35263a868ffac3a8d0a95
2019-08-22 06:32:54 -06:00
George Joseph
23882ddb3e Merge "res_pjsip: Channel variable SIPFROMDOMAIN" into 16 2019-08-21 18:42:06 -05:00
Dan Cropp
c8cc530726 pjproject: Configurable setting for cnonce to include hyphens or not
NEC SIP Station interface with authenticated registration only supports cnonce
up to 32 characters.  In Linux, PJSIP would generate 36 character cnonce
which included hyphens.  Teluu developed this patch adding a compile time
setting to default to not include the hyphens.  They felt it best to still
generate the UUID and strip the hyphens.
They have indicated it will be part of PJSIP 2.10.

ASTERISK-28509
Reported-by: Dan Cropp

Change-Id: Ibdfcf845d4f8c0a14df09fd983b11f2d72c5f470
2019-08-21 11:34:42 -05:00
Friendly Automation
ad63cb7cef Merge "res_ari.c: Prefer exact handler match over wildcard" into 16 2019-08-21 07:56:12 -05:00
Stas Kobzar
fb984eda40 res_pjsip: Channel variable SIPFROMDOMAIN
In chan_sip, there was variable SIPFROMDOMAIN that allows to set
From header URI domain per channel. This patch introduces res_pjsip
variable SIPFROMDOMAIN for backward compatibility with chan_sip.

ASTERISK-28489

Change-Id: I715133e43172ce2a1e82093538dc39f9e99e5f2e
2019-08-21 07:04:57 -05:00