All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 0/5] Add support of remote hangup
@ 2011-05-18 13:33 Nicolas Bertrand
  2011-05-18 13:33 ` [PATCH 1/5] controlbase: Add hangup button Nicolas Bertrand
                   ` (5 more replies)
  0 siblings, 6 replies; 7+ messages in thread
From: Nicolas Bertrand @ 2011-05-18 13:33 UTC (permalink / raw)
  To: ofono

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

These patchs introduce the possibility of remote hangup
by selecting the call in the call table and use the new 
button "hangup".

Nicolas Bertrand (5):
  controlbase: Add hangup button
  callmanager: Remote hangup slot
  hardwaremanipulator: add hangup signal
  control: Handle hangup call
  phonesim: Connect hangup signal

 src/callmanager.cpp       |   23 +++++++++++++++++++++++
 src/callmanager.h         |    3 +++
 src/control.cpp           |   24 +++++++++++++++++++++++-
 src/control.h             |    2 ++
 src/controlbase.ui        |    7 +++++++
 src/hardwaremanipulator.h |    1 +
 src/phonesim.cpp          |    2 ++
 7 files changed, 61 insertions(+), 1 deletions(-)


^ permalink raw reply	[flat|nested] 7+ messages in thread

* [PATCH 1/5] controlbase: Add hangup button
  2011-05-18 13:33 [PATCH 0/5] Add support of remote hangup Nicolas Bertrand
@ 2011-05-18 13:33 ` Nicolas Bertrand
  2011-05-18 13:33 ` [PATCH 2/5] callmanager: Remote hangup slot Nicolas Bertrand
                   ` (4 subsequent siblings)
  5 siblings, 0 replies; 7+ messages in thread
From: Nicolas Bertrand @ 2011-05-18 13:33 UTC (permalink / raw)
  To: ofono

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

---
 src/controlbase.ui |    7 +++++++
 1 files changed, 7 insertions(+), 0 deletions(-)

diff --git a/src/controlbase.ui b/src/controlbase.ui
index 45b60f9..50315db 100644
--- a/src/controlbase.ui
+++ b/src/controlbase.ui
@@ -1410,6 +1410,13 @@ p, li { white-space: pre-wrap; }
            </property>
           </widget>
          </item>
+         <item>
+          <widget class="QPushButton" name="pbHangup">
+           <property name="text">
+            <string>Hangup</string>
+           </property>
+          </widget>
+         </item>
         </layout>
        </item>
        <item>
-- 
1.7.1


^ permalink raw reply related	[flat|nested] 7+ messages in thread

* [PATCH 2/5] callmanager: Remote hangup slot
  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
  2011-05-18 13:33 ` [PATCH 3/5] hardwaremanipulator: add hangup signal Nicolas Bertrand
                   ` (3 subsequent siblings)
  5 siblings, 0 replies; 7+ messages in thread
From: Nicolas Bertrand @ 2011-05-18 13:33 UTC (permalink / raw)
  To: ofono

[-- 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


^ permalink raw reply related	[flat|nested] 7+ messages in thread

* [PATCH 3/5] hardwaremanipulator: add hangup signal
  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 ` [PATCH 2/5] callmanager: Remote hangup slot Nicolas Bertrand
@ 2011-05-18 13:33 ` Nicolas Bertrand
  2011-05-18 13:33 ` [PATCH 4/5] control: Handle hangup call Nicolas Bertrand
                   ` (2 subsequent siblings)
  5 siblings, 0 replies; 7+ messages in thread
From: Nicolas Bertrand @ 2011-05-18 13:33 UTC (permalink / raw)
  To: ofono

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

---
 src/hardwaremanipulator.h |    1 +
 1 files changed, 1 insertions(+), 0 deletions(-)

diff --git a/src/hardwaremanipulator.h b/src/hardwaremanipulator.h
index 9a82ca0..881125e 100644
--- a/src/hardwaremanipulator.h
+++ b/src/hardwaremanipulator.h
@@ -60,6 +60,7 @@ signals:
     void startIncomingCall(const QString &number, const QString &called_number, const QString &name);
     void stateChangedToAlerting();
     void stateChangedToConnected();
+    void stateChangedToHangup( int callId );
 
 protected:
     virtual QString constructCBMessage(const QString &messageCode, int geographicalScope, const QString &updateNumber, const QString &channel,
-- 
1.7.1


^ permalink raw reply related	[flat|nested] 7+ messages in thread

* [PATCH 4/5] control: Handle hangup call
  2011-05-18 13:33 [PATCH 0/5] Add support of remote hangup Nicolas Bertrand
                   ` (2 preceding siblings ...)
  2011-05-18 13:33 ` [PATCH 3/5] hardwaremanipulator: add hangup signal Nicolas Bertrand
@ 2011-05-18 13:33 ` 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
  5 siblings, 0 replies; 7+ messages in thread
From: Nicolas Bertrand @ 2011-05-18 13:33 UTC (permalink / raw)
  To: ofono

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

---
 src/control.cpp |   24 +++++++++++++++++++++++-
 src/control.h   |    2 ++
 2 files changed, 25 insertions(+), 1 deletions(-)

diff --git a/src/control.cpp b/src/control.cpp
index 60f23f2..7c52564 100644
--- a/src/control.cpp
+++ b/src/control.cpp
@@ -90,6 +90,7 @@ ControlWidget::ControlWidget(const QString &ruleFile, Control *parent)
     connect(ui->pbSendNotif, SIGNAL(clicked()), this, SLOT(sendCSSN()));
     connect(ui->pbAlerting, SIGNAL(clicked()), this, SLOT(setStateAlerting()));
     connect(ui->pbActive, SIGNAL(clicked()), this, SLOT(setStateConnected()));
+    connect(ui->pbHangup, SIGNAL(clicked()), this, SLOT(setStateHangup()));
 
     QStringList headers;
     headers << "Sender" << "Priority" << "Notification Status";
@@ -127,7 +128,8 @@ Control::Control(const QString& ruleFile, SimRules *sr, QObject *parent)
         << SIGNAL(switchTo(QString))
         << SIGNAL(startIncomingCall(QString, QString, QString))
         << SIGNAL(stateChangedToAlerting())
-        << SIGNAL(stateChangedToConnected());
+        << SIGNAL(stateChangedToConnected())
+        << SIGNAL(stateChangedToHangup(int));
 
     foreach (QByteArray sig, proxySignals)
         connect(widget, sig, this, sig);
@@ -182,6 +184,26 @@ void ControlWidget::setStateAlerting()
     emit stateChangedToAlerting();
 }
 
+void ControlWidget::setStateHangup()
+{
+    QList <QTableWidgetItem *> items = ui->twCallMgt->selectedItems();
+
+    foreach ( QTableWidgetItem *item, items )
+    {
+        int row = item->row();
+        if ( row >= 0 )
+        {
+            QTableWidgetItem *itemCallId = ui->twCallMgt->item( row, 0 );
+            if ( itemCallId != 0 )
+            {
+                QString strid = itemCallId->text();
+                int id = strid.toInt();
+                emit p->stateChangedToHangup( id );
+            }
+        }
+    }
+}
+
 void ControlWidget::setCssiEnabled( bool enableCSSI )
 {
     ui->cbCSSI->setEnabled( enableCSSI );
diff --git a/src/control.h b/src/control.h
index 3b8ff64..fd1a4e6 100644
--- a/src/control.h
+++ b/src/control.h
@@ -106,6 +106,7 @@ private slots:
     void sendCSSN();
     void setStateAlerting();
     void setStateConnected();
+    void setStateHangup();
 
 signals:
     void unsolicitedCommand(const QString &);
@@ -115,6 +116,7 @@ signals:
     void startIncomingCall(const QString &, const QString &, const QString &);
     void stateChangedToAlerting();
     void stateChangedToConnected();
+    void stateChangedToHangup( int callId );
 
 protected:
     void closeEvent(QCloseEvent *event);
-- 
1.7.1


^ permalink raw reply related	[flat|nested] 7+ messages in thread

* [PATCH 5/5] phonesim: Connect hangup signal
  2011-05-18 13:33 [PATCH 0/5] Add support of remote hangup Nicolas Bertrand
                   ` (3 preceding siblings ...)
  2011-05-18 13:33 ` [PATCH 4/5] control: Handle hangup call Nicolas Bertrand
@ 2011-05-18 13:33 ` Nicolas Bertrand
  2011-05-22 11:00 ` [PATCH 0/5] Add support of remote hangup Denis Kenzior
  5 siblings, 0 replies; 7+ messages in thread
From: Nicolas Bertrand @ 2011-05-18 13:33 UTC (permalink / raw)
  To: ofono

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

---
 src/phonesim.cpp |    2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)

diff --git a/src/phonesim.cpp b/src/phonesim.cpp
index d3bd049..aa49f46 100644
--- a/src/phonesim.cpp
+++ b/src/phonesim.cpp
@@ -534,6 +534,8 @@ SimRules::SimRules( int fd, QObject *p,  const QString& filename, HardwareManipu
                 SLOT( dialingToAlerting() ) );
         connect ( machine, SIGNAL( stateChangedToConnected() ), _callManager,
                 SLOT( dialingToConnected() ) );
+        connect ( machine, SIGNAL( stateChangedToHangup( int ) ), _callManager,
+                SLOT( hangupRemote( int ) ) );
     }
 
     connect(this,SIGNAL(readyRead()),
-- 
1.7.1


^ permalink raw reply related	[flat|nested] 7+ messages in thread

* Re: [PATCH 0/5] Add support of remote hangup
  2011-05-18 13:33 [PATCH 0/5] Add support of remote hangup Nicolas Bertrand
                   ` (4 preceding siblings ...)
  2011-05-18 13:33 ` [PATCH 5/5] phonesim: Connect hangup signal Nicolas Bertrand
@ 2011-05-22 11:00 ` Denis Kenzior
  5 siblings, 0 replies; 7+ messages in thread
From: Denis Kenzior @ 2011-05-22 11:00 UTC (permalink / raw)
  To: ofono

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

Hi Nicolas,

On 05/18/2011 08:33 AM, Nicolas Bertrand wrote:
> These patchs introduce the possibility of remote hangup
> by selecting the call in the call table and use the new 
> button "hangup".
> 
> Nicolas Bertrand (5):
>   controlbase: Add hangup button
>   callmanager: Remote hangup slot
>   hardwaremanipulator: add hangup signal
>   control: Handle hangup call
>   phonesim: Connect hangup signal
> 

All 5 patches have been applied, thanks.

Regards,
-Denis

^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2011-05-22 11:00 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
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 ` [PATCH 2/5] callmanager: Remote hangup slot Nicolas Bertrand
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

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.