aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorNicolas Bertrand <nicolas.bertrand@linux.intel.com>2011-05-18 15:33:27 +0200
committerDenis Kenzior <denkenz@gmail.com>2011-05-22 05:42:56 -0500
commit179841107b391defa91346918a9a959014b68a89 (patch)
tree92877dc440cd7fb1671eca3bf5ac66d7e2e34037
parent2da6af1856b46cbabeb59d726eb066046acb8e9f (diff)
downloadphonesim-179841107b391defa91346918a9a959014b68a89.tar.gz
callmanager: Remote hangup slot
-rw-r--r--src/callmanager.cpp23
-rw-r--r--src/callmanager.h3
2 files changed, 26 insertions, 0 deletions
diff --git a/src/callmanager.cpp b/src/callmanager.cpp
index fb132b5..a9fe171 100644
--- a/src/callmanager.cpp
+++ b/src/callmanager.cpp
@@ -445,6 +445,29 @@ void CallManager::hangupCall( int id )
chld1x( id );
}
+void CallManager::hangupRemote( int id )
+{
+ int index = indexForId( id );
+ if ( index >= 0 )
+ {
+ if ( callList[index].state == CallState_Dialing ||
+ callList[index].state == CallState_Alerting )
+ {
+ hangupTimer->stop();
+ }
+ callList[index].state = CallState_Hangup;
+ sendState( callList[index] );
+
+ callList.removeAt( index );
+
+ if ( !hasCall( CallState_Active ) && !hasCall( CallState_Held ) )
+ waitingToIncoming();
+
+ send ( "NO CARRIER" );
+ emit callStatesChanged( &callList );
+ }
+}
+
bool CallManager::acceptCall()
{
int id = idForIncoming();
diff --git a/src/callmanager.h b/src/callmanager.h
index ff3ac30..c34e7fd 100644
--- a/src/callmanager.h
+++ b/src/callmanager.h
@@ -106,6 +106,9 @@ public slots:
// Transition the active dialing call to alerting.
void dialingToAlerting();
+ // Simulate a remote hangup.
+ void hangupRemote( int id );
+
signals:
// Send a response to a command.
void send( const QString& line );