Commit Graph

28977 Commits

Author SHA1 Message Date
Jenkins2
997c11235e Merge "app_voicemail: IMAP connection control" into 13 2017-06-29 09:03:05 -05:00
Torrey Searle
1f59d08924 res/res_pjsip_t38: fix incorrect increment of media_count
The T38 sdp callback incorrectly has a side effect of incrementing
the media_count.  This can lead to core dumps.

Change-Id: I7bb2f4987de4046ec52cfc34e5ea0662dae32af8
2017-06-27 17:46:43 +02:00
Torrey Searle
9fbc34d2bd res_pjsip: Add DTMF INFO Failback mode
The existing auto dtmf mode reverts to inband if 4733 fails to be
negotiated.  This patch adds a new mode auto_info which will
switch to INFO instead of inband if 4733 is not available.

ASTERISK-27066 #close

Change-Id: Id185b11e84afd9191a2f269e8443019047765e91
2017-06-23 09:15:24 +02:00
Richard Mudgett
764d04fa87 res_pjsip_mwi.c: Eliminate RAII_VAR in contact delete observer
Change-Id: I0bc97c6608de1d1a4228826b3b3be43f162f05f3
2017-06-21 18:21:57 -05:00
Alexei Gradinari
0f6a9617eb res_pjsip_mwi: update unsolicited MWI subscriptions on updating contact
Do not need to unsubscribe/subscribe on creating the ednpoint's contact.
The modified function create_mwi_subscriptions_for_endpoint adds
the subscription only if it does not exist.

The subscriptions aren't added for active contacts
which are retrieved on startup from realtime
if mwi_disable_initial_unsolicited=yes.
Because the mwi_contact_added is not called.
So the subscriptions also should be created on updating contact.

ASTERISK-26230 #close

Change-Id: I47e265af9296ca09aa42a316fdacac104148cee4
2017-06-21 18:21:57 -05:00
Jenkins2
bd9d72793d Merge "core_local: local channel data not being properly unref'ed and unlocked" into 13 2017-06-21 18:06:44 -05:00
Joshua Colp
7b325d55e1 Merge "bridge: stuck channel(s) after failed attended transfer" into 13 2017-06-21 17:36:54 -05:00
Kevin Harwell
1f9913f272 core_local: local channel data not being properly unref'ed and unlocked
In an earlier version of Asterisk a local channel [un]lock all functions were
added in order to keep a crash from occurring when a channel hung up too early
during an attended transfer. Unfortunately, when a transfer failure occurs and
depending on the timing, the local channels sometime do not get properly
unlocked and deref'ed after being locked and ref'ed. This happens because the
underlying local channel structure gets NULLed out before unlocking.

This patch reworks those [un]lock functions and makes sure the values that get
locked and ref'ed later get unlocked and deref'ed.

ASTERISK-27074 #close

Change-Id: Ice96653e29bd9d6674ed5f95feb6b448ab148b09
2017-06-21 16:17:02 -05:00
Kevin Harwell
67664fbf95 bridge: stuck channel(s) after failed attended transfer
If an attended transfer failed it was possible for some of the channels
involved to get "stuck" because Asterisk was not hanging up the transfer target.

This patch ensures Asterisk hangs up the transfer target when an attended
transfer failure occurs.

ASTERISK-27075 #close

Change-Id: I98a6ecd92d3461ab98c36f0d9451d23adaf3e5f9
2017-06-21 11:16:47 -05:00
Jenkins2
9554166182 Merge "res_corosync: Change thread stack size" into 13 2017-06-20 18:12:14 -05:00
Jenkins2
2619c04f1e Merge "cdr: fix mistake spelling of a word for Unanswered." into 13 2017-06-20 09:15:58 -05:00
Jenkins2
34b3665612 Merge "res_pjsip_mwi: unsubscribe unsolicited MWI on deleting endpoint last contact" into 13 2017-06-20 05:45:51 -05:00
Rodrigo Ramírez Norambuena
cecf6540dc cdr: fix mistake spelling of a word for Unanswered.
Change-Id: I7a610bef369924523a445c7e849ee88cc45dc5df
2017-06-20 04:59:59 -05:00
Alexei Gradinari
8f356192d1 app_voicemail: IMAP connection control
A new global option "imap_poll_logout" was added to specify whether need to
disconnect from the IMAP server after polling of mailboxes.

ASTERISK-27068 #close

Closing IMAP connection after loading mailbox from voicemail.conf

ASTERISK-24052 #close

Change-Id: Ib7558ba04516240a32b65f42e9be64372a0ae12a
2017-06-19 18:21:29 -04:00
Jenkins2
507ce0aa95 Merge "res_stasis: Plug reference leak on stolen channels" into 13 2017-06-19 11:38:02 -05:00
George Joseph
470bccd769 Merge "app_voicemail: IMAP logout on reload/unload" into 13 2017-06-19 09:19:39 -05:00
Jenkins2
707e0e62e6 Merge "res_pjsip: New endpoint option "notify_early_inuse_ringing"" into 13 2017-06-19 08:48:09 -05:00
Alexei Gradinari
8e749c8f51 res_pjsip_mwi: unsubscribe unsolicited MWI on deleting endpoint last contact
If the endpoint's last contact is deleted unsolicited MWI has to be
unsubscribed.

ASTERISK-27051 #close

Change-Id: I33e174e0b9dba0998927d16d6d100fda5c7254e0
2017-06-16 18:45:51 -04:00
Jenkins2
2c87fced4f Merge "formats/format_g729: Fix typo in comment" into 13 2017-06-16 16:16:18 -05:00
Jenkins2
47b9651658 Merge "Core/PBX: Deadlock between dialplan execution and application unregistration." into 13 2017-06-16 16:05:39 -05:00
George Joseph
edfdb4dff5 res_stasis: Plug reference leak on stolen channels
When a stasis channel is stolen by another app, the control
structure is unreffed but never unlinked from the app_controls
container.  This causes the channel reference to leak.

Added OBJ_UNLINK to the callback in channel_stolen_cb.

Also added some additional channel lifecycle debug messages to
channel.c.

ASTERISK-27059 #close
Repoorted-by: George Joseph

Change-Id: Ib820936cd49453f20156971785e7f4f182c56e14
2017-06-16 15:06:56 -05:00
Matthew Fredrickson
0a40073750 formats/format_g729: Fix typo in comment
There was a typo in a comment.  This commit is to fix the typo.

ASTERISK-27060 #close

Change-Id: Ic2699f8dbeaacd58ccb6ec3203e853e1babe3235
2017-06-16 15:00:54 -05:00
Alexei Gradinari
a6e4899612 res_pjsip: New endpoint option "notify_early_inuse_ringing"
This option was added to control whether to notify dialog-info state
'early' or 'confirmed' on Ringing when already INUSE.
The value "yes" is useful for some SIP phones (Cisco SPA)
to be able to indicate and pick up ringing devices.

ASTERISK-26919 #close

Change-Id: Ie050bc30023543c7dfb4365c5be3ce58c738c711
2017-06-16 12:08:27 -04:00
Jenkins2
0b7a0681a3 Merge "res_ari: Add "module loaded" check to ari stubs" into 13 2017-06-16 10:57:43 -05:00
Jenkins2
d88344c3d4 Merge "chan_pjsip: Fix PJSIP_MEDIA_OFFER dialplan function read." into 13 2017-06-16 07:48:28 -05:00
Jan Friesse
005a4afa6b res_corosync: Change thread stack size
In Corosync 2.x libraries were changed to use LibQB IPC.
Sadly LibQB IPC doesn't support copy-free access to received buffer, so
Corosync libraries were rewritten to use stack as buffer. Mostly the
needed stack size is quite small, but for all *_dispatch functions, 1MiB
is needed.

Asterisk function ast_pthread_create_background set stack size for new
thread to much smaller AST_BACKGROUND_STACKSIZE (~500KiB).

This results in Asterisk crash when running with Corosync 2.x.

