Open Source Telephony
 help / color / mirror / Atom feed
* [PATCH 1/2] test: Rename script hangup-active to hangup
@ 2012-07-30 15:45 Guillaume Zajac
  2012-07-30 15:45 ` [PATCH 2/2] test: Tweak hangup script to clear waiting active and held calls Guillaume Zajac
  2012-07-30 16:46 ` [PATCH 1/2] test: Rename script hangup-active to hangup Marcel Holtmann
  0 siblings, 2 replies; 4+ messages in thread
From: Guillaume Zajac @ 2012-07-30 15:45 UTC (permalink / raw)
  To: ofono

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

---
 Makefile.am        |    2 +-
 test/hangup        |   29 +++++++++++++++++++++++++++++
 test/hangup-active |   29 -----------------------------
 3 files changed, 30 insertions(+), 30 deletions(-)
 create mode 100755 test/hangup
 delete mode 100755 test/hangup-active

diff --git a/Makefile.am b/Makefile.am
index 4410043..a3681c3 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -554,7 +554,7 @@ test_scripts = test/backtrace \
 		test/enter-pin \
 		test/reset-pin \
 		test/hangup-all \
-		test/hangup-active \
+		test/hangup \
 		test/set-mms-details \
 		test/set-roaming-allowed \
 		test/list-contexts \
diff --git a/test/hangup b/test/hangup
new file mode 100755
index 0000000..6444b23
--- /dev/null
+++ b/test/hangup
@@ -0,0 +1,29 @@
+#!/usr/bin/python
+
+import sys
+import dbus
+
+bus = dbus.SystemBus()
+
+manager = dbus.Interface(bus.get_object('org.ofono', '/'),
+						'org.ofono.Manager')
+
+modems = manager.GetModems()
+path = modems[0][0]
+
+manager = dbus.Interface(bus.get_object('org.ofono', path),
+						'org.ofono.VoiceCallManager')
+
+calls = manager.GetCalls()
+
+for path, properties in calls:
+		state = properties["State"]
+		print "[ %s ] %s" % (path, state)
+
+		if state != "active":
+			continue
+
+		call = dbus.Interface(bus.get_object('org.ofono', path),
+						'org.ofono.VoiceCall')
+
+		call.Hangup()
diff --git a/test/hangup-active b/test/hangup-active
deleted file mode 100755
index 6444b23..0000000
--- a/test/hangup-active
+++ /dev/null
@@ -1,29 +0,0 @@
-#!/usr/bin/python
-
-import sys
-import dbus
-
-bus = dbus.SystemBus()
-
-manager = dbus.Interface(bus.get_object('org.ofono', '/'),
-						'org.ofono.Manager')
-
-modems = manager.GetModems()
-path = modems[0][0]
-
-manager = dbus.Interface(bus.get_object('org.ofono', path),
-						'org.ofono.VoiceCallManager')
-
-calls = manager.GetCalls()
-
-for path, properties in calls:
-		state = properties["State"]
-		print "[ %s ] %s" % (path, state)
-
-		if state != "active":
-			continue
-
-		call = dbus.Interface(bus.get_object('org.ofono', path),
-						'org.ofono.VoiceCall')
-
-		call.Hangup()
-- 
1.7.5.4


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

* [PATCH 2/2] test: Tweak hangup script to clear waiting active and held calls
  2012-07-30 15:45 [PATCH 1/2] test: Rename script hangup-active to hangup Guillaume Zajac
