/pps/services/phone/private/control

Private phone control object

Publishers
Phone service; clients that have permission to access the phone service object
Subscribers
Phone radio service; clients that have permission to access the phone service object
Note: This type of object is known as a server object, a special PPS object designed for point-to-point communication between a server and one or more clients. For details, see "Server objects" in the Persistent Publish/Subscribe Developer's Guide.

Message/response format

Commands sent to the /pps/services/phone/private/control object are of the form:

msg::command_string\nid::msg_ID\ndat:json:{data}

Responses always reflect the command_string and msg_ID that were sent in the message, along with additional data, an error code, or error data, if applicable:

res::command_string
id::msg_ID
dat:json:{data}
err:n:{error_code}
errdat:json:error_data

start_call command

Start a call.

The start_call command has the following form:

msg::start_call
id:msg_ID
dat:json:
{
    "line":"line_type",
    "phone_number":"phone_number"
}

where line is a string representing the type of line to use the make the call and phone_number is the phone number, name, or address of the contact to call (maximum 80 characters). Currently, the only supported value for line is cellular.

start_call response

The phone service sends the start_call response to the client in reply to the start_call command. The response has the following form:

res::start_call
id::msg_ID
dat:json:
{
    "call_id":"call_ID",
    "call_type":"call_type",
    "phone_number":"phone_number",
    "line":"line_type"
}
err::error_string
errdat:json:
{
    "3gpp_cs":rejection_cause
}
The start_call response returns the following information:
call_id
A string representing the ID of the started call. This ID is passed in subsequent commands to identify which call the commands apply to.
call_type
A string representing the type of call (required). Possible values are:
  • outgoing—outgoing call
  • emergency—emergency call
  • unknown—invalid or unknown call type
phone_number
A string representing the phone number, name, or address of the contact to call (maximum 80 characters). Required.
line
A string representing the line to use to place the call. Required.
err
A string representing the error code. The err attribute is returned only in an error condition and is one of the values listed in the Error codes section.
3gpp_cs
The raw value of the rejection cause. For more information, refer to section "10.5.3.6 Reject cause" of the 3GPP TS 24.008 specification.

start_emergency_call command

Start an emergency call.

The start_emergency_call command has the following form:

msg::start_emergency_call
id::msg_ID
dat:json:
{
    "category":"emergency_category"
}
where category (required) is the emergency category to call. Allowable values are:
  • police
  • ambulance
  • fire
  • marine
  • mountain

start_emergency_call response

The phone service sends the start_emergency_call response to the client in reply to the start_emergency_call command. The response has the following form:

res::start_emergency_call
id::msg_ID
dat:json:
{
    "call_id":"call_ID"
}
err::error_string
The start_emergency_call response returns the following information:
call_id
A string representing the ID of the started call. This ID is passed in subsequent commands to identify which call the commands apply to.
err
A string describing the failure, if any. Possible values are listed in the Error codes section.

answer_call command

Answer an incoming call.

The answer_call command has the following form:

msg::answer_call
id::msg_ID
dat:json:
{
    "answer_call_id":"call_ID"
}

The phone service notifies the client of the incoming call by sending the incoming_call message, which provdes the call ID.

answer_call response

The phone service sends the answer_call response to the client in reply to the answer_call command. The response has the following form:

res::answer_call
id::msg_ID
dat:json:
{
    "call_id":"call_ID"
}
err::error_string
The answer_call response returns the following information:
call_id
A string representing the ID of the started call. This ID is passed in subsequent commands to identify which call the commands apply to.
err
A string describing the failure, if any. Possible values are listed in the Error codes section.

reject_call command

Reject an incoming call.

The reject_call command has the following form:

msg::reject_call
id::msg_ID
dat:json:
{
    "call_id":"call_ID"
}

where call_id is the ID of the incoming call to reject (provided in the incoming_call message).

reject_call response

The phone service sends the reject_call response to the client in reply to the reject_call command. The response has the following form:

res::reject_call
id::msg_ID
dat:json:
{
    "call_id":"call_ID"
}
err::error_string
The reject_call response returns the following information:
call_id
A string representing the ID of call that was rejected.
err
A string describing the failure, if any. Possible values are listed in the Error codes section.

end_call command

End an active or incoming call.

The end_call command has the following form:

msg::end_call
id::msg_ID
dat:json:
{
    "call_id":"call_ID"
}

where call_id (required) is the ID of the call to end.

end_call response

The phone service sends the end_call response to the client in reply to the end_call command. The response has the following form:

res::end_call
id::msg_ID
dat:json:
{
    "call_id":"call_ID"
}
err::error_string
The end_call response returns the following information:
call_id
A string representing the ID of the call that was ended.
err
A string describing the failure, if any. Possible values are listed in the Error codes section.

mute_call command

Mute a call.

The mute_call command has the following form:

msg::mute_call
id::msg_ID
dat:json:
{
    "call_id":"call_ID"
}

where call_id is the ID of the call to mute.

mute_call response

The phone service sends the mute_call response to the client in reply to the mute_call command. The response has the following form:

res::mute_call
id::msg_ID
err::error_string

where err is a string describing the failure, if any. Possible values are listed in the Error codes section.

unmute_call command

Unmute a call.

The unmute_call command has the following form:

msg::unmute_call
id::msg_ID
dat:json:
{
    "call_id":"call_ID"
}

where call_id is the ID of the call to mute.

unmute_call response

The phone service sends the unmute_call response to the client in reply to the unmute_call command. The response has the following form:

res::unmute_call
id::msg_ID
dat:json:
err::error_string

where err is a string describing the failure, if any. Possible values are listed in the Error codes section.

start_dtmf_tone command

Begin sending a dual-tone multi-frequency (DTMF) tone.

The start_dtmf_tone command has the following form:

msg::start_dtmf_tone
id::msg_ID
dat:json:
{
    "line":"line_ID",
    "tone":"tone"
}

where line is a string representing the ID of the line to send the tone to and tone is a string representing the single tone to send. The line ID is cellular by default. The tone (required) is represented by a single character in the set A-Z, 0-9, #, *, a, or b.

start_dtmf_tone response

The phone service sends the start_dtmf_tone response to the client in reply to the start_dtmf_tone command. The response has the following form:

res::start_dtmf_tone
id::msg_ID
err::error_string

where err is a string describing the failure, if any. Possible values are listed in the Error codes section.

stop_dtmf_tone command

Stop sending a DTMF tone.

The stop_dtmf_tone command has the following form:

msg::stop_dtmf_tone
id::msg_ID

stop_dtmf_tone response

The phone service sends the stop_dtmf_tone response to the client in reply to the stop_dtmf_tone command. The response has the following form:

res::stop_dtmf_tone
id::msg_ID
err::error_string

where err is a string describing the failure, if any. Possible values are listed in the Error codes section.

send_dtmf_tones command

Send (possibly multiple) DTMF tones.

The send_dtmf_tones command has the following form:

msg::send_dtmf_tones
id::msg_ID
dat:json:
{
    "line":"line_ID",
    "tones":"tone_string"
}

where line is the ID of the line to send the tones on (defaults to cellular, and tones is a string representing the DTMF tones to send (each tone is represented by a character in the set A-Z, 0-9, #, *, a, or b.

send_dtmf_tones response

The phone service sends the send_dtmf_tones response to the client in reply to the send_dtmf_tones command. The response has the following form:

res::send_dtmf_tones
id::msg_ID
err:: error_string

where err is a string describing the failure, if any. Possible values are listed in the Error codes section.

start_ecall command

Start an emergency call.

The start_ecall command has the following form:

msg::start_ecall
id::msg_ID
dat:json:
{
    "ecall_type":"ecall_type",
    "confidence":true|false,
    "vehicle":vehicle_class,
    "vin":"vehicle_id_number",
    "storage_type":energy_storage_type,
    "time_stamp":time_stamp,
    "latitude":current_latitude,
    "longitude":current_longitude,
    "direction":current_direction,
    "delta_latitude":delta_latitude,
    "delta_longitude":delta_longitude,
    "passengers":number_of_passengers
}

The parameters are as follows:

ecall_type
The type of ecall activation. Optional. Possible values are:
  • auto—automatic activation
  • man—manual activation
  • test—test call
confidence
The position confidence. Optional. Possible values are true (the position is within +/- 150 metres with 95% confidence) or false (otherwise).
vehicle
An integer representing the vehicle definition class. Optional. Possible values are:
  • 0—Unknown
  • 1—Passenger vehicle, class M1
  • 2—Buses and coaches, class M2
  • 3—Buses and coaches, class M3
  • 4—Light commercial vehicles, class N1
  • 5—Heavy duty vehicles, class N2
  • 6—Heavy duty vehicles, class N3
  • 7—Motorcycles, class L1e
  • 8—Motorcycles, class L2e
  • 9—Motorcycles, class L3e
  • 10—Motorcycles, class L4e
  • 11—Motorcycles, class L5e
  • 12—Motorcycles, class L6e
  • 13—Motorcycles, class L7e
vin
An integer representing the vehicle identification number. Optional.
storage_type
A bit mask representing the vehicle's energy storage type. Optional. Multiple bits may be set if there's more than one type of energy storage present. Possible values are:
  • 0—Unknown
  • 1—Gasoline
  • 2—Diesel
  • 4—Compressed natural gas
  • 8—Liquid propane gas
  • 16—Electric
  • 32—Hydrogen
time_stamp
The time stamp in seconds. Optional. If the time stamp fails, its value is zero.
latitude
The latitude of the vehicle's current position, in milliarcseconds. Optional. If the position is invalid or unknown, set the latitude to 0x7FFFFFFF.
longitude
The longitude of the vehicle's current position, in milliarcseconds. Optional. If the position is invalid or unknown, set the longitude to 0x7FFFFFFF.
direction
The direction of travel in 2-degree steps from magnetic north (0–358, clockwise). Optional. If the direction of travel is invalid or unknown, set the direction to 0xFF.
delta_latitude
The latitude of the vehicle's recent position, in milliarcseconds. Optional.
delta_longitude
The longitude of the vehicle's recent position, in milliarcseconds. Optional.
passengers
An integer representing the number of passengers in the vehicle. Optional. Valid values are from 0 to 254. If no information is available, set to 0xFF.

start_ecall response

The phone service sends the start_ecall response to the client in reply to the start_ecall command. The response has the following form:

res::start_ecall
id::msg_ID
dat:json:
{
    "call_id":"call_ID
}
err::error_string

The attributes and parameters are as follows:

call_id
A string representing the ID of the started eCall. This ID is passed in subsequent commands to identify which call the commands apply to.
err
A string describing the failure, if any. Possible values are listed in the Error codes section.

incoming_call message

Notify the client of an incoming call (server to client message).

The incoming_call message has the following form:

msg::incoming_call
id::msg_ID
dat:json:
{
    "call_id":"call_ID"
}

where call_id is a string representing the ID of the started call. This ID is passed in subsequent commands to identify which call the commands apply to.

Error codes

The error codes returned by the phone service are as follows:

operation_failed
The corresponding radio operation failed.
api_restricted
The client doesn't have permission to access the PPS command.
api_unavailable
The requested API is not available.
invalid_call
The phone service can't find the call with the specified ID, or the call is in an invalid state.
invalid_phone_number
The phone number is invalid.
open_failed
The phone service can't open the PPS object.
read_error
The phone service encountered an error reading from PPS.
network_unavailable
The network is unavailable because the radio is turned off.
network_rejected
The radio is turned on, but the network has rejected the call. Check the 3gpp_cs field for information regarding the rejection.
invalid_line
The specified line is invalid.
invalid_state
Thee phone is in a state that makes this request invalid.
sim_locked
The SIM is locked, so calls can't be made.
fdn_blocked
The operation failed because Fixed Dialing Number (FDN) is enabled on the phone, and the requested number is not in the FDN phonebook.