]> git.ipfire.org Git - thirdparty/asterisk.git/log
thirdparty/asterisk.git
8 years agopjproject_bundled: Fix compilation with MALLOC_DEBUG 04/4704/2
George Joseph [Sun, 8 Jan 2017 16:29:01 +0000 (09:29 -0700)] 
pjproject_bundled:  Fix compilation with MALLOC_DEBUG

When MALLOC_DEBUG was specified, make was failing.  Immediately
remaking would work.  The issues was in the ordering of the make
dependencies.

Change-Id: If6030b54fc693f3179f32bfd20c6b5d5f1b3f7cd

8 years agoMerge "res_rtp_asterisk.c: Initialize ourip passed to ast_find_ourip()." into 13
zuul [Fri, 6 Jan 2017 16:23:52 +0000 (10:23 -0600)] 
Merge "res_rtp_asterisk.c: Initialize ourip passed to ast_find_ourip()." into 13

8 years agoMerge "bridge_native_rtp.c: Minor code cleanups." into 13
zuul [Thu, 5 Jan 2017 19:22:43 +0000 (13:22 -0600)] 
Merge "bridge_native_rtp.c: Minor code cleanups." into 13

8 years agoMerge "res_pjsip_session: Access SIPDOMAIN via Dialplan." into 13
zuul [Thu, 5 Jan 2017 13:43:51 +0000 (07:43 -0600)] 
Merge "res_pjsip_session: Access SIPDOMAIN via Dialplan." into 13

8 years agoMerge "acl.c: Improve ast_ouraddrfor() diagnostic messages." into 13
George Joseph [Thu, 5 Jan 2017 04:06:40 +0000 (22:06 -0600)] 
Merge "acl.c: Improve ast_ouraddrfor() diagnostic messages." into 13

8 years agoMerge "bridge_native_rtp.c: Fix native rtp bridge data race." into 13
George Joseph [Thu, 5 Jan 2017 04:05:31 +0000 (22:05 -0600)] 
Merge "bridge_native_rtp.c: Fix native rtp bridge data race." into 13

8 years agoMerge "chan_pjsip: Use session for retrieving CHANNEL() information." into 13
George Joseph [Wed, 4 Jan 2017 22:25:47 +0000 (16:25 -0600)] 
Merge "chan_pjsip: Use session for retrieving CHANNEL() information." into 13

8 years agores_pjsip_session: Access SIPDOMAIN via Dialplan. 53/4653/2
Alexander Traud [Thu, 22 Dec 2016 15:13:46 +0000 (16:13 +0100)] 
res_pjsip_session: Access SIPDOMAIN via Dialplan.

This feature was available in the SIP channel driver chan_sip. For example,
Asterisk is the outbound proxy and has to handle all SIP-URIs, even domains not
local to Asterisk. In that case, SIPDOMAIN is used in the Dialplan, to detect
and dial remote SIP-URIs. This change here sets the SIP destination domain of
an inbound call (SIPDOMAIN) in the SIP channel driver res_pjsip as well.

ASTERISK-26670 #close

Change-Id: I27c880dc404a3c1c6792e1ba3545475339577243

8 years agopjproject_bundled: Compile pjsua with max log level = 2 91/4691/2
George Joseph [Tue, 3 Jan 2017 21:14:09 +0000 (14:14 -0700)] 
pjproject_bundled:  Compile pjsua with max log level = 2

A while back, we changed config_site.h to set PJ_LOG_MAX_LEVEL = 6.
This allowed us to control the log level better from inside Asterisk.
An unfortunate side effect of this was that the pjsua binary and
python bindings were also compiled with log level set to 6 so whenever
a testsuite test that uses pjsua runs, it spits out 6795 lines of
debug in an instant even before the test starts.  I believe this
overruns the Jenkins capture buffer and prevents the test from
properly terminating.  In turn, this results in the testsuite just
hanging until the job is killed.  It's more frequent on the higher
end agents because they can spit out the messages faster.

Unfortunately, the messages are all spit out before we have control
of the python pj.Lib instance where we can set logging levels so the
only alternative was to actually compile pjsua and _pjsua.so with an
overridden PJ_LOG_MAX_LEVEL.  Although defining a lower max level was
done in the Makefile, the define in config_site.h had to be wrapped
with "#ifndef" so the change would take effect.

Change-Id: I2af9e7d48dde1927279c586c9c725d868fe6f3ff

8 years agochan_pjsip: Use session for retrieving CHANNEL() information. 71/4671/3
Joshua Colp [Thu, 22 Dec 2016 22:00:58 +0000 (22:00 +0000)] 
chan_pjsip: Use session for retrieving CHANNEL() information.

The CHANNEL() dialplan function implementation for PJSIP allows
querying of PJSIP specific information. This used the channel
passed in to get the PJSIP session and associated information.
It is possible for this channel to be masqueraded and end
up as a different channel type by the time the information
request is actually acted upon.

This change retrieves the PJSIP session safely and accesses
data from it (including channel). This provides a guarantee
that the session and channel will not be altered when the
request is being acted upon.

ASTERISK-26673

Change-Id: I335e12b89e1820cafdd92b3e7526b8ba649eb7e6

8 years agores_pjsip_refer: Handle compact Refer-To header. 84/4684/1
George Joseph [Fri, 30 Dec 2016 15:10:09 +0000 (08:10 -0700)] 
res_pjsip_refer:  Handle compact Refer-To header.

refer_incoming_refer_request needed to look for the "r" header as well
as the "Refer-To" header.

ASTERISK-26655 #close
patches:
refer_compact_fix.diff submitted by JoshE (license 6075)

Change-Id: I610410a99b02427ea5db887aeb454d5f12c2259f

8 years agobridge_native_rtp.c: Minor code cleanups. 76/4676/1
Richard Mudgett [Fri, 23 Dec 2016 18:11:02 +0000 (12:11 -0600)] 
bridge_native_rtp.c: Minor code cleanups.

In native_rtp_bridge_compatible_check()

* Made one variable declaration per line.

* Extracted if test assignment to make the test easier to see.

* Made long if tests easier to see the combinatorial logic.

* Added bridge id to a couple debug messages.

Change-Id: I65bc5732aa7c9a2537f062f106fbea711cf2daad

