diff options
author | Arun Ravindran <ext-arun.1.ravindran@nokia.com> | 2010-09-17 11:16:57 +0300 |
---|---|---|
committer | Denis Kenzior <denkenz@gmail.com> | 2010-09-17 21:30:13 -0500 |
commit | d373d16608229c4bbcd4257830ee8ec19e398aca (patch) | |
tree | 7958256b16fa61b50b345752e0fdcc14580f70fc | |
parent | fbaeccf3578a93d1f076155355bee55102740725 (diff) | |
download | phonesim-d373d16608229c4bbcd4257830ee8ec19e398aca.tar.gz |
Simulation of MT release of call to special number
-rw-r--r-- | src/callmanager.cpp | 17 | ||||
-rw-r--r-- | src/callmanager.h | 3 | ||||
-rw-r--r-- | src/default.xml | 1 |
3 files changed, 21 insertions, 0 deletions
diff --git a/src/callmanager.cpp b/src/callmanager.cpp index 5336d27..06f426d 100644 --- a/src/callmanager.cpp +++ b/src/callmanager.cpp @@ -643,6 +643,17 @@ void CallManager::dialingToConnected() // Transition the call to its new state. callList[index].state = CallState_Active; sendState( callList[index] ); + // If the dialed number starts with 05123, disconnect the + // call after xx seconds, where xx is part of the dial string + // as 05123xx + if( callList[index].number.startsWith( "05123" ) ) { + bool ok; + QString temp = callList[index].number; + temp = temp.replace( "05123" , "" ); + int timeout = temp.toInt( &ok, 10 ); + timeout = ok ? timeout * 1000: 10000; + QTimer::singleShot( timeout, this, SLOT(hangup()) ); + } } void CallManager::dialingToAlerting() @@ -686,6 +697,12 @@ void CallManager::hangupTimeout() } } +void CallManager::hangup() +{ + send ( "NO CARRIER" ); + hangupConnected(); +} + void CallManager::sendNextRing() { if ( idForIncoming() >= 0 ) { diff --git a/src/callmanager.h b/src/callmanager.h index 875687e..3dd01cd 100644 --- a/src/callmanager.h +++ b/src/callmanager.h @@ -128,6 +128,9 @@ private slots: // Send the next RING indication for incoming calls. void sendNextRing(); + // Hangup the connected call after xx seconds + void hangup(); + private: QList<CallInfo> callList; QTimer *connectTimer; diff --git a/src/default.xml b/src/default.xml index ef8ac83..135bad3 100644 --- a/src/default.xml +++ b/src/default.xml @@ -7,6 +7,7 @@ <!-- Note: dialing 177 will cause a dialback to simulate an incoming call, and hangup after 5 seconds --> <!-- Note: dialing 166 will accept the incoming call and hangup up after 5 seconds--> <!-- Note: dialing 155 will elicit a 'BUSY' response from the recipient--> +<!-- Note: dialing 05123xx cause an MT disconnect of the connected call after xx seconds--> <!-- Initialize state variables --> |