Commit Graph

48 Commits

Author SHA1 Message Date
Aleksander Morgado
df8918ff8c base-call: implement Deflect() with +CTFR 2019-07-11 23:21:00 +02:00
Aleksander Morgado
222874299e api,call: new Deflect() method
This method allows deflecting an incoming or waiting call to a
different number.
2019-07-11 23:20:59 +02:00
Aleksander Morgado
f994982cce base-call: support hanging up specific calls
E.g. we can hangup a waiting call without interfering with the active
one.
2019-07-11 23:01:30 +02:00
Aleksander Morgado
b22f90c4c4 broadband-modem: if +CLCC is supported, call supports detailed events 2019-07-11 23:01:08 +02:00
Aleksander Morgado
67cc999266 base-call: if incoming call is reported terminated, cleanup timeout 2019-07-11 23:00:50 +02:00
Aleksander Morgado
cd2e851b8c base-call: allow skipping the timeout in incoming calls
E.g. if the modem supports reporting incoming call updates explicitly.
2019-07-11 23:00:50 +02:00
Aleksander Morgado
3873fda83f base-call: allow keeping ongoing call index for easy call matching 2019-07-11 23:00:50 +02:00
Aleksander Morgado
a006ed0744 base-call: add simple getters for the MmGdbusCall properties 2019-07-11 23:00:50 +02:00
Bob Ham
1cee215f83 base-call: Increase incoming call timeout to ten seconds
The standard says a RING or CRING should be emitted whenever the
network sends an incoming call notification, which is nation-specific:

  "Interpretation of indications from the network to determine what
  constitutes a "ring" is defined by national regulations.  This
  result code should be repeated each time the network repeats the
  incoming call indication."  -- ITU-T Rec. V.250, p. 42

On the giffgaff (O2) network in the UK, a SIMCom SIM7100E modem emits
RING indicators every six seconds.  The current timeout is only five
seconds resulting in a stream of timed-out ModemManager call objects
whenever there is an incoming call.  To fix this, we increase the
timeout to ten seconds.
2018-12-12 17:05:42 +00:00
Bob Ham
318d453532 base-call: Fix in-call URC regex to match handler logic
The handler assumes the regex sub-expressions each have the same index
so they need to be within the same set of parentheses rather than each
individually parenthesised.  Without this fix, call state changes are
missed.
2018-12-12 11:13:02 +00:00
Ben Chan
9c03ce033c base-call: remove unused 'self' variables 2018-10-20 13:56:13 +02:00
Aleksander Morgado
329caff84f base-call: implement generic audio channel setup/cleanup handlers
Modems that require specific commands to setup or cleanup the audio
channel as soon as a call is ongoing can subclass these two new
methods.

The setup() method is considered part of the call start/accept
process, and so if it fails, the whole operation will fail.

The failures in the cleanup() method will be reported in the log, but
otherwise ignored, as this operation may be executed without any
user intervention (e.g. if the remote party hangs up).
2018-10-16 17:09:21 +00:00
Dan Williams
627303a748 api/libmm-glib/cli: add AudioPort and AudioFormat properties to the Call object 2018-10-16 17:09:21 +00:00
Aleksander Morgado
b2d859e370 base-call: treat 'ringing-in' as an in-call state
So that we setup in-call events as soon as we get the incoming call
ringing in. This allows us to have plugin-specific implementations
e.g. reporting call termination when the remote caller hangs up.
2018-10-16 17:09:21 +00:00
Aleksander Morgado
887376fe44 mm-iface-mode: provide direction and number when creating calls
Calls created from property bundles are always outgoing, while calls
created as input events from URCs during runtime are always incoming.

This change makes it mandatory to provide at least direction of the
call when the object is created, leaving the number as an optional
property that may or may not be known in advance (e.g. it would be
optional only for incoming calls).
2018-10-16 17:09:21 +00:00
Aleksander Morgado
44413308b2 iface-modem-voice: always create plugin-specified call objects
The Voice interface logic must always use the create_call() object
from its own interface to create call objects, as that is the method
that plugins can subclass to provide plugin-specific call objects.

This applies to both incoming and outgoing calls.
2018-10-16 17:09:21 +00:00
Aleksander Morgado
638c5b49f1 base-call: improve logging 2018-10-16 17:09:21 +00:00
Aleksander Morgado
0478e88b4f base-call: listen for connection error URCs in-call
In order to detect state changes while we're in-call, we have to
monitor the standard connection errors we're used to, but have them
processed as URCs instead of as responses to ATD requests.
2018-10-16 17:09:21 +00:00
Aleksander Morgado
bd3b5aca01 base-call: automatically terminate unanswered incoming calls
Try to automatically detect when the caller finishes the attempt to
establish the call.
2018-10-16 17:09:21 +00:00
Aleksander Morgado
0090124ec0 base-call: ACTIVE after start() if detailed transitions unavailable
The most detailed call state transition flow for a new outgoing call
would be:

  UNKNOWN -> DIALING -> RINGING -> ACTIVE

But, if the modem doesn't support reporting intermediate states
(e.g. DIALING or RINGING) then a successful start() should imply
getting into ACTIVE state right away.

For now, only the Huawei plugin implements the detailed transition
support, so make them configurable via call object properties.
2018-10-16 17:09:21 +00:00
Aleksander Morgado
7c10db26c2 base-call: setup/cleanup custom events when transitioning to/from in-call 2018-10-16 17:09:21 +00:00
Aleksander Morgado
cfdd6ffc95 base-call: don't update state twice
The mm_gdbus_call_set_() methods update the properties in the same way
as via g_object_set(), no need to do it twice.
2018-10-16 17:09:21 +00:00
Aleksander Morgado
4409ccffcc base-call: call state updates only in the interface logic
Don't do any call state update on the generic implementation of the
commands, do it in the common interface logic exclusively.

We were doing the state updates in both places.
2018-10-16 17:09:21 +00:00
Aleksander Morgado
9a69e5363a base-call: don't notify a state change if it didn't change 2018-10-16 17:09:21 +00:00
Aleksander Morgado
60d42de68e base-call: no need to delete call info from the device
Call information only lives in the ModemManager logic, there is no
associated date stored within the device itself. Therefore, simplify
everything by assuming there is nothing to remove.

Looks like this logic was implemented because it was originally based
on the SMS management logic, but for SMS we do have to remove
them (the stored PDU parts) from the device.
2018-10-16 17:09:21 +00:00
Aleksander Morgado
9503af95e2 base-call: fix logic when rejecting calls
Make sure the async task is always finished, even when
mm_base_modem_at_command_finish() returns an error which is not
MM_SERIAL_ERROR_RESPONSE_TIMEOUT.
2018-10-16 17:09:21 +00:00
Aleksander Morgado
0ac15f6e22 base-call: fix logic when accepting calls
Don't return FALSE when call is successfully accepted, otherwise the
caller will get very confused:

    ModemManager[19952]: <debug> [1528968478.344338] (ttyACM2): --> 'ATA<CR>'
    ModemManager[19952]: <debug> [1528968478.361986] (ttyACM2): <-- '<CR><LF>OK<CR><LF>'

    (ModemManager:19952): GLib-GIO-CRITICAL **: 11:27:58.387: g_dbus_method_invocation_take_error: assertion 'error != NULL' failed

And also, make sure the async task is always finished, even when
mm_base_modem_at_command_finish() returns an error which is not
MM_SERIAL_ERROR_RESPONSE_TIMEOUT.
2018-10-16 17:09:21 +00:00
Aleksander Morgado
a6101a8532 call-list: coding style fixes 2018-06-11 18:06:38 +02:00
Lubomir Rintel
b39dd2ec05 all: drop unused variables
Keeps build with GCC 8 happy.

