Commit Graph

28630 Commits

Author SHA1 Message Date
George Joseph
6d1eb880c2 menuselect: Add a new 'options' support type
The Binaural Rendering patches in the master branch required
menuselect to be updated with a new support type called 'option'.
This allows binaural rendering to be turned on or off when
bridge_softmix is built.  This patch backports the 'option'
functionality to the 13 and 14 branches.

Here's what it looks like in menuselect:

  [*] bridge_simple
  [*] bridge_softmix
      --- Module Options ---
  [ ] binaural_rendering_in_bridge_softmix

To create an option for a module, you can create (or update) the
menuselect-tree xml snippet in the directory where the module
resides and add a member element with an 'option' support_level.

Example (abbreviated) from bridges/bridges.xml:

<member name="binaural_rendering_in_bridge_softmix"
	displayname="Enable binaural rendering in bridge_softmix"
	remove_on_change="bridges/bridge_softmix.o bridges/bridge_softmix.so">
	<support_level>option</support_level>
	<depend>bridge_softmix</depend>
	<depend>fftw3</depend>
	<defaultenabled>no</defaultenabled>
</member>

The 'name' will be added or removed from the MENUSELECT_<dir>
make variable following the standard module "missing means yes"
rules.

Example (abbreviated) from bridges/Makefile:

ifeq ($(findstring binaural_rendering,$(MENUSELECT_BRIDGES)),)
bridge_softmix.o: _ASTCFLAGS+=-DBINAURAL_RENDERING
bridge_softmix.so: LIBS+=$(FFTW3_LIB)
endif

Change-Id: I66d23755ed6e81f8d439cad410f2ffa7c30f25ad
2017-03-13 10:01:42 -06:00
Joshua Colp
8386a38e06 Merge "pjsip/cli_commands: pjsip show channelstats shows wrong codec" into 13 2017-03-10 14:45:07 -06:00
Daniel Journo
67c989ce78 pjsip/cli_commands: pjsip show channelstats shows wrong codec
* cli_commands.c Fixed CLI output

ASTERISK-26822 #close

Change-Id: I3889ef6a8f6738fc312fab42db5efacd6e452b01
2017-03-09 21:42:12 +00:00
Daniel Journo
bc6eeab822 app_voicemail: Cannot set fromstring on a per-mailbox basis
* apps/app_voicemail.c fromstring field added to mailbox which will
override the global fromstring if set.

ASTERISK-24562 #close

Change-Id: I5e90e3a1ec2b2d5340b49a0db825e4bbb158b2fe
2017-03-08 19:24:52 +00:00
Joshua Colp
a860bf63e1 Merge "pbx_spool: Gracefully handle long lines in call files" into 13 2017-03-07 17:20:31 -06:00
Daniel Journo
d9972423d1 Saynumber is trying to get "and" from "digits/" subfolder
* say.c Changed 'digits/and' to 'vm-and' for en_GB

ASTERISK-26598 #close

Change-Id: If1b713e5daea6f952b339f139178d292a6c4fcfe
2017-03-06 21:54:23 +00:00
Sean Bright
77901a58ca pbx_spool: Gracefully handle long lines in call files
Per the linked issue, we aren't checking the buffer filled by fgets()
to determine if it contains a newline, so we will fail to correctly
parse the trailing portion of a long line.

This patch increases the buffer size from 256 to 1024, and skips any
line that exceeds that length, logging a warning in the process.

ASTERISK-17067 #close
Reported by: Dave Olszewski

Change-Id: I51bcf270c1b4347ba05b43f18dc2094c76f5d7b0
2017-03-06 16:29:17 -05:00
Richard Mudgett
4271c700f7 core: Cleanup ast_get_hint() usage.
* manager.c:manager_state_cb() Fix potential use of uninitialized hint[]
if a hint does not exist for the requested extension.  Ran into this when
developing a testsuite test.  The AMI event ExtensionStatus came out with
the hint header value containing garbage.  The AMI event PresenceStatus
also had the same issue.

* manager.c:action_extensionstate() no need to completely initialize the
hint[].  Only initialize the first element.

* pbx.c:ast_add_hint() Remove unnecessary assignment.

* chan_sip.c: Eliminate an unneeded hint[] local variable.  We only care
about the return value of ast_get_hint() there.

Change-Id: Ia9a8786f01f93f1f917200f0a50bead0319af97b
2017-03-02 21:43:23 -06:00
Joshua Colp
75ebd8f0d2 Merge "res_pjsip WebRTC/websockets: Fix usage of WS vs WSS." into 13 2017-03-01 18:25:33 -06:00
zuul
65a025e9fa Merge "chan_sip: Allow DTLS to be disabled when reloading." into 13 2017-03-01 11:43:55 -06:00
Jørgen H
e510595c86 res_pjsip WebRTC/websockets: Fix usage of WS vs WSS.
According to the RFC[1] WSS should only be used in the Via header
for secure Websockets.

* Use WSS in Via for secure transport.

* Only register one transport with the WS name because it would be
ambiguous.  Outgoing requests may try to find the transport by name and
pjproject only finds the first one registered.  This may mess up unsecure
websockets but the impact should be minimal.  Firefox and Chrome do not
support anything other than secure websockets anymore.

* Added and updated some debug messages concerning websockets.

* security_events.c: Relax case restriction when determining security
transport type.

* The res_pjsip_nat module has been updated to not touch the transport
on Websocket originating messages.

[1] https://tools.ietf.org/html/rfc7118

ASTERISK-26796 #close

Change-Id: Ie3a0fb1a41101a4c1e49d875a8aa87b189e7ab12
2017-03-01 15:52:16 +00:00
Sean Bright
76971d4c4a res_config_pgsql: Make 'require' return consistent with other backends
res_config_pgsql should match the behavior of other realtime backend
drivers so that queue_log can disable adaptive logging.

ASTERISK-25628 #close
Reported by: Dmitry Wagin

Change-Id: Ic1fb1600c7ce10fdfb1bcdc43c5576b7e0014372
2017-03-01 08:23:55 -05:00
zuul
848e211e1c Merge "res_config_pgsql: Release table locks where appropriate" into 13 2017-02-28 19:30:20 -06:00
zuul
c36cab8468 Merge "res_pjsip_outbound_registration: Subscribe to network change events" into 13 2017-02-28 19:24:10 -06:00
zuul
4bff6bc144 Merge "build: Warn if asterisk is installed in both 32 and 64 bit sys dirs" into 13 2017-02-28 17:28:37 -06:00
zuul
024e724aca Merge "res_pjsip_pubsub: Remove unneeded endpoint unref" into 13 2017-02-28 17:14:30 -06:00
zuul
acb906fa2f Merge "bridge_native_rtp: Handle case where channel joins already suspended." into 13 2017-02-28 14:42:40 -06:00
zuul
59a00786e8 Merge "config: Improve documentation and behavior of outbound_proxy option." into 13 2017-02-28 13:32:22 -06:00
zuul
bf3cb76452 Merge "res_pjsip: Fix crash when contact has no status" into 13 2017-02-28 13:32:19 -06:00
Sean Bright
fa8f6c2fc4 res_config_pgsql: Release table locks where appropriate
The find_table() functions NULL or a locked table pointer. We are
not consistently calling release_table() in failure paths.

Change-Id: I6f665b455799c84b036e5b34904b82b05eab9544
2017-02-28 10:41:45 -05:00
Tzafrir Cohen
5b34b751a0 pjsip.conf.sample: user_agent: not a specific version
Use the description of useragent from sip.conf here.

ASTERISK-26825 #close

Change-Id: I5b33a4aaa0ae1d793289d05e3bc09521affbf755
2017-02-28 06:21:49 -06:00
George Joseph
8e6ecdade2 res_pjsip_pubsub: Remove unneeded endpoint unref
When a subscription was being recreated and the endpoint wasn't
found, we were trying to unref the endpoint.  This was causing
FRACKs.  Removed the unref.

ASTERISK-26823 #close

Change-Id: If86d2aecff8fe853c7f38a1bfde721fcef3cd164
2017-02-27 19:07:06 -07:00
Jørgen H
0595c31da7 res_pjsip: Fix crash when contact has no status
This change fixes an assumption in res_pjsip that a contact will
always have a status. There is a race condition where this is
not true and would crash. The status will now be unknown when
this situation occurs.

ASTERISK-26623 #close

Change-Id: Id52d3ca4d788562d236da49990a319118f8d22b5
2017-02-27 15:18:52 -06:00
George Joseph
c07bcca87e res_pjsip_outbound_registration: Subscribe to network change events
Outbound registration now subscribes to network change events
published by res_stun_monitor and refreshes all registrations
when an event happens.

The 'pjsip send (un)register' CLI commands were updated to accept
'*all' as an argument to operate on all registrations.

The 'PJSIP(Un)Register' AMI commands were also updated to
accept '*all'.

ASTERISK-26808 #close

Change-Id: Iad58a9e0aa5d340477fca200bf293187a6ca5a25
2017-02-27 14:09:51 -07:00
Vitezslav Novy
d91f61f0b5 chan_sip: Allow DTLS to be disabled when reloading.
This change fixes a problem where removing the DTLS configuration
options and reloading would not disable DTLS. This occurred
because the DTLS configuration was not reset to an unconfigured
state on reload.

ASTERISK-26313

Change-Id: I10952709cc4a7727fb50534b042bce9d64894b39
2017-02-27 13:03:24 -06:00
George Joseph
3d2c119778 build: Warn if asterisk is installed in both 32 and 64 bit sys dirs
... and clean them both up on uninstall.

