diff options
author | Marcel Holtmann <marcel@holtmann.org> | 2012-08-12 16:24:42 -0700 |
---|---|---|
committer | Marcel Holtmann <marcel@holtmann.org> | 2012-08-12 16:24:42 -0700 |
commit | fbce1a2060c7943f77815ce1465343ad0a6e9725 (patch) | |
tree | afffe1e3fb4c44e21fda6395f4688c1cd9ba8602 | |
parent | 810c25bec5d3e55e9887ff728240272fb5ab4e58 (diff) | |
download | phonesim-fbce1a2060c7943f77815ce1465343ad0a6e9725.tar.gz |
callmanager: Add 06123xx magic numbers for accepting calls
When dialing numbers starting with 06123, then just accept the
call automatically.
-rw-r--r-- | src/callmanager.cpp | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/src/callmanager.cpp b/src/callmanager.cpp index 8f0b7a7..9079c41 100644 --- a/src/callmanager.cpp +++ b/src/callmanager.cpp @@ -150,6 +150,8 @@ bool CallManager::command( const QString& cmd ) // Automatic accept of calls if ( number.startsWith( "05123" ) ) { QTimer::singleShot( 1000, this, SLOT(dialingToConnected()) ); + } else if ( number.startsWith( "06123" ) ) { + QTimer::singleShot( 1000, this, SLOT(dialingToAlerting()) ); } // Data call - phone number 696969 @@ -730,6 +732,17 @@ void CallManager::dialingToAlerting() callList[index].state = CallState_Alerting; sendState( callList[index] ); emit callStatesChanged( &callList ); + // If the dialed number starts with 06123, accept that + // call after xx seconds, where xx is part of the dial string + // as 06123xx + if( callList[index].number.startsWith( "06123" ) ) { + bool ok; + QString temp = callList[index].number; + temp = temp.replace( "06123" , "" ); + int timeout = temp.toInt( &ok, 10 ); + timeout = ok ? timeout * 1000 : 10000; + QTimer::singleShot( timeout, this, SLOT(dialingToConnected()) ); + } } void CallManager::waitingToIncoming() |