All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] Simulation of MT release of call to spcial number
@ 2010-09-17  7:41 ext-arun.1.ravindran
  0 siblings, 0 replies; 3+ messages in thread
From: ext-arun.1.ravindran @ 2010-09-17  7:41 UTC (permalink / raw)
  To: ofono

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

From: Arun Ravindran <ext-arun.1.ravindran@nokia.com>

---
 src/callmanager.cpp |   17 +++++++++++++++++
 src/callmanager.h   |    3 +++
 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 -->
 
-- 
1.7.0.4


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

* Re: [PATCH] Simulation of MT release of call to spcial number
  2010-09-17  7:50 ext-arun.1.ravindran
@ 2010-09-17  8:09 ` Marcel Holtmann
  0 siblings, 0 replies; 3+ messages in thread
From: Marcel Holtmann @ 2010-09-17  8:09 UTC (permalink / raw)
  To: ofono

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

Hi Arun,

> From: Arun Ravindran <ext-arun.1.ravindran@nokia.com>

mind fixing the spelling mistake in the subject :)

Regards

Marcel



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

* [PATCH] Simulation of MT release of call to spcial number
@ 2010-09-17  7:50 ext-arun.1.ravindran
  2010-09-17  8:09 ` Marcel Holtmann
  0 siblings, 1 reply; 3+ messages in thread
From: ext-arun.1.ravindran @ 2010-09-17  7:50 UTC (permalink / raw)
  To: ofono

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

From: Arun Ravindran <ext-arun.1.ravindran@nokia.com>

---
 src/callmanager.cpp |   17 +++++++++++++++++
 src/callmanager.h   |    3 +++
 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 -->
 
-- 
1.7.0.4


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

end of thread, other threads:[~2010-09-17  8:09 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-09-17  7:41 [PATCH] Simulation of MT release of call to spcial number ext-arun.1.ravindran
2010-09-17  7:50 ext-arun.1.ravindran
2010-09-17  8:09 ` Marcel Holtmann

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.