Commit Graph

2573 Commits

Author SHA1 Message Date
Denis Kenzior 3b951d20f4 voicecall: expand synthesize_outgoing_call
synthethize_outgoing_call was only used once from dial_handle_result.
So move all the logic of registering the call to D-Bus and adding it to
the voicecalls list to that function.

This will allow synthethize_outgoing_call to be used from other
callbacks where the dial callback is guaranteed to return before any
call state notifications, e.g. in the case of +BLDN.
2017-10-26 10:23:47 -05:00
James Prestwood 2bc262b3af simauth: Fixed incorrect AUTS length
The initial SimAuth implementation incorrectly parsed
the AUTS value as 16 bytes, not 14.
2017-10-20 14:08:57 -05:00
James Prestwood 95e795b62d simauth: fixup adding more dbus return checks 2017-10-16 11:16:27 -05:00
James Prestwood 5ba90f6b09 sim-auth: implementation of core sim-auth atom
The sim-auth module atom can now be used for SIM application discovery
and authentication. The atom will automatically discover SIM
applications available on the SIM and register a new DBus object under
the modem, whos name is the AID string e.g.

/modem1/A0000000871004FFFFFFFF8906190000

A list of discovered AID object paths and types can be retrieved by
calling GetApplications() under the modems (new)
org.ofono.SimAuthentication interface which returns "a{oa{sv}}" where

o = path (e.g. above)

and the dictionary contains the following properties:

Type: "Umts" or "Ims"
Name: "USim" or "ISim"

The Type signifies which interfaces the AID object will have:

Umts = org.ofono.USimApplication
Ims = org.ofono.ISimApplication

These interfaces will contain the supported USIM/ISIM authentication
algorithms. Where:

org.ofono.USimApplication has:
    GetProperties()
    GsmAuthenticate()
    UmtsAuthenticate()

org.ofono.ISimApplication has:
    GetProperties()
    ImsAuthenticate()
2017-10-12 15:28:40 -05:00
James Prestwood a8f609727d sim: new API to check for a UST service only
The existing service check API takes both SST and UST services
and could inadvertently return success on a service if one
(SST or UST) service did not exist. This adds an API specifically
for checking for a UST service, and if the UST dir is not available
it will return FALSE, rather than possibly returning true on some
other SST service.
2017-10-11 10:31:10 -05:00
James Prestwood 2a1982e8c0 simutil: Added authenticate builder/parser API
Used to compose/parse non-TLV formatted authenticate commands
for GSM and UMTS authentication.
2017-10-11 10:29:13 -05:00
James Prestwood eb2915e231 simutil: Added app type to application parser
Parsing a SIM application only copied the 16 byte AID
portion, which included the application type. Parsing out
the type makes sorting much easier for modules using the
parser.
2017-10-11 10:26:24 -05:00
Denis Kenzior 8a09ad56fe ims: Rework initialization
We should bootstrap the registration status prior to registering the
interface with D-Bus
2017-10-09 11:35:46 -05:00
Denis Kenzior b002a79f4b ims: Remove logic checking presence of SIM atom
This part is not required
2017-10-09 11:35:05 -05:00
Ankit Navik 32d7596ff4 ims: add implementation for IMS atom
This implementation includes:
* D-Bus interface
* interaction with driver
2017-10-09 11:23:04 -05:00
Slava Monich 61bbbb0d7a modem: Implement ofono_modem_get_sim 2017-10-05 11:22:54 -05:00
Denis Kenzior e6268d1eb7 devinfo: Implement ofono_devinfo_get_modem 2017-10-05 11:08:38 -05:00
Denis Kenzior 8dc66c11bd build: Add optional ell dependency 2017-10-05 11:08:38 -05:00
Jonas Bonn 3796744b5e Fix out of tree build 2017-09-12 12:48:23 -05:00
Nishanth V 76c3dcec11 netmonagent: fix unnecessary function declaration 2017-09-12 12:29:24 -05:00
Alexander Couzens e98f683309 network.c: notify_status_watches: check for NULL
In rare cases when ofono_netreg_status_notify() is called before
ofono_netreg_register() netreg->status_watches is NULL.
2017-09-11 10:39:17 -05:00
Denis Kenzior 25db45daaa netmonagent: Fix typo 2017-09-09 10:21:20 -05:00
Nishanth V bcc37ad77f netmon: core changes for network monitor agent
Added implementation for RegisterAgent and UnregisterAgent in
NetworkMonitor interface and added netmonagent source file for agent
implemention.
2017-09-08 15:06:10 -05:00
Alexander Couzens 8e6ac330a5 voicecall: use ofono_call_status_name in DBG messages
status names are more readable then integer values.
2017-09-07 17:29:46 -05:00
Alexander Couzens 9b16b2c23c voicecall,common: move call_status_to_string() to common
call_status_to_string() is useful for debug output.
Change signature to contain enum call_status
Replace default case to get compiler warning when new enums added
2017-09-07 17:29:42 -05:00
Alexander Couzens d08a6043a3 gprs: use registration_status_to_string in debug messages 2017-09-07 16:50:51 -05:00
Alexander Couzens 7d27ccea5e common: move strlen(apn) check into is_valid_apn() 2017-09-05 10:41:05 -05:00
Slava Monich d9b2dbbd0b sms: Pass const pointer to dispatch_app_datagram 2017-08-21 11:36:32 -05:00
Slava Monich 980bb705d1 ussd: Switch the state from USER_ACTION to IDLE
... when a USSD notification is received. Some networks
send 0 (no further user action required) after the response
timeout expires. That should result in the user input form
getting removed from the ME screen.
2017-08-07 14:50:57 -05:00
John Ernberg 8ad77d5e10 radio-settings: Fix typo in radio_band_umts_from_string 2017-06-29 09:11:11 -05:00
Marcel Holtmann 9b7a6425bd phonebook: Add missing fall through statement 2017-07-11 10:45:48 -07:00
Marcel Holtmann 9fa6f20a6f voicecall: Reword fall through statement to avoid compiler warning 2017-07-11 10:45:19 -07:00
Marcel Holtmann 38a6826228 stk: Add missing break statement for inkey duration 2017-07-11 10:44:53 -07:00
Slava Monich 00613b5bbc radio-settings: Fix memory leaks in radio_load_settings
Errors returned by g_key_file_get_integer have to be deallocated
by the caller to avoid leaks like these:

==13330== 104 (24 direct, 80 indirect) bytes in 2 blocks are definitely lost
==13330==    at 0x483F3EC: malloc (vg_replace_malloc.c)
==13330==    by 0x4B020DF: g_malloc (gmem.c)
==13330==    by 0x4B17F51: g_slice_alloc (gslice.c)
==13330==    by 0x4AE80B9: g_error_new_valist (gerror.c)
==13330==    by 0x4AE830B: g_set_error (gerror.c)
==13330==    by 0x4AF5681: g_key_file_get_value (gkeyfile.c)
==13330==    by 0x4AF6817: g_key_file_get_integer (gkeyfile.c)
==13330==    by 0x10CFE3: radio_load_settings (radio-settings.c)
==13330==    by 0x10D2E3: ofono_radio_settings_register (radio-settings.c)
2017-06-02 10:42:30 -05:00
Slava Monich 440c9bec88 simfs: Prevent a crash in sim_fs_notify_file_watches
If no file watchers have ever been added, context->file_watches
is NULL and sim_fs_notify_file_watches() should take that into
account.
2017-05-12 14:37:26 -05:00
Denis Kenzior d9cb969dcf gprs: Don't use pri_set_apn for auto activated cids
There are two problems with using pri_set_apn.  The first issue is that
this function was built to be used by the set_property handler and
assumes the presence of a pending DBusMessage.

The second issue is that it touches the settings store.

In the case of auto-activated contexts no pending message exists.  Also,
we should not be touching the settings store as the APN might
potentially be a value that has not been provisioned.  Or in some cases
bogus.
2017-05-09 11:33:07 -05:00
Denis Kenzior 24f36da04d gprs: Return after releasing pri_ctx 2017-05-09 11:33:07 -05:00
Luiz Augusto von Dentz 27afa421cf handsfree-audio: Add Acquire implementation
This adds Acquire method which can be used by agents that require
pulling the fd directly instead of waiting a NewConnection.
2017-05-04 12:34:31 -05:00
Jonas Bonn 526b30b7ec ofono: add missing header inclusions
This is a "leaf" header and doesn't even have header guards, but
it still seems natural that the header should pull in its own declarations
rather than relying on the including source file to ensure that they
are included.
2017-04-18 09:47:42 -05:00
Jonas Bonn 0167c3339c gprs: set driver_attached when activating automatic contexts
The ofono_gprs_cid_activated attachment machinery cannot go through
ofono_gprs_status_notify for getting the attached property set because
that would result in the automatic contexts that were just set up
being released.  As such, it needs to call gprs_set_attached_property
manually.  Doing so, however, means that the driver_attached property
never gets set, resulting in all contexts being released when the
network transitions between registered states (roaming/non-roaming).
2017-04-14 17:43:13 -05:00
Jonas Bonn 1fd419e5b4 gprs: _cid_activated is an 'attaching' state
ofono_gprs_status_notify is an asynchronous notification that messes
with the 'attached' state of the GPRS atom.  This method is normally
prevented from running while an attach is in progress because the
attachment machinery wants to finish up and make it's own determination
of attach state.

When automatic context activation is relevant, as for LTE networks,
the ofono_gprs_cid_activated machinery replaces the usual set_attach
machinery for attaching to the network.  The cid_activated variant,
however, does not guard against simulatenous invocations of
ofono_gprs_status_notify.  This causes a race whereby status_notify
sets the state to 'attached' before the context is fully constructed
and set to active.  If the connection manager sees the 'attached'
state before there are any 'active' contexts, it may decide to
activate a context manually which is not the correct behaviour for
this type of network.

This patch makes the *_cid_activated machinery an 'attaching' state,
introducing the same guards that set_attached has to prevent
ofono_gprs_status_notify from running concurrently.
2017-04-14 17:28:46 -05:00
Jonas Bonn a722cef201 modem: set_online is valid for AlwaysOnline modems
Calling set_online(TRUE) for an AlwaysOnline modem should succeed; the
modem is, after all, in the requested state when the call returns.
Returning not_implemented is not necessarily wrong, but it's a bit ugly.
2017-04-03 09:23:53 -05:00
Christophe Ronco d43e48ae73 gprs: fix error check of gprs_cid_alloc function
When there is no context id available, idmap_alloc and
gprs_cid_alloc return max + 1.
2017-02-15 14:39:36 -06:00
Christophe Ronco c5fbfaa55f sim: backup driver read_imsi by IMSI via EF read
If read_imsi driver function fails, try to obtain IMSI via EF read
2017-01-09 12:25:00 -06:00
Slava Monich aaf70beb06 sim: Stop facility lock query sequence on removal
SIM card can be removed while the query is in progress. There's
still a remote possibility that SIM card is removed and inserted
back while the query is pending, that would start the second query
sequence and end up invoking sim_initialize() twice. But at least
these checks reduce the probability of something like that happening.
2017-01-06 12:25:48 -06:00
Slava Monich a1df13a3bc smsutil: Prevent invalid access in cbs_decode_text
Valgrind was complaining about it like this:

==18099== Conditional jump or move depends on uninitialised value(s)
==18099==    at 0x4C32281: strspn
==18099==    by 0x41286B: cbs_decode_text (smsutil.c:4140)
==18099==    by 0x40675C: test_cbs_encode_decode (test-sms.c:1417)
2016-12-30 18:19:21 -06:00
Djalal Harouni 9898cc5fad netmon: handle OFONO_NETMON_INFO_{EARFCN|EBAND|CQI} 2016-12-13 11:04:42 -06:00
Djalal Harouni d9c618fd94 netmon: handle NETMON_INFO_{RSCP|ECN0|RSRQ|RSRP}
Handle the newly added netmon info types.
2016-11-30 09:29:59 -06:00
Denis Kenzior c1cf5ae25e netmon: Fix style issue 2016-11-29 10:46:05 -06:00
Denis Kenzior 46c44a2b56 netmon: No need to initialize mcc/mnc 2016-11-29 10:45:19 -06:00
Dragos Tatulea c2b489dca8 gprs: lte: set attached after successful activation
Otherwise the attached state gets to be set before the actual LTE
automatic context is ready. This triggers a race between connman
and ofono: connman sees status attached before the context is active
so connman will try to activate another context with same apn and will
fail over and over again.
2016-11-22 10:51:09 -06:00
Dragos Tatulea 627b5df8a2 lte: fix early imsi free
storage_close was creating an empty sync file in /var/lib/ofono/lte
when it should have been closing the proper file
/var/lig/ofono/<imsi>/lte.
2016-11-22 10:03:10 -06:00
Slava Monich 52c2c401b4 smsutil: Fix receiving UTF-16 encoded messages
The spec supports UCS2, but in reality UTF-16 is used, which supports
4-byte characters, which could be split into different message
fragments. Accumulate the entire UTF-16 message before converting to
UTF8.

Author: Martin Jones <martin.jones@jolla.com>
2016-11-18 09:34:33 -06:00
Denis Kenzior b8d6828388 lte: If method is NULL, return not implemented 2016-11-15 13:43:15 -06:00
Denis Kenzior 872c1a82f1 lte: Relax condition to g_free imsi
imsi malloc is not directly tied to l_settings being valid
2016-11-15 13:39:44 -06:00