mncc_{test,mg_loadgen}.py: Add a manual call-release function

Change-Id: I30265b765f03bd0485bdaa7d6be6d95ad678b0ee
changes/05/17405/3
Neels Hofmeyr 3 years ago committed by Harald Welte
parent cf8e58e5fb
commit a765716b8c
  1. 10
      gsm_call_fsm.py
  2. 3
      mncc_mt_loadgen.py
  3. 3
      mncc_test.py

@ -90,6 +90,10 @@ class GsmCallFsm(pykka.ThreadingActor):
bearer_cap = mncc_bearer_cap(self.codecs_permitted))
self.mncc_ref.tell({'type': 'send', 'msg': msg})
def _onmncc_disc_req(self, e):
msg = mncc_msg(msg_type = mncc.MNCC_DISC_REQ, callref = self.callref)
self.mncc_ref.tell({'type': 'send', 'msg': msg})
def find_matching_codec(self, ms_codecs):
# find common denominator of permitted codecs and MS codecs
for i in self.codecs_permitted:
@ -182,6 +186,7 @@ class GsmCallFsm(pykka.ThreadingActor):
('onmncc_call_conf_ind', self._onmncc_call_conf_ind),
('onmncc_setup_cnf', self._onmncc_setup_cnf),
('onmncc_disc_ind', self._onmncc_disc_ind),
('onmncc_disc_req', self._onmncc_disc_req),
('onenterNULL', self._onenter_NULL),
],
)
@ -302,6 +307,8 @@ class GsmCallFsm(pykka.ThreadingActor):
self.connect_rtp(message['rtp'])
elif message['type'] == 'get_callref':
return self.callref
elif message['type'] == 'release':
self.fsm.mncc_disc_req(None)
else:
raise Exception('mncc', '%s: Unknown message %s' % (self, message))
@ -366,3 +373,6 @@ class GsmCallConnector(pykka.ThreadingActor):
self.rtp_created(message['called'], message['rtp'])
#else:
# raise Exception('mncc', 'GsmCallConnector Rx Unknown message %s' % message)
def release(self):
self.call_a.tell({'type':'release'})

@ -120,6 +120,9 @@ class MTCallRtpsource(pykka.ThreadingActor):
self.call.tell({'type':'start_mt_call',
'calling':self.msisdn_calling, 'called':self.msisdn_called})
def release(self):
self.call.tell({'type':'release'})
def on_stop(self):
# Attempt to do a graceful shutdown by deleting the RTP connection from rtpsource
self.ctrl_act.ask({'type':'rtp_delete', 'cname':self.callref})

@ -69,7 +69,8 @@ def connect_call(msisdn_a, msisdn_b, rtp_bridge = True, codecs = GSM48.AllCodecs
log.info("")
log.info("")
log.info("Start calls by typing:")
log.info(' connect_call("90001", "90002")')
log.info(' c = connect_call("90001", "90002")')
log.info(' c.release()')
log.info("")
log.info("")

Loading…
Cancel
Save