We've fixed the issue where 'make install' was installing to
/usr/lib on 64-bit systems that use /usr/lib64.  Now we need
to clean up the remnants in /usr/lib.

* 'make install' now prints a warning if DESTDIR/ASTLIBDIR
  contains 'lib64' and libasterisk* shared libraries or modules
  are also found in DESTDIR/ASTLIBDIR with 'lib64' transformed
  to 'lib'.

* 'make uninstall' ALWAYS cleans up both DESTDIR/ASTLIBDIR and
  DESTDIR/ASTLIBDIR with 'lib64' transformed to 'lib'.

ASTERISK-26705

Change-Id: I6edddeb3c07a51e7c7ba7cac3c05e4bf3ec3f01f
2017-02-27 11:55:41 -07:00
Joshua Colp
eac818801b bridge_native_rtp: Handle case where channel joins already suspended.
The bridge_native_rtp module did not properly handle the case where
a smart bridge operation occurs while a channel is suspended. In this
scenario the module would incorrectly set up local or remote RTP
bridging despite the media having to flow through Asterisk. The remote
endpoint would see two media streams and experience wonky audio.

The module has been changed so that it ensures both channels are
not suspended when performing the native RTP bridging and this
requirement has been documented in the bridge technology.

ASTERISK-26781

Change-Id: Id4022d73ace837d4a293106445e3ade10dbc7c7c
2017-02-27 13:02:38 +00:00
Joshua Colp
9d3ab062cc Merge "pjproject_bundled: Update for pjproject 2.6" into 13 2017-02-24 12:48:53 -06:00
Joshua Colp
1d5b6fe2b6 Merge "build: Execute ldconfig to build cache. (take two)" into 13 2017-02-24 11:51:50 -06:00
Joshua Colp
d49af061bc config: Improve documentation and behavior of outbound_proxy option.
This change updates the documentation for the outbound_proxy option
to ensure it is consistently stated that a full SIP URI must be
provided for the option.

The res_pjsip_outbound_registration module has also been changed so
that the provided outbound_proxy value is checked to ensure it is a
URI and if not an error is output stating so.

ASTERISK-26782

Change-Id: I6c239a32274846fd44e65b44ad9bf6373479b593
2017-02-24 17:49:59 +00:00
George Joseph
9c05ddbddd pjproject_bundled: Update for pjproject 2.6
* Removed all 2.5.5 functional patches.
 * Updated usages of pj_release_pool to be "safe".
 * Updated configure options to disable webrtc.
 * Updated config_site.h to disable webrtc in pjmedia.
 * Added Richard Mudgett's recent resolver patches.

Change-Id: Ib400cc4dfca68b3d07ce14d314e829bfddc252c7
2017-02-23 15:23:15 -07:00
George Joseph
bee55aaf2c build: Execute ldconfig to build cache. (take two)
On some platforms a multiarch approach is used for libraries.
The build system does not take this into account and still
places libraries into the lib directory if no --libdir is
specified to configure. On initial startup this results in
libasteriskssl.so not being found, as it is not in the multiarch
lib directory.  To make matters worse, options were being passed
to ldconfig on both Linux and FreeBSD that actually prevented
the rebuild of the cache.

 * Fedora has a /usr/share/config.site that automatically tells
   autoconf to use /usr/lib64 but CentOS does not. This logic was
   copied to configure.ac and modified so systems like Ubuntu,
   which still use /usr/lib for 64-bit systems, aren't affected.

Now that we have them in the correct directory...

In order for the system loader to find libasteriskssl and
libasteriskpj, one of 3 things has to happen...

  - The linker cache must be rebuilt including the directory
    where the libasterisk* libraries were installed.  Only root
    can rebuild the cache.  This was busted.
  - We have to link the asterisk binary with an rpath pointing
    to the directrory where the libasterisk* libraries were
    installed.  This makes things very complicated and will happen
    over the collective dead bodies of everyone who's had to
    package a distribution with an rpath.
  - Finally, you can start asterisk with LD_LIBRARY_PATH set to the
    directrory where the libasterisk* libraries were installed.

There are no other options. So...

 * The invokation of ldconfig has been moved from main/Makefile
   to ASTTOPDIR/Makefile, the options have been removed, and
   DESTDIR/ASTLIBDIR appended.  If you aren't root, you will be
   warned after the "Asterisk Installation Compete" banner that
   you must re-run 'make install' as root, manually run
   'ldconfig DESTDIR/ASTLIBDIR' as root, or run asterisk with
   LD_LIBRARY_PATH.

ASTERISK-26705

Change-Id: I2a64b7c33a7d3e9bde20f47e3d3ab771977af982
2017-02-23 14:49:17 -07:00
Sean Bright
da0cadd100 res_config_pgsql: Fix thread safety problems
* A missing AST_LIST_UNLOCK() in find_table()

* The ESCAPE_STRING() macro uses pgsqlConn under the hood and we were
  not consistently locking before calling it.

* There were a handful of other places where pgsqlConn was accessed
  directly without appropriate locking.

Change-Id: Iea63f0728f76985a01e95b9912c3c5c6065836ed
2017-02-23 15:48:53 -05:00
Joshua Colp
803afec45f Merge "res_config_ldap: Various code improvements" into 13 2017-02-23 12:06:41 -06:00
Sean Bright
f1963c5b8d res_config_ldap: Various code improvements
The initial motivation for this patch was to properly handle memory
allocation failures - we weren't checking the return values from the
various LDAP library allocation functions.

In the process, because update_ldap() and update2_ldap() were
substantially the same code, they've been consolidated.

Change-Id: Iebcfe404177cc6860ee5087976fe97812221b822
2017-02-22 17:37:34 -06:00
Michael L. Young
1ec796ce18 build_tools: Fix download_externals to allow the use of curl or wget
Not sure if this is really a bug versus an improvement. I can see it being
viewed as a bug though by some.

The current build_tools/download_externals file depends on wget in order to
download external modules.  The current build system is able to discover
which tool to use for fetching remote files - either wget or curl.

This patch takes advantage of this capability by modifying the two calls to
the wget binary to instead use what was discovered by the build system.

ASTERISK-26812 #close

Change-Id: If9411a2554f009274d377445613ae91192d948a1
2017-02-22 16:50:20 -05:00
zuul
debaf377be Merge "Revert "build: Execute ldconfig to build cache."" into 13 2017-02-22 13:56:50 -06:00
zuul
726e3945c3 Merge "pbx_realtime: Prevent premature extension matching" into 13 2017-02-22 12:08:47 -06:00
Joshua Colp
5c9c097d17 Revert "build: Execute ldconfig to build cache."
This reverts commit d90430953c.

Change-Id: I758fe7ea0408f83a6df8e1774310d69f482700f6
2017-02-22 11:13:04 -06:00
zuul
89e0bf6ddd Merge "pbx_dundi: DUNDi weight parameter not processed correctly" into 13 2017-02-22 10:19:49 -06:00
Joshua Colp
e9c8514b03 Merge "realtime: Fix ast_load_realtime_multientry handling" into 13 2017-02-22 08:40:41 -06:00
Sean Bright
ca6d001144 pbx_realtime: Prevent premature extension matching
The patterns provided by pbx_realtime were checked in the order in
which they were returned from the realtime backend. If there was
overlap between multiple patterns, the first one to correctly match was
chosen even though it may not have been the best match.

We now sort the patterns descending by their length and compare in that
order. There may be cases where this still results in a sub-optimal
match, but this patch should improve the overall behavior.

ASTERISK-18271 #close
Reported by: Charlie Smurthwaite

Change-Id: I56d9ac15810eb1775966b669c3028e32cc7bd809
2017-02-22 05:31:22 -06:00
Joshua Colp
c637285419 Merge changes from topic 'ASTERISK-26669' into 13
* changes:
  pjproject: Fixes to resolve DNS SRV crashes.
  pjproject: Increase SENDER_WIDTH column size for 64-bit system logs.
2017-02-22 04:48:47 -06:00
zuul
4e0dba31cf Merge "res_pjsip_authenticator_digest.c: Fix sorcery's immutable contract violation." into 13 2017-02-21 21:56:45 -06:00
zuul
0afff51e72 Merge "pjsip_distributor.c: Update some debug messages to get transaction name." into 13 2017-02-21 21:17:28 -06:00
zuul
a3584c6834 Merge "res_pjsip: Record the serializer earlier on the tdata." into 13 2017-02-21 21:17:24 -06:00
zuul
51c9dd3d16 Merge "res_pjsip: Update artificial auth whenever default_realm changes." into 13 2017-02-21 21:17:20 -06:00
zuul
38b04d7dac Merge "res_pjsip: Update authentication realm documentation." into 13 2017-02-21 20:41:27 -06:00
George Joseph
61172a841b Merge "realtime: Centralize some common realtime backend code" into 13 2017-02-21 18:34:47 -06:00
Sean Bright
0654bf637c pbx_dundi: DUNDi weight parameter not processed correctly
The DUNDi weight field is not always converted from network byte order
to host byte order. This can result in incorrect weight values and
incorrect selection of DUNDi destinations.

ASTERISK-18731 #close
Reported by: Peter Racz
Patches:
	dundi_weight.patch (license #6290) patch uploaded by Peter Racz

Change-Id: Iba3e1a700ff539db57211a7bbc26f7b22ea9a1be
2017-02-21 17:10:11 -06:00