mm-base-call.c:758:18: warning: variable 'response' set but not used [-Wunused-but-set-variable]
mm-base-call.c:822:18: warning: variable 'response' set but not used [-Wunused-but-set-variable]
mm-base-sms.c:908:18: warning: variable 'response' set but not used [-Wunused-but-set-variable]
mm-sms-list.c:331:25: warning: variable 'ctx' set but not used [-Wunused-but-set-variable]
mm-iface-modem-messaging.c:1210:21: warning: variable 'storage_ctx' set but not used [-Wunused-but-set-variable]
huawei/mm-plugin-huawei.c:183:18: warning: variable 'response' set but not used [-Wunused-but-set-variable]
ublox/mm-plugin-ublox.c:161:24: warning: variable 'response' set but not used [-Wunused-but-set-variable]
ublox/mm-plugin-ublox.c:159:24: warning: variable 'ctx' set but not used [-Wunused-but-set-variable]
icera/mm-modem-helpers-icera.c:218:25: warning: variable 'first_free' set but not used [-Wunused-but-set-variable]
novatel/mm-common-novatel.c:50:18: warning: variable 'response' set but not used [-Wunused-but-set-variable]
2018-04-24 18:11:15 +02:00
Ben Chan
da20697e18 base-call: minor coding style fixes 2017-07-14 10:59:46 +02:00
Aleksander Morgado
b44f1b6da0 base-call: port mm_base_call_delete to use GTask 2017-07-06 11:16:37 +02:00
Aleksander Morgado
da45d0c5b2 base-call: minor coding style fixes 2017-07-06 11:11:20 +02:00
Aleksander Morgado
4e5ad5585a base-call: no need to keep a modem reference around
The mm_base_modem_at_command() async calls keep a modem reference
valid for as long as the operation and its completion handler are run,
so there really is no need for the caller (the call operation) to keep
a reference to the modem object itself.
2017-07-06 10:59:09 +02:00
Ben Chan
2ffcd93ebb base-call: port call_delete to use GTask 2017-07-06 10:51:48 +02:00
Ben Chan
f9ddfd7aa4 base-call: port call_send_dtmf_ready to use GTask 2017-07-06 10:51:48 +02:00
Ben Chan
3659ada7d9 base-call: port call_hangup to use GTask 2017-07-06 10:51:48 +02:00
Ben Chan
c5232ffe41 base-call: port call_accept to use GTask 2017-07-06 10:51:48 +02:00
Ben Chan
76b3ad41fe base-call: port call_start to use GTask 2017-07-06 10:51:48 +02:00
Ben Chan
23b67db7c9 base-call: remove unnecessary string duplications 2017-04-08 12:42:39 +02:00
Dan Williams
f33ea91ccf base-call: formatting cleanups 2016-08-02 16:27:56 -05:00
Marco Bascetta
74325b547a core,libmm-glib,cli,voice: Replaced 'SendTone' method and 'ToneReceived' signal with 'SendDtmf' and 'DtmfReceived' 2015-08-02 10:39:48 +02:00
Aleksander Morgado
e75d888b51 core,voice: minor coding style fixes 2015-08-02 10:39:48 +02:00
Marco Bascetta
9874f10e1f base-call,iface-modem-voice:: handle DTMF 2015-08-02 10:39:47 +02:00
Riccardo Vangelisti
40fae5fcba base-call: refactoring of error handling when call starts 2015-08-02 10:39:47 +02:00
Riccardo Vangelisti
5a281dbd34 base-call: created an unique function to switch call's state and reason 2015-08-02 10:39:47 +02:00
Riccardo Vangelisti
94c8371076 base-call: fixed bug when hangup call.
Ok, busy and no carrier messages are handled by serial-parser.
2015-08-02 10:39:13 +02:00
Riccardo Vangelisti
c53bc10092 base-call: added deletion of a specified call 2015-08-02 10:39:12 +02:00
Riccardo Vangelisti
ec5c539f55 core: implemented new MMBaseCall object 2015-08-02 10:39:12 +02:00