Open Source Telephony
 help / color / mirror / Atom feed
From: Nicolas Bertrand <nicolas.bertrand@linux.intel.com>
To: ofono@ofono.org
Subject: [PATCH 2/5] callmanager: Remote hangup slot
Date: Wed, 18 May 2011 15:33:27 +0200	[thread overview]
Message-ID: <1305725610-32602-3-git-send-email-nicolas.bertrand@linux.intel.com> (raw)
In-Reply-To: <1305725610-32602-1-git-send-email-nicolas.bertrand@linux.intel.com>

[-- Attachment #1: Type: text/plain, Size: 1524 bytes --]

---
 src/callmanager.cpp |   23 +++++++++++++++++++++++
 src/callmanager.h   |    3 +++
 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 );
-- 
1.7.1


  parent reply	other threads:[~2011-05-18 13:33 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-05-18 13:33 [PATCH 0/5] Add support of remote hangup Nicolas Bertrand
2011-05-18 13:33 ` [PATCH 1/5] controlbase: Add hangup button Nicolas Bertrand
2011-05-18 13:33 ` Nicolas Bertrand [this message]
2011-05-18 13:33 ` [PATCH 3/5] hardwaremanipulator: add hangup signal Nicolas Bertrand
2011-05-18 13:33 ` [PATCH 4/5] control: Handle hangup call Nicolas Bertrand
2011-05-18 13:33 ` [PATCH 5/5] phonesim: Connect hangup signal Nicolas Bertrand
2011-05-22 11:00 ` [PATCH 0/5] Add support of remote hangup Denis Kenzior

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1305725610-32602-3-git-send-email-nicolas.bertrand@linux.intel.com \
    --to=nicolas.bertrand@linux.intel.com \
    --cc=ofono@ofono.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox