Skip to content

Instantly share code, notes, and snippets.

@lawrencekm
Forked from adothompson/kannel.conf
Created April 23, 2022 07:20
Show Gist options
  • Save lawrencekm/f8c8739c7fc3b7dace8f1bb72fecff36 to your computer and use it in GitHub Desktop.
Save lawrencekm/f8c8739c7fc3b7dace8f1bb72fecff36 to your computer and use it in GitHub Desktop.

Revisions

  1. @tobiasmcnulty tobiasmcnulty revised this gist Jan 31, 2012. 1 changed file with 2 additions and 1 deletion.
    3 changes: 2 additions & 1 deletion settings.py
    Original file line number Diff line number Diff line change
    @@ -15,4 +15,5 @@
    "coding": 0,
    "charset": "ascii",
    "encode_errors": "ignore", # strip out unknown (unicode) characters
    }
    }
    }
  2. @tobiasmcnulty tobiasmcnulty revised this gist Jan 31, 2012. 1 changed file with 18 additions and 0 deletions.
    18 changes: 18 additions & 0 deletions settings.py
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,18 @@
    INSTALLED_BACKENDS = {
    "message_tester": {
    "ENGINE": "rapidsms.backends.bucket",
    },
    # ...
    "kannel-cebu" : {
    "ENGINE": "rapidsms.backends.kannel",
    "host": "public.ip.of.this_server",
    "port": 8080,
    "sendsms_url": "http://remote.ip.of.kannel.server:13013/cgi-bin/sendsms",
    "sendsms_params": {"smsc": "usb0-modem",
    "from": "+SIMphonenumber", # not set automatically by SMSC
    "username": "rapidsms",
    "password": ""}, # set in localsettings.py
    "coding": 0,
    "charset": "ascii",
    "encode_errors": "ignore", # strip out unknown (unicode) characters
    }
  3. @tobiasmcnulty tobiasmcnulty revised this gist Jan 31, 2012. 2 changed files with 158 additions and 0 deletions.
    File renamed without changes.
    158 changes: 158 additions & 0 deletions modems.conf
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,158 @@
    # Modems configuration
    #
    # Example and default values
    #
    # group = modems
    # id = "my-id"
    # name = "my-name"
    # detect-string = "MODEM"
    # detect-string2 = "" [Default]
    # init-string = "AT+CNMI=1,2,0,0,0" [Default]
    # speed = 9600 [Default]
    # enable-hwhs = "AT+IFC=2,2" [Default]
    # need-sleep = false [Default]
    # no-pin = false [Default]
    # no-smsc = false [Default]
    # sendline-sleep = 100 [Default, miliseconds]
    # keepalive-cmd = "AT" [Default]
    # broken = false [Default]
    # message-storage = "SM"
    # enable-mms = false [Default]


    # If modemtype=auto, try everyone and defaults to this one
    group = modems
    id = generic
    name = "Generic Modem"

    group = modems
    id = wavecom
    name = Wavecom
    detect-string = "WAVECOM"
    init-string = "AT+CNMI=1,2,0,0,0"

    group = modems
    id = premicell
    name = Premicell
    detect-string = "PREMICEL"
    no-pin = true
    no-smsc = true

    group = modems
    id = siemens_tc35
    name = "Siemens TC35"
    detect-string = "SIEMENS"
    detect-string2 = "TC35"
    init-string = "AT+CNMI=3,2,0,1,1"
    speed = 19200
    enable-hwhs = "AT\\Q3"
    need-sleep = true
    reset-string = "AT+CFUN=1"
    keepalive-cmd = "AT+CSQ"

    group = modems
    id = siemens_m20
    name = "Siemens M20"
    detect-string = "SIEMENS"
    detect-string2 = "M20"
    speed = 19200
    enable-hwhs = "AT\\Q3"
    keepalive-cmd = "AT+CBC;+CSQ"
    need-sleep = true

    group = modems
    id = siemens_sl45
    name = "Siemens SL45"
    detect-string = "SIEMENS"
    detect-string2 = "SL45"
    init-string = "AT+CNMI=1,2,2,2,1"
    keepalive-cmd = "AT+CBC;+CSQ"
    speed = 19200
    enable-hwhs = "AT\\Q3"
    need-sleep = true
    message-storage = "SM"

    group = modems
    id = nokiaphone
    name = "Nokia Phone"
    detect-string = "Nokia Mobile Phone"
    need-sleep = true
    keepalive-cmd = "AT+CBC;+CSQ"
    enable-mms = true

    group = modems
    id = falcom
    name = "Falcom"
    detect-string = "Falcom"
    #no-smsc = true

    group = modems
    id = ericsson_r520m
    name = "Ericsson R520m"
    detect-string = "R520m"
    init-string = "AT+CNMI=3,2,0,0"

    group = modems
    id = ericsson_t68
    name = "Ericsson T68"
    detect-string = "T68"
    init-string = "AT+CNMI=3,3"
    keepalive-cmd = "AT+CBC;+CSQ"
    broken = true

    group = modems
    id = sonyericsson_gr47
    name = "Sony Ericsson GR47"
    detect-string = "GR47"
    message-storage = "ME"
    # use this init-string for non sim-buffering
    init-string = "AT+CNMI=3,2,0,0"
    # use this init-string for sim-buffering
    #init-string = "AT+CNMI=3,1,0,0"
    reset-string = "ATZ"
    broken = true

    group = modems
    id = alcatel
    name = "Alcatel"
    detect-string = "Alcatel"
    init-string = "AT+CNMI=3,2,0,0"

    group = modems
    id = sonyericsson_T630-T628
    name = "Sony Ericsson T630-T628?
    init-string = "AT+CNMI=2,3,2,0,0;+CMGF=0?
    keepalive-cmd = "AT+CBC;+CSQ;+CMGF=0?
    broken = true

    group = modems
    id = sonyericsson_p1i
    name = "Sony Ericsson P1i"
    detect-string = "Sony Ericsson P1i"
    init-string = "ATQ0 V1 E1 S0=0 &C1 &D2 +FCLASS=0"
    message-storage = "SM"
    reset-string = "ATZ"
    broken = true

    group = modems
    id = huawei_e1550
    name = "Huawei E1550"
    detect-string = "huawei"
    init-string = "ATQ0 V1 E1 S0=0 &C1 &D2 +FCLASS=0"
    #sim-buffering = true
    message-storage = "SM"
    need-sleep = true
    speed = 9600
    #speed = 460800


    group = modems
    id = huawei_e620
    name = "Huawei E620"
    detect-string = "huawei"
    init-string = "AT+CFUN=1"
    message-storage = "ME"
    need-sleep = true
    speed = 460800
    no-pin = true
    reset-string = "AT+CFUN=1"
  4. @tobiasmcnulty tobiasmcnulty created this gist Jan 31, 2012.
    122 changes: 122 additions & 0 deletions gistfile1.cfg
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,122 @@
    #
    # CONFIGURATION FOR USING SMS KANNEL WITH RAPIDSMS
    #
    # For any modifications to this file, see Kannel User Guide
    # If that does not help, see Kannel web page (http://www.kannel.org) and
    # various online help and mailing list archives
    #
    # Notes on those who base their configuration on this:
    # 1) check security issues! (allowed IPs, passwords and ports)
    # 2) groups cannot have empty rows inside them!
    # 3) read the user guide
    #
    # Kalle Marjola for Kannel project 2001, 2004

    include = "/etc/kannel/modems.conf"

    #---------------------------------------------
    # CORE
    #
    # There is only one core group and it sets all basic settings
    # of the bearerbox (and system). You should take extra notes on
    # configuration variables like 'store-file' (or 'store-dir'),
    # 'admin-allow-ip' and 'access.log'


    group = core
    admin-port = 13000
    smsbox-port = 13001
    admin-password = CHANGE ME
    status-password = CHANGE ME
    admin-deny-ip = "*.*.*.*"
    admin-allow-ip = "127.0.0.1"
    box-deny-ip = "*.*.*.*"
    box-allow-ip = "127.0.0.1"
    log-file = "/var/log/kannel/bearerbox.log"
    log-level = 0

    #---------------------------------------------
    # SMSC CONNECTIONS
    #
    # SMSC connections are created in bearerbox and they handle SMSC specific
    # protocol and message relying. You need these to actually receive and send
    # messages to handset, but can use GSM modems as virtual SMSCs


    # This is a fake smsc connection, _only_ used to test the system and services.
    # It really cannot relay messages to actual handsets!

    #group = smsc
    #smsc = fake
    #smsc-id = FAKE
    #port = 20000
    #connect-allow-ip = 127.0.0.1

    group = smsc
    smsc = at
    smsc-id = usb0-modem
    my-number = 1234
    modemtype = auto
    device = /dev/ttyUSB0

    #---------------------------------------------
    # SMSBOX SETUP
    #
    # Smsbox(es) do higher-level SMS handling after they have been received from
    # SMS centers by bearerbox, or before they are given to bearerbox for delivery

    group = smsbox
    bearerbox-host = 127.0.0.1
    sendsms-port = 13013
    sendsms-chars = "0123456789 +-"
    log-file = "/var/log/kannel/smsbox.log"
    log-level = 0
    access-log = "/var/log/kannel/smsbox-access.log"
    reply-couldnotfetch = "Your message could not be processed at this time. Please try again later. (err=couldnotfetch)"
    reply-requestfailed = "Your message could not be processed at this time. Please try again later. (err=requestfailed)"
    reply-couldnotrepresent = "Your message could not be processed at this time. Please try again later. (err=couldnotrepresent)"
    http-request-retry = 3
    http-queue-delay = 10

    # SEND-SMS USERS
    #
    # These users are used when Kannel smsbox sendsms interface is used to
    # send PUSH sms messages, i.e. calling URL like
    # http://kannel.machine:13013/cgi-bin/sendsms?username=tester&password=foobar...

    # This is the username and password that RapidSMS uses to deliver SMSes to
    # Kannel. It must also set the 'smsc' variable in the query string, so that
    # Kannel knows which SMSC to use to route the message.

    group = sendsms-user
    username = rapidsms
    password = CHANGE ME
    user-deny-ip = "*.*.*.*"
    user-allow-ip = "127.0.0.1;ip.of.rapidsms.server;"

    #---------------------------------------------
    # SERVICES
    #
    # These are 'responses' to sms PULL messages, i.e. messages arriving from
    # handsets. The response is based on message content. Only one sms-service is
    # applied, using the first one to match.

    # The 'ping-kannel' service let's you check to see if Kannel is running,
    # even if RapidSMS is offline for some reason.

    group = sms-service
    keyword = ping-kannel
    text = "Kannel is online and responding to messages."

    # There should be always a 'default' service. This service is used when no
    # other 'sms-service' is applied. These relay incoming messages from Zain
    # and TNM, respectively, to the appropriate HTTP backend URLs in RapidSMS.
    # By setting 'accepted-smsc', we are assured that messages are routed to
    # the appropriate backend in RapidSMS.

    group = sms-service
    keyword = default
    accepted-smsc = usb0-modem
    # don't send a reply here (it'll come through sendsms):
    max-messages = 0
    get-url = http://my.rapidsms.server.com:8080/?id=%p&text=%a&charset=%C&coding=%c