Commit Graph

28270 Commits

Author SHA1 Message Date
Joshua Colp
a4ba3d2b52 Merge "res_pjsip res_pjsip_mwi: Misc fixes and cleanups." into 14 2016-08-12 04:46:29 -05:00
zuul
15540119c0 Merge "pjsip_distributor.c: Add missing allocation failure check." into 14 2016-08-12 03:22:29 -05:00
zuul
d003057ff5 Merge "res_pjsip: Make aor named lock a mutex." into 14 2016-08-11 23:14:42 -05:00
zuul
6092514405 Merge "taskprocessor.c: Tweak high water checks." into 14 2016-08-11 21:17:56 -05:00
zuul
ef3973f57f Merge "res_odbc: Show only when there a fail attempt of connection in CLI" into 14 2016-08-11 21:17:54 -05:00
Joshua Colp
cf48c672af Merge "cdr_adaptive_odbc: Fix DNSs mixed config quote quoted_identifiers" into 14 2016-08-11 19:42:09 -05:00
Joshua Colp
968e78f9be Merge "autohints: Update CHANGES and extensions.conf.sample" into 14 2016-08-11 16:10:36 -05:00
zuul
8071c3d04e Merge "Fixed compile flags for non-module libs" into 14 2016-08-11 14:08:52 -05:00
zuul
ef7361659f Merge "res_resolver_unbound: Allow compilation with libunbound version < 1.5" into 14 2016-08-11 12:30:19 -05:00
Richard Mudgett
63863ed0f3 res_pjsip res_pjsip_mwi: Misc fixes and cleanups.
* Eliminated RAII_VAR() usage in
ast_sip_persistent_endpoint_update_state().

* Added a missing allocation failure check to
persistent_endpoint_find_or_create().

* Made persistent_endpoint_find_or_create() create the new object without
a lock as it isn't needed.

* Cleaned up some ao2 container allocation idioms.

* Reordered res_pjsip_mwi.c load_module() and unload_module()

Change-Id: If8ce88fbd82a0c72a37a2388f74f77237a6a36a8
2016-08-11 12:17:34 -05:00
George Joseph
96887cc110 autohints: Update CHANGES and extensions.conf.sample
Make it clear that we're talking about device state hints and add
an entry to the sample config.

Change-Id: Iaef58ffb960191a21b713e8e0b51ce1fcd47e433
2016-08-11 11:01:33 -06:00
Richard Mudgett
7f9789fc39 taskprocessor.c: Tweak high water checks.
* The high water check in ast_taskprocessor_alert_set_levels() would
trigger immediately if the new high water level is zero and the queue was
empty.

* The high water check in taskprocessor_push() was off by one.

Change-Id: I687729fb4efa6a0ba38ec9c1c133c4d407bc3d5d
2016-08-11 11:59:58 -05:00
Richard Mudgett
94ff684388 res_pjsip: Make aor named lock a mutex.
The named aor lock was always being locked for writes so a rwlock adds no
benefit and may be slower because rwlocks are biased toward read locking.

Change-Id: I8c5c2c780eb30ce5441832257beeb3506fd12b28
2016-08-11 11:58:25 -05:00
Richard Mudgett
31a1b066ee pjsip_distributor.c: Add missing allocation failure check.
Change-Id: I932ab2cea845e534d9ff318035b6de39972d3b28
2016-08-11 11:57:10 -05:00
zuul
b08497c048 Merge "channels/chan_pjsip: Add PJSIP_SEND_SESSION_REFRESH" into 14 2016-08-11 11:43:20 -05:00
David M. Lee
919824ebbc Fixed compile flags for non-module libs
The non-module libs libasteriskssl.dylib and libasteriskpj.dylib have
long been missing the AST_NOT_MODULE compile flag. This was mostly
okay, until a recent fix to improve compiler warnings when the
AST_MODULE_SELF_SYM is missing broke the build on OS X/macOS/whatever
they are calling it these days.

Change-Id: I2cb51c890824f001280a5114f2e775f97c163516
2016-08-11 10:50:09 -05:00
Joshua Colp
01c49ac889 Merge "res_srtp: Move SDP SRTP code from the core to res_srtp." into 14 2016-08-11 06:20:38 -05:00
zuul
9c5bc68e0f Merge "alembic/sqlalchemy: auto increment only allowed on a single column" into 14 2016-08-10 20:26:06 -05:00
Richard Mudgett
34d366eb0c res_srtp: Move SDP SRTP code from the core to res_srtp.
A patch made to the master branch (Now the 14 branch) inadvertently made
libsrtp a required dependency in order to compile Asterisk.  Rather than
create dummy defines to substitute for the defines supplied by libsrtp
when libsrtp is not available, most of the code in sdp_srtp.c is moved
into res_srtp.c.  This gets more code out of Asterisk's core that isn't
used when SRTP is not available.  This also makes another inadvertent
required dependency on libsrtp by Asterisk's core unlikely.

ASTERISK-26253 #close
Reported by: Ben Merrills

Change-Id: I0a46cde81501c0405399c2588633ae32706d1ee7
2016-08-10 17:32:42 -05:00
Alexei Gradinari
ecad35e147 pjsip: Fix deadlock with suspend taskprocessor on masquerade
If both channels which should be masqueraded
are in the same serializer:
1st channel will be locked waiting condition 'complete'
2nd channel will be locked waiting condition 'suspended'

On heavy load system a chance that both channels will be in
the same serializer 'pjsip/distibutor' is very high.

To reproduce compile res_pjsip/pjsip_distributor.c with
DISTRIBUTOR_POOL_SIZE=1

Steps to reproduce:
1. Party A calls Party B (bridged call 'AB')
2. Party B places Party A on hold
3. Party B calls Voicemail app (non-bridged call 'BV')
4. Party B attended transfers Party A to voicemail using REFER.
5. When asterisk masquerades calls 'AB' and 'BV',
   a deadlock is happened.

This patch adds a suspension indicator to the taskprocessor.
When a session suspends/unsuspends the serializer
it sets the indicator to the appropriate state.
The session checks the suspension indicator before
suspend the serializer.

ASTERISK-26145 #close

Change-Id: Iaaebee60013a58c942ba47b1b4930a63e686663b
2016-08-10 15:14:56 -05:00
Kevin Harwell
223b7756a6 alembic/sqlalchemy: auto increment only allowed on a single column
The extensions table defined two columns (id and priority) as primary key
autoincrement columns. However only one is allowed when defining the primary
key.

This patch removes the autoincrement attribute from the priority column since
it does not need to be as such and really should not have been on there in the
first place.

This patch also removes 'context', 'exten', and 'priority' from the primary key
index and creates a new combined unique contraint index on them.

ASTERISK-26183 #close

Change-Id: Ib9c712c612a4d7ec1edb0dcb77f1bae0905a470b
2016-08-10 13:50:20 -05:00
George Joseph
a8512f9afe res_resolver_unbound: Allow compilation with libunbound version < 1.5
libunbound at version 1.4.20 (which CentOS still uses) declared all
of their string function parameters as as 'char *'.  1.4.21 changed
them all to 'const char *'.  Thankfully 1.4.21 also introduced the
UNBOUND_VERSION_MAJOR define so configure now checks for that and
sets HAVE_UNBOUND_CONST_PARAMS.  res_resolver_unbound then checks
that and casts away the 'const' if it's not set.

Tested compile and testsuite on CentOS6 (1.4.20), Ubuntu14 (1.4.22) and
Fedora24 (1.5.4).  There are a few failing tests to be addressed though.

ASTERISK-26283 #close

Change-Id: Ib708b19b706c5d0ba7b7d5473e6df339d9ae4148
2016-08-10 11:08:25 -06:00
Matt Jordan
eec60dd773 channels/chan_pjsip: Add PJSIP_SEND_SESSION_REFRESH
This patch adds a new PJSIP specific dialplan function,
PJSIP_SEND_SESSION_REFRESH. When invoked on a PJSIP channel, the media
session will be refreshed via either an UPDATE or re-INVITE request.
When used in conjunction with the PJSIP_MEDIA_OFFER dialplan function,
the formats in use on a PJSIP channel can be re-negotiated and changed
dynamically after call setup.

ASTERISK-26277 #close

Change-Id: Ib98fe09ba889aafe26d58d32f0fd1323f8fd9b1b
2016-08-10 11:26:33 -05:00
zuul
d85e9d99cb Merge "res_rtp_asterisk: Cache local RTCP address." into 14 2016-08-10 10:37:40 -05:00
zuul
400ce294e6 Merge "Produce friendly error when AST_MODULE_SELF_SYM is not defined." into 14 2016-08-09 19:09:36 -05:00
Rodrigo Ramírez Norambuena
9ce71b6f9e cdr_adaptive_odbc: Fix DNSs mixed config quote quoted_identifiers
When haved more than once DNSs config and one of their dont set
quoted_identifiers and before this is with configurated with
quoted_identifiers resulting a truncate statement for a reference null
for quote character identifier.

This patch initializes quoted flag before build SQL Query

Example config for this bugfix case in cdr_adaptive_odbc.conf file

	[first]
	connection=asterisk-server1
	table=cdr
	quoted_identifiers="

	[second]
	connection=asterisk-server2
	table=cdr

	[third]
	connection=asterisk-server3
	table=cdr
	quoted_identifiers=`

Change-Id: Ibd95667b468e10d4a19a2b9d88b9934ec7207e1d
2016-08-09 17:12:32 -05:00
Rodrigo Ramírez Norambuena
c2652d05d9 res_odbc: Show only when there a fail attempt of connection in CLI
When is executed CLI command "odbc show all" every time is show
information about variable last_negative_connect. If not there  a fail
attempt of connection will show date like "1969-12-31 21:00:00".

This patch fix there situation for to show only this information when
exists a fail attempt before.

Change-Id: I7c058b0be6f7642e922de75ee6b82c7276c9f113
2016-08-09 17:12:12 -05:00
zuul
00a0101f2a Merge "res_pjsip_mwi: fix unsolicited mwi blocks PJSIP stack" into 14 2016-08-09 16:36:02 -05:00
Mark Michelson
5c203c6ca3 res_rtp_asterisk: Cache local RTCP address.
When an RTCP packet is sent or received, res_rtp_asterisk generates a
Stasis event that contains the RTCP report as well as the local and
remote addresses that the report pertains to.

The addresses are determined using ast_find_ourip(). For the local
address, this will typically result in a lookup of the hostname of the
server, and then a DNS lookup of that hostname. If you do not have the
host in /etc/hosts, then this results in a full DNS lookup, which can
potentially block for some time.

This is especially problematic when performing RTCP reads, since those
are done on the same thread responsible for reading and writing media.

This patch addresses the issue by performing a lookup of the local
address when RTCP is allocated. We then use this cached local address
for the Stasis events when necessary.

ASTERISK-26280 #close
Reported by Mark Michelson

Change-Id: I3dd61882c2e57036f09f0c390cf38f7c87e9b556
2016-08-09 16:22:47 -05:00
zuul
028171f465 Merge "res_pjsip_outbound_publish: Use a serializer shutdown group for unload." into 14 2016-08-09 16:19:01 -05:00
Corey Farrell
bbaebd75c4 Produce friendly error when AST_MODULE_SELF_SYM is not defined.
Modules must define AST_MODULE_SELF_SYM to be used as the name of a
generated function.  This produces a friendly error when it's not
defined.

ASTERISK-26278 #close

Change-Id: Ib9d35a08104529c516d636771365e02c6e77a45b
2016-08-08 20:48:33 -04:00
Alexei Gradinari
4d6d3eb268 res_pjsip_mwi: fix unsolicited mwi blocks PJSIP stack
The PJSIP taskprocessors could be overflowed on startup
if there are many (thousands) realtime endpoints
configured with unsolicited mwi.
The PJSIP stack could be totally unresponsive for a few minutes
after boot completed.

This patch creates a separate PJSIP serializers pool for mwi
and makes unsolicited mwi use serializers from this pool.
This patch also adds 2 new global options to tune taskprocessor
alert levels: 'mwi_tps_queue_high' and 'mwi_tps_queue_low'.

This patch also adds new global option 'mwi_disable_initial_unsolicited'
to disable sending unsolicited mwi to all endpoints on startup.
If disabled then unsolicited mwi will start processing
on next endpoint's contact update.

ASTERISK-26230 #close

Change-Id: I4c8ecb82c249eb887930980a800c9f87f28f861a
2016-08-08 13:58:31 -05:00
Alexei Gradinari
5d74c0ea30 app_voicemail: Add taskprocessor alert level options.
On heavy loaded system with IMAP or DB storage,
'app_voicemail' taskprocessor queue could reach 500 scheduled tasks.
It could happen when the IMAP or DB server dies or is unreachable.
It could happen on startup when there are many (thousands)
realtime endpoints configured with unsolicited mwi.
If the taskprocessor queue reaches the high water level
then the alert is triggered and pjsip stops processing new requests
until the queue reaches the low water level to clear the alert.

This patch adds 2 new 'general' configuration options
to tune taskprocessor alert levels:
'tps_queue_high' - Taskprocessor high water alert trigger level.
'tps_queue_low' - Taskprocessor low water clear alert level

ASTERISK-26229 #close

Change-Id: I766294fbffedf64053c0d9ac0bedd3109f043ee8
2016-08-05 16:45:38 -04:00
Joshua Colp
a9592043dc res_pjsip_outbound_publish: Use a serializer shutdown group for unload.
This change replaces the custom unload process for the outbound
publish module with the common serializer shutdown group.

ASTERISK-25217 #close

Change-Id: I280a0384d860c486202d87d2d674394cca77ffb6
2016-08-04 15:35:09 +00:00
Kevin Harwell
93aa3f74a2 resource_channels: Sync with ARI stubs
This file was out of sync with the current ARI definitions.

Change-Id: Ie7cb7d6d3c2eeb9cc9d683ca87b43b117e713d0a
2016-08-04 10:27:48 -05:00
Corey Farrell
8e6a28e86b Add missing checks during startup.
This ensures startup is canceled due to allocation failures from the
following initializations.
* channel.c: ast_channels_init
* config_options.c: aco_init

ASTERISK-26265 #close

Change-Id: I911ed08fa2a3be35de55903e0225957bcdbe9611
2016-08-03 16:41:04 -04:00
Joshua Colp
d1f973906a astconfigparser: Really handle case where line is simply a comment.
The regular expression would match causing the code that handled
the line if it was merely a comment to never get executed.

Change-Id: I3e4022481037ebcba9905587fe8c764b4ce21819
2016-08-03 09:49:38 -05:00
zuul
2306c71052 Merge "res_pjsip: SIP/SDP origin (o=) contained square brackets on IP6 transports." into 14 2016-08-02 15:13:19 -05:00
Kevin Harwell
9b926ac4f0 make_ari_stubs: Updated WIKI_PREFIX for 14
Change-Id: Id5678d20d8892fdcde7849c810d492527e77c15d
2016-08-02 14:26:21 -05:00
zuul
177ea926b2 Merge "menuselect: Add an opaque "member_data" string to the acceptable xml" into 14 2016-08-02 13:43:41 -05:00
Kevin Harwell
63dd0fab30 rest-api: Code out of sync with the model
Change-Id: Idccaa26fd4a423d47d013ee592b8fa6a0349c006
2016-08-02 13:04:05 -05:00
zuul
be170d0ed9 Merge "sorcery: Use more compatible regex for local expressions." into 14 2016-08-02 11:28:19 -05:00
zuul
342a2e53b7 Merge "pjproject: fixed a few bugs" into 14 2016-08-02 10:50:47 -05:00
Joshua Colp
b63262e7bf sorcery: Use more compatible regex for local expressions.
This changes the use of an empty regex for both res_sorcery_config
and res_sorcery_memory to "." instead. This is a more compatible
regular expression which also works on FreeBSD.

ASTERISK-26206 #close

Change-Id: Ia9166dd176f1597555ba22b6931180d0626c1388
2016-08-02 05:25:28 -05:00
Alexander Traud
7e0178925f res_pjsip: SIP/SDP origin (o=) contained square brackets on IP6 transports.
ASTERISK-26256 #close

Change-Id: I3fd68df561f81fdb8c6c497d465b50c12422f058
2016-08-02 03:16:10 -05:00
George Joseph
eefd446b9f menuselect: Add an opaque "member_data" string to the acceptable xml
Change-Id: Id5ac43b95c8d7395f3be37f983632169db3d1afe
2016-08-01 16:14:18 -05:00
zuul
ca721b7629 Merge "astconfigparser: Handle case where line is simply a comment." into 14 2016-08-01 15:05:09 -05:00
Joshua Colp
44b1492c83 Merge "Remove SILK payload mappings from Asterisk core." into 14 2016-08-01 14:52:27 -05:00
zuul
62c3bb566c Merge "pbx.c: Fix handling of '-' in extension name and callerid" into 14 2016-08-01 09:06:50 -05:00
Mark Michelson
d50895c7b0 Remove SILK payload mappings from Asterisk core.
SILK is a bit of a hog when it comes to using up our limited number of
dynamic payload types in the RTP engine. By freeing up four slots, it
allows for other codecs to potentially take the place.

Now, codec_silk.so will dynamically use the payload slots in the RTP
engine when it loads.

A better fix would be make RTP dynamic payload types actually
dynamic. However, at this stage of Asterisk 14 development, this is a
risky move that would be imprudent.

Change-Id: I5774e09408f9a203db189529eabdc0d3f4c1e612
2016-07-29 13:13:55 -05:00