Android-cuttlefish cvd tool
|
#include <call_service.h>
Classes | |
struct | CallStatus |
Public Member Functions | |
CallService (int32_t service_id, ChannelMonitor *channel_monitor, ThreadLooper *thread_looper) | |
~CallService ()=default | |
CallService (const CallService &)=delete | |
CallService & | operator= (const CallService &)=delete |
void | SetupDependency (SimService *sim, NetworkService *net) |
void | HandleDial (const Client &client, const std::string &command) |
void | HandleAcceptCall (const Client &client) |
void | HandleRejectCall (const Client &client) |
void | HandleCurrentCalls (const Client &client) |
void | HandleHangup (const Client &client, const std::string &command) |
void | HandleMute (const Client &client, const std::string &command) |
void | HandleSendDtmf (const Client &client, const std::string &command) |
void | HandleCancelUssd (const Client &client, const std::string &command) |
void | HandleEmergencyMode (const Client &client, const std::string &command) |
void | HandleRemoteCall (const Client &client, const std::string &command) |
int | FindFreeCallIndex () const |
![]() | |
virtual | ~ModemService ()=default |
ModemService (const ModemService &)=delete | |
ModemService & | operator= (const ModemService &)=delete |
bool | HandleModemCommand (const Client &client, std::string command) |
void | CloseRemoteConnection (ClientId remote_client) |
Private Types | |
using | CallToken = std::pair< int, std::string > |
Private Member Functions | |
void | InitializeServiceState () |
std::vector< CommandHandler > | InitializeCommandHandlers () |
void | SimulatePendingCallsAnswered () |
void | CallStateUpdate () |
void | SendCallStatusToRemote (CallStatus &call, CallStatus::CallState state) |
void | TimerWaitingRemoteCallResponse (CallToken token) |
Private Attributes | |
SimService * | sim_service_ |
NetworkService * | network_service_ |
std::map< int, CallStatus > | active_calls_ |
bool | in_emergency_mode_ |
bool | mute_on_ |
Additional Inherited Members | |
![]() | |
static constexpr char | kCmeErrorOperationNotAllowed [] = "+CME ERROR: 3" |
static constexpr char | kCmeErrorOperationNotSupported [] = "+CME ERROR: 4" |
static constexpr char | kCmeErrorSimNotInserted [] = "+CME ERROR: 10" |
static constexpr char | kCmeErrorSimPinRequired [] = "+CME ERROR: 11" |
static constexpr char | kCmeErrorSimPukRequired [] = "+CME ERROR: 12" |
static constexpr char | kCmeErrorSimBusy [] = "+CME ERROR: 14" |
static constexpr char | kCmeErrorIncorrectPassword [] = "+CME ERROR: 16" |
static constexpr char | kCmeErrorMemoryFull [] = "+CME ERROR: 20" |
static constexpr char | kCmeErrorInvalidIndex [] = "+CME ERROR: 21" |
static constexpr char | kCmeErrorNotFound [] = "+CME ERROR: 22" |
static constexpr char | kCmeErrorInvalidCharactersInTextString [] |
static constexpr char | kCmeErrorNoNetworkService [] = "+CME ERROR: 30" |
static constexpr char | kCmeErrorNetworkNotAllowedEmergencyCallsOnly [] |
static constexpr char | kCmeErrorInCorrectParameters [] = "+CME ERROR: 50" |
static constexpr char | kCmeErrorNetworkNotAttachedDueToMTFunctionalRestrictions [] |
static constexpr char | kCmeErrorFixedDialNumberOnlyAllowed [] |
static constexpr char | kCmsErrorOperationNotAllowed [] = "+CMS ERROR: 302" |
static constexpr char | kCmsErrorOperationNotSupported [] = "+CMS ERROR: 303" |
static constexpr char | kCmsErrorInvalidPDUModeParam [] = "+CMS ERROR: 304" |
static constexpr char | kCmsErrorSCAddressUnknown [] = "+CMS ERROR: 304" |
static constexpr std::pair< int, int > | kRemotePortRange {6520, 6527} |
![]() | |
ModemService (int32_t service_id, std::vector< CommandHandler > command_handlers, ChannelMonitor *channel_monitor, ThreadLooper *thread_looper) | |
void | HandleCommandDefaultSupported (const Client &client) |
void | SendUnsolicitedCommand (std::string unsol_command) |
cuttlefish::SharedFD | ConnectToRemoteCvd (std::string port) |
void | SendCommandToRemote (ClientId remote_client, std::string response) |
![]() | |
static std::string | GetHostId () |
![]() | |
int32_t | service_id_ |
const std::vector< CommandHandler > | command_handlers_ |
ThreadLooper * | thread_looper_ |
ChannelMonitor * | channel_monitor_ |
|
private |
cuttlefish::CallService::CallService | ( | int32_t | service_id, |
ChannelMonitor * | channel_monitor, | ||
ThreadLooper * | thread_looper | ||
) |
|
default |
|
delete |
|
private |
|
inline |
void cuttlefish::CallService::HandleAcceptCall | ( | const Client & | client | ) |
void cuttlefish::CallService::HandleCancelUssd | ( | const Client & | client, |
const std::string & | command | ||
) |
void cuttlefish::CallService::HandleCurrentCalls | ( | const Client & | client | ) |
AT+CLCC Returns list of current calls of MT. If command succeeds but no calls are available, no information response is sent to TE.
command Possible response(s) AT+CLCC [+CLCC: <ccid1>,<dir>,<stat>,<mode>,<mpty> [,<number>,<type>[,<alpha>[,<priority> [,<CLI validity>]]]][<CR><LF> +CLCC: <ccid2>,<dir>,<stat>,<mode>,<mpty> [,<number>,<type>[,<alpha>[,<priority>[,<CLI validity>]]]] +CME ERROR: <err>
<ccidx>: integer type. This number can be used in +CHLD command operations. Value range is from 1 to N. N, the maximum number of simultaneous call control processes is implementation specific. <dir>: integer type 0 mobile originated (MO) call 1 mobile terminated (MT) call <stat>: integer type (state of the call) 0 active 1 held 2 dialing (MO call) 3 alerting (MO call) 4 incoming (MT call) 5 waiting (MT call) <mode>: integer type (bearer/teleservice) 0 voice 1 data 2 fax 3 voice followed by data, voice mode 4 alternating voice/data, voice mode 5 alternating voice/fax, voice mode 6 voice followed by data, data mode 7 alternating voice/data, data mode 8 alternating voice/fax, fax mode 9 unknown <mpty>: integer type 0 call is not one of multiparty (conference) call parties 1 call is one of multiparty (conference) call parties <number>: string type phone number in format specified by <type>. <type>: type of address octet in integer format
see RIL_REQUEST_GET_CURRENT_CALLS in RIL
void cuttlefish::CallService::HandleDial | ( | const Client & | client, |
const std::string & | command | ||
) |
Normal dial: ATDnumber[clir]; Emergency dial: ATDnumber@[category],#[clir];
void cuttlefish::CallService::HandleEmergencyMode | ( | const Client & | client, |
const std::string & | command | ||
) |
AT+WSOS
Command Possible response(s) +WSOS=[<n>] +CME ERROR: <err> +WSOS? +WSOS: <n> +CME ERROR: <err>
<n>: integer type 0 enter emergency mode 1 exit emergency mode
see RIL_REQUEST_EXIT_EMERGENCY_CALLBACK_MODE RIL_UNSOL_ENTER_EMERGENCY_CALLBACK_MODE RIL_UNSOL_EXIT_EMERGENCY_CALLBACK_MODE in RIL
void cuttlefish::CallService::HandleHangup | ( | const Client & | client, |
const std::string & | command | ||
) |
AT+CHLD This command allows the control of the following call related services: 1) a call can be temporarily disconnected from the MT but the connection is retained by the network; 2) multiparty conversation (conference calls); 3) the served subscriber who has two calls (one held and the other either active or alerting) can connect the other parties and release the served subscriber's own connection.
Calls can be put on hold, recovered, released, added to conversation, and transferred similarly.
command Possible response(s) +CHLD=<n> +CME ERROR: <err>
+CHLD=? +CHLD: (list of supported <n>s) e.g. +CHLD: (0,1,1x,2,2x,3,4)
see RIL_REQUEST_HANGUP_WAITING_OR_BACKGROUND RIL_REQUEST_HANGUP_FOREGROUND_RESUME_BACKGROUND RIL_REQUEST_SWITCH_WAITING_OR_HOLDING_AND_ACTIVE RIL_REQUEST_CONFERENCE RIL_REQUEST_SEPARATE_CONNECTION RIL_REQUEST_HANGUP RIL_REQUEST_UDUB in RIL
void cuttlefish::CallService::HandleMute | ( | const Client & | client, |
const std::string & | command | ||
) |
AT+CMUT This command is used to enable and disable the uplink voice muting during a voice call. Read command returns the current value of <n>.
Command Possible response(s) +CMUT=[<n>] +CME ERROR: <err> +CMUT? +CMUT: <n> +CME ERROR: <err>
<n>: integer type 0 mute off 1 mute on
see RIL_REQUEST_SET_MUTE or RIL_REQUEST_GET_MUTE in RIL
void cuttlefish::CallService::HandleRejectCall | ( | const Client & | client | ) |
void cuttlefish::CallService::HandleRemoteCall | ( | const Client & | client, |
const std::string & | command | ||
) |
AT+REMOTECALL=<dir>,<stat>,<mode>,<mpty>,<number>,<num_type> This command allows to dial a remote voice call with another cuttlefish emulator. If request is successful, the remote emulator can simulate hold on, hang up, reject and so on.
e.g. AT+REMOTECALL=4,0,0,6521,129
<stat>: integer type (state of the call) 0 active 1 held 2 dialing (MO call) 3 alerting (MO call) 4 incoming (MT call) 5 waiting (MT call) <mode>: integer type 0 voice 1 data 2 fax 3 voice followed by data, voice mode 4 alternating voice/data, voice mode 5 alternating voice/fax, voice mode 6 voice followed by data, data mode 7 alternating voice/data, data mode 8 alternating voice/fax, fax mode 9 unknown <mpty>: integer type 0 call is not one of multiparty (conference) call parties 1 call is one of multiparty (conference) call parties <number>: string here maybe remote port <num_type>: type of address octet in integer format
Note: reason should be added to indicate why hang up. Since not realizing RIL_LAST_CALL_FAIL_CAUSE, delay to be implemented.
void cuttlefish::CallService::HandleSendDtmf | ( | const Client & | client, |
const std::string & | command | ||
) |
AT+VTS This command transmits DTMF, after a successful call connection. Setting Command is used to send one or more ASCII characters which make MSC (Mobile Switching Center) send DTMF tone to remote User.
Command Possible response(s) AT+VTS=<dtmf>[,<duration>] +CME ERROR: <err>
<dtmf> A single ASCII character in the set { 0 -9, #, *, A – D}. <duration> Refer to duration value range of +VTD command
see RIL_REQUEST_DTMF in RIL
|
private |
|
private |
|
delete |
|
private |
void cuttlefish::CallService::SetupDependency | ( | SimService * | sim, |
NetworkService * | net | ||
) |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |