Exemplo n.º 1
0
void QPhoneCallDummy::dial( const QDialOptions& options )
{
    // Change to the "Dialing" state and notify everyone who is interested.
    setNumber( options.number() );
    setState( QPhoneCall::Dialing );

    // Start a timer to transition to the hangup state after 3 seconds.
    QTimer::singleShot( 3000, this, SLOT(dialTimeout()) );
}
Exemplo n.º 2
0
void FsoPhoneCall::dial( const QDialOptions& options )
{
    QString number = options.number();
    setNumber( number );
    
    qDebug() << "FsoPhoneCall::dial(" << number << ")";

    // If the number starts with '*' or '#', then this is a request
    // for a supplementary service, not an actual phone call.
    // So we dial and then immediately hang up, allowing the network
    // to send us the SS/USSD response when it is ready.
    if ( number.startsWith("*") || number.startsWith("#") ) {
        service->suppl_services.sendSupplementaryServiceData(number);
        setState( QPhoneCall::ServiceHangup );
        return;
    }
    
    QFsoDBusPendingCall call = service->gsmCall.Initiate(number, "voice");
    watchFsoCall(call, this, SLOT(initiateFinished(QFsoDBusPendingCall &)));
    setState(QPhoneCall::Dialing);
}
Exemplo n.º 3
0
void TestPhoneCallImpl::dial( const QDialOptions& options )
{
    provider().beginStateTransaction();
    if ( hasCall( QPhoneCall::Dialing ) ) {
        // There is already a dialing call.
        setState( QPhoneCall::HangupLocal );
        provider().endStateTransaction();
        return;
    }
    if ( hasCall( QPhoneCall::Connected ) ) {
        if ( hasCall( QPhoneCall::Hold ) ) {
            // No free slots for the dialing call.
            setState( QPhoneCall::HangupLocal );
            provider().endStateTransaction();
            return;
        }
        findCall( QPhoneCall::Connected )->setState( QPhoneCall::Hold );
    }
    setNumber( options.number() );
    setState( QPhoneCall::Dialing );
    provider().endStateTransaction();
    QTimer::singleShot( 1000, this, SLOT(connectTimeout()) );
}