Python scripting interface to OsmoNITB/OsmoMSC MNCC interface
Go to file
Holger Hans Peter Freyther 03980b4e31 mncc: Make it possible to build a MNCC server for testing
For manual testing the osmo-sip-connector it is nice to run a custom
MNCC server to mock certain behavior. Refactor the socket class to
share code between client/server.

Change-Id: I8387fe1687557c6a1a26ff1e0cc9dbff3087aa82
2017-04-29 14:12:31 +02:00
.gitignore add .gitignore file 2015-12-01 20:18:47 +01:00
README some README clarifications, including required python modules 2015-12-12 23:04:34 +01:00
gsm_call_fsm.py gsm_call_fsm: Less debug printf's 2015-12-05 16:13:05 +01:00
mncc.h mncc.{h,py}: Add a gsm_mncc_bridge struct 2015-12-05 13:51:37 +01:00
mncc.py mncc.{h,py}: Add a gsm_mncc_bridge struct 2015-12-05 13:51:37 +01:00
mncc.xml mncc.{h,py}: Add a gsm_mncc_bridge struct 2015-12-05 13:51:37 +01:00
mncc_sock.py mncc: Make it possible to build a MNCC server for testing 2017-04-29 14:12:31 +02:00
mncc_test.py gcm_call_fsm: Allow user to specify which codec(s) are to be used 2015-12-05 13:51:43 +01:00
regen-mncc-py.sh rename regen.sh to regen-mncc-py.sh 2015-12-01 21:39:48 +01:00
smpp_test.py add smpp_test to generate SMS load via SMPP interface 2015-12-05 22:41:57 +01:00

README

python MNCC interface for OsmoNITB
(C) 2015 by Harald Welte
======================================================================

I've been working on a small python tool that can be used to attach to 
the MNCC interface of OsmoNITB.  It implements the 04.08 CC state 
machine with our MNCC primitives, including support for RTP bridge mode
of the voice streams.

= Requirements =

mncc-python needs python-pykka, and fysom.

On Debian or Ubuntu you can install them via
	sudo apt-get install python-pykka python-pip
	sudo pip install fysom


= Getting the code =

The first working version of the tool is available from
        http://git.osmocom.org/mncc-python/
or
        git clone git://git.osmocom.org/mncc-python

The code is pretty hacky in some places.  That's partially due to the 
fact that I'm much more familiar in the C, Perl and Erlang world than in
python.  Still I thought it's a good idea to do it in python to enable 
more people to use/edit/contribute to it.

I'm happy for review / cleanup suggestion by people with more Python-foo 
than I have.

Architecturally, I decided to do things a bit erlang-like, where we have
finite state machines in an actor models, and message passing between 
the actors.  This is what happens with the GsmCallFsm()'s, which are 
created by the GsmCallConnector() representing both legs of a call and 
the MnccActor() that wraps the MNCC socket towards OsmoNITB.

The actual encoding/decoding of MNCC messages is auto-generated from the
mncc header file #defines, enums and c-structures by means of ctypes 
code generation.

The immediate first use case for this was to be able to generate MT 
calls to a set of known MSISDNs and load all 14 TCH/H channels of a
single-TRX BTS.  It will connect the MT calls in pairs, so you end up 
with 7 MS-to-MS calls.

mncc_test.py currently drops you into a python shell where you can e.g.
start more / new calls by calling functions like
        connect_call("7839", "3802")
from that shell.  Above example initiates MT calls to subscribers with
extension number 7839 and 3802.

Exiting the shell by quit() or Ctrl+C will terminate all call FSMs and
terminate.