mncc_test: add calls() to initiate series of calls

Change-Id: I0cec9e5dc52e62247da8a3bec47917f929bde5be
changes/06/17406/3
Neels Hofmeyr 3 years ago committed by Harald Welte
parent a765716b8c
commit 5e6d9d3594
  1. 8
      mncc_mt_loadgen.py
  2. 17
      mncc_test.py

@ -176,6 +176,14 @@ def mt_call(msisdn_called, msisdn_calling = '123456789', codecs = GSM48.AllCodec
call_conn.start_call(msisdn_called, msisdn_calling)
return call_conn
def calls(nr, ramp=1.0):
for i in range(nr):
a = 90001 + i
a = str(a)
print("%d: mt_call(%r)" % (i, a))
mt_call(a)
time.sleep(ramp)
log.info("")
log.info("")
log.info("Start calls by typing:")

@ -16,6 +16,7 @@ import pykka
import logging as log
import signal, sys, time
import readline, code
import time
# MnccActor provides an interface for GsmCallFsm to send MNCC messages
class MnccActor(pykka.ThreadingActor):
@ -64,6 +65,20 @@ def connect_call(msisdn_a, msisdn_b, rtp_bridge = True, codecs = GSM48.AllCodecs
call_conn.start_call_ab(msisdn_a, msisdn_b)
return call_conn
def calls(nr, ramp=1.0):
if (nr & 1):
print('Only even numbers allowed, because each invocation has two call legs')
return
nr /= 2
for i in range(nr):
a = 90001 + 2*i
b = a + 1
a = str(a)
b = str(b)
print('%d: connect_call(%r, %r)' % (i, a, b))
connect_call(a, b)
time.sleep(ramp)
# start a first bogus call
log.info("")
@ -71,6 +86,8 @@ log.info("")
log.info("Start calls by typing:")
log.info(' c = connect_call("90001", "90002")')
log.info(' c.release()')
log.info('or')
log.info(' calls(200)')
log.info("")
log.info("")

Loading…
Cancel
Save