Skip to content

Instantly share code, notes, and snippets.

@srugano
Last active March 22, 2020 19:03
Show Gist options
  • Save srugano/021e134ca46ef055481f to your computer and use it in GitHub Desktop.
Save srugano/021e134ca46ef055481f to your computer and use it in GitHub Desktop.
If you have more than one modem, I guess you can do thi in `RapidSMS` :
INSTALLED_BACKENDS = {
"message_tester": {
"ENGINE": "rapidsms.backends.database.DatabaseBackend",
},
"kannel-usb0-smsc" : {
"ENGINE": "rapidsms.backends.kannel.KannelBackend",
"sendsms_url": "http://127.0.0.1:13013/cgi-bin/sendsms",
"sendsms_params": {"smsc": "usb0-modem",
"from": "+firstnumber", # not set automatically by SMSC
"username": "rapidsms",
"password": "CHANGE-ME"}, # or set in localsettings.py
"coding": 0,
"charset": "ascii",
"encode_errors": "http://127.0.0.1:8000", # strip out unknown (unicode) characters
},
"kannel-usb1-smsc" : {
"ENGINE": "rapidsms.backends.kannel.KannelBackend",
"sendsms_url": "http://127.0.0.1:13013/cgi-bin/sendsms",
"sendsms_params": {"smsc": "usb0-modem",
"from": "+secondnumber", # not set automatically by SMSC
"username": "rapidsms",
"password": "CHANGE-ME"}, # or set in localsettings.py
"coding": 0,
"charset": "ascii",
"encode_errors": "http://127.0.0.1:8000", # strip out unknown (unicode) characters
},
}
And configure kannel to do accordingly like we did in order to usher corresponding SMS-provider to its corresponding SMS:
# in /etc/kannel/kannel.conf
#SMSC MODEM GSM
group = smsc
smsc = at
port = 13013
host = "localhost"
smsc-id = Huawei0
modemtype = Huawei
device = /dev/ttyUSB0
speed = 19200
my-number = +firstnumber
sim-buffering=true
validityperiod=167
log-level = 0
connect-allow-ip = "*.*.*.*"
allowed-prefix = +25771;+25772;+25779 #for Leo
#SMSC MODEM GSM
group = smsc
smsc = at
port = 13013
host = "localhost"
smsc-id = Huawei1
modemtype = Huawei
device = /dev/ttyUSB1
speed = 19200
my-number = +secondnumber
sim-buffering=true
validityperiod=167
log-level = 0
connect-allow-ip = "*.*.*.*"
allowed-prefix = 25775;+25775 #for smart
# SMS-SERVICE
group = sms-service
keyword = default
catch-all = yes
accept-x-kannel-headers = true
max-messages = 99
concatenation = true
catch-all = true
omit-empty = true
accepted-smsc = Huawei0
get-url = http://127.0.0.1:8000/backend/kannel-usb0-smsc/?id=%p&text=%a&charset=%C&coding=%c
group = sms-service
keyword = default
catch-all = yes
accept-x-kannel-headers = true
max-messages = 99
concatenation = true
catch-all = true
omit-empty = true
accepted-smsc = Huawei1
get-url = http://127.0.0.1:8000/backend/kannel-usb0-smsc/?id=%p&text=%a&charset=%C&coding=%c
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment