Private phone control object
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 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.
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:
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" }
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
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.
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
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).
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
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.
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
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.
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 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.
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.
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.
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 sending a DTMF tone.
The stop_dtmf_tone command has the following form:
msg::stop_dtmf_tone id::msg_ID
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 (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.
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 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:
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:
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.
The error codes returned by the phone service are as follows: