Commit Graph

26704 Commits

Author SHA1 Message Date
Matt Jordan
7111ba6df4 Merge "tcptls: Avoiding ERR_remove_state in OpenSSL." into 13 2015-05-08 15:55:46 -05:00
Sean Bright
613a461c3d res_rtp_asterisk: Issue ERROR if res_srtp is not found.
While trying to get WebRTC working with chan_pjsip, I was running
into the following error:

    Attempted to set an invalid DTLS-SRTP configuration on RTP
    instance...

Josh helpfully pointed out that res_srtp.so might not be loaded, and
sure enough, it wasn't. This patch adds a ERROR indiciating as much
to hopefully help others having a similar problem.

Change-Id: I13aa477b47b299876728a21b130998a0ea6cd19f
2015-05-08 13:32:53 -05:00
Rusty Newton
394fcb5eab sounds: Add Swedish sounds to Makefile and XML
Added the necessary lines to the Makefile and sounds.xml so we'll have the
Swedish sounds in all available formats in menuselect.

See also: Swedish sounds were added into the core sounds release 1.4.27.

ASTERISK-24744 #close

Reported by: Tove Hjelm
Tested by: Rusty Newton

Change-Id: Ib6f4fd177afd1667b2402735034001d4d055a908
2015-05-08 12:54:46 -05:00
Joshua Colp
30c3b254c5 Merge "doc: Make progdocs play nice with git" into 13 2015-05-08 09:54:47 -05:00
Alexander Traud
2115f11b54 tcptls: Avoiding ERR_remove_state in OpenSSL.
ERR_remove_state was deprecated with OpenSSL 1.0.0 and was replaced by 
ERR_remove_thread_state. ERR_load_SSL_strings and ERR_load_BIO_strings were 
called by SSL_load_error_strings already and got removed. These changes allow 
OpenSSL forks like BoringSSL to be used with Asterisk.

ASTERISK-25043 #close
Reported by: Alexander Traud
patches:
  asterisk_with_BoringSSL.patch uploaded by Alexander Traud (License 6520)

Change-Id: If1c0871ece21a7e0763fafbd2fa023ae49d4d629
(cherry picked from commit 247fef6653)
2015-05-08 08:34:22 -05:00
George Joseph
5392e970d0 doc: Make progdocs play nice with git
Moved contrib/asterisk-ng-doxygen to doc/asterisk-ng-doxygen.in

Changed /Makefile to copy asterisk-ng-doxygen.in to
asterisk-ng-doxygen then modify it with version instead of
modifying asterisk-ng-doxygen directly.  Updated clean
targets as well.

Updated /.gitignore and doc/.gitignore.

Change-Id: I38712d3e334fa4baec19d30d05de8c6f28137622
2015-05-07 22:24:24 -06:00
Joshua Colp
1e44d1bef9 Merge "res_pjsip_exten_state: Fix race condition between sending NOTIFY and termination" into 13 2015-05-07 15:10:23 -05:00
Ivan Poddubny
608f0a94ee contrib/editors: Fix vim syntax highlighting of comments in config files
* Added a lookbehind to one-line comment matcher to skip escaped
   semicolons.
 * Added support for block comments.

Change-Id: Id17dfaeda8ed4be572e8107a0c010066584aaee7
2015-05-07 14:40:35 -05:00
Matt Jordan
22c6c12af2 Merge "vector: Additional enhancements and fixes" into 13 2015-05-07 13:30:11 -05:00
Joshua Colp
d649d682c4 res_pjsip_exten_state: Fix race condition between sending NOTIFY and termination
The res_pjsip_exten_state module currently has a race condition between
processing the extension state callback from the PBX core and processing
the subscription shutdown callback from res_pjsip_pubsub. There is currently
no synchronization between the two. This can present a problem as while
the SIP subscription will remain valid the tree it points to may not.
This is in particular a problem as a task to send a NOTIFY may get queued
which will try to use the tree that may no longer be valid.

This change does the following to fix this problem:

1. All access to the subscription tree is done within the task that
sends the NOTIFY to ensure that no other thread is modifying or
destroying the tree. This task executes on the serializer for the
subscriptions.

2. A reference to the subscription serializer is kept to ensure it
remains valid for the lifetime of the extension state subscription.

3. The NOTIFY task has been changed so it will no longer attempt
to send a NOTIFY if the subscription has already been terminated.

ASTERISK-25057 #close
Reported by: Matt Jordan

Change-Id: I0b3cd2fac5be8d9b3dc5e693aaa79846eeaf5643
2015-05-07 09:32:58 -03:00
Matt Jordan
9322bc6ff6 Merge "chan_dahdi: Improve force_restart_unavailable_chans option description." into 13 2015-05-07 07:02:42 -05:00
Matt Jordan
b1514362ef Merge "res_stasis_snoop: Spying on a single direction continually increases CPU" into 13 2015-05-07 06:39:20 -05:00
Joshua Colp
652ee2ff83 Merge "features: Fix crash when transferee hangs up during DTMF attended transfer." into 13 2015-05-07 06:28:00 -05:00
George Joseph
5f9aea8e3c vector: Additional enhancements and fixes
After using the new vector stuff for real I found...

A bug in AST_VECTOR_INSERT_AT that could cause a seg fault.

The callbacks needed to be closer to ao2_callback in behavior
WRT to CMP_MATCH and CMP_STOP behavior and the ability to return
a vector of matched entries.

A pre-existing issue with APPEND and REPLACE was also fixed.

I also added a new macro to test.h that acts like ast_test_validate
but also accepts a return code variable and a cleanup label.  As well
as printing the error, it sets the rc variable to AST_TEST_FAIL and
does a goto to the specified label on error.  I had a local version
of this in test_vector so I just moved it.

ASTERISK-25045

Change-Id: I05e5e47fd02f61964be13b7e8942bab5d61b29cc
2015-05-06 21:35:54 -06:00
Kevin Harwell
68513e00f7 res_stasis_snoop: Spying on a single direction continually increases CPU
Creating a snoop channel in ARI and spying only on a single direction (in or
out) results in CPU utilization continually increasing until the CPU is fully
consumed. This occurs because frames are being put in the opposing direction's
slin factory queue, but not being removed.

Fixed the problem by always reading and disposing of frames from the opposite
queue of the direction selected.

ASTERISK-24938 #closes

Change-Id: I935bfd15f1db958f364d9d6b3b45582c0113dd60
2015-05-06 16:09:33 -05:00
Richard Mudgett
904f5d98f6 chan_dahdi: Improve force_restart_unavailable_chans option description.
ASTERISK-25034
Reported by: Richard Mudgett

Change-Id: I1ff8f02124d2f4abd632a050da52c64285bb7f30
2015-05-06 16:05:31 -05:00
Joshua Colp
d6ffbe39b0 Merge "app_queue: Fix queue_log EXITWITHTIMEOUT containing only 1 parameter" into 13 2015-05-06 07:42:05 -05:00
Matt Jordan
dfb292ce3e Merge "res_ari_bridges: Add missing dependencies." into 13 2015-05-06 06:13:37 -05:00
Matt Jordan
50e90f9121 Merge "pbx_config: Register manager actions with module version of macro." into 13 2015-05-05 21:05:10 -05:00
Richard Mudgett
be1260a35f features: Fix crash when transferee hangs up during DTMF attended transfer.
A crash happens with this sequence of steps:
1) Party A is connected to party B.
2) Party B starts a DTMF attended transfer.
3) Party A hangs up while party B is dialing party C.

When party A hangs up the bridge that party A and party B are in is
dissolved and party B is kicked out of the bridge.  When party B finishes
dialing party C he attempts to move to the new bridge with party C.  Since
party B is no longer in a bridge the attempted move dereferences a NULL
bridge_channel pointer and crashes.

* Made the hold(), unhold(), ringing(), and the bridge_move() functions
tolerant of the channel not being in a bridge.  The assertion that party B
is always in a bridge is not true if the bridged peer of party B hangs up
and dissolves the bridge.  Being tolerant of not being in a bridge allows
the peer hangup stimulus to be processed by the FSM.

* Made the bridge_move() function return void since where the return value
for a failed move was checked generated a FSM coding ERROR message for a
normal off-nominal condition.

* Eliminated most uses of RAII_VAR in bridge_basic.c.

ASTERISK-25003 #close
Reported by: Artem Volodin

Change-Id: Ie2c1b14e5e647d4ea6de300bf56d69805d7bcada
2015-05-05 18:17:54 -05:00
George Joseph
8b0f85ac06 test_vector: Fix build breakage caused by ASTERISK_REGISTER_FILE
My 13 version of test_vector had an ASTERISK_REGISTER_FILE() macro
call at the top which is only supported in master.  Once removed
builds are successful.

Change-Id: I7cac8b669bed6de543bbf4e2eec3cffc9741acdd
2015-05-05 14:42:26 -06:00
Ivan Poddubny
87263b47b5 app_queue: Fix queue_log EXITWITHTIMEOUT containing only 1 parameter
This patch fixes EXITWITHTIMEOUT queue_log entry to always come with 3
parameters: position, original position and waiting time.

ASTERISK-25038 #close
Reported by: Etienne Lessard

Change-Id: I0c62045922e26bee2125e93aee1dee17eee79618
2015-05-05 15:38:23 -05:00
Matt Jordan
2d9081b5ec Merge "stasis: Fix dial masquerade datastore lifetime" into 13 2015-05-05 13:13:10 -05:00
Matt Jordan
8ca25dfd7e Merge "vector: Traversal, retrieval, insert and locking enhancements" into 13 2015-05-05 12:45:43 -05:00
Corey Farrell
366ea63438 res_ari_bridges: Add missing dependencies.
Missed this module in the previous commit.  res_ari_bridges uses symbols
from res_stasis_playback and res_stasis_recording.

ASTERISK-25027 #close
Reported by: Corey Farrell

Change-Id: I90bf756abd25adfc4920d2869ebe7feb636b8c5f
2015-05-05 10:47:43 -04:00
Corey Farrell
69ae8cf0a4 pbx_config: Register manager actions with module version of macro.
Switch manager actions in pbx_config to use the registration macro that
passes the module pointer, allowing pbx_config reference to be bumped
while the manager actions run.

ASTERISK-25061 #close
Reported by: Corey Farrell

Change-Id: I422c50dd74814616ac10c5e9c6598a0b1bc2c44e
2015-05-05 10:27:15 -04:00
Joshua Colp
181ae3b8d9 stasis: Fix dial masquerade datastore lifetime
A recent change went into Asterisk which added reference counts to the
channels stored in a dial masquerade datastore. Unfortunately this
included a reference to the caller in a dialing operation. While all
of the dialed targets have the datastore removed from them upon dialing
completion this did not occur for the caller, causing it to have a
reference to itself that could go never go away (as it depended on
the destruction of the datastore which only happened when the channel
was destroyed). This resulted in the caller channel remaining on the
system despite it having hung up.

This change does the following to fix this issue:

1. The dial masquerade datastore is now removed from the caller upon
dialing completion, just like the dialed targets.
2. Upon destruction of the caller all the dialed targets are also
removed from the dial masquerade datastore (just in case).
3. The reference to the caller has been removed as it should not be
possible for the datastore to now be valid/useful after the lifetime
of the caller has ended.

ASTERISK-25025 #close

Change-Id: I1ef4ca5ca04980028604cc2af5d2992ac3431b3f
2015-05-05 07:34:19 -03:00
George Joseph
7a7e9733c2 vector: Traversal, retrieval, insert and locking enhancements
Renamed AST_VECTOR_INSERT to AST_VECTOR_REPLACE because it really
does replace not insert.  The few users of AST_VECTOR_INSERT were
refactored.  Because these are macros, there should be no ABI
compatibility issues.

Added AST_VECTOR_INSERT_AT that actually inserts an element into the
vector at a specific index pushing existing elements to the right.

Added AST_VECTOR_GET_CMP that can retrieve from the vector based
on a user-provided compare function.

Added AST_VECTOR_CALLBACK function that will execute a function
for each element in the vector.  Similar to ao2_callback and
ao2_callback_data functions although the vector callback can take
a variable number of arguments.  This should allow easy migration
to a vector where a container might be too heavy.

Added read/write locked vector and lock manipulation macros.

Added unit tests.

ASTERISK-25045 #close

Change-Id: I2e07ecc709d2f5f91bcab8904e5e9340609b00e0
2015-05-04 19:46:51 -05:00
Corey Farrell
040d2f8558 main/test.c: Add test to verify there were no registration errors.
This adds a test that will fail if any test failed to register. Also fail
if any test registration produced a warning about missing a leading or
trailing slash.

ASTERISK-25053 #close
Reported by: Corey Farrell

Change-Id: I93e50b8fcbcfa7f1f5b41b2c44a51685c09529c3
2015-05-04 18:13:36 -04:00
Matt Jordan
626bffc4c2 Merge "contrib/ast-db-manage: Add Postgres ENUM type support in auto DTMF mode update" into 13 2015-05-04 09:26:10 -05:00
Matt Jordan
87fb7fc165 Merge "cdr/cdr_csv.c: Add a new option to enable columns added in Asterisk 1.8" into 13 2015-05-04 09:26:01 -05:00
Matt Jordan
81c27127aa Merge "Format Interfaces: Prevent unload except by shutdown." into 13 2015-05-04 09:25:35 -05:00
Matt Jordan
743fed71fc Merge "res_odbc: Use negative connection cache for all connections" into 13 2015-05-04 07:46:06 -05:00
Martin Tomec
3dcec04ab5 res_odbc: Use negative connection cache for all connections
Apply the negative connection cache setting to all connections,
even those that are not pooled. This ensures that the connection
will not be re-established before the negative connection cache
time is met.

ASTERISK-22708 #close

Change-Id: I431cc2e8584ab0b6908b3523d0a0e18c9a527271
2015-05-04 06:47:26 -05:00
Matt Jordan
74799b3fe2 Merge "Remove unneeded uses of optional_api providers." into 13 2015-05-04 04:03:50 -05:00
Matt Jordan
78c02f8e88 Merge "Update configure.ac/Makefile for clang" into 13 2015-05-04 04:03:10 -05:00
Corey Farrell
f38066fcad Format Interfaces: Prevent unload except by shutdown.
Format interfaces cannot be unregistered, so the modules that provide them
need to be held open except by shutdown.

ASTERISK-25054 #close
Reported by: Corey Farrell

Change-Id: Iadbd9675bf0d30b8fded5a739b163db3ea2db8f3
2015-05-03 22:08:14 -04:00
Matt Jordan
e76a6a97bf contrib/ast-db-manage: Add Postgres ENUM type support in auto DTMF mode update
The upgrade script for auto DTMF mode (31cd4f4891ec) added in 88b0fa7755
failed to add ENUM support for Postgres databases. This requires a
specific import from the sqlalchemy.dialects.postgresql package. This
patch corrects this error, which allows for Postgres update scripts to
be generated.

ASTERISK-24706

Change-Id: I4742ac8efa533cd6f18e0bdd907b339a9aedf015
2015-05-03 20:28:52 -05:00
D Tucny
92120247e9 term: send proper reset sequence when black background is forced
When using the force black background command-line option or configuration
option an invalid reset sequence is sent following a coloured output item 
in the CLI, the result is that the colour is not 'turned off' and continues
until the next non-default coloured text output.

A reset sequence is already defined in term.c, but the ast_term_reset
function doesn't use it, instead building it's own invalid sequence and 
returning that.

This patch changes that behaviour, removing the building of a reset sequence
and instead using the pre-built constant 'enddata' which is a suitable reset
sequence for this purpose.

ASTERISK-24896 #close
Reported by: Dan Tucny

Change-Id: I56323899123ae3264900389cae1f5b252aa3bf43
2015-05-03 09:41:15 -05:00
Matt Jordan
13819a34c4 Merge "Build System: Prevent unneeded changes to asterisk/buildopts.h." into 13 2015-05-03 09:20:15 -05:00
Matt Jordan
b518ba1c6c Merge "res_pjsip_dlg_options: Fix MODULEINFO section." into 13 2015-05-03 09:19:06 -05:00
Corey Farrell
ad6ea29697 Remove unneeded uses of optional_api providers.
A few cases exist where headers of optional_api provders are included but
not needed.  This causes unneeded calls to ast_optional_api_use.

* Don't include optional_api.h from sip_api.h.
* Move 'struct ast_channel_monitor' to channel.h.
* Don't include monitor.h from chan_sip.c, channel.c or features.c.

The move of struct ast_channel_monitor is needed since channel.c depends on
it.  This has no effect on users of monitor.h since channel.h is included
from monitor.h.

ASTERISK-25051 #close
Reported by: Corey Farrell

Change-Id: I53ea65a9fc9693c89f8bcfd6120649bfcfbc3478
2015-05-02 20:25:11 -04:00
Matt Jordan
9888562c8c Merge "include/asterisk/channel.h: Fix typo" into 13 2015-05-02 10:19:08 -05:00
Matt Jordan
b4000f2d44 Merge "Astobj2: Fix initialization order of refdebug and AO2_DEBUG." into 13 2015-05-02 10:17:26 -05:00
Rodrigo Ramírez Norambuena
525c8c8689 include/asterisk/channel.h: Fix typo
Change-Id: Ie584b85e16a94c255e60d0b1732ef9686464fef3
2015-05-02 02:28:13 -05:00
Corey Farrell
63196a8256 res_pjsip_dlg_options: Fix MODULEINFO section.
Removed the extra space before "MODULEINFO" in res_pjsip_dlg_options.
This extra space prevented any of the dependencies from being seen by
menuselect, so building with default options would fail if PJSIP was
not installed.

This also makes the tool that extracts information for menuselect
tolerant of multiple spaces in the future.

ASTERISK-25033 #close
Reported by: Peter Whisker

Change-Id: Iccd54846f70c4a7a50cb5bf70b7bb5cb4bab3698
2015-05-02 03:15:15 -04:00
Corey Farrell
ac1f0090eb Build System: Prevent unneeded changes to asterisk/buildopts.h.
* Add AST_DEVMODE to BUILDOPTS
* Remove CFLAGS that do not effect ABI from BUILDOPTS.
* Use BUILDOPTS to generate AST_BUILDOPT_SUM.
* Remove loop that defined AST_MODULE_*

These changes ensure that only ABI effecting options are considered for
AST_BUILDOPT_SUM.  This also reduces unneeded full system rebuilds caused
by enabling or disabling one module that another is dependent on.

ASTERISK-25028
Reported by: Corey Farrell

Change-Id: I2c516d93df9f6aaa09ae079a8168c887a6ff93a2
2015-05-01 16:45:05 -04:00
Corey Farrell
5875bf183c Astobj2: Fix initialization order of refdebug and AO2_DEBUG.
This ensures that refdebug is initialized before AO2_DEBUG if
both are enabled, since AO2_DEBUG allocates a container.

This change also makes AO2_DEBUG initialization critical, a
failure will abort Asterisk startup.  This is needed since
the failure would be caused by reg_containers allocation
failure, and that would result in a segmentation fault by
ao2_container_register later in startup.

ASTERISK-25048 #close
Reported by: Corey Farrell

Change-Id: I9a243ea3fc5653b48b931ba6d61971cb2e530244
2015-05-01 15:40:45 -04:00
Matt Jordan
1b19c15f17 main/pbx: Improve performance of dialplan reloads with a large number of hints
The PBX core maintains two hash tables for hints: a container of the
actual hints (hints), along with a container of devices that are watching that
hint (hintdevices). When a dialplan reload occurs, each hint in the hints
container is destroyed; this requires a lookup in the container of devices to
find the device => hint mapping object. In the current code, this performs an
ao2_callback, iterating over each of the device to hint objects in the
hintdevices container. For a large number of hints, this is extremely
expensive: dialplan reloads with 20000 hints could take several minutes
in just this phase.

This patch improves the performance of this step in the dialplan reloads
by caching which devices are watching a hint on the hint object itself.
Since we don't want to create a circular reference, we just cache the
name of the device. This allows us to perform a smarter ao2_callback on
the hintdevices container during hint removal, hashing on the name of the
device and returning an iterator to the matching names. The overall
performance improvement is rather large, taking this step down to a number of
seconds as opposed to minutes.

In addition, this patch also registers the hint containers in the PBX
core with the astobj2 library. This allows for reasonable debugging to
hash collisions in those containers.

ASTERISK-25040 #close
Reported by: Matt Jordan

Change-Id: Iedfc97a69d21070c50fca42275d7b3e714e59360
2015-05-01 08:25:47 -05:00
Matt Jordan
ec0f80b6e8 Merge "res_pjsip_outbound_authenticator_digest: Add missing outbound authenticator callback." into 13 2015-05-01 06:55:49 -05:00