[solved] Issue connecting Kannel to an SMPP connection

Hi all,

First of all, I just want to mention how much I love playSMS: great stuff, I love it - keep up the good work!

The last couple of days I’ve been trying to connect install Kannel (with playSMS) and connect it to an SMPP connection (SMPPSim for starters) but I can’t seem to resolve this issue by myself.

I have successfully set up the Kannel gateway in playSMS and can see that the setup, so far, is correct and working. Please see below for the status (before trying to connect to a specific SMPP connection).

Kannel bearerbox version `1.4.3'.
Build `Nov 24 2011 09:54:00', compiler `4.6.2'.
System Linux, release 3.13.0-57-generic, version #95-Ubuntu SMP Fri Jun 19 09:28:15 UTC 2015, machine x86_64.
Hostname ubuntu2, IP 127.0.1.1.
Libxml version 2.7.8.
Using OpenSSL 1.0.0e 6 Sep 2011.
Compiled with MySQL 5.5.17, using MySQL 5.5.46.
Using SQLite 3.7.9.
Using native malloc.


Status: running, uptime 0d 0h 0m 2s

WDP: received 0 (0 queued), sent 0 (0 queued)

SMS: received 0 (0 queued), sent 0 (0 queued), store size 0
SMS: inbound (0.00,0.00,0.00) msg/sec, outbound (0.00,0.00,0.00) msg/sec

DLR: 0 queued, using internal storage

Box connections:
    smsbox:(none), IP 127.0.0.1 (0 queued), (on-line 0d 0h 0m 1s)  


SMSC connections:
    FAKE    FAKE:10000 (connecting, rcvd 0, sent 0, failed 0, queued 0 msgs)

When I try to add a # SMSC smpp1 connection in my kannel.conf it fails and I instead get the below error:

Unable to access Kannel admin commands

I have tried configuring the kannel.conf to connect to SMPPSim with the following kannel.conf

# CORE
group = core
admin-port = 13000
admin-password = password
status-password = password
log-file = /var/log/kannel/kannel.log
log-level = 0
access-log = /var/log/kannel/access.log
smsbox-port = 13001
store-type = spool
store-location = /var/spool/kannel/store
smsbox-max-pending = 100

# SMSBOX
group = smsbox
bearerbox-host = localhost
bearerbox-port = 13001
sendsms-port = 13131
sendsms-chars = "0123456789+ "
log-file = /var/log/kannel/smsbox.log
log-level = 0
access-log = /var/log/kannel/access.log
mo-recode = true

 SMSC smpp1
smsc = smpp
smsc-id = smpp1
allowed-smsc-id = smpp1
preferred-smsc-id = smpp1
host = localhost
port = 2775
transceiver-mode = yes
smsc-username = smppclient1
smsc-password = password
system-type = "VMA"
log-file = /var/log/kannel/smsc-smpp1.log
log-level = 0

Here’s my SMSC configuration in playSMS (as I can connect to Kannel but not to the specific SMPP connection I guess the mainpage is not helpful?): http://prntscr.com/8zfv2z

I’m pretty much going crazy here, so if anyone can help me out or point me in the right direction that would be highly appreciated.

Cheerios!

you’re missing a # in front of SMSC smpp1

and the send SMS port is not 10000, your kannel config states its 13131

and then you need to put correct admin password in Operational tab in kannel gateway config (on playSMS)

anton

Thanks a lot for the quick reply. Regarding the missing “#”, I’ve been commenting out that particular SMPP connection to confirm that it stopped working when I added an SMPP connection and I must’ve removed one too many “#” -char.

I however made the adjustments per your advice but it didn’t change anything :/.

Current config below.

# SMSC smpp1
smsc = smpp
smsc-id = smpp1
allowed-smsc-id = smpp1
preferred-smsc-id = smpp1
host = localhost
port = 2775
transceiver-mode = yes
smsc-username = smppclient1
smsc-password = password
system-type = "VMA"
log-file = /var/log/kannel/smsc-smpp1.log
log-level = 0

Is this indicating that something might be wrong with the connection to the connection I’m trying to connect or the way I’m connecting (did I configure the file & playSMS wrong et cetera)?

Thanks again!

you need to make sure that port 13131 and 13000 is active on localhost

netstat -lnptu

anton

Hi Anton,

Thanks! I know for sure that I haven’t opened any ports so I’ll get to it. I’ll get back to you when I figured out how to open the ports to tell you if it solved my problem or not.

Thanks again!

no, what I meant, when you made the changes on kannel.conf and then you restart Kannel, you have to make sure that Kannel is alive. how to make sure is by looking at netstat -lnptu, you have to make sure that you see port 13131 and 13000 both active (Kannel is using them)

anton

Oh… This is what I get, please see below.

root@ubuntu2:~# netstat -lnptu
Active Internet connections (only servers)
Proto Recv-Q Send-Q Local Address           Foreign Address         State       PID/Program name
tcp        0      0 0.0.0.0:22              0.0.0.0:*               LISTEN      975/sshd
tcp        0      0 127.0.0.1:3306          0.0.0.0:*               LISTEN      1030/mysqld
tcp6       0      0 :::22                   :::*                    LISTEN      975/sshd
tcp6       0      0 :::80                   :::*                    LISTEN      1454/apache2

If I instead comment the SMPP connection out and add ‘FAKE-SMSC’ I get a successful kannel-status and the following netstat -lnptu

root@ubuntu2:~# netstat -lnptu
Active Internet connections (only servers)
Proto Recv-Q Send-Q Local Address           Foreign Address         State       PID/Program name
tcp        0      0 0.0.0.0:22              0.0.0.0:*               LISTEN      975/sshd
tcp        0      0 0.0.0.0:13000           0.0.0.0:*               LISTEN      4075/bearerbox
tcp        0      0 0.0.0.0:13001           0.0.0.0:*               LISTEN      4075/bearerbox
tcp        0      0 127.0.0.1:3306          0.0.0.0:*               LISTEN      1030/mysqld
tcp        0      0 0.0.0.0:13131           0.0.0.0:*               LISTEN      4090/smsbox
tcp        0      0 0.0.0.0:10000           0.0.0.0:*               LISTEN      4075/bearerbox
tcp6       0      0 :::22                   :::*                    LISTEN      975/sshd
tcp6       0      0 :::80                   :::*                    LISTEN    

I would assume that I have an issue with the smpp-details I enter and therefore I get the following error? As it works with the FAKE SMSC.

access Kannel admin commands

The FAKE SMSC config looks like this:

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

Could it be that the details I enter for my smpp connection is somewhat invalid?

you can try to find out whats wrong by reading kannel.log or smsbox.log in /var/log/kannel

anton

Hi Anton,

Not sure if that made me any smarter…

Someone else might see something I miss so I’m going to paste it here.

Kannel.log below

2015-11-06 09:41:22 [4516] [0] INFO: All flow threads have died, killing core
2015-11-06 09:41:22 [4516] [0] DEBUG: Waiting for 2 (gwlib/http.c:server_thread) to terminate
2015-11-06 09:41:22 [4516] [3] DEBUG: HTTP: No clients with requests, quitting.
2015-11-06 09:41:22 [4516] [3] DEBUG: Thread 3 (gw/bb_http.c:httpadmin_run) terminates.
2015-11-06 09:41:22 [4516] [2] DEBUG: Thread 2 (gwlib/http.c:server_thread) terminates.
2015-11-06 09:41:22 [4516] [1] DEBUG: Thread 1 (gwlib/fdset.c:poller) terminates.
2015-11-06 09:41:22 [4516] [0] INFO: Total WDP messages: received 0, sent 0
2015-11-06 09:41:22 [4516] [0] INFO: Total SMS messages: received 0, sent 0
2015-11-06 09:41:22 [4516] [0] DEBUG: Immutable octet strings: 125.
2015-11-06 09:43:18 [4601] [0] INFO: Added logfile `/var/log/kannel/kannel.log' with level `0'.
2015-11-06 09:43:18 [4601] [0] INFO: Started access logfile `/var/log/kannel/access.log'.
2015-11-06 09:43:18 [4601] [0] INFO: HTTP: Opening server at port 13000.
2015-11-06 09:43:18 [4601] [0] DEBUG: Started thread 1 (gwlib/fdset.c:poller)
2015-11-06 09:43:18 [4601] [0] DEBUG: Started thread 2 (gwlib/http.c:server_thread)
2015-11-06 09:43:18 [4601] [0] DEBUG: Started thread 3 (gw/bb_http.c:httpadmin_run)
2015-11-06 09:43:18 [4601] [0] DEBUG: starting smsbox connection module
2015-11-06 09:43:18 [4601] [0] DEBUG: Started thread 4 (gw/bb_boxc.c:sms_to_smsboxes)
2015-11-06 09:43:18 [4601] [0] DEBUG: Started thread 5 (gw/bb_boxc.c:smsboxc_run)
2015-11-06 09:43:18 [4601] [0] INFO: Set SMS resend frequency to 60 seconds.
2015-11-06 09:43:18 [4601] [0] INFO: SMS resend retry set to unlimited.
2015-11-06 09:43:18 [4601] [0] DEBUG: smsbox MO concatenated message handling enabled
2015-11-06 09:43:18 [4601] [0] INFO: DLR rerouting for smsc id <FAKE> disabled.
2015-11-06 09:43:18 [4601] [0] DEBUG: Started thread 6 (gw/smsc/smsc_fake.c:fake_listener)
2015-11-06 09:43:18 [4601] [0] DEBUG: Started thread 7 (gw/bb_smscconn.c:sms_router)
2015-11-06 09:43:18 [4601] [0] INFO: ----------------------------------------
2015-11-06 09:43:18 [4601] [0] INFO: Kannel bearerbox II version 1.4.3 starting
2015-11-06 09:43:18 [4601] [5] DEBUG: Thread 5 (gw/bb_boxc.c:smsboxc_run) maps to pid 4601.
2015-11-06 09:43:18 [4601] [0] INFO: Loaded 0 messages from store.
2015-11-06 09:43:18 [4601] [0] INFO: MAIN: Start-up done, entering mainloop
2015-11-06 09:43:18 [4601] [0] DEBUG: smsc_fake: start called
2015-11-06 09:43:18 [4601] [4] DEBUG: Thread 4 (gw/bb_boxc.c:sms_to_smsboxes) maps to pid 4601.
2015-11-06 09:43:18 [4601] [3] DEBUG: Thread 3 (gw/bb_http.c:httpadmin_run) maps to pid 4601.
2015-11-06 09:43:18 [4601] [7] DEBUG: Thread 7 (gw/bb_smscconn.c:sms_router) maps to pid 4601.
2015-11-06 09:43:18 [4601] [6] DEBUG: Thread 6 (gw/smsc/smsc_fake.c:fake_listener) maps to pid 4601.
2015-11-06 09:43:18 [4601] [2] DEBUG: Thread 2 (gwlib/http.c:server_thread) maps to pid 4601.
2015-11-06 09:43:18 [4601] [1] DEBUG: Thread 1 (gwlib/fdset.c:poller) maps to pid 4601.
2015-11-06 09:43:20 [4601] [5] INFO: Client connected from <127.0.0.1>
2015-11-06 09:43:20 [4601] [5] DEBUG: Started thread 8 (gw/bb_boxc.c:function)
2015-11-06 09:43:20 [4601] [8] DEBUG: Thread 8 (gw/bb_boxc.c:function) maps to pid 4601.
2015-11-06 09:43:20 [4601] [8] DEBUG: Started thread 9 (gw/bb_boxc.c:boxc_sender)
2015-11-06 09:43:20 [4601] [9] DEBUG: Thread 9 (gw/bb_boxc.c:boxc_sender) maps to pid 4601.
2015-11-06 09:43:26 [4601] [2] DEBUG: HTTP: Creating HTTPClient for `127.0.0.1'.
2015-11-06 09:43:26 [4601] [2] DEBUG: HTTP: Created HTTPClient area 0x7f9f44000a90.
2015-11-06 09:43:26 [4601] [3] DEBUG: HTTP: Destroying HTTPClient area 0x7f9f44000a90.
2015-11-06 09:43:26 [4601] [3] DEBUG: HTTP: Destroying HTTPClient for `127.0.0.1'.
2015-11-06 09:50:51 [4601] [8] INFO: Connection closed by the box <127.0.0.1>
2015-11-06 09:50:51 [4601] [9] DEBUG: send_msg: sending msg to box: <127.0.0.1>
2015-11-06 09:50:51 [4601] [9] DEBUG: Thread 9 (gw/bb_boxc.c:boxc_sender) terminates.
2015-11-06 09:50:51 [4601] [8] DEBUG: Thread 8 (gw/bb_boxc.c:function) terminates.
2015-11-06 09:50:51 [4601] [0] WARNING: Killing signal or HTTP admin command received, shutting down...
2015-11-06 09:50:51 [4601] [0] DEBUG: Shutting down Kannel...
2015-11-06 09:50:51 [4601] [0] DEBUG: shutting down smsc
2015-11-06 09:50:51 [4601] [0] DEBUG: Shutting down SMSCConn FAKE, slow
2015-11-06 09:50:51 [4601] [0] DEBUG: shutting down udp
2015-11-06 09:50:51 [4601] [6] DEBUG: smsc_fake connection has completed shutdown.
2015-11-06 09:50:51 [4601] [6] DEBUG: Thread 6 (gw/smsc/smsc_fake.c:fake_listener) terminates.
2015-11-06 09:50:51 [4601] [4] DEBUG: Thread 4 (gw/bb_boxc.c:sms_to_smsboxes) terminates.
2015-11-06 09:50:51 [4601] [7] DEBUG: Thread 7 (gw/bb_smscconn.c:sms_router) terminates.
2015-11-06 09:50:51 [4601] [0] INFO: All flow threads have died, killing core
2015-11-06 09:50:51 [4601] [0] DEBUG: Waiting for 2 (gwlib/http.c:server_thread) to terminate
2015-11-06 09:50:51 [4601] [3] DEBUG: HTTP: No clients with requests, quitting.
2015-11-06 09:50:51 [4601] [3] DEBUG: Thread 3 (gw/bb_http.c:httpadmin_run) terminates.
2015-11-06 09:50:51 [4601] [5] DEBUG: Thread 5 (gw/bb_boxc.c:smsboxc_run) terminates.
2015-11-06 09:50:51 [4601] [2] DEBUG: Thread 2 (gwlib/http.c:server_thread) terminates.
2015-11-06 09:50:51 [4601] [1] DEBUG: Thread 1 (gwlib/fdset.c:poller) terminates.
2015-11-06 09:50:51 [4601] [0] DEBUG: final clean-up for SMSCConn
2015-11-06 09:50:51 [4601] [0] DEBUG: smsbox MO concatenated message handling cleaned up
2015-11-06 09:50:51 [4601] [0] INFO: Total WDP messages: received 0, sent 0
2015-11-06 09:50:51 [4601] [0] INFO: Total SMS messages: received 0, sent 0
2015-11-06 09:50:51 [4601] [0] DEBUG: Immutable octet strings: 219.

smsbox.log below

2015-11-06 09:41:02 [4497] [0] DEBUG: Started thread 4 (gw/smsbox.c:obey_request_thread)
2015-11-06 09:41:02 [4497] [0] DEBUG: Started thread 5 (gw/smsbox.c:url_result_thread)
2015-11-06 09:41:02 [4497] [0] DEBUG: Started thread 6 (gw/smsbox.c:http_queue_thread)
2015-11-06 09:41:02 [4497] [3] DEBUG: Thread 3 (gw/smsbox.c:sendsms_thread) maps to pid 4497.
2015-11-06 09:41:02 [4497] [0] ERROR: connect failed
2015-11-06 09:41:02 [4497] [0] ERROR: System error 111: Connection refused
2015-11-06 09:41:02 [4497] [0] ERROR: error connecting to server `localhost' at port `13001'
2015-11-06 09:41:02 [4497] [0] PANIC: Couldn't connect to the bearerbox.
2015-11-06 09:41:02 [4497] [2] DEBUG: Thread 2 (gwlib/http.c:server_thread) maps to pid 4497.
2015-11-06 09:41:02 [4497] [0] PANIC: /usr/sbin/smsbox(gw_panic+0x17b) [0x43e14b]
2015-11-06 09:41:02 [4497] [0] PANIC: /usr/sbin/smsbox(main+0xcbc) [0x40e0fc]
2015-11-06 09:41:02 [4497] [0] PANIC: /lib/x86_64-linux-gnu/libc.so.6(__libc_start_main+0xf5) [0x7f1772b77ec5]
2015-11-06 09:41:02 [4497] [0] PANIC: /usr/sbin/smsbox() [0x40ea35]
2015-11-06 09:41:02 [4505] [0] INFO: Added logfile `/var/log/kannel/smsbox.log' with level `0'.
2015-11-06 09:41:02 [4505] [0] INFO: Logging accesses to '/var/log/kannel/access.log'.
2015-11-06 09:41:02 [4505] [0] INFO: Started access logfile `/var/log/kannel/access.log'.
2015-11-06 09:41:02 [4505] [0] INFO: HTTP: Opening server at port 13131.
2015-11-06 09:41:02 [4505] [0] DEBUG: Started thread 1 (gwlib/fdset.c:poller)
2015-11-06 09:41:02 [4505] [0] DEBUG: Started thread 2 (gwlib/http.c:server_thread)
2015-11-06 09:41:02 [4505] [0] INFO: Set up send sms service at port 13131
2015-11-06 09:41:02 [4505] [0] DEBUG: Started thread 3 (gw/smsbox.c:sendsms_thread)
2015-11-06 09:41:02 [4505] [0] DEBUG: ----------------------------------------------
2015-11-06 09:41:02 [4505] [0] DEBUG: Kannel smsbox version 1.4.3 starting
2015-11-06 09:41:02 [4505] [0] DEBUG:   dumping group (sendsms-user):
2015-11-06 09:41:02 [4505] [0] DEBUG:     <group> = <sendsms-user>
2015-11-06 09:41:02 [4505] [0] DEBUG:     <default-smsc> = <none>
2015-11-06 09:41:02 [4505] [0] DEBUG:     <max-messages> = <6>
2015-11-06 09:41:02 [4505] [0] DEBUG:     <username> = <playsms>
2015-11-06 09:41:02 [4505] [0] DEBUG:     <concatenation> = <true>
2015-11-06 09:41:02 [4505] [0] DEBUG:     <password> = <password>
2015-11-06 09:41:02 [4505] [0] DEBUG: Started thread 4 (gw/smsbox.c:obey_request_thread)
2015-11-06 09:41:02 [4505] [0] DEBUG: Started thread 5 (gw/smsbox.c:url_result_thread)
2015-11-06 09:41:02 [4505] [0] DEBUG: Started thread 6 (gw/smsbox.c:http_queue_thread)
2015-11-06 09:41:02 [4505] [0] ERROR: connect failed
2015-11-06 09:41:02 [4505] [0] ERROR: System error 111: Connection refused
2015-11-06 09:41:02 [4505] [0] ERROR: error connecting to server `localhost' at port `13001'
2015-11-06 09:41:02 [4505] [0] PANIC: Couldn't connect to the bearerbox.
2015-11-06 09:41:02 [4505] [0] PANIC: /usr/sbin/smsbox(gw_panic+0x17b) [0x43e14b]
2015-11-06 09:41:02 [4505] [0] PANIC: /usr/sbin/smsbox(main+0xcbc) [0x40e0fc]
2015-11-06 09:41:02 [4505] [0] PANIC: /lib/x86_64-linux-gnu/libc.so.6(__libc_start_main+0xf5) [0x7f711e385ec5]
2015-11-06 09:41:02 [4505] [0] PANIC: /usr/sbin/smsbox() [0x40ea35]
2015-11-06 09:43:19 [4616] [0] INFO: Added logfile `/var/log/kannel/smsbox.log' with level `0'.
2015-11-06 09:43:20 [4616] [0] INFO: Logging accesses to '/var/log/kannel/access.log'.
2015-11-06 09:43:20 [4616] [0] INFO: Started access logfile `/var/log/kannel/access.log'.
2015-11-06 09:43:20 [4616] [0] INFO: HTTP: Opening server at port 13131.
2015-11-06 09:43:20 [4616] [0] DEBUG: Started thread 1 (gwlib/fdset.c:poller)
2015-11-06 09:43:20 [4616] [0] DEBUG: Started thread 2 (gwlib/http.c:server_thread)
2015-11-06 09:43:20 [4616] [0] INFO: Set up send sms service at port 13131
2015-11-06 09:43:20 [4616] [0] DEBUG: Started thread 3 (gw/smsbox.c:sendsms_thread)
2015-11-06 09:43:20 [4616] [0] DEBUG: ----------------------------------------------
2015-11-06 09:43:20 [4616] [0] DEBUG: Kannel smsbox version 1.4.3 starting
2015-11-06 09:43:20 [4616] [0] DEBUG:   dumping group (sendsms-user):
2015-11-06 09:43:20 [4616] [0] DEBUG:     <group> = <sendsms-user>
2015-11-06 09:43:20 [4616] [0] DEBUG:     <default-smsc> = <none>
2015-11-06 09:43:20 [4616] [0] DEBUG:     <max-messages> = <6>
2015-11-06 09:43:20 [4616] [0] DEBUG:     <username> = <playsms>
2015-11-06 09:43:20 [4616] [0] DEBUG:     <concatenation> = <true>
2015-11-06 09:43:20 [4616] [0] DEBUG:     <password> = <password>
2015-11-06 09:43:20 [4616] [0] DEBUG: Started thread 4 (gw/smsbox.c:obey_request_thread)
2015-11-06 09:43:20 [4616] [0] DEBUG: Started thread 5 (gw/smsbox.c:url_result_thread)
2015-11-06 09:43:20 [4616] [0] DEBUG: Started thread 6 (gw/smsbox.c:http_queue_thread)
2015-11-06 09:43:20 [4616] [0] INFO: Connected to bearerbox at localhost port 13001.
2015-11-06 09:43:20 [4616] [0] DEBUG: Started thread 7 (gw/heartbeat.c:heartbeat_thread)
2015-11-06 09:43:20 [4616] [3] DEBUG: Thread 3 (gw/smsbox.c:sendsms_thread) maps to pid 4616.
2015-11-06 09:43:20 [4616] [6] DEBUG: Thread 6 (gw/smsbox.c:http_queue_thread) maps to pid 4616.
2015-11-06 09:43:20 [4616] [5] DEBUG: Thread 5 (gw/smsbox.c:url_result_thread) maps to pid 4616.
2015-11-06 09:43:20 [4616] [7] DEBUG: Thread 7 (gw/heartbeat.c:heartbeat_thread) maps to pid 4616.
2015-11-06 09:43:20 [4616] [4] DEBUG: Thread 4 (gw/smsbox.c:obey_request_thread) maps to pid 4616.
2015-11-06 09:43:20 [4616] [2] DEBUG: Thread 2 (gwlib/http.c:server_thread) maps to pid 4616.
2015-11-06 09:43:20 [4616] [1] DEBUG: Thread 1 (gwlib/fdset.c:poller) maps to pid 4616.

Hi Anton,

Solved it, I forgot to add group = smsc in my kannel.conf file. Now I’m connected!

Quite embarrassing :smiley:

Thanks a lot for your help!

hides