]> git.ipfire.org Git - thirdparty/asterisk.git/log
thirdparty/asterisk.git
9 years agores_pjsip: Added "subscribe_context" to endpoint 45/3145/4
Alexei Gradinari [Mon, 4 Jul 2016 18:54:34 +0000 (14:54 -0400)] 
res_pjsip: Added "subscribe_context" to endpoint

If specified, incoming SUBSCRIBE requests will be searched for the matching
extension in the indicated context. If no "subscribe_context" is specified,
then the "context" setting is used.

ASTERISK-25471 #close

Change-Id: I3fb7a15f5bc154079bd348c08b7ad1cdd2d5e514

9 years agoMerge "res_pjsip_session.c: Don't send extra BYE if SDP invalid." into 13
Joshua Colp [Fri, 1 Jul 2016 16:16:21 +0000 (11:16 -0500)] 
Merge "res_pjsip_session.c: Don't send extra BYE if SDP invalid." into 13

9 years agoMerge "res_pjsip_session.c: End call on initial invalid SDP negotiation." into 13
Joshua Colp [Fri, 1 Jul 2016 16:16:16 +0000 (11:16 -0500)] 
Merge "res_pjsip_session.c: End call on initial invalid SDP negotiation." into 13

9 years agoMerge "res_pjsip.c: Register PJMEDIA error code decoder." into 13
Joshua Colp [Fri, 1 Jul 2016 16:16:12 +0000 (11:16 -0500)] 
Merge "res_pjsip.c: Register PJMEDIA error code decoder." into 13

9 years agoMerge "res_pjsip_session.c: Remove unused parameter from handle_incoming()." into 13
Joshua Colp [Fri, 1 Jul 2016 16:16:06 +0000 (11:16 -0500)] 
Merge "res_pjsip_session.c: Remove unused parameter from handle_incoming()." into 13

9 years agoMerge "res_pjsip: Add missing NULL checks when using pjsip_inv_end_session()." into 13
Joshua Colp [Fri, 1 Jul 2016 16:15:59 +0000 (11:15 -0500)] 
Merge "res_pjsip: Add missing NULL checks when using pjsip_inv_end_session()." into 13

9 years agoMerge "features: Fix channel datastore access." into 13
Joshua Colp [Fri, 1 Jul 2016 14:59:40 +0000 (09:59 -0500)] 
Merge "features: Fix channel datastore access." into 13

9 years agoMerge "res_pjsip: improve realtime performance #2" into 13
Joshua Colp [Thu, 30 Jun 2016 20:53:16 +0000 (15:53 -0500)] 
Merge "res_pjsip: improve realtime performance #2" into 13

9 years agofeatures: Fix channel datastore access. 24/3124/1
Richard Mudgett [Thu, 30 Jun 2016 20:17:02 +0000 (15:17 -0500)] 
features: Fix channel datastore access.

Found as a result of the testsuite tests/callparking test crashing.

Several calls to ast_get_chan_featuremap_config() and
ast_get_chan_features_xfer_config() did not lock the channel before
calling so the channel's datastore list was accessed without the lock's
protection.  Apparently another thread deleted a datastore on the
channel's list while the crashing thread was walking the list.  Crash at
0xdeaddead due to MALLOC_DEBUG's memory filler value as a result.

* Add missing channel locks to calls that were not already protected
as the doxygen for those calls indicates.

Change-Id: Id273b3d305cc616406c353cbc841b2b7655efaa1

9 years agores_pjsip_session.c: Don't send extra BYE if SDP invalid. 30/3130/1
Richard Mudgett [Wed, 22 Jun 2016 22:26:38 +0000 (17:26 -0500)] 
res_pjsip_session.c: Don't send extra BYE if SDP invalid.

When an answer SDP is invalid we were disconnecting the outgoing call and
sending two BYE requests.  The first BYE was sent by PJPROJECT because of
the invalid SDP answer.  The second BYE was sent by Asterisk because it
thought the canceled call was the result of the RFC5407 section 3.1.2 race
condition.

* Made not send the BYE on a canceled session if the SDP negotiation is
incomplete because PJPROJECT has already sent a BYE for the failed
negotiation.

ASTERISK-25772 #close
Reported by:  Dmitriy Serov

Change-Id: I44ad0bd0605e8eeb7035c890d6f97a1331f1a836

9 years agores_pjsip_session.c: End call on initial invalid SDP negotiation. 29/3129/1
Richard Mudgett [Mon, 27 Jun 2016 22:19:08 +0000 (17:19 -0500)] 
res_pjsip_session.c: End call on initial invalid SDP negotiation.

When an incoming call defers SDP negotiation and then sends us an invalid
SDP in the ACK, we need to send a BYE to disconnect the call.  In this
case SDP negotiation has failed and we don't have valid media streams
negotiated.

ASTERISK-25772

Change-Id: Ia358516b0fc1e6c4c139b78246f10b9da7a2dfb8

9 years agores_pjsip.c: Register PJMEDIA error code decoder. 28/3128/1
Richard Mudgett [Thu, 23 Jun 2016 20:13:24 +0000 (15:13 -0500)] 
res_pjsip.c: Register PJMEDIA error code decoder.

Registering the PJMEDIA error codes allows errors found when parsing an
incoming SDP to be easier to figure out.

"Missing SDP rtpmap for dynamic payload type (PJMEDIA_SDP_EMISSINGRTPMAP)"
is much easier to understand than "Unknown error 220030".

ASTERISK-25772

Change-Id: I44b2dcea656fedd7593171be9e845880a2c70ca0

9 years agores_pjsip_session.c: Remove unused parameter from handle_incoming(). 27/3127/1
Richard Mudgett [Mon, 27 Jun 2016 21:56:33 +0000 (16:56 -0500)] 
res_pjsip_session.c: Remove unused parameter from handle_incoming().

Change-Id: Iedd182d189ec947c42edc2c66c4bda3c22060daa

9 years agores_pjsip: Add missing NULL checks when using pjsip_inv_end_session(). 26/3126/1
Richard Mudgett [Wed, 22 Jun 2016 23:02:59 +0000 (18:02 -0500)] 
res_pjsip: Add missing NULL checks when using pjsip_inv_end_session().

pjsip_inv_end_session() is documented as being able to return the
passed in tdata parameter set to NULL on success.

Change-Id: I09d53725c49b7183c41bfa1be3ff225f3a8d3047

9 years agoconfigure: Fix HAVE_PJSIP_EVSUB_GRP_LOCK not set with external pjproject 12/3112/1
George Joseph [Thu, 30 Jun 2016 13:25:09 +0000 (07:25 -0600)] 
configure:  Fix HAVE_PJSIP_EVSUB_GRP_LOCK not set with external pjproject

There was a typo in configure.ac preventing HAVE_PJSIP_EVSUB_GRP_LOCK
from getting set when using an external pjproject.

ASTERISK-26099 #close
Reported-by: Ross Beer
Change-Id: I709af70428e125fb5ccd44b171d25dd29141f0ae

9 years agoMerge "pjproject/patches/config_site: Increase the max number of ICE candidates"...
Joshua Colp [Wed, 29 Jun 2016 23:11:30 +0000 (18:11 -0500)] 
Merge "pjproject/patches/config_site: Increase the max number of ICE candidates" into 13

9 years agohep.conf.sample: Default 'enabled' to 'no' 07/3107/2
Matt Jordan [Wed, 29 Jun 2016 20:31:30 +0000 (15:31 -0500)] 
hep.conf.sample: Default 'enabled' to 'no'

Following the principle of least surprise, we should not be sending
massive numbers of PJSIP and RTCP HEP packets out into the ether to some
only-slightly-random IP address. Having 'enabled' set to 'no' in the
sample configuration file should prevent this from happening for those
who run 'make samples'.

ASTERISK-26159 #close

Change-Id: I1753a64ca83a3442a6ebdc31061f8185c062d9b1

9 years agopjproject/patches/config_site: Increase the max number of ICE candidates 05/3105/1
Matt Jordan [Wed, 29 Jun 2016 20:09:02 +0000 (15:09 -0500)] 
pjproject/patches/config_site: Increase the max number of ICE candidates

When negotiating ICE candidates with WebRTC capable endpoints, many
networks will result in a browser offering ICE candidates that exceeds
the default number of max candidates, 16. This patch bumps the max
candidates to 32, with the max checks at twice the number of candidates.
In practice, this has shown to be sufficient for browser/WebRTC
negotiation.

Change-Id: Ifd8da8b315f5ae14814d4ce20e10d2e6355020e5

9 years agoMerge "codecs: Fix ABI incompatibility created by adding format_name to ast_codec...
zuul [Wed, 29 Jun 2016 19:38:11 +0000 (14:38 -0500)] 
Merge "codecs:  Fix ABI incompatibility created by adding format_name to ast_codec" into 13

9 years agoMerge "siren: Add format attribute modules for Siren7 and Siren14." into 13
zuul [Wed, 29 Jun 2016 16:24:25 +0000 (11:24 -0500)] 
Merge "siren: Add format attribute modules for Siren7 and Siren14." into 13

9 years agoMerge "BuildSystem: Avoid obsolete warning with AC_TYPE_SIGNAL on autoconf." into 13
Joshua Colp [Wed, 29 Jun 2016 15:17:30 +0000 (10:17 -0500)] 
Merge "BuildSystem: Avoid obsolete warning with AC_TYPE_SIGNAL on autoconf." into 13

9 years agoMerge "BuildSystem: Fix a few issues hightlighted by gcc 6.x" into 13
Joshua Colp [Wed, 29 Jun 2016 10:13:19 +0000 (05:13 -0500)] 
Merge "BuildSystem:  Fix a few issues hightlighted by gcc 6.x" into 13

9 years agocodecs: Fix ABI incompatibility created by adding format_name to ast_codec 00/3100/5
George Joseph [Tue, 28 Jun 2016 14:00:32 +0000 (08:00 -0600)] 
codecs:  Fix ABI incompatibility created by adding format_name to ast_codec

Adding format_name even to the end of ast_codec caused issued with
binary codec modules because the pointer would be garbage in asterisk
when they registered.  So, the ast_codec structure was reverted and an
internal_ast_codec structure was created just for use in codec.c.  A new
internal-only API was also added (__ast_codec_register_with_format) so
that codec_builtin could register codecs with the format_name in a
separate parameter rather than in the ast_codec structure.

ASTERISK-26144 #close
Reported-by: Alexei Gradinari
Change-Id: I6df1b08f6a6ae089db23adfe1ebc8636330265ba

9 years agoBuildSystem: Fix a few issues hightlighted by gcc 6.x 95/3095/4
George Joseph [Tue, 28 Jun 2016 13:22:24 +0000 (07:22 -0600)] 
BuildSystem:  Fix a few issues hightlighted by gcc 6.x

gcc 6.1.1 caught a few more issues.
Made sure the unit tests still pass for the func_env and stdtime
issues.

ASTERISK-26157 #close

Change-Id: I6664d8f34a45bc1481d2a854481c7878b0c1cf8e

9 years agoconfigs/basic-pbx/modules.conf: Remove 'bad' modules 98/3098/1
Matt Jordan [Tue, 28 Jun 2016 15:33:30 +0000 (10:33 -0500)] 
configs/basic-pbx/modules.conf: Remove 'bad' modules

This patch removes the following modules:
 - pbx_functions: It never existed.
 - res_pjsip_log_forwarder: It no longer exists.
 - res_hep_pjsip: The base HEP module wasn't loaded, and most basic PBXs
                  aren't going to be installing HOMER
 - res_pjsip_phoneprov_provider: The basic res_phoneprov module isn't
                  loaded, and we aren't configured to make use of the
                  module

Change-Id: Id91f68cae7c9c8c3d370029fe1268cb51e4ff5a5

9 years agosiren: Add format attribute modules for Siren7 and Siren14. 89/3089/1
Joshua Colp [Wed, 22 Jun 2016 16:19:32 +0000 (13:19 -0300)] 
siren: Add format attribute modules for Siren7 and Siren14.

This change removes hardcoded SDP parsing and generation for
Siren7 and Siren14 from chan_sip and moves it to format attribute
modules so it can also be used by chan_pjsip.

With this the fmtp lines for both are added with the bitrate
information.

ASTERISK-26021

Change-Id: Ibb004eda37a14c0a35ef0613f6237977fc800037

9 years agoBuildSystem: Avoid obsolete warning with AC_TYPE_SIGNAL on autoconf. 88/3088/1
Alexander Traud [Thu, 23 Jun 2016 09:33:06 +0000 (11:33 +0200)] 
BuildSystem: Avoid obsolete warning with AC_TYPE_SIGNAL on autoconf.

Removed the obsolete macro AC_TYPE_SIGNAL because Asterisk does not use K&R C
but requires ANSI C anyway.

ASTERISK-26046

Change-Id: I914c014385e1862102d90fe7650621def78db02e

9 years agoMerge "res_fax: Fix reference leak in fax_v21_session_new." into 13
zuul [Thu, 23 Jun 2016 02:50:19 +0000 (21:50 -0500)] 
Merge "res_fax: Fix reference leak in fax_v21_session_new." into 13

9 years agoMerge "res_rtp_asterisk: Fix a self-comparison identified by gcc 6" into 13
zuul [Thu, 23 Jun 2016 00:23:16 +0000 (19:23 -0500)] 
Merge "res_rtp_asterisk:  Fix a self-comparison identified by gcc 6" into 13

9 years agoMerge "chan_unistim: Fix memcpy in get_to_address" into 13
zuul [Wed, 22 Jun 2016 23:50:52 +0000 (18:50 -0500)] 
Merge "chan_unistim:  Fix memcpy in get_to_address" into 13

9 years agoMerge "BuildSystem: Avoid obsolete warning with AC_FUNC_SETVBUF_REVERSED on autoconf...
Joshua Colp [Wed, 22 Jun 2016 22:26:01 +0000 (17:26 -0500)] 
Merge "BuildSystem: Avoid obsolete warning with AC_FUNC_SETVBUF_REVERSED on autoconf." into 13

9 years agoMerge "Fix Alembic upgrades." into 13
zuul [Wed, 22 Jun 2016 20:22:44 +0000 (15:22 -0500)] 
Merge "Fix Alembic upgrades." into 13

9 years agoMerge "res_pjproject.c: Replace inlined DEBUG_ATLEAST() with macro." into 13
zuul [Wed, 22 Jun 2016 20:16:18 +0000 (15:16 -0500)] 
Merge "res_pjproject.c: Replace inlined DEBUG_ATLEAST() with macro." into 13

9 years agores_fax: Fix reference leak in fax_v21_session_new. 83/3083/2
Corey Farrell [Wed, 22 Jun 2016 20:04:54 +0000 (16:04 -0400)] 
res_fax: Fix reference leak in fax_v21_session_new.

fax_v21_session_new created a session details object but only released
the allocation reference during error conditions.  fax_session_new adds
it's own reference to details if needed so the caller is always
responsible for cleaning it's own reference.

ASTERISK-26141 #close

Change-Id: Ie7fc52a83b6596ce9ce2d5a2bd9f3e204f48fc88

9 years agoMerge "test_res_pjsip_scheduler: Add 'depends' on pjproject in MODULEINFO" into 13
zuul [Wed, 22 Jun 2016 19:29:26 +0000 (14:29 -0500)] 
Merge "test_res_pjsip_scheduler: Add 'depends' on pjproject in MODULEINFO" into 13

9 years agores_rtp_asterisk: Fix a self-comparison identified by gcc 6 79/3079/1
George Joseph [Wed, 22 Jun 2016 18:41:57 +0000 (12:41 -0600)] 
res_rtp_asterisk:  Fix a self-comparison identified by gcc 6

gcc 6 caught a previously unidentified self-comparison in
ice_candidate_cmp.  Fixed it and re-ordered the predicates for better
short-circuiting.

ASTERISK-26140 #close

Change-Id: I3da713c568e24064430257b3502fbdafd35af7a7

9 years agochan_unistim: Fix memcpy in get_to_address 71/3071/2
George Joseph [Wed, 22 Jun 2016 15:37:23 +0000 (09:37 -0600)] 
chan_unistim:  Fix memcpy in get_to_address

A code block only enabled when HAVE_PKTINFO is not defined (FreeBSD)
was using a pointer to a pointer as the destination of a memcpy and a
'&' instead of '*' in the sizeof.

ASTERISK-26138 #close

Change-Id: Id4927ff256c0e470bdf7bcfc025146a2f656e708

9 years agoFix Alembic upgrades. 46/3046/7
Mark Michelson [Mon, 20 Jun 2016 18:18:38 +0000 (13:18 -0500)] 
Fix Alembic upgrades.

A non-existent constraint was being referenced in the upgrade script.
This patch corrects the problem by removing the reference.

This patch fixes another realtime problem as well. Our Alembic scripts
store booleans as yes or no values. However, Sorcery tries to insert
"true" or "false" instead. This patch updates Sorcery to use "yes" and
"no"

ASTERISK-26128 #close

Change-Id: I366dbbf91418a9cb160b3ca74b0e59b5ac284bec

9 years agoBuildSystem: Avoid obsolete warning with AC_FUNC_SETVBUF_REVERSED on autoconf. 78/3078/1
Alexander Traud [Wed, 22 Jun 2016 15:55:05 +0000 (17:55 +0200)] 
BuildSystem: Avoid obsolete warning with AC_FUNC_SETVBUF_REVERSED on autoconf.

Removed the obsolete macro AC_FUNC_SETVBUF_REVERSED because Asterisk does not
support the platform SVR2 from the year 1987 anymore.

ASTERISK-26046

Change-Id: I28161b037feb2d29ab46ed20e785928460226c22

9 years agotest_res_pjsip_scheduler: Add 'depends' on pjproject in MODULEINFO 74/3074/1
George Joseph [Wed, 22 Jun 2016 15:51:14 +0000 (09:51 -0600)] 
test_res_pjsip_scheduler: Add 'depends' on pjproject in MODULEINFO

Since the file was missing the depends on pjproject, it wasn't
picking up the pjproject related include path.  If there was no
system installed pjproject and pjproject-bundled was used, a compile
would fail because pjsip.h wasn't found.

ASTERISK-26139 #close

Change-Id: I2ee64a999051452bc198c4e2c168c70769cd3757

9 years agores_pjsip: improve realtime performance #2 06/2906/6
Alexei Gradinari [Thu, 2 Jun 2016 22:26:09 +0000 (18:26 -0400)] 
res_pjsip: improve realtime performance #2

The patch removes updating all Endpoints' status on startup.
Instead, only non-qualified aors with static contact
and non-qualified non-expired contacts are retrieved from the realtime to
update the endpoint status to ONLINE.
The endpoint name was added to the contact object to simply find the endpoint
that created this contact.

The status of endpoints with qualified aors will be updated by 'qualify'
functions.

ASTERISK-26061 #close

Change-Id: Id324c1776fa55d3741e0c5457ecac0304cb1a0df

9 years agores_rtp_asterisk: fix memory leak in dtls 64/3064/1
Torrey Searle [Tue, 21 Jun 2016 11:52:20 +0000 (13:52 +0200)] 
res_rtp_asterisk: fix memory leak in dtls

ensure that cert bios get freed after creating the fingerprint

ASTERISK-26129 #close

Change-Id: I44d23aea07dce80176ca1ff877c5ace9452ef451

9 years agoMerge "res_pjsip_pubsub: Address SEGV when attempting to terminate a subscription...
zuul [Wed, 22 Jun 2016 02:07:45 +0000 (21:07 -0500)] 
Merge "res_pjsip_pubsub: Address SEGV when attempting to terminate a subscription" into 13

9 years agoMerge "res_rtp_asterisk: Use latest DTLS version available by underlying platform...
Joshua Colp [Wed, 22 Jun 2016 00:49:20 +0000 (19:49 -0500)] 
Merge "res_rtp_asterisk: Use latest DTLS version available by underlying platform." into 13

9 years agoMerge "res_pjsip_session: Handle race condition at shutdown with timer." into 13
zuul [Wed, 22 Jun 2016 00:04:29 +0000 (19:04 -0500)] 
Merge "res_pjsip_session: Handle race condition at shutdown with timer." into 13

9 years agores_pjproject.c: Replace inlined DEBUG_ATLEAST() with macro. 62/3062/1
Richard Mudgett [Tue, 21 Jun 2016 22:42:28 +0000 (17:42 -0500)] 
res_pjproject.c: Replace inlined DEBUG_ATLEAST() with macro.

Change-Id: I8799fb0a347ad76e747dafd0eacf1ea1086b9a8c

9 years agoMerge "PJSIP: provide transport type with received messages" into 13
Joshua Colp [Tue, 21 Jun 2016 20:24:59 +0000 (15:24 -0500)] 
Merge "PJSIP: provide transport type with received messages" into 13

9 years agores_pjsip_pubsub: Address SEGV when attempting to terminate a subscription 18/3018/8
George Joseph [Sun, 12 Jun 2016 16:19:27 +0000 (10:19 -0600)] 
res_pjsip_pubsub: Address SEGV when attempting to terminate a subscription

Occasionally under load we'll attempt to send a final NOTIFY on a
subscription that's already been terminated and a SEGV will occur
down in pjproject's evsub_destroy function.  This is a result of a
race condition between all the paths that can generate a notify
and/or destroy the underlying pjproject evsub object:

 * The client can send a SUBSCRIBE with Expires: 0.
 * The client can send a SUBSCRIBE/refresh.
 * The subscription timer can expire.
 * An extension state can change.
 * An MWI event can be generated.
 * The pjproject transaction timer (timer_b) can expire.

Normally when our pubsub_on_evsub_state is called with a terminate,
we push a task to the serializer and return at which point the dialog
is unlocked.  This is usually not a problem because the task runs
immediately and locks the dialog again.  When the system is heavily
loaded though, there may be a delay between the unlock and relock
during which another event may occur such as the subscription timer
or timer_b expiring, an extension state change, etc.  These may also
cause a terminate to be processed and if so, we could cause pjproject
to try to destroy the evsub structure twice.  There's no way for us to
tell that the evsub was already destroyed and the evsub's group lock
can't tolerate this and SEGVs.

The remedy is twofold.

 * A patch has been submitted to Teluu and added to the bundled
   pjproject which adds add/decrement operations on evsub's group lock.

 * In res_pjsip_pubsub:
   * configure.ac and pjproject-bundled's configure.m4 were updated
     to check for the new evsub group lock APIs.
   * We now add a reference to the evsub group lock when we create
     the subscription and remove the reference when we clean up the
     subscription.  This prevents evsub from being destroyed before
     we're done with it.
   * A state has been added to the subscription tree structure so
     termination progress can be tracked through the asyncronous tasks.
   * The pubsub_on_evsub_state callback has been split so it's not doing
     double duty.  It now only handles the final cleanup of the
     subscription tree.  pubsub_on_rx_refresh now handles both client
     refreshes and client terminates.  It was always being called for
     both anyway.
   * The serialized_on_server_timeout task was removed since
     serialized_pubsub_on_rx_refresh was almost identical.
   * Missing state checks and ao2_cleanups were added.
   * Some debug levels were adjusted to make seeing only off-nominal
     things at level 1 and nominal or progress things at level 2+.

ASTERISK-26099 #close
Reported-by: Ross Beer.
Change-Id: I779d11802cf672a51392e62a74a1216596075ba1

9 years agores_rtp_asterisk: Use latest DTLS version available by underlying platform. 54/3054/2
Alexander Traud [Tue, 21 Jun 2016 12:05:30 +0000 (14:05 +0200)] 
res_rtp_asterisk: Use latest DTLS version available by underlying platform.

Do not use DTLSv1_method() but DTLS_method() when available in OpenSSL of the
underlying platform. This change enables DTLS 1.2 since OpenSSL 1.0.2, for
WebRTC (DTLS-SRTP via SIP-over-WebSockets). This change enables AEAD-based
cipher-suites.

ASTERISK-26130 #close

Change-Id: I41f24448d6d2953e8bdb97c9f4a6bc8a8f055fd0

9 years agoPJSIP: provide transport type with received messages 59/3059/1
Scott Griepentrog [Tue, 21 Jun 2016 15:53:05 +0000 (10:53 -0500)] 
PJSIP: provide transport type with received messages

The receipt of a SIP MESSAGE may occur over any transport including TCP
and TLS. When the message is received, the original URI is added to the
message in the field PJSIP_RECVADDR, but this is insufficient to ensure
a reply message can reach the originating endpoint. This patch adds the
PJSIP_TRANSPORT field populated with the transport type.

ASTERISK-26132 #close

Change-Id: I28c4b1e40d573a056c81deb213ecf53e968f725e

9 years agoBuildSystem: Avoid obsolete warning with HELP_STRING on autoconf. 57/3057/1
Alexander Traud [Tue, 21 Jun 2016 13:01:40 +0000 (15:01 +0200)] 
BuildSystem: Avoid obsolete warning with HELP_STRING on autoconf.

Some configure scripts used both AC_HELP_STRING and its replacement
AS_HELP_STRING. For consistency and to avoid obsolete warnings, those were
changed to AS_HELP_STRING.

ASTERISK-26046

Change-Id: I8aad4fd2bdee40aa2a31ce3339a1eb33ff4f5b0f

9 years agoMerge "fix: memory leaks, resource leaks, out of bounds and bugs" into 13
zuul [Tue, 21 Jun 2016 12:02:17 +0000 (07:02 -0500)] 
Merge "fix: memory leaks, resource leaks, out of bounds and bugs" into 13

9 years agoMerge "app_voicemail.c: Fix IMAP compile error." into 13
zuul [Mon, 20 Jun 2016 20:00:53 +0000 (15:00 -0500)] 
Merge "app_voicemail.c: Fix IMAP compile error." into 13

9 years agores_pjsip_session: Handle race condition at shutdown with timer. 48/3048/3
Joshua Colp [Mon, 20 Jun 2016 15:29:13 +0000 (12:29 -0300)] 
res_pjsip_session: Handle race condition at shutdown with timer.

When shutting down res_pjsip_session will get unloaded before res_pjsip.
The act of unloading unregisters all the PJSIP services and sets
their module IDs to -1. In some cases it is possible for a timer to
occur after this happens which calls into res_pjsip_session. The
res_pjsip_session module can then try to get the session from the
INVITE session using the module ID. Since the module ID is now -1
this fails.

This change stores a copy of the module ID and uses it for the timer
callback scenario. If the module ID is -1 the callback immediately
returns but if the module ID is valid then it continues as normal.

This works as the original ID of the module is guaranteed to still
be valid when used with the INVITE session.

ASTERISK-26127 #close

Change-Id: I88df72525c4e9ef9f19c13aedddd3ac4a335c573

9 years agoapp_voicemail.c: Fix IMAP compile error. 44/3044/2
Richard Mudgett [Mon, 20 Jun 2016 17:13:27 +0000 (12:13 -0500)] 
app_voicemail.c: Fix IMAP compile error.

Fix compile error introduced by the patch for
ASTERISK-26045

Change-Id: I5b02876266f2824f4cec2b54d6ff4db5de5778d3

9 years agofix: memory leaks, resource leaks, out of bounds and bugs 36/3036/6
Alexei Gradinari [Thu, 16 Jun 2016 20:56:19 +0000 (16:56 -0400)] 
fix: memory leaks, resource leaks, out of bounds and bugs

ASTERISK-26119 #close

Change-Id: Iecbf7d0f360a021147344c4e83ab242fd1e7512c

9 years agoMerge "http: leverage 'bindaddr' for TLS in http.conf" into 13
Joshua Colp [Mon, 20 Jun 2016 17:03:45 +0000 (12:03 -0500)] 
Merge "http: leverage 'bindaddr' for TLS in http.conf" into 13

9 years agoMerge "ARI: Ensure announcer channels are destroyed." into 13
zuul [Mon, 20 Jun 2016 16:39:45 +0000 (11:39 -0500)] 
Merge "ARI: Ensure announcer channels are destroyed." into 13

9 years agoARI: Ensure announcer channels are destroyed. 23/3023/4
Mark Michelson [Mon, 13 Jun 2016 22:40:07 +0000 (17:40 -0500)] 
ARI: Ensure announcer channels are destroyed.

Announcer channels were not being destroyed because the
stasis_app_control structure that referenced them was not being
destroyed. The control structure was not being destroyed because it was
not being unlinked from its container. It was not being unlinked from
its container because the after bridge callback for the announcer
channel was not being run. The after bridge callback was not being run
because the after bridge datastore was not being removed from the
channel on destruction. The channel was not being destroyed because the
hangup that used to destroy the channel was now only reducing the
reference count to one. The reference count of the channel was only
being reduced to one because the stasis_app_control structure was
holding the final reference...

The control structure used to not keep a reference to the channel, so
that loop described above did not happen.

The solution is to manually remove the control structure from its
container when the playback on a bridge is complete.

ASTERISK-26083 #close
Reported by Joshua Colp

Change-Id: I0ddc0f64484ea0016245800b409b567dfe85cfb4

9 years agohttp: leverage 'bindaddr' for TLS in http.conf 43/3043/1
Alexander Traud [Mon, 20 Jun 2016 13:05:09 +0000 (15:05 +0200)] 
http: leverage 'bindaddr' for TLS in http.conf

The internal HTTP/WebSocket server supports both TCP and TLS, which can be
activated separately via the file http.conf. The source code intends to re-use
the TCP parameter 'bindaddr' for TLS, even if 'tlsbindaddr' is not specified
explicitly. This did not work because of a typo. This change resolves this typo.

ASTERISK-26126 #close

Change-Id: I5efb0409ae12044dfb3495b6b97b6d40a8c9c51f

9 years agoMerge "chan_sip: bigger buffers for headers, better failure mode" into 13
zuul [Thu, 16 Jun 2016 22:21:51 +0000 (17:21 -0500)] 
Merge "chan_sip: bigger buffers for headers, better failure mode" into 13

9 years agochan_sip: bigger buffers for headers, better failure mode 34/3034/1
Vasil Kolev [Tue, 31 May 2016 14:10:29 +0000 (17:10 +0300)] 
chan_sip: bigger buffers for headers, better failure mode

Currently chan_sip can give weird messages if the contacts don't
fit in the From: or To: headers. This fix changes the from,to and
invite variables to use ast_str, allocates and deallocates them and
resizes them if needed.

ASTERISK-26069 #close

Change-Id: I1b68fcbddca6f6cc7d7a92fe1cb0d5430282b2b3

9 years agores_pjsip_transport_management.c: Misc cleanups to survive shutdown. 29/3029/1
Richard Mudgett [Wed, 18 May 2016 22:37:27 +0000 (17:37 -0500)] 
res_pjsip_transport_management.c: Misc cleanups to survive shutdown.

* In unload_module(), reordered destroying things to minimize the window
that the global transports container could be used by other threads on
shutdown.  When shutting down you need to stop things in the opposite
order of creation.

* Put the global transports container into an AO2_GLOBAL_OBJ_STATIC to
eliminate the crash potential by other threads using the container on
shutdown.

