Introduction
This is a very basic, incomplete implentation of SIP Message RFC 3428 to somewhat act as a GSM SMSC would act.
License
This code is licensed under GPLv3.
Features
To Do
How to Run
Just run smsc.py under python. It will listen to a 5062 and transmit messages to the OpenBTS software on 5063 by default. Change the top of smsc.py if you want to reassign ports.
How to Write Code
When a shortcode comes in, the python script takes a look at the destination number. Then, it tries to see if it can attempt to import short_NNNNN, where NNNNN is a variable length destination number. Care should be taken as to who you let make calls, and what the destination number is.
Your job is to write short_NNNN.py (for example, short_1337.py), and create just one function: moSMS(from number, destination number, text)
After you have processed the request in a desired way, simply return a string, like: return str(some_variable) or return "hello world"
Some examples exist such as short_1000 (directory service), short_1001 (echo service), and short_1002 (math service) to get you started.
Right now, to keep things simple (heheh), messaging is synchronous. Eventually, there will be a process for silently receiving SIP Messages and transmitting them asynchronous.
simulator.py and short_tester.py
To help in development, simulator.py acts like OpenBTS. Simply type in:
Alternately, there is short_tester.py. This is a simple script (you can
probably write a better one), that invokes the short code module's only
moSMS() function for testing purposes. Both source and destination
numbers are faked, so type away for quick testing and development.
Download