8 years agobridge_native_rtp.c: Fix native rtp bridge data race. 75/4675/1
Richard Mudgett [Fri, 23 Dec 2016 18:10:40 +0000 (12:10 -0600)] 
bridge_native_rtp.c: Fix native rtp bridge data race.

native_rtp_bridge_compatible() didn't lock the bridge channels before
checking the channels for native bridging ability.  As a result, one of
the channel's native format capabilities structure got replaced out from
under the native bridge check.  Use of a stale pointer to freed memory
causes bad things to happen.

MALLOC_DEBUG, DO_CRASH, and the
tests/channels/pjsip/transfers/blind_transfer/caller_direct_media
testsuite test caught this.

* Add missing channel locking in native_rtp_bridge_compatible().

Change-Id: If25fdb3ac8e85563c4857fb8216b3d9dc3d0fa53

8 years agores_rtp_asterisk.c: Initialize ourip passed to ast_find_ourip(). 56/4656/1
Richard Mudgett [Wed, 21 Dec 2016 23:55:48 +0000 (17:55 -0600)] 
res_rtp_asterisk.c: Initialize ourip passed to ast_find_ourip().

We access uninitialized memory when the 'ourip' parameter does not
have an initial guess to our IP address.

ASTERISK-26672

Change-Id: I35507ea1ad7455d2be188f6ccdd4add7bd150e15

8 years agoacl.c: Improve ast_ouraddrfor() diagnostic messages. 55/4655/1
Richard Mudgett [Wed, 21 Dec 2016 22:25:00 +0000 (16:25 -0600)] 
acl.c: Improve ast_ouraddrfor() diagnostic messages.

* Made not generate strings unless they will actually be used.

ASTERISK-26672

Change-Id: I155fbe7fdff5ce47dfe5326f3baf5446849702c3

8 years agores_rtp_asterisk.c: Fix off nominal memory leak. 45/4645/1
Richard Mudgett [Wed, 7 Dec 2016 21:23:02 +0000 (15:23 -0600)] 
res_rtp_asterisk.c: Fix off nominal memory leak.

Change-Id: I95b1088d11244a2edae6607c12fbf33b38658a75

8 years agoMerge "pjproject_bundled: Make build single threaded" into 13
Joshua Colp [Tue, 20 Dec 2016 11:31:15 +0000 (05:31 -0600)] 
Merge "pjproject_bundled:  Make build single threaded" into 13

8 years agoMerge "res_pjsip: Add/update ERROR msg if invalid URI." into 13
Joshua Colp [Tue, 20 Dec 2016 11:30:37 +0000 (05:30 -0600)] 
Merge "res_pjsip: Add/update ERROR msg if invalid URI." into 13

8 years agoMerge "autosupport: Add 'pjproject show buildopts'" into 13
George Joseph [Tue, 20 Dec 2016 04:21:19 +0000 (22:21 -0600)] 
Merge "autosupport: Add 'pjproject show buildopts'" into 13

8 years agoMerge "MESSAGE: Flush Message/ast_msg_queue channel alert pipe." into 13
George Joseph [Tue, 20 Dec 2016 04:18:28 +0000 (22:18 -0600)] 
Merge "MESSAGE: Flush Message/ast_msg_queue channel alert pipe." into 13

8 years agoMerge "chan_dahdi.c: Fix bounds check regression." into 13
Joshua Colp [Tue, 20 Dec 2016 00:27:48 +0000 (18:27 -0600)] 
Merge "chan_dahdi.c: Fix bounds check regression." into 13

8 years agoMerge "chan_sip: Reorder unload_module to deal with stuck TCP threads." into 13
Joshua Colp [Mon, 19 Dec 2016 22:19:11 +0000 (16:19 -0600)] 
Merge "chan_sip: Reorder unload_module to deal with stuck TCP threads." into 13

8 years agoMerge "app_queue: Ensure member is removed from pending when hanging up." into 13
zuul [Mon, 19 Dec 2016 18:41:08 +0000 (12:41 -0600)] 
Merge "app_queue: Ensure member is removed from pending when hanging up." into 13

8 years agoapp_queue: Ensure member is removed from pending when hanging up. 11/4611/2
Martin Tomec [Fri, 9 Dec 2016 18:23:37 +0000 (19:23 +0100)] 
app_queue: Ensure member is removed from pending when hanging up.

In some cases member is added to pending_members, and the channel
is hung up before any extension state change. So the member would
stay in pending_members forever. So when we call do_hang, we
should also remove member from pending.

ASTERISK-26621 #close

Change-Id: Iae476b5c06481db18ebe0fa594b3e80fdc9a7d54

8 years agopjproject_bundled: Make build single threaded 42/4642/1
George Joseph [Sun, 18 Dec 2016 21:23:17 +0000 (14:23 -0700)] 
pjproject_bundled:  Make build single threaded

There were just too many issues in various environments with
multi threaded building of pjproject.  It doesn't really speed
things up anyway since asterisk is already being compiled in
parallel.

Change-Id: Ie5648fb91bb89b4224b6bf43a0daa1af793c4ce1

8 years agochan_sip: Reorder unload_module to deal with stuck TCP threads. 40/4640/2
Corey Farrell [Fri, 9 Dec 2016 02:00:02 +0000 (21:00 -0500)] 
chan_sip: Reorder unload_module to deal with stuck TCP threads.

In some situations TCP threads may become frozen.  This creates the
possibility that Asterisk could segfault if they become unfrozen after
chan_sip has been dlclose'd.  This reorders the unload_module process to
allow abort if threads do not exit within 5 seconds.

High level order as follows:
1) Unregister from the core to stop new requests.
2) Signal threads to stop
3) Clear config based tables (but do not free the table itself).
4) Verify that threads have shutdown, cancel unload if not.
5) Clean all remaining resources.

ASTERISK-26586

Change-Id: Ie23692041d838fbd35ece61868f4c640960ff882

8 years agoconfigure: fix with-pjproject-bundled 39/4639/1
David M. Lee [Fri, 16 Dec 2016 07:32:57 +0000 (01:32 -0600)] 
configure: fix with-pjproject-bundled

The AC_ARG_WITH macro's shell variable is withval; not enableval. Purely
coincidentally, the option would work when --enable-dev-mode is given.

Also fixed a portability problem with bootstrap.sh, since -printf is not
a portable option for find.

Change-Id: I0f0e5b1a934b5af5737713834361e9c95b96b376

8 years agoautosupport: Add 'pjproject show buildopts' 34/4634/1
Richard Mudgett [Thu, 15 Dec 2016 19:25:50 +0000 (13:25 -0600)] 
autosupport: Add 'pjproject show buildopts'

Change-Id: I8aa55a7c3fb175235ddc7f85e9457d5102d06fa7

8 years agochan_dahdi.c: Fix bounds check regression. 29/4629/1
Richard Mudgett [Wed, 14 Dec 2016 20:21:47 +0000 (14:21 -0600)] 
chan_dahdi.c: Fix bounds check regression.

Caused by ASTERISK-25494

Change-Id: I1fc408c1a083745ff59da5c4113041bbfce54bcb

8 years agores_pjsip: Add/update ERROR msg if invalid URI. 22/4622/1
Richard Mudgett [Tue, 13 Dec 2016 20:34:54 +0000 (14:34 -0600)] 
res_pjsip: Add/update ERROR msg if invalid URI.

ASTERISK-24499

Change-Id: Ie305153e47e922233b2ff24715e0e326e5fa3a6c

8 years agoMESSAGE: Flush Message/ast_msg_queue channel alert pipe. 21/4621/1
Richard Mudgett [Tue, 13 Dec 2016 00:38:42 +0000 (18:38 -0600)] 
MESSAGE: Flush Message/ast_msg_queue channel alert pipe.

ASTERISK-25083

Change-Id: Id54baa57a8dbca84e29f28bcd2ffc0a5ac12d8b2

8 years agores_sorcery_memory_cache: Change an error to a debug message 16/4616/3
George Joseph [Tue, 13 Dec 2016 20:06:34 +0000 (13:06 -0700)] 
res_sorcery_memory_cache:  Change an error to a debug message

When a sorcery user calls ast_sorcery_delete on an object that
may have already expired from the cache, res_sorcery_memory_cache
spits out an ERROR.  Since this can happen frequently and validly when
an inbound registration expires after the cache entry expired, the
errors are unnecessary and misleading.  Changed to a debug/1.

Change-Id: Idf3a67038c16e3da814cf612ff4d6d18ad29ecd7

8 years agopjproject_bundled: Retry download if previously saved tarball is bad 08/4608/1
George Joseph [Fri, 9 Dec 2016 14:14:09 +0000 (07:14 -0700)] 
pjproject_bundled:  Retry download if previously saved tarball is bad

If a tarball is corrupted during download, the makefile will attempt to
download it again. If the tarball somehow gets corrupted after it's
downloaded however, the makefile was just failing.  We now
retry the download.

ASTERISK-26653 #close

Change-Id: I1b24d454852d80186f60c5a65dc4624ea8a1c359

8 years agoMerge "Fix typo in chan_sip" into 13
Joshua Colp [Fri, 9 Dec 2016 11:33:16 +0000 (05:33 -0600)] 
Merge "Fix typo in chan_sip" into 13

8 years agoMerge "chan_sip: Delete unneeded check" into 13
Joshua Colp [Fri, 9 Dec 2016 11:32:09 +0000 (05:32 -0600)] 
Merge "chan_sip: Delete unneeded check" into 13

8 years agoMerge "Small code cleanup in chan_sip" into 13
zuul [Fri, 9 Dec 2016 09:25:12 +0000 (03:25 -0600)] 
Merge "Small code cleanup in chan_sip" into 13

8 years agoMerge "res_pjsip: Fix 'A = B != C' kind." into 13
zuul [Fri, 9 Dec 2016 03:54:37 +0000 (21:54 -0600)] 
Merge "res_pjsip: Fix 'A = B != C' kind." into 13

8 years agoMerge "res_pjsip_registrar: AMI Add RegistrationInboundContactStatuses command" into 13
Joshua Colp [Fri, 9 Dec 2016 00:42:06 +0000 (18:42 -0600)] 
Merge "res_pjsip_registrar: AMI Add RegistrationInboundContactStatuses command" into 13

8 years agochan_sip: Delete unneeded check 07/4607/1
Badalyan Vyacheslav [Thu, 8 Dec 2016 18:54:06 +0000 (18:54 +0000)] 
chan_sip: Delete unneeded check

P is always true. We check it before

Change-Id: Iee61cda002a9f61aee26b9f66c5f9b59e3389efb

8 years agoSmall code cleanup in chan_sip 05/4605/1
Badalyan Vyacheslav [Thu, 8 Dec 2016 18:58:19 +0000 (18:58 +0000)] 
Small code cleanup in chan_sip

The conditional expressions of the 'if' operators situated
alongside each other are identical.

Change-Id: I2cf7c317b106ec14440c7f1b5dcfbf03639f748a

8 years agoFix typo in chan_sip 03/4603/1
Badalyan Vyacheslav [Thu, 8 Dec 2016 18:43:23 +0000 (18:43 +0000)] 
Fix typo in chan_sip

The conditional expressions of the 'if' operators
situated alongside each other are identical.

Change-Id: I652b6dcddb3be007e669a6aa8107edb31a1ddafb

8 years agores_pjsip: Fix 'A = B != C' kind. 93/4593/2
Badalyan Vyacheslav [Thu, 8 Dec 2016 18:30:38 +0000 (18:30 +0000)] 
res_pjsip: Fix 'A = B != C' kind.

Consider reviewing the expression of the 'A = B != C' kind.
The expression is calculated as following: 'A = (B != C)'

Change-Id: Ibaa637dfda47d51a20e26069d3103e05ce80003d

8 years agoMerge "res_format_attr_opus: Fix crash when fmtp contains spaces." into 13
Kevin Harwell [Thu, 8 Dec 2016 17:07:12 +0000 (11:07 -0600)] 
Merge "res_format_attr_opus: Fix crash when fmtp contains spaces." into 13

8 years agochan_sip: Do not allow non-SP/HTAB between header key and colon. 83/4583/1
Walter Doekes [Wed, 30 Nov 2016 15:31:39 +0000 (16:31 +0100)] 
chan_sip: Do not allow non-SP/HTAB between header key and colon.

