Create a D-Bus service for dialing calls
At the moment we have one method for external programs to dial calls: Calls is registered as a handler for the tel: URI scheme. This is inadequate for certain dialing use cases such as USSD numbers described in !88 (comment 85267). !89 (merged) implements an extra method for external programs: a new --dial command-line option to provide dial strings rather than phone numbers. However, this is still inadequate for certain use cases and also requires external programs to hard-code Calls command lines.
What is needed is a D-Bus service to encompass all dialing use cases. A D-Bus service would free external programs from hard-coding calls to the Calls binary. Use cases for dialing which the service needs to encompass are as follows:
-
Global numbers. For example, "+441234567890". These are covered by the tel: URI scheme at present.
-
Dial strings. These are strings of digits (together with permissible white space and visual separators) which can be used as numbers in modem ATD commands. The strings are specifically not arbitrary as passing arbitrary, unvalidated input to a modem would not be good from a security perspective. The permissible digits are largely expressed in ITU-T Rec. V.250. !89 (merged) implements this validation with a slightly expanded set of digits informed by the Gemalto PLS8's ATD command and https://blog.barisione.org/2010/06/14/handling-phone-numbers/.
-
Non-global numbers. That is, national or local numbers. For example, "0123 456 7890" or "456 7890" respectively. These numbers highlight a particular subtlety which has some consequences, shown by this example:
- A user enters a number into Contacts in a national format, "0123 456 7890".
- In their home region, Calls dials this number in the format the user entered it.
- If the user travels to a different region, Calls does not dial the number as the user entered it but instead dials an international call by changing the user-entered number into a global number prefixed with the international code for their home region, "+441234567890".
This use case requires the following functionality to support it:
- Contacts stores the location where a number was entered.
- (When Calls gains the ability to add numbers to Contacts) Calls provides Contacts with the location where a number was dialed when adding a number to a contact.
- The D-Bus service proposed here has the option to dial non-global numbers using a (number, location) pair.
- Calls checks the current location and compares it to the location in the (number, location) pair, possibly altering the dial string for an international call.
The discussion above focuses on national numbers. Local numbers are theoretically similar, with area codes replacing international prefixes. However, they are practically unsupportable: it's possible to determine a user's current national location at runtime but, as far as I know, there's no way to determine the user's current area code. Also, according to Wikipedia, in the UK at least, there are plans to make area codes mandatory, completely obviating local numbers.
-
Numbers of unknown type. An arbitrary string whose type the service should attempt to determine: global number, non-global number or dial string.
Related reference works: RFC 3966, ITU-T Rec. V.250, Cinterion PLS8-E AT Command Set version 03.017
Related issues: #34 (closed) chatty#117 (closed) gnome-contacts#33 #106 #127 (closed)
Related merge requests: chatty!83 (merged) !60 (merged) gnome-contacts!25 !88 (closed) !89 (merged)