@ 2012-07-30 15:45 ` Guillaume Zajac
  2012-07-30 16:50   ` Marcel Holtmann
  2012-07-30 16:46 ` [PATCH 1/2] test: Rename script hangup-active to hangup Marcel Holtmann
  1 sibling, 1 reply; 4+ messages in thread
From: Guillaume Zajac @ 2012-07-30 15:45 UTC (permalink / raw)
  To: ofono

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

---
 test/hangup |   12 +++++++++++-
 1 files changed, 11 insertions(+), 1 deletions(-)

diff --git a/test/hangup b/test/hangup
index 6444b23..60858a8 100755
--- a/test/hangup
+++ b/test/hangup
@@ -3,6 +3,16 @@
 import sys
 import dbus
 
+if (len(sys.argv) < 2):
+	print "Usage: %s <call state>" % (sys.argv[0])
+	sys.exit(1)
+
+cstate = sys.argv[1]
+
+if cstate != "active" and cstate != "waiting" and cstate != "held":
+	print "Valid <call state> is active / waiting / held"
+	sys.exit(1)
+
 bus = dbus.SystemBus()
 
 manager = dbus.Interface(bus.get_object('org.ofono', '/'),
@@ -20,7 +30,7 @@ for path, properties in calls:
 		state = properties["State"]
 		print "[ %s ] %s" % (path, state)
 
-		if state != "active":
+		if state != cstate:
 			continue
 
 		call = dbus.Interface(bus.get_object('org.ofono', path),
-- 
1.7.5.4


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

* Re: [PATCH 1/2] test: Rename script hangup-active to hangup
  2012-07-30 15:45 [PATCH 1/2] test: Rename script hangup-active to hangup Guillaume Zajac
  2012-07-30 15:45 ` [PATCH 2/2] test: Tweak hangup script to clear waiting active and held calls Guillaume Zajac
@ 2012-07-30 16:46 ` Marcel Holtmann
  1 sibling, 0 replies; 4+ messages in thread
From: Marcel Holtmann @ 2012-07-30 16:46 UTC (permalink / raw)
  To: ofono

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

Hi Guillaume,

>  Makefile.am        |    2 +-
>  test/hangup        |   29 +++++++++++++++++++++++++++++
>  test/hangup-active |   29 -----------------------------
>  3 files changed, 30 insertions(+), 30 deletions(-)
>  create mode 100755 test/hangup
>  delete mode 100755 test/hangup-active

and why are we renaming this?

Regards

Marcel



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

* Re: [PATCH 2/2] test: Tweak hangup script to clear waiting active and held calls
  2012-07-30 15:45 ` [PATCH 2/2] test: Tweak hangup script to clear waiting active and held calls Guillaume Zajac
@ 2012-07-30 16:50   ` Marcel Holtmann
  0 siblings, 0 replies; 4+ messages in thread
From: Marcel Holtmann @ 2012-07-30 16:50 UTC (permalink / raw)
  To: ofono

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

Hi Guillaume,

>  test/hangup |   12 +++++++++++-
>  1 files changed, 11 insertions(+), 1 deletions(-)

this is a case where you should have done a summary email to describe
why are you doing things.

> 
> diff --git a/test/hangup b/test/hangup
> index 6444b23..60858a8 100755
> --- a/test/hangup
> +++ b/test/hangup
> @@ -3,6 +3,16 @@
>  import sys
>  import dbus
>  
> +if (len(sys.argv) < 2):
> +	print "Usage: %s <call state>" % (sys.argv[0])
> +	sys.exit(1)
> +
> +cstate = sys.argv[1]
> +
> +if cstate != "active" and cstate != "waiting" and cstate != "held":
> +	print "Valid <call state> is active / waiting / held"
> +	sys.exit(1)
> +

If you wanna do things like this, then at least the call without
parameter should list the current calls and in what state they are.
Otherwise this is making things worse.

And don't bother renaming the script first. Just introduce a new script
and delete the duplicate later on.

Regards

Marcel



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

end of thread, other threads:[~2012-07-30 16:50 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-07-30 15:45 [PATCH 1/2] test: Rename script hangup-active to hangup Guillaume Zajac
2012-07-30 15:45 ` [PATCH 2/2] test: Tweak hangup script to clear waiting active and held calls Guillaume Zajac
2012-07-30 16:50   ` Marcel Holtmann
2012-07-30 16:46 ` [PATCH 1/2] test: Rename script hangup-active to hangup Marcel Holtmann

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox