From d27de2ba564c7ce9d98d573094cc68ff0539d7bd Mon Sep 17 00:00:00 2001 From: Pau Espin Pedrol Date: Mon, 6 Nov 2017 17:42:41 +0100 Subject: [PATCH] suites: Add ussd support to interactive shell test Change-Id: I055f2b9de56da8d956c3e4944f6600dea2ee5578 --- suites/aoip_debug/interactive.py | 12 +++++++++++- suites/debug/interactive.py | 12 +++++++++++- 2 files changed, 22 insertions(+), 2 deletions(-) diff --git a/suites/aoip_debug/interactive.py b/suites/aoip_debug/interactive.py index 819f2072..f09732b9 100755 --- a/suites/aoip_debug/interactive.py +++ b/suites/aoip_debug/interactive.py @@ -23,7 +23,7 @@ for m in modems: m.connect(msc.mcc_mnc()) while True: - cmd = prompt('Enter command: (q)uit (s)ms (g)et-registered (w)ait-registered, call-list [], call-dial , call-wait-incoming , call-answer , call-hangup ') + cmd = prompt('Enter command: (q)uit (s)ms (g)et-registered (w)ait-registered, call-list [], call-dial , call-wait-incoming , call-answer , call-hangup , ussd ') cmd = cmd.strip().lower() if not cmd: @@ -103,5 +103,15 @@ while True: print('hanging up %s %r' % (ms.name(), call_id)) ms.call_hangup(call_id) + elif cmd.startswith('ussd'): + if len(params) != 2: + print('wrong format') + continue + ussd_cmd = params[1] + for ms in modems: + print('modem %s: ussd %s' % (ms.name(), ussd_cmd)) + response = ms.ussd_send(ussd_cmd) + print('modem %s: response=%r' % (ms.name(), response)) + else: print('Unknown command: %s' % cmd) diff --git a/suites/debug/interactive.py b/suites/debug/interactive.py index 1b89a7d4..d5f76156 100755 --- a/suites/debug/interactive.py +++ b/suites/debug/interactive.py @@ -16,7 +16,7 @@ for m in modems: m.connect(nitb.mcc_mnc()) while True: - cmd = prompt('Enter command: (q)uit (s)ms (g)et-registered (w)ait-registered, call-list [], call-dial , call-wait-incoming , call-answer , call-hangup ') + cmd = prompt('Enter command: (q)uit (s)ms (g)et-registered (w)ait-registered, call-list [], call-dial , call-wait-incoming , call-answer , call-hangup , ussd ') cmd = cmd.strip().lower() if not cmd: @@ -96,5 +96,15 @@ while True: print('hanging up %s %r' % (ms.name(), call_id)) ms.call_hangup(call_id) + elif cmd.startswith('ussd'): + if len(params) != 2: + print('wrong format') + continue + ussd_cmd = params[1] + for ms in modems: + print('modem %s: ussd %s' % (ms.name(), ussd_cmd)) + response = ms.ussd_send(ussd_cmd) + print('modem %s: response=%r' % (ms.name(), response)) + else: print('Unknown command: %s' % cmd)