* Made struct monitored_transport.sip_received not use
ast_atomic_fetchadd_int() since it is used as a boolean value that is only
set TRUE.  It was previously incremented for every received SIP message
and could theoretically overflow.

* In monitored_transport_state_callback(), allocated the monitored
transport object without a lock since the lock was unused.

* In keepalive_global_loaded(), removed releasing the transports container
if the keepalive_thread could not be started.  I set it up to be tried
again if the user reloads the configuration.

Change-Id: I8d12d16ef564290fa6d25a32334bb5ce8fdf87ff

9 years agores_pjsip.c: Add check that timer actually got scheduled. 27/3027/1
Richard Mudgett [Wed, 6 Jan 2016 01:08:24 +0000 (19:08 -0600)] 
res_pjsip.c: Add check that timer actually got scheduled.

Change-Id: Iabaa2e5dccf0762c258101ea0eb1487cf6959ad1

9 years agoMerge "res_pjsip_session.c: Reorganize ast_sip_session_terminate()." into 13
zuul [Tue, 14 Jun 2016 18:36:44 +0000 (13:36 -0500)] 
Merge "res_pjsip_session.c: Reorganize ast_sip_session_terminate()." into 13

9 years agores_rtp_multicast.c: Fix warning message typo. 20/3020/1
Richard Mudgett [Mon, 13 Jun 2016 18:33:53 +0000 (13:33 -0500)] 
res_rtp_multicast.c: Fix warning message typo.

Change-Id: Ic9928208b9957e09866abe3d9649030942ec52b3

9 years agoMerge "chan_rtp: Backport changes from master." into 13
Joshua Colp [Mon, 13 Jun 2016 16:59:31 +0000 (11:59 -0500)] 
Merge "chan_rtp: Backport changes from master." into 13

9 years agoMerge "chan_rtp.c: Copy file from chan_multicast_rtp.c" into 13
Joshua Colp [Mon, 13 Jun 2016 16:59:19 +0000 (11:59 -0500)] 
Merge "chan_rtp.c: Copy file from chan_multicast_rtp.c" into 13

9 years agores_pjsip_session.c: Reorganize ast_sip_session_terminate(). 16/3016/1
Richard Mudgett [Fri, 12 Feb 2016 00:15:31 +0000 (18:15 -0600)] 
res_pjsip_session.c: Reorganize ast_sip_session_terminate().

Change-Id: I68a2128bcba4830985d2d441e70dfd1ac5bd712b

9 years agochan_rtp: Backport changes from master. 13/3013/1
Richard Mudgett [Fri, 10 Jun 2016 17:35:33 +0000 (12:35 -0500)] 
chan_rtp: Backport changes from master.

* Deprecate chan_multicast_rtp.

Change-Id: Ib5a45e58c75ee8abd0b4f9575379b5321feb853e

9 years agochan_rtp.c: Copy file from chan_multicast_rtp.c 12/3012/1
Richard Mudgett [Fri, 10 Jun 2016 21:13:04 +0000 (16:13 -0500)] 
chan_rtp.c: Copy file from chan_multicast_rtp.c

Change-Id: I1119b53f2152ab1cbec74b5be7ea44844dbda8ef

9 years agocore: Not the configured but granted number of possible file descriptors. 70/2970/3
Alexander Traud [Wed, 8 Jun 2016 11:15:15 +0000 (13:15 +0200)] 
core: Not the configured but granted number of possible file descriptors.

With CLI "core show settings", simply the parameter maxfiles of the file
asterisk.conf was shown. If that parameter was not set, nothing was displayed
although the environment might have set a default number itself. Or if maxfiles
were not granted (completely), still maxfiles was shown. Now, the maximum number
of possible file descriptors in the environment is shown.

ASTERISK-26097

Change-Id: I2df5c58863b5007b34b77adbe28b885dfcdf7e0b

9 years agoMerge "cel: Ensure only one dial status per channel exists." into 13
Joshua Colp [Fri, 10 Jun 2016 10:09:18 +0000 (05:09 -0500)] 
Merge "cel: Ensure only one dial status per channel exists." into 13

9 years agoMerge "res_pjsip_registrar.c: Eliminate rx REGISTER request race condition." into 13
Joshua Colp [Fri, 10 Jun 2016 01:25:22 +0000 (20:25 -0500)] 
Merge "res_pjsip_registrar.c: Eliminate rx REGISTER request race condition." into 13

9 years agoMerge "stasis: Add setting subscription congestion levels." into 13
Joshua Colp [Fri, 10 Jun 2016 01:25:15 +0000 (20:25 -0500)] 
Merge "stasis: Add setting subscription congestion levels." into 13

9 years agoMerge "sorcery: Add setting object type congestion levels." into 13
Joshua Colp [Fri, 10 Jun 2016 01:25:09 +0000 (20:25 -0500)] 
Merge "sorcery: Add setting object type congestion levels." into 13

9 years agoMerge "taskprocessors: Implement high/low water mark alerts." into 13
zuul [Fri, 10 Jun 2016 01:12:30 +0000 (20:12 -0500)] 
Merge "taskprocessors: Implement high/low water mark alerts." into 13

9 years agoMerge "res_pjsip_session: Use distributor serializer for incoming calls." into 13
zuul [Fri, 10 Jun 2016 01:12:28 +0000 (20:12 -0500)] 
Merge "res_pjsip_session: Use distributor serializer for incoming calls." into 13

9 years agoMerge "res_pjsip_pubsub.c: Recreate subscriptions using distributor serializer."...
zuul [Fri, 10 Jun 2016 00:41:20 +0000 (19:41 -0500)] 
Merge "res_pjsip_pubsub.c: Recreate subscriptions using distributor serializer." into 13

9 years agoMerge "res_pjsip_pubsub.c: Use distributor serializer for incoming subscriptions...
zuul [Fri, 10 Jun 2016 00:41:13 +0000 (19:41 -0500)] 
Merge "res_pjsip_pubsub.c: Use distributor serializer for incoming subscriptions." into 13

9 years agoMerge "pjsip_distributor.c: Consistently pick a serializer for messages." into 13
zuul [Thu, 9 Jun 2016 23:48:04 +0000 (18:48 -0500)] 
Merge "pjsip_distributor.c: Consistently pick a serializer for messages." into 13

9 years agoMerge "pjsip_distributor.c: Ignore messages until fully booted." into 13
zuul [Thu, 9 Jun 2016 23:47:07 +0000 (18:47 -0500)] 
Merge "pjsip_distributor.c: Ignore messages until fully booted." into 13

9 years agocel: Ensure only one dial status per channel exists. 72/2972/4
Joshua Colp [Tue, 7 Jun 2016 23:45:37 +0000 (20:45 -0300)] 
cel: Ensure only one dial status per channel exists.

CEL wrongly assumed that a channel would only have a single dial
event on it. This is incorrect. Particularly in a queue each
call attempt to a member will result in a dial event, adding
a new dial status in CEL without removing the old one. This
would cause the container to grow with only one dial status
being removed when the channel went away. The other dial status
entries would remain leaking memory.

This change fixes the memory leak by ensuring that only one dial
status will only ever exist for each channel.

The behavior during the scenario where multiple events are received
has also been improved. For failure cases the first failure will
be the dial status. If an answer dial status is received, though,
it will take priority and the dial status for the channel will be
answer.

Memory usage has also been decreased by storing the minimal
amount of information and the code has been cleaned up slightly.

ASTERISK-25262 #close

Change-Id: I5944eb923db17b6a0faa7317ff6abc9307c009fe

9 years agoMerge "chan_pjsip: Lock channel when checking for RTP changes." into 13
zuul [Thu, 9 Jun 2016 18:54:01 +0000 (13:54 -0500)] 
Merge "chan_pjsip: Lock channel when checking for RTP changes." into 13

9 years agochan_pjsip: Lock channel when checking for RTP changes. 03/3003/1
Mark Michelson [Thu, 9 Jun 2016 15:37:53 +0000 (10:37 -0500)] 
chan_pjsip: Lock channel when checking for RTP changes.

bridge_native_rtp can call into an RTP-capable channel driver in order
for the driver to update information about who the channel is
communicating with. For SIP channel drivers, this means deactivating
RTCP and sending a reinvite so that the endpoints can communicate
directly.

bridge_native_rtp does the right thing and has the channel locked when
calling into the channel driver. chan_pjsip can't alter session
properties in this thread, though. chan_pjsip queues a task on the
session serializer in order to update properties there.

The problem is that this queued task was not locking the channel. This
meant that the queued task could attempt to deactivate RTCP at the same
time that the channel thread was attempting to process an incoming RTCP
packet. This could lead to a crash.

This patch fixes the issue by locking the channel in the queued task
when altering RTP properties.

ASTERISK-26092 #close
Reported by Niklas Larsson

Change-Id: I3464e226a3c41f6b915f97891e07fa1599e2a159

9 years agobuild: Fix ast_sockaddr initialization to be more portable 79/2979/2
George Joseph [Thu, 9 Jun 2016 14:20:33 +0000 (08:20 -0600)] 
build:  Fix ast_sockaddr initialization to be more portable

A change to glibc 2.22 changed the order of the sockadddr_storage
members which caused the places where we do an initialization of
ast_sockaddr with '{ { 0, 0, } }' to fail compilation.  Those
initializers (which we shouldn't have been using anyway) have been
replaced with memsets.

Change-Id: Idd1b3b320903d8771bfe221f0b015685de628fa4

9 years agoMerge "astfd: Not maximum size of a single file but maximum file descriptors." into 13
zuul [Thu, 9 Jun 2016 13:21:35 +0000 (08:21 -0500)] 
Merge "astfd: Not maximum size of a single file but maximum file descriptors." into 13

9 years agoMerge "BuildSystem: Avoid 'ar cru' and use 'ar cr' instead." into 13
zuul [Thu, 9 Jun 2016 03:50:39 +0000 (22:50 -0500)] 
Merge "BuildSystem: Avoid 'ar cru' and use 'ar cr' instead." into 13

9 years agoMerge "res_hep_{pjsip|rtcp}: Decline module loads if res_hep had not loaded" into 13
Joshua Colp [Thu, 9 Jun 2016 00:03:05 +0000 (19:03 -0500)] 
Merge "res_hep_{pjsip|rtcp}: Decline module loads if res_hep had not loaded" into 13

9 years agoMerge "Fix #include poll.h and sys/cdefs.h" into 13
Joshua Colp [Wed, 8 Jun 2016 21:18:34 +0000 (16:18 -0500)] 
Merge "Fix #include poll.h and sys/cdefs.h" into 13

9 years agores_hep_{pjsip|rtcp}: Decline module loads if res_hep had not loaded 75/2975/1
Matt Jordan [Wed, 8 Jun 2016 17:26:29 +0000 (12:26 -0500)] 
res_hep_{pjsip|rtcp}: Decline module loads if res_hep had not loaded

A crash can occur in res_hep_pjsip or res_hep_rtcp if res_hep has not
loaded and does not have a configuration file. Previously when this
occurred, checks were put in to see if the configuration was loaded
successfully. While this is a good idea - and has been added to the
offending function in res_hep - the reality is res_hep_pjsip and
res_hep_rtcp have no business running if res_hep isn't also running.

As such, this patch also adds a function to res_hep that returns whether
or not it successfully loaded. Oddly enough, ast_module_check returns
"everything is peachy" even if a module declined its load - so it cannot
be solely relied on. res_hep_pjsip and res_hep_rtcp now also check this
function to see if they should continue to load; if it fails, they
decline their load as well.

ASTERISK-26096 #close

Change-Id: I007e535fcc2e51c2ca48534f48c5fc2ac38935ea

9 years agoastfd: Not maximum size of a single file but maximum file descriptors. 66/2966/1
Alexander Traud [Wed, 8 Jun 2016 10:58:48 +0000 (12:58 +0200)] 
astfd: Not maximum size of a single file but maximum file descriptors.

With menuselect "DEBUG_FD_LEAKS" and CLI "core show fd", the maximum size of a
single file was shown. Now, the maximum number of possible file descriptors is
shown.

ASTERISK-26097

Change-Id: Icf98d145774b38cac144ca76d19eaef42ce659a3

9 years agoMerge "ari/resource_channels: Add 'formats' to channel create/originate" into 13
zuul [Wed, 8 Jun 2016 05:11:29 +0000 (00:11 -0500)] 
Merge "ari/resource_channels:  Add 'formats' to channel create/originate" into 13

9 years agoFix #include poll.h and sys/cdefs.h 63/2963/1
Timo Teräs [Thu, 2 Jun 2016 19:53:39 +0000 (22:53 +0300)] 
Fix #include poll.h and sys/cdefs.h

POSIX defines poll.h, sys/poll.h should not be used at is c-library
internal header which may or may not exist. Notable in musl it
generates warning of being incorrect. And add explict include of
sys/cdefs.h where needed.

Change-Id: I142930df53fe7585a06b854b6faddc5301e024be

9 years agores_pjsip_registrar.c: Eliminate rx REGISTER request race condition. 55/2955/3
Richard Mudgett [Sat, 4 Jun 2016 03:44:46 +0000 (22:44 -0500)] 
res_pjsip_registrar.c: Eliminate rx REGISTER request race condition.

This patch fixes a race condition processing received REGISTER requests
and their retransmissions caused by REGISTER requests being processed by
two threads.  The "sip_transaction Unable to register REGISTER transaction
(key exists)" message is a notable symptom of this issue.

This issue was more likely to happen before the pjsip/distributor
serializers were created.  Instead of steps one and two below placing the
REGISTER messages into the same pjsip/distributor they were placed in
random pjsip/default serializers.

1) REGISTER requests come in and get placed on the pjsip/distributor
serializer.

2) Before the first request is processed a retransmission comes in and is
placed on the same pjsip/distributor serializer.

3) The first request goes up the pjsip stack and is then shunted off to
the pjsip/aor/<aor> serializer.

4) Before the first request is completed processing in the pjsip/aor/<aor>
serializer, the second request goes up the pjsip stack and is also shunted
off to the pjsip/aor/<aor> serializer.

5) The first request completes processing and sends out its response.

6) The second request completes processing and tries to send out its
response but pjlib complains that the REGISTER transaction key already
exists.

7) Sadness ensues.

* The race is eliminated by removing the pjsip/aor/<aor> serializer and
continuing the processing in the pjsip/distributor serializer.  Now any
retransmissions queued in the pjsip/distributor serializer will be
processed after the first message is completely processed.

ASTERISK-26088 #close
Reported by:  Richard Mudgett

Change-Id: I842d714346088bf717ea27437f1dd85bff0bab5a

9 years agostasis: Add setting subscription congestion levels. 54/2954/3
Richard Mudgett [Fri, 3 Jun 2016 16:35:49 +0000 (11:35 -0500)] 
stasis: Add setting subscription congestion levels.

Stasis subscriptions and message routers create taskprocessors to process
the event messages.  API calls are needed to be able to set the congestion
levels of these taskprocessors for selected subscriptions and message
routers.

* Updated CDR, CEL, and manager's stasis subscription congestion levels
based upon stress testing.  Increased the congestion levels to reduce the
potential for bursty call setup/teardown activity from triggering the
taskprocessor overload alert.  CDRs in particular need an extra high
congestion level because they can take awhile to process the stasis
messages.

ASTERISK-26088
Reported by:  Richard Mudgett

Change-Id: Id0a716394b4eee746dd158acc63d703902450244

9 years agosorcery: Add setting object type congestion levels. 53/2953/3
Richard Mudgett [Thu, 2 Jun 2016 23:19:13 +0000 (18:19 -0500)] 
sorcery: Add setting object type congestion levels.

Sorcery creates taskprocessors for object types to process object observer
callbacks.  An API call is needed to be able to set the congestion levels
of these taskprocessors for selected object types.

* Updated PJSIP's contact and contact_status sorcery object type observer
default congestion levels based upon stress testing.  Increased the
congestion levels to reduce the potential for bursty register/unregister
and subscribe/unsubscribe activity from triggering the taskprocessor
overload alert.

ASTERISK-26088
Reported by:  Richard Mudgett

Change-Id: I4542e83b556f0714009bfeff89505c801f1218c6

9 years agotaskprocessors: Implement high/low water mark alerts. 52/2952/3
Richard Mudgett [Thu, 2 Jun 2016 21:08:19 +0000 (16:08 -0500)] 
taskprocessors: Implement high/low water mark alerts.

When taskprocessors get backed up, there is a good chance that we are
being overloaded and need to defer adding new work to the system.

* Implemented a high/low water alert mechanism for modules to check if the
system is being overloaded and take appropriate action.  When a
taskprocessor is created it has default congestion levels set.  A
taskprocessor can later have those congestion levels altered for specific
needs if stress testing shows that the taskprocessor is a symptom of
overloading or needs to handle bursty activity without triggering an
overload alert.

* Add CLI "core show taskprocessor" low/high water columns.

* Fixed __allocate_taskprocessor() to not use RAII_VAR().  RAII_VAR() was
never a good thing to use when creating a taskprocessor because of the
nature of how its references needed to be cleaned up on a partial
creation.

* Made res_pjsip's distributor check if the taskprocessor overload alert
is active before placing a message representing brand new work onto a
distributor serializer.

ASTERISK-26088
Reported by:  Richard Mudgett

Change-Id: I182f1be603529cd665958661c4c05ff9901825fa

9 years agores_pjsip_session: Use distributor serializer for incoming calls. 51/2951/2
Richard Mudgett [Fri, 27 May 2016 22:31:52 +0000 (17:31 -0500)] 
res_pjsip_session: Use distributor serializer for incoming calls.

We must continue using the serializer that the original INVITE came in on
for the dialog.  There may be retransmissions already enqueued in the
original serializer that can result in reentrancy and message sequencing
problems.

Outgoing call legs create the pjsip/outsess/<endpoint> serializers for
their dialogs.

ASTERISK-26088
Reported by:  Richard Mudgett

Change-Id: I24d7948749c582b8045d5389ba3f6588508adbbc

9 years agores_pjsip_pubsub.c: Recreate subscriptions using distributor serializer. 50/2950/2
Richard Mudgett [Fri, 27 May 2016 21:28:39 +0000 (16:28 -0500)] 
res_pjsip_pubsub.c: Recreate subscriptions using distributor serializer.

* Resolves potential reentrancy problems if system restarted in the middle
of subscription message transactions.

* Fixes memory leak recreating persistent subscriptions when the
subscription resource tree could not be created.

ASTERISK-26088
Reported by:  Richard Mudgett

Change-Id: I71e34d7ae8ed35a694f1030e820e2548c48697be