RFC says SIP headers look like:

    HCOLON  =  *( SP / HTAB ) ":" SWS
    SWS     =  [LWS]                    ; sep whitespace
    LWS     =  [*WSP CRLF] 1*WSP        ; linear whitespace
    WSP     =  SP / HTAB                ; from rfc2234

chan_sip implemented this:

    HCOLON  =  *( LOWCTL / SP ) ":" SWS
    LOWCTL  = %x00-1F                   ; CTL without DEL

This discrepancy meant that SIP proxies in front of Asterisk with
chan_sip could pass on unknown headers with \x00-\x1F in them, which
would be treated by Asterisk as a different (known) header.  For
example, the "To\x01:" header would gladly be forwarded by some proxies
as irrelevant, but chan_sip would treat it as the relevant "To:" header.

Those relying on a SIP proxy to scrub certain headers could mistakenly
get unexpected and unvalidated data fed to Asterisk.

This change fixes so chan_sip only considers SP/HTAB as valid tokens
before the colon, making it agree on the headers with other speakers of
SIP.

ASTERISK-26433 #close
AST-2016-009

Change-Id: I78086fbc524ac733b8f7f78cb423c91075fd489b

8 years agores_format_attr_opus: Fix crash when fmtp contains spaces. 78/4578/1
Joshua Colp [Tue, 15 Nov 2016 00:18:21 +0000 (00:18 +0000)] 
res_format_attr_opus: Fix crash when fmtp contains spaces.

When an opus offer or answer was received that contained an
fmtp line with spaces between the attributes the module would
fail to properly parse it and crash due to recursion.

This change makes the module handle the space properly and
also removes the recursion requirement.

ASTERISK-26579

Change-Id: I01f53e5d9fa9f1925a7365f8d25071b5b3ac2dc3

8 years agores_pjsip_registrar: AMI Add RegistrationInboundContactStatuses command 69/4569/3
George Joseph [Tue, 6 Dec 2016 20:54:25 +0000 (13:54 -0700)] 
res_pjsip_registrar: AMI Add RegistrationInboundContactStatuses command

The PJSIPShowRegistrationsInbound AMI command was just dumping out
all AORs which was pretty useless and resource heavy since it had
to get all endpoints, then all aors for each endpoint, then all
contacts for each aor.

PJSIPShowRegistrationInboundContactStatuses sends ContactStatusDetail
events which meets the intended purpose of the other command and has
significantly less overhead.  Also, some additional fields that were
added to Contact since the original creation of the ContactStatusDetail
event have been added to the end of the event.

For compatibility purposes, PJSIPShowRegistrationsInbound is left
intact.

ASTERISK-26644 #close

Change-Id: I326f12c9ecb52bf37ba03f0748749de4da01490a

8 years agoMerge "Bundled pjproject: Fix finding SIP transactions." into 13
Joshua Colp [Wed, 7 Dec 2016 19:38:10 +0000 (13:38 -0600)] 
Merge "Bundled pjproject:  Fix finding SIP transactions." into 13

8 years agoBundled pjproject: Fix finding SIP transactions. 65/4565/2
Richard Mudgett [Tue, 6 Dec 2016 22:45:38 +0000 (16:45 -0600)] 
Bundled pjproject:  Fix finding SIP transactions.

Occasionally SIP message transactions are not found when they should be.
In the particular case an incoming INVITE transaction is CANCELed but the
INVITE transaction cannot be found so a 481 response is returned for the
CANCEL.  The problematic calls have a '_' character in the Via branch
parameter.

The problem is in the pjproject PJ_HASH_USE_OWN_TOLOWER feature's code.
The problem with the "own tolower" code is that it does not calculate the
same hash value as when the pj_tolower() function is used.  The "own
tolower" code will erroneously modify the ASCII characters '@', '[', '\\',
']', '^', and '_'.  Calls to pj_hash_calc_tolower() can use the
PJ_HASH_USE_OWN_TOLOWER substitute algorithm when enabled.  Calls to
pj_hash_get_lower(), pj_hash_set_lower(), and pj_hash_set_np_lower() call
find_entry() which never uses the PJ_HASH_USE_OWN_TOLOWER algorithm.  As a
result you may not be able to find a hash tabled entry because the
calculated hash values would differ.

* Simply disable PJ_HASH_USE_OWN_TOLOWER.

ASTERISK-26490 #close

Change-Id: If89bfdb5f301b8b685881a9a2a6e0c3c5af32253

8 years agopjproject_bundled: Fix missing inclusion of symbols 57/4557/1
George Joseph [Tue, 6 Dec 2016 18:06:45 +0000 (11:06 -0700)] 
pjproject_bundled:  Fix missing inclusion of symbols

Added back in a -g3, and an -O3 when DONT_OPTIMIZE is not set, to
the CFLAGS.  Not sure how they went missing.

Also fixed an uninstall problem where we weren't removing the
symlink from libasteriskpj.so.2 to libasteriskpj.so.  While I was
there, I fixed it for libasteriskssl as well.

Change-Id: I9e00873b1e9082d05b5549d974534b48a2142556

8 years agoMerge "res_pjsip_outbound_registration.c: Filter redundant statsd reporting." into 13
Joshua Colp [Tue, 6 Dec 2016 11:34:38 +0000 (05:34 -0600)] 
Merge "res_pjsip_outbound_registration.c: Filter redundant statsd reporting." into 13

8 years agoMerge "Remove files that got merged in error somehow to the 13 branch." into 13
Joshua Colp [Mon, 5 Dec 2016 17:43:21 +0000 (11:43 -0600)] 
Merge "Remove files that got merged in error somehow to the 13 branch." into 13

8 years agoRemove files that got merged in error somehow to the 13 branch. 52/4552/1
Richard Mudgett [Fri, 2 Dec 2016 18:04:31 +0000 (12:04 -0600)] 
Remove files that got merged in error somehow to the 13 branch.

Change-Id: Id79e2226c31084f9252d5aede9050d3cf13322c8

8 years agores_pjsip_outbound_registration.c: Filter redundant statsd reporting. 41/4541/2
Richard Mudgett [Thu, 1 Dec 2016 00:25:11 +0000 (18:25 -0600)] 
res_pjsip_outbound_registration.c: Filter redundant statsd reporting.

Increasing the testsuite shutdown timeout before forcibly killing
Asterisk allowed more events to be sent out.  Some tests failed as
a result.  The tests/channels/pjsip/statsd/registrations failed
because we now get the statsd events that a comment in the test
configuration stated couldn't be intercepted.  Unfortunately, we
get a variable number of events because of internal status state
transition races generating redundant statsd events.

We were reporting redundant statsd PJSIP.registrations.state changes
for internal state changes that equated to the same thing publicly.

* Made update_client_state_status() filter out redundant statsd
updates.

ASTERISK-26527

Change-Id: If851c7d514bb530d9226e4941ba97dcf52000646

8 years agoMerge "res_pjsip/chan_sip: Advertise 'ws' in the SIP URI transport parameter" into 13
Joshua Colp [Fri, 2 Dec 2016 17:30:09 +0000 (11:30 -0600)] 
Merge "res_pjsip/chan_sip: Advertise 'ws' in the SIP URI transport parameter" into 13

8 years agoMerge "tcptls: Use new certificate upon sip reload" into 13
Joshua Colp [Fri, 2 Dec 2016 13:56:51 +0000 (07:56 -0600)] 
Merge "tcptls: Use new certificate upon sip reload" into 13

8 years agoMerge "PJPROJECT logging: Made easier to get available logging levels." into 13
Joshua Colp [Fri, 2 Dec 2016 11:38:05 +0000 (05:38 -0600)] 
Merge "PJPROJECT logging: Made easier to get available logging levels." into 13

8 years agoMerge "res_rtp: Fix regression when IPv6 is not available." into 13
Joshua Colp [Thu, 1 Dec 2016 21:51:06 +0000 (15:51 -0600)] 
Merge "res_rtp: Fix regression when IPv6 is not available." into 13

8 years agoMerge "res_calendar_caldav: Add support reading gmail calendar" into 13
Joshua Colp [Thu, 1 Dec 2016 21:28:09 +0000 (15:28 -0600)] 
Merge "res_calendar_caldav: Add support reading gmail calendar" into 13

8 years agoMerge "Frame deferral: Re-queue deferred frames one-at-a-time." into 13
Joshua Colp [Thu, 1 Dec 2016 16:38:34 +0000 (10:38 -0600)] 
Merge "Frame deferral: Re-queue deferred frames one-at-a-time." into 13

8 years agoMerge "OpenSSL 1.1.0 support" into 13
Joshua Colp [Thu, 1 Dec 2016 11:08:52 +0000 (05:08 -0600)] 
Merge "OpenSSL 1.1.0 support" into 13

8 years agores_rtp: Fix regression when IPv6 is not available. 40/4540/1
Guido Falsi [Tue, 22 Nov 2016 17:20:06 +0000 (18:20 +0100)] 
res_rtp: Fix regression when IPv6 is not available.

The latest Release candidate fails to create RTP streams when IPv6
is not available. Due to the changes made in September the ast_sockaddr
structure passed around to create these streams is always of AF_INET6
type, causing failure when used for IPv4. This patch adds a utility
function to check for availability of IPv6 and applies such check
at startup to determine how to create the ast_sockaddr structures.

ASTERISK-26617 #close

Change-Id: I627a4e91795e821111e1cda523f083a40d0e0c3e

8 years agores_calendar_caldav: Add support reading gmail calendar 34/4534/1
Eduardo S. Libardi [Tue, 29 Nov 2016 01:43:53 +0000 (23:43 -0200)] 
res_calendar_caldav: Add support reading gmail calendar

The response from gmail calendar includes the string name
"caldav:calendar-data". res_calendar_caldav implements
the example included in RFC 4791: string "C:calendar-data".
When reading the calendar, res_calendar_caldav compare the
string and if does not match just discards the event.
This commit compares the response to both strings,
successfully loading gmail calendar events.
Writing to gmail calendar is working prior to this fix.

ASTERISK-26624
Reported by: Eduardo S. Libardi

Change-Id: Ia1eef10552ae616efb645d390f5ffe81260d7d4a

8 years agoPJPROJECT logging: Made easier to get available logging levels. 15/4515/4
Richard Mudgett [Thu, 24 Nov 2016 00:27:54 +0000 (18:27 -0600)] 
PJPROJECT logging: Made easier to get available logging levels.

Use of the new logging is as simple as issuing the new CLI command or
setting the new pjproject.conf option.

Other options that can affect the logging are how you have the pjproject
log levels mapped to Asterisk log types in pjproject.conf and if you have
configured Asterisk to log the DEBUG type messages.  Altering the
pjproject.conf level mapping shouldn't be necessary for most installations
as the default mapping is sensible.  Configuring Asterisk to log the DEBUG
message type is standard practice for collecting debug information.

* Added CLI "pjproject set log level" command to dynamically adjust the
maximum pjproject log message level.

* Added CLI "pjproject show log level" command to see the currently set
maximum pjproject log message level.

* Added pjproject.conf startup section "log_level" option to set the
initial maximum pjproject log message level so all messages could be
captured from initialization.

* Set PJ_LOG_MAX_LEVEL to 6 to compile in all defined logging levels into
bundled pjproject.  Pjproject will use the currently set run time log
level to determine if a log message is generated just like Asterisk
verbose and debug logging levels.

* In log_forwarder(), made always log enabled and mapped pjproject log
messages.  DEBUG mapped log messages are no longer gated by the current
Asterisk debug logging level.

* Removed RAII_VAR() from res_pjproject.c:get_log_level().

ASTERISK-26630 #close

Change-Id: I6dca12979f482ffb0450aaf58db0fe0f6d2e5389

8 years agoFrame deferral: Re-queue deferred frames one-at-a-time. 30/4530/1
Mark Michelson [Wed, 30 Nov 2016 16:48:39 +0000 (10:48 -0600)] 
Frame deferral: Re-queue deferred frames one-at-a-time.

The recent change that made frame deferral into an API had a behavior
change to it. When frame deferral was completed, we would take all of
the deferred frames and queue them all onto the channel in one call to
ast_queue_frame_head(). Before frame deferral was API-ized, places that
performed manual frame deferral would actually take each deferred frame
and queue them onto the channel.