Patch solves this issue by creating it's own version of
ast_pthread_create_background which sets stack size to much higher value
(actually it's AST_BACKGROUND_STACKSIZE + 3MiB).

Another problem may appear when "corosync show members" netconsole
command is executed. It is also executed in thread and also has only
500KiB stack size. Sadly it calls corosync_cfg_get_node_addrs which
again needs at least 1MiB stack.

Solution is to use HAVE_COROSYNC_CFG_STATE_TRACK as a discriminator
between Corosync 1.x and 2.x. If 1.x is found, nothing changes. If 2.x
is found, NodeID is displayed instead of IP address.

ASTERISK-25370 #close
Reported by: mdu113

Change-Id: Id95b0d21ab6e708e7d74ad8786c587211676fa08
2017-06-16 14:44:34 +02:00
George Joseph
7901b9853e res_ari: Add "module loaded" check to ari stubs
The recent change to make the use of LOAD_DECLINE more consistent
caused res_ari to unload itself before declining if the ari.conf
file wasn't found.  The ari stubs though still tried to use the
configuration resulting in segfaults.

This patch creates a new CHECK_ARI_MODULE_LOADED macro which tests
to see if res_ari is actually loaded and causes the stubs to also
decline if it isn't.  The macro was then added to the mustache
template's "load_module" function.

ASTERISK-27026 #close
Reported-by: Ronald Raikes

Change-Id: I263d56efa628ee3c411bdcd16d49af6260c6c91d
2017-06-15 18:31:53 -06:00
Jenkins2
37bc343b58 Merge "channel: Fix reference counting in ast_channel_suppress." into 13 2017-06-15 16:18:26 -05:00
Alexei Gradinari
3b6c327c51 app_voicemail: IMAP logout on reload/unload
Closing IMAP connection on module reload or unload.

ASTERISK-24052 #close

Change-Id: I2a40182aa9ef249fa6865d33570430e9ada68525
2017-06-15 16:52:34 -04:00
Jenkins2
ae6c38db98 Merge "res_pjsip_pubsub: Fix reference to released endpoint" into 13 2017-06-15 15:02:31 -05:00
Jenkins2
5fa52f0b5a Merge "bridge: Add a deferred queue." into 13 2017-06-15 14:48:39 -05:00
Richard Mudgett
b9a4ab8c8c chan_pjsip: Fix PJSIP_MEDIA_OFFER dialplan function read.
The construction of the returned string assumed incorrectly that the
supplied buffer would always be initialized as an empty string.  If it is
not an empty string we could overrun the supplied buffer by the length of
the non-empty buffer string plus one.  It is also theoreticaly possible
for the supplied buffer to be overrun by a string terminator during a read
operation even if the supplied buffer is an empty string.

* Fix the assumption that the supplied buffer would already be an empty
string.  The buffer is not guaranteed to contain an empty string by all
possible callers.

* Fix string terminator buffer overrun potential.

Change-Id: If6a0806806527678c8554b1dcb34fd7808aa95c9
2017-06-15 12:33:22 -05:00
Jenkins2
8b12ad2f61 Merge "app_voicemail: IMAP logout on MWI unsubscribe" into 13 2017-06-15 09:23:58 -05:00
Jenkins2
a3b142dbe0 Merge "app_voicemail.c: Fix compile error when IMAP enabled." into 13 2017-06-15 08:46:01 -05:00
Jenkins2
320fb81580 Merge "res_pjsip_refer/session: Calls dropped during transfer" into 13 2017-06-15 08:01:31 -05:00
Joshua Colp
4910a3bf40 channel: Fix reference counting in ast_channel_suppress.
The ast_channel_suppress function wrongly decremented the
reference count of the underlying structure used to keep
track of what should be suppressed on a channel if the
function was called multiple times on the same channel.

This change cleans up the reference counting a bit so
this no longer occurs.

ASTERISK-27016

Change-Id: I2eed4077cb4916e6626f9f120b63b963acc5c136
2017-06-15 12:32:32 +00:00
George Joseph
8a858275eb Merge "res_rtp_asterisk: Fix ssrc change for rtcp srtp" into 13 2017-06-14 16:05:58 -05:00
Jenkins2
ffedf68136 Merge "res_pjsip_session: Correct inverted test in session_outgoing_nat_hook" into 13 2017-06-14 15:28:32 -05:00
Jenkins2
4ade9085d5 Merge "res_pjsip_transport_websocket: Add NULL check in get_write_timeout" into 13 2017-06-14 15:15:56 -05:00
George Joseph
3065bcd021 Merge "pjproject_bundled: Use the asterisk github mirror for download" into 13 2017-06-14 14:43:36 -05:00
Joshua Colp
4ece39f476 Merge "BuildSystem: Add patches to allow building with recent LibreSSL" into 13 2017-06-14 14:22:58 -05:00
Richard Mudgett
f1a209d5ac app_voicemail.c: Fix compile error when IMAP enabled.
Change-Id: I2703f15b4099b4210c68eccf293105d1975c1fc1
2017-06-14 12:34:06 -05:00
Frederic LE FOLL
dc307af7f2 Core/PBX: Deadlock between dialplan execution and application unregistration.
Not easy to reproduce, but we have noticed deadlocks when unloading a module
while dialplan is handling a request.

The deadlock is between :
1) Dialplan execution: pbx_extension_helper() first taking conlock,
then pbx_findapp() [when called] asking for lock on apps list.
2) Application unregistration: ast_unregister_application() first taking lock
on apps list, then unreference_cached_app() [when called] asking for conlock.

As a protection, I suggest to modify ast_unregister_application(), so that it
anticipates the need of conlock, before taking the lock on apps list.
The side effect is a longer unavailability of conlock when unregistering an
application.

ASTERISK-27041

Change-Id: I0db0f1eb320da6a5758cce3a47d765be1face8e2
2017-06-14 18:29:40 +02:00
George Joseph
c2eea791e4 res_pjsip_pubsub: Fix reference to released endpoint
destroy_subscription was attempting to get the id of the
subscription tree's endpoint after we'd already called ao2_cleanup
on it causing a segfault.

Moved the cleanup until after the debug statement and since
endpoint could also be NULL at this point, check for that as well.

ASTERISK-27057 #close
Reported-by: Ryan Smith

Change-Id: Ice0a7727f560cf204d870a774c6df71e159b1678
2017-06-14 10:12:21 -06:00
George Joseph
2dee95cc7a res_pjsip_session: Correct inverted test in session_outgoing_nat_hook
There was a typo introduced in commit 776ffd77 which was preventing
the transport's external media address from being used.

ASTERISK-27024 #close
Reported-by: Christopher van de Sande
patches:
	patch.diff submitted by Florian Floimair (license 6892)

Change-Id: I7ec617171eaa2d86d2680b00cf37d5088adafc27
2017-06-14 11:06:18 -05:00
Jenkins2
e26d15fabb Merge "CFLAGS for BIND8 support" into 13 2017-06-14 10:39:13 -05:00
Jørgen H
e16a669c70 res_pjsip_transport_websocket: Add NULL check in get_write_timeout
Added check for NULL return value when calling
ast_sorcery_retrieve_by_id in function get_write_timeout

ASTERISK-27046

Change-Id: I9357717278da631c3a1cb502c412693929b0cb41
2017-06-14 09:54:16 -05:00
Jenkins2
44d4b55697 Merge "res_pjsip_mwi: don't create mwi subscriptions if initial unsolicited disabled" into 13 2017-06-14 09:34:04 -05:00
George Joseph
7dafe82751 res_rtp_asterisk: Fix ssrc change for rtcp srtp
It looks like there was a copy/paste error in ast_rtp_change_source
where if there was a rtcp srtp instance, instead of updating its
ssrc we were updating the srtp instance ssrc twice.

ASTERISK-27022 #close
Reported-by: Michael Walton

Change-Id: Ic88f3aee7227b401c58745ac265ff92c19620095
2017-06-14 07:54:45 -06:00
Joshua Colp
e414833f6e bridge: Add a deferred queue.
This change adds a deferred queue to bridging. If a bridge
technology determines that a frame can not be written and
should be deferred it can indicate back to bridging to do so.
Bridging will then requeue any deferred frames upon a new
channel joining the bridge.

This change has been leveraged for T.38 request negotiate
control frames. Without the deferred queue there is a race
condition between the bridge receiving the T.38 request
negotiate and the second channel joining and being in the
bridge. If the channel is not yet in the bridge then the T.38
negotiation fails.

A unit test has also been added that confirms that a T.38
request negotiate control frame is deferred when no other
channel is in the bridge and that it is requeued when a new
channel joins the bridge.

ASTERISK-26923

Change-Id: Ie05b08523f399eae579130f4a5f562a344d2e415
2017-06-13 22:05:28 +00:00