This change in behavior caused the confbridge_recording test to start
failing consistently. Without going too crazily deep into the details,
a channel was getting "stuck" in an ast_safe_sleep(). An AMI redirect
was attempting to break it out of the sleep, but because there were more
frames in the channel read queue than expected, the channel ended up
being unable to break from its sleep loop.

By restoring the behavior of individual frame queuing after deferral,
the test starts passing again.

Note, this points to a potential underlying issue pointing to an
"unbalance" that can occur when queuing multiple frames at once,
and so a follow-up issue is being created to investigate that
possibility.

Change-Id: Ied5dacacda06d343dea751ed5814a03364fe5a7d

8 years agoMerge "chan_pjsip: fix switching sending codec when asymmetric_rtp_codec=no" into 13
zuul [Wed, 30 Nov 2016 16:48:13 +0000 (10:48 -0600)] 
Merge "chan_pjsip: fix switching sending codec when asymmetric_rtp_codec=no" into 13

8 years agoMerge "chan_sip: Fix segfault during module unload" into 13
zuul [Wed, 30 Nov 2016 13:56:43 +0000 (07:56 -0600)] 
Merge "chan_sip: Fix segfault during module unload" into 13

8 years agoOpenSSL 1.1.0 support 25/4525/1
Tzafrir Cohen [Tue, 28 Jun 2016 21:26:59 +0000 (23:26 +0200)] 
OpenSSL 1.1.0 support

OpenSSL 1.1.0 includes some major changes in the interface. See
https://wiki.openssl.org/index.php/1.1_API_Changes .

Status: Right now there are still a few deprecation notes with OpenSSL
1.1.0. But it's a start.

Changes:
* CRYPTO_LOCK is no longer available. Replace it with its value for now.
  I don't completely understand what it is used for there.
* Remove several functions from libasteriskssl that seem to no longer be
  needed.
* Structures have become opaque and are accesses with accessors.
* ERR_remove_thread_state() no longer needed.
* SSLv2 code now could no longer be used in 1.1.

ASTERISK-26109 #close

Change-Id: I5e29d477d486ca29b6aae0dc2f5dff960c1cb82b

8 years agores/res_pjsip: Fix documentation whitespace issues 12/4512/1
Matt Jordan [Mon, 28 Nov 2016 21:12:08 +0000 (15:12 -0600)] 
res/res_pjsip: Fix documentation whitespace issues

Tabs > Spaces.

Change-Id: If1e43a71822615a898e958e0f8b2e882606f0bd0

8 years agoMerge "build_tools: Fix download_externals to handle certified branches" into 13
Mark Michelson [Mon, 28 Nov 2016 20:44:28 +0000 (14:44 -0600)] 
Merge "build_tools:  Fix download_externals to handle certified branches" into 13

8 years agoMerge "autoconf: more variants for OSARCH linux-gnu" into 13
zuul [Mon, 28 Nov 2016 20:38:55 +0000 (14:38 -0600)] 
Merge "autoconf: more variants for OSARCH linux-gnu" into 13

8 years agores_pjsip/chan_sip: Advertise 'ws' in the SIP URI transport parameter 09/4509/1
Matt Jordan [Tue, 22 Nov 2016 16:27:46 +0000 (10:27 -0600)] 
res_pjsip/chan_sip: Advertise 'ws' in the SIP URI transport parameter

Per RFC 7118 5.2, the SIP URI 'transport' parameter should advertise
'ws' when WebSockets are to be used as the transport. This applies to
both secure and insecure WebSockets.

There were two bugs in Asterisk with respect to this:

(1) The most egregious occurs in res_pjsip. There, we advertise 'ws' for
    insecure websockets and 'wss' for secure websockets. While this
    would seem to make sense - since 'WS' and 'WSS' are used for the Via
    Transport parameter - this is not the case for the SIP URI. This
    patch corrects that by registering the secure websockets with
    pjproject using the shorthand 'WS', and by returning 'ws' when asked
    for the transport parameter. Note that in pjproject, it is perfectly
    valid to have multiple transports use the same shorthand.

(2) In chan_sip, we return an upper-case version of the transport 'WS'
    instead of 'ws'. Since we should be strict in what we send and
    liberal in what we accept (within reason), this patch lower-cases
    the transport before appending it to the parameter.

ASTERISK-24330 #close
Reported by: cervajs, Inaki Baz Castillo

Change-Id: Iff77b645f8cc3b7cd35168a6676c26b147f22f42

8 years agobuild_tools: Fix download_externals to handle certified branches 05/4505/1
George Joseph [Mon, 28 Nov 2016 17:03:23 +0000 (10:03 -0700)] 
build_tools:  Fix download_externals to handle certified branches

download_externals wasn't handling the "certified/13.x" version
correctly.

Change-Id: I124d195bb117ca36fd7bf1150c630f3b474a9d9a

8 years agoautoconf: more variants for OSARCH linux-gnu 00/4500/1
Tzafrir Cohen [Wed, 2 Nov 2016 10:05:18 +0000 (12:05 +0200)] 
autoconf: more variants for OSARCH linux-gnu

There are quite a few odd GNU/Linux platforms. Just call all of them
linux-gnu.

Specifically this fixes building the Debian platforms mips64el and x32.
And maybe also others.

ASTERISK-26546 #close

Change-Id: I06ec4bd7f0ee1c84b6b24d81538223b07c4174b1

8 years agocodec_dahdi: Fix poll.h include. 98/4498/1
Timo Teräs [Thu, 17 Nov 2016 14:25:41 +0000 (16:25 +0200)] 
codec_dahdi: Fix poll.h include.

POSIX defines poll.h. sys/poll.h should not be used as it is c-library
internal header which may or may not exist. Notably in musl including
sys/poll.h generates warning of being incorrect.

Change-Id: Ib318c1c7142a737bcf3caa4d8d72560bebe39252

8 years agochan_sip: Fix segfault during module unload 94/4494/1
Michael Kuron [Sat, 26 Nov 2016 16:57:03 +0000 (17:57 +0100)] 
chan_sip: Fix segfault during module unload

If a TCP/TLS connection was pending (not accepted and not timed out) during
unload of chan_sip, Asterisk would segfault when trying to send a signal to
a thread whose thread ID hadn't been recorded yet. This commit fixes that by
recording the thread ID before calling the blocking connect() syscall.
This was a regression introduced by 776a14386a55b5425c7e9617eff8af8b45427144.

The above wasn't enough to fix the segfault, which was now delayed to the
point where connect() timed out. Therefore, it was necessary to also remove
the SA_RESTART flag from the SIGURG sigaction so that pthread_kill() could be
used to interruput the connect() syscall.
This was a regression introduced by 5d313f51b982a18f7321adcf7c7a4e822d8b2714.

ASTERISK-26586 #close

Change-Id: I76fd9d47d56e4264e2629bce8ec15fecba673e7b

8 years agoMerge "addons/chan_mobile: do not use strerror_r" into 13
zuul [Wed, 23 Nov 2016 22:44:01 +0000 (16:44 -0600)] 
Merge "addons/chan_mobile: do not use strerror_r" into 13

8 years agores_rtp_asterisk: RTT miscalculation in RTCP 97/4397/2
gestoip2 [Fri, 11 Nov 2016 14:16:50 +0000 (14:16 +0000)] 
res_rtp_asterisk: RTT miscalculation in RTCP

When retrieving RTCP stats for PJSIP channels, RTT values are unreliable.
RTT calculation is correct, but the data representation isn't.  RTT is
represented by a 32-bit fixed-point number with the integer part in the
first 16 bits and the fractional part in the last 16 bits.  In order to
get the RTT value, the fractional part is miscalculated, there is an
unnecessary 16 bit shift that causes overflow.  Besides this there is
another mistake, when transforming the integer value to the fixed point
fractional part via bitwise operation, that loses precision.

* RTT fractional part is no longer shifted, avoiding overflow.

* RTT fractional part is transformed to its fixed-point value more
precisely.

* Fixed timeval2ntp() and ntp2timeval() second fraction conversions.

* Fixed NTP timestamp report logging.  The usec was inexplicably
multiplied by 4096.

ASTERISK-26566 #close
Reported by Hector Royo Concepcion

Change-Id: Ie09bdabfee75afb3f1b8ddfd963e5219ada3b96f

8 years agotcptls: Use new certificate upon sip reload 48/4448/8
Michael Kuron [Tue, 15 Nov 2016 19:44:13 +0000 (20:44 +0100)] 
tcptls: Use new certificate upon sip reload

Previously, a TLS server socket would only be restarted upon sip reload if the
bind address had changed. This commit adds checking for changes to TLS
parameters like certificate, ciphers, etc. so they get picked up without
requiring a reload of the entire chan_sip module. This does not affect open
connections in any way, but new connections will use the new TLS parameters.
The changes also apply to HTTP and Manager.

ASTERISK-26604 #close

Change-Id: I169e86cefc6dcd627c915134015a6a1ab1aadbe6

8 years agoaddons/chan_mobile: do not use strerror_r 86/4486/1
Timo Teräs [Fri, 11 Nov 2016 06:29:40 +0000 (08:29 +0200)] 
addons/chan_mobile: do not use strerror_r

The two reasons why it might be used are that some systems do not
implement strerror in thread safe manner, and that strerror_r returns
the error code in the string in case there's no error message.

However, all of asterisk elsewhere uses strerror() and assumes it
to be thread safe. And in chan_mobile the errno is also explicitly
printed so neither of the above reasons are valid.

The reasoning to remove usage is that there are actually two versions
of strerror_r: XSI and GNU. They are incompatible in their return
value, and there's no easy way to figure out which one is being
used. glibc gives you the GNU version if _GNU_SOURCE is defined,
but the same feature test macro is needed for other symbols. On
all other systems you assumedly get XSI symbol, and compilation warnings
as well as non-working error printing.

Thus the easiest solution is to just remove strerror_r and use
strerror as rest of the code. Alternative is to introduce ast_strerror
in separate translation unit so it can request the XSI symbol in
glibc case, and replace all usage of strerror.

Change-Id: I84d35225b5642d85d48bc35fdf399afbae28a91d

8 years agobuild: Backport addition of librt check to configure.ac 81/4481/1
George Joseph [Mon, 21 Nov 2016 15:40:59 +0000 (08:40 -0700)] 
build:  Backport addition of librt check to configure.ac

A while back, a master-only change was made to check for librt which
should probably have been cherry-picked to 13 at that time.  Sometime
between then and now, part of that change did make it into 13 but it
was incomplete and non-functional.  This patch backports the rest
of the librt check and allows the link of libasteriskpj to use the
results.

Change-Id: I1424008fd8c90f389dda53162ec4a340b253a3c1

8 years agoMerge "pjproject_bundled: Improve reliability of pjproject download" into 13
Joshua Colp [Mon, 21 Nov 2016 12:23:58 +0000 (06:23 -0600)] 
Merge "pjproject_bundled:  Improve reliability of pjproject download" into 13

8 years agoMerge "main/app.c: Transmit Silence on ControlPlayback pause" into 13
Joshua Colp [Mon, 21 Nov 2016 10:46:42 +0000 (04:46 -0600)] 
Merge "main/app.c: Transmit Silence on ControlPlayback pause" into 13

8 years agoMerge "build: Various OpenBSD issues" into 13
Joshua Colp [Fri, 18 Nov 2016 18:37:59 +0000 (12:37 -0600)] 
Merge "build:  Various OpenBSD issues" into 13

8 years agoMerge "Bump ARI version to 1.10.0" into 13
Joshua Colp [Fri, 18 Nov 2016 18:35:45 +0000 (12:35 -0600)] 
Merge "Bump ARI version to 1.10.0" into 13

8 years agoBump ARI version to 1.10.0 74/4474/3
Mark Michelson [Fri, 18 Nov 2016 15:45:27 +0000 (09:45 -0600)] 
Bump ARI version to 1.10.0

The video-related bridge changes mean that the version needs to be
bumped.

Change-Id: I41c4495068562bef03aa76728f188b8ac4bd393d

8 years agopjproject_bundled: Improve reliability of pjproject download 57/4457/2
George Joseph [Wed, 16 Nov 2016 18:05:43 +0000 (11:05 -0700)] 
pjproject_bundled:  Improve reliability of pjproject download

The download process now has a timeout which will cause wget to retry
if it stops retrieving data for 5 seconds and fetch and curl to timeout
if the whole retrieval take smore than 30 seconds.

If the tarball retrieval works, the MD5SUM file is retrieved from
the downloads site and the md5 checksum is verified.

If either the tarball retrieval or MD5SUM retrieval fails, or the
checksums don't match, the entire process is retried once.  If it
fails again, any incomplete tarball is deleted.

.DELETE_ON_ERROR: was also added to the Makefile.  Not only does
this delete the tarball on failure, it till also delete corrupted
library files from the pjproject source directory should they
fail to build correctly.

Tested all the way back to FreeBSD 9, CentOS 6, Debian 6 and
Ubuntu 14.

Change-Id: Iea7d33b96a31622ab1b6e54baebaf271959514e1

8 years agomain/app.c: Transmit Silence on ControlPlayback pause 96/4396/5
misha [Fri, 11 Nov 2016 13:13:30 +0000 (14:13 +0100)] 
main/app.c: Transmit Silence on ControlPlayback pause

ASTERISK-26562 #close

Change-Id: Ie6cb0ffc2b8c775639ce7784fe96f4ea00cfa2f8

8 years agomanager: update minor version 67/4467/1
Mark Michelson [Thu, 17 Nov 2016 16:50:58 +0000 (10:50 -0600)] 
manager: update minor version

Based on bridge video AMI event changes, bump the minor version of AMI.

Change-Id: I02586bd6cafc0baa33ea98c2f75356c0f5e03435

8 years agoMerge "res_pjsip_outbound_authenticator_digest.c: Fix memory pool leak." into 13
zuul [Thu, 17 Nov 2016 05:20:10 +0000 (23:20 -0600)] 
Merge "res_pjsip_outbound_authenticator_digest.c: Fix memory pool leak." into 13

8 years agoMerge "res_format_attr_opus: Fix fmtp generation." into 13
George Joseph [Thu, 17 Nov 2016 04:41:00 +0000 (22:41 -0600)] 
Merge "res_format_attr_opus: Fix fmtp generation." into 13

8 years agobuild: Various OpenBSD issues 65/4465/1
George Joseph [Thu, 17 Nov 2016 02:24:08 +0000 (19:24 -0700)] 
build:  Various OpenBSD issues

OpenBSD's 'find' doesn't take the -delete argument so you have to pipe
through 'xargs rm -rf'.

'echo -e' doesn't like \t starting a line. It just prints 't' which
causes the libasteriskpj.exports file to be garbage.  They were just
cosmetic so they were removed.

librt doesn't exist so the link of libasteriskpj.so fails. It's not
actually needed for linux anyway so -lrt was removed from the link.

res_rtp_asterisk was failing to load because of an undefined
DTLS_method. '|| defined(LIBRESSL_VERSION_NUMBER)' was added to the #if
so DTLSv1_method is used instead.

ASTERISK-26608

Change-Id: I926ec95b0b69633231e3ad1d6e803b977272c49c

8 years agoMerge "channel: Fix issues in hangup scenarios caused by frame deferral" into 13
George Joseph [Wed, 16 Nov 2016 23:42:17 +0000 (17:42 -0600)] 
Merge "channel:  Fix issues in hangup scenarios caused by frame deferral" into 13

8 years agochannel: Fix issues in hangup scenarios caused by frame deferral 22/4422/4
George Joseph [Tue, 15 Nov 2016 00:45:01 +0000 (17:45 -0700)] 
channel:  Fix issues in hangup scenarios caused by frame deferral

ASTERISK-26343

Change-Id: I06dbf7366e26028251964143454a77d017bb61c8

8 years agoMerge "codec_opus: Fix warning when Opus negotiated but codec_opus not loaded." into 13
Joshua Colp [Wed, 16 Nov 2016 23:40:36 +0000 (17:40 -0600)] 
Merge "codec_opus: Fix warning when Opus negotiated but codec_opus not loaded." into 13

8 years agoMerge "res/ari/resource_bridges: Add the ability to manipulate the video source"...
zuul [Wed, 16 Nov 2016 22:48:14 +0000 (16:48 -0600)] 
Merge "res/ari/resource_bridges: Add the ability to manipulate the video source" into 13

8 years agores_format_attr_opus: Fix fmtp generation. 60/4460/1
Mark Michelson [Wed, 16 Nov 2016 21:42:39 +0000 (15:42 -0600)] 
res_format_attr_opus: Fix fmtp generation.

res_format_attr_opus assumed that the string being passed into it was
empty. It tried to determine if the only thing it had written was

a=fmtp:<num>

And if it had, it would reset the string. Its calculation was off when
working with chan_sip, though. chan_sip passes the entire built SDP
rather than an empty string. This resulted in always putting an empty
fmtp line in the SDP.

ASTERISK-26520 #close
Reported by scgm11

Change-Id: Ib2e8712d26a47067e5f36d5973577added01dbb5

8 years agoMerge "Revert "Revert "channel: Use frame deferral API for safe sleep.""" into 13
Joshua Colp [Wed, 16 Nov 2016 21:39:00 +0000 (15:39 -0600)] 
Merge "Revert "Revert "channel: Use frame deferral API for safe sleep.""" into 13

8 years agoMerge "Revert "Revert "autoservice: Use frame deferral API""" into 13
Joshua Colp [Wed, 16 Nov 2016 21:38:55 +0000 (15:38 -0600)] 
Merge "Revert "Revert "autoservice: Use frame deferral API""" into 13

8 years agoMerge "Revert "Revert "AGI: Only defer frames when in an interception routine.""...
zuul [Wed, 16 Nov 2016 21:06:25 +0000 (15:06 -0600)] 
Merge "Revert "Revert "AGI: Only defer frames when in an interception routine.""" into 13

8 years agoMerge "Revert "Revert "Add API for channel frame deferral.""" into 13
zuul [Wed, 16 Nov 2016 21:06:24 +0000 (15:06 -0600)] 
Merge "Revert "Revert "Add API for channel frame deferral.""" into 13