New SqlBox release: 0.7.2
I’ve just updated SqlBox. Version 0.7.2 adds:
* rpm target (already on the latest snapshot). You can now run ./configure and then make rpm to build an RPM!
* Support for MS-SQL and Sybase over FreeTDS. You need a current Kannel snapshot to support this.
* Some code cleanups.
You can get it from here.
As usual, try it and let me know what you think.
Alex
Hi Alex,
Just tried to compile SqlBox on ALT Linux but have the following problem.
When I launch ./configure it’s finishing with “Kannel gwlib is required!” message.
At last I’ve decided to hack configure.in file and commented this line:
#AC_CHECK_LIB([gwlib], [cfg_create], [], AC_MSG_ERROR([Kannel gwlib is required!]))
After that ./configure proceed correctly and sqlbox compiled without any problems and seems is working. I’m not familiar with autotools but seems like such hack is not a good idea.
Can you suggest something or just relax and build with hack? 🙂
Misha,
Just use the –with-kannel-dir=/path/to/kannel switch when running ./configure and you should be all set.
Thank you, Alex.
Of course, I’ve read instructions and did this as required.
Even specially rebuild and installed Kannel with –prefix=/usr/local/kannel and then sqlbox with –with-kannel-dir=/usr/local/kannel – it didn’t help me. Exactly the same thing on CentOS 5 just works.
Well. Probably it’s ALT-specific autotools/libtool problem. Maybe toolchain maintainers will explain me some undocumented magic 🙂
Problem resolved – it’s “ld -Wl,–as-needed” influence that is default for ALT.
Fixed by changing LDFLAGS to LIBS in configure.in when determine gw-config parameters, now prepare patch for this.
How can i tell sqlbox , that i have to send SMS with TON=3 ?
SqlBox can’t handle the TON settings on a per-message basis, because Kannel itself can’t.
You need to configure your smsc connection with the TON settings using source-addr-ton and dest-addr-ton.
Check Kannel’s userguide for more details.
Hi Alex,
My SMPP requires 2 additional optional parameters to be sent along with the message. According to the Kannel user guide we have set the smpp-tlv groups and it works when using the Kannel HTTP send. The sms is delivered on the phone, However when we use Sqlbox the message doesnt get delivered and looking at the logs its clear that sqlbox is not passing required optional parameters. I have looked through the sqlbox user guide but cant seem to find a way for this. Can you please let me know a way to pass the optional parameters that kannel uses successfully?
Thanks
Karan
SqlBox does not support optional parameters yet. I’m working on a patch to fix that soon.
Regards,
Alex
Thanks Alex,
I tried patching it myself and added the additional required variables in the database and then modified the sqlbox_mysql.c and sqlbox_mysql.h file but I am getting the following error which I don’t know how to resolve (I am not an expert in C btw) may be you can help:
Error when I make Sqlbox Error: structure has no member named: ‘name of the variable’
If you can point me to the files which need patching in Sqlbox then I can go about doing them myself.
Any help would be appreciated.
Can sqlbox completely replace smsbox ?
In fact am using sqlbox and it can only deliver MTs when i insert in it’s table, but what about MOs ? they are still delivered through classic smsbox ? is there a way to tell Kannel to route MTs to sqlbox table ?
Yes it’s possible.
You’re probably setting an smsbox-id on sqlbox configuration. If you pretend to use only Sqlbox, you should remove the smsbox-id, or add an mo-route on kannel to route MO messages to sqlbox instead.
Check the Kannel documentation for more info on the mo-route parameter.
Using sqlbox with smppbox, gets me into a problem.
1. When smppbox connects to sqlbox, it is very similar to smsbox
2. When dlr is attempted to be returned back to smppbox, connection from smppbox is shown as dropped, and one more new smppbox connection is issued to bearerbox. So bearerbox now shows 3 boxes connected. 1 sqlbox, and 2 smppboxes. Where the second connection doesnt exist.
3. We have been using smppbox for a while with bearerbox and this doesnt happen.
I was writing an extension to sqlbox, to route traffic from smppbox via sqlbox to insert into sql tables, and stop and proceed data.
I have tested it with fresh sqlbox and issue persists.
Any help appreciated.
Regards,
Sreekanth
Sqlbox was designed to be used inbetween smsbox and bearerbox. I’ve never tried using it with smppbox, maybe there’s some functional differences causing that problem.
Have you tried using smsbox instead of smppbox and see if the reconnection problems still occur?
Regarding your approach, I’d rather write a plugin for smppbox instead.
Regards,
Alex
Hello Alex,
The problem was with smppbox 1.8.3 meta version, and the problem for the same persists if I connect it to Kannel 1.4.3. With the 1.7 smppbox, no issues were identified with sqlbox 0.7.2. Thanks for the help.
I am presently expanding sqlbox for the following requirements:
1. A config directive set_def_send to enable default send/hold setting
2. A config directive obey_priority to obey priority (int) set in MT Table
3. A config directive pick_max to pick max n messages from MT table at a stretch
4. A config directive sleep_time to sleep x duration after each MT select
Modifications to MT Table
Additions:
priority (int)
status (int) – sets whether to hold (0) or send (1)
Modifications to architecture
SMPPBOX -> Thread smsbox_bearerbox -> gw_savedb_message (modification to gw_save_message to save into MT not MO)
Thread smsbox_bearerbox -> generate ack and send to SMPPBOX making it believe sqlbox is bearerbox
Thread sql_to_bearerbox -> MT select -> bearerbox
bearerbox -> Thread bearerbox_to_sql -> gw_save_message (to MO) + send_msg (to smsbox/smppbox connection)
New Thread sql_to_smsbox -> send_msg(to smsbox/smppbox, to send DLR inserted into DLR_Pending Table) – SMSC at times does not give all DLRs, so we need to give customers UNDELIV or EXPIRED DLR to meet SLA
Thanks for all the help, and for the wonderful code of sqlbox.
Wishing for more of your help if needed in future..
Regards,
Sreekanth
Sreekanth,
The problem is probably because 1.4.3 doesn’t support meta-data. You should try using either a non-meta smppbox, or kannel’s latest CVS. Sqlbox doesn’t support meta-data either (yet).
Good luck with your mods and let me know if you get stuck somewhere and need any help.
Regards,
Alex
hello Mr alex
“sqlbox-0.7.2.tar.gz” do not contain “configure” file; instead it contains “configure.in” file.
when i use ./configure.in lot of errors occurs!!
plz help me 🙂
i am a new kannel user
thnx
Have a quick look to the README file, you’re missing the running the “bootstrap” script.
thank u Mr alex for replay
the output of sh ./bootstrap is :<>
but downloaded automake with the latest version!!
after that when i type sh ./configure.in the output is:<>
note that i am using kannel version 1.4.3 over ubuntu server 9.10, i configured it correctly and now i can send sms’s using smpp protocol with mysql DLR storage,so every thing is fine except sqlbox thing!!
plz help me with that.
Appreciate your reply.
best regards
plz ignore my previous comment.
thank u Mr alex for reply
the output of sh ./bootstrap is 🙁
+ set -e
amvers=no
+……
+….
….
./bootstrap: you need automake version 1.5 or later
)
but downloaded automake with the latest version!!
after that when i type sh ./configure.in the output is:(
./configure.in : 1: dnl: not found
./configure.in : 2: dnl: not found
./configure.in : 3: syntax error: newline unexpected
)
note that i am using kannel version 1.4.3 over ubuntu server 9.10, i configured it correctly and now i can send sms’s using smpp protocol with mysql DLR storage,so every thing is fine except sqlbox thing!!
plz help me with that.
Appreciate your reply.
best regards
You’re missing something on bootstrap, after running you should have a “configure” script. Do NOT try to run configure.in, won’t work.
thank u alex for helping me.
thats right i install automake v 1.7 and libtool
every thing work correct about ./bootstap & ./configure as u said.
but when i type “make” or “make rpm” the following errors occurs:
…………………………….
sqlbox.c:79:2 : error : #error You need support for at least one DB engine. Please recompile Kannel.
sqlbox.c:154:1: warning: “OCTSTR” redefined
sqlbox.c:130:1: warning: this is the location of the previous definition
……other warnings……
make[2]: *** [sqlbox.o] Error 1
make[1] : *** [all-recursive] Error 1
make: *** [all] Error 2
……………………..
i have already mysql server installed and using dlr-storage = mysql ,with no problems at all.
did i miss something about “make” or any thing else??
sorry for disturbing 🙂
OK, much better 🙂
Now, you need to compile kannel with support for mysql or any other DB engine. Sqlbox uses kannel’s libraries to connect to the DB, so if you don’t have support for it on kannel, sqlbox won’t compile.
hello alex
i did what told me
i am now compiling kannel “gateway-1.4.3”
every thing is OK with ./configure like bellow:
sh ./configure –prefix=/usr/kannelnew –with-mysql –with-mysql-dir=/usr/include/mysql
but “sudo make” gives an error at the end of compiling:
……………………………
/bin/bash: ./utils/foobar-config.sh : permission denied
make: *** [gw-config] Error 126
……………………………
i dont know why this error occurs, i install all kannel Requirements.
what i miss here??
plz help
thnx
Seems like a permission problem on the foobar-config.sh script.
Try running this:
sudo chmod 755 ./utils/foobar-config.sh
And try running make again.
hey alex
thank u very much for helping
now my kannel boxes works correctly with no errors at all.
but i am facing a little problems with sqlbox sent_sms table!
when i insert a record in send_sms like this:
INSERT INTO send_sms ( momt, sender, receiver, msgdata, sms_type,dlr_mask) VALUES
(’MT’, ’sando’, ’1234567890’, ’Hello world’, 2, 1);
my msg sent and the record moved to sent_sms table with no kannels internal id or smsc-provided message ID on any field!.
then when i receive deliver_sm pdu from my provider, a new DLR record is inserted in sent_sms, also with no id.
so i cant associate each DLR recond to its sent msg record!!
i am wondering if i uncomment /* msg->sms.id = atol_null(row[10]); */ in home/sqlbox-0.7.2/gw/sqlbox_mysql.c, the problem will be solved(if so do i have to recompile sqlbox again?)??
any help plz
thnx
That’s correct, Sqlbox doesn’t handle Kannel’s internal message id at all. The usual way to match an MT with it’s DLR is to add an arbitrary ID as part of your dlr-url, so you’ll be able to match it using that ID.
thanks alex that solved it perfectly.:D
Hi Alex,
I need a bit of your help regarding Calling of Dlr-url when using sqlbox. I am using sqlbox & it seems like the dlr-url is not called but i get a entry with momt as DLR in sent_sms table.
Below are my kannel.conf &sql.conf files:
group = core
admin-port = 13000
smsbox-port = 13001
admin-password = something
#admin-deny-ip = “*.*.*.*”
admin-allow-ip = “*.*.*.*”
log-file = “/var/log/kannel/bearerbox.log”
#box-deny-ip = “*.*.*.*”
box-allow-ip = “*.*.*.*”
dlr-storage = internal
group = smsc
smsc = smpp
smsc-id = someid
host = xx.xx.xx.xx
port = xxxx
smsc-username = sssssss
smsc-password = ssssss
system-type = “SMPP”
transceiver-mode = true
group = smsc
smsc = smpp
smsc-id = someid1
host = xx.xx.xx.xx
port = xxxx
smsc-username = sssssss
smsc-password = ssssss
system-type = “SMPP”
transceiver-mode = true
group = smsbox
smsbox-id = smsbox
bearerbox-host = 127.0.0.1
sendsms-port = 13013
log-file = “/var/log/kannel/smsbox.log”
group = sendsms-user
username = somepass
password = xxxx
—sql.conf
group = sqlbox
id = sqlbox-db
smsbox-id = smsbox
bearerbox-host = localhost
bearerbox-port = 13001
smsbox-port = 13005
smsbox-port-ssl = false
sql-log-table = sent_sms
sql-insert-table = send_sms
log-file = “/var/log/kannel/kannel-sqlbox.log”
log-level = 0
# Example MYSQL Connection
group = mysql-connection
id = sqlbox-db
host = localhost
username = xxxx
password = xxxx
database = kannel
Kindly tell me what mistake i am doing & why is Dlr-URL not invoked. what i want is DLR-URL to be invoked instead of getting a record of type DLR in sent_sms on receiving DLR.
Kindly help.
Hi Alex,
Is there source for SqlBox so that we could try to build the latest? I do not see SqlBox in Redmine or any source control.
Thanks,
Mark
It’s on Kannel’s CVS, plus there’s the latest snapshot on my home dir:
http://www.kannel.org/~aguerrieri/SqlBox/Snapshots/
Regards,
Alex
hey alex, how you doin.
i tried to send long sms (more than 160 char) by inserting a record in sqlbox DB send_sms table but i received it corrupted, not like sending using URL (http://1.1.1.1:13013/cgi-bin/sendsms?username=user&password=pass&from=sando&to=123456789123&text=test……&dlr-mask=31) which works correctly.
in my config file:
max-messages = 5
concatenation = true
any help plz
thanks in advance
BR
Hi,
Please help me to configure sqlbox, once i insert data in to send_sms table data moves to sent_sms then once i receive dlr report there will be new entry in sent_sms table, how can move DLR entry to one more table and how to identify DLR against sent_sms table entry.
To move the messages, you should do it by running the proper SQL against it. To match the MT with the DLR, you need to pass some sort of unique id parameter on your dlr-url, and use it to match the two entries.
Hello Alex,
I have install sqlbox and I am starting it as bearerbox smsbox sqlbox. When I insert data into send_sms table sms is successfully sent and is moved to sent_sms but when the DLR is received it is only updated in the sent_sms table with DLR as momt, whereas I want the dlr to trigger the url as it does without sqlbox.
Is that possible please help.
Hi,
Sqlbox is not sending concatenated message, it break it in part. I have done the following configuration under sendsms-user
max-messages = 8
concatenation = true
when i call the url it works fine but when through a sqlbox, message is inserted properly in one row but when sms is received on the handset it is broken into parts.
Please help me with this.
Having the issue:
[root@sls-eb5p20 trunk]# make install
Making install in gw
make[1]: Entering directory `/usr/src/trunk/gw’
if gcc -DHAVE_CONFIG_H -I. -I. -I.. -I../gw -I../gw -g -O2 -D_XOPEN_SOURCE=600 -D_BSD_SOURCE -I/usr/include/openssl -I/usr/local/include/kannel -g -O2 -D_XOPEN_SOURCE=600 -D_BSD_SOURCE -D_FILE_OFFSET_BITS=64 -D_LARGE_FILES= -I/usr/include/libxml2 -I/usr/include/openssl -MT sqlbox.o -MD -MP -MF “.deps/sqlbox.Tpo” -c -o sqlbox.o sqlbox.c; \
then mv -f “.deps/sqlbox.Tpo” “.deps/sqlbox.Po”; else rm -f “.deps/sqlbox.Tpo”; exit 1; fi
sqlbox.c:97:2: error: #error You need support for at least one DB engine. Please recompile Kannel.
sqlbox.c:154:1: warning: “OCTSTR” redefined
sqlbox.c:130:1: warning: this is the location of the previous definition
sqlbox.c:155:1: warning: “SINGLE_GROUP” redefined
sqlbox.c:133:1: warning: this is the location of the previous definition
sqlbox.c:158:1: warning: “MULTI_GROUP” redefined
sqlbox.c:140:1: warning: this is the location of the previous definition
make[1]: *** [sqlbox.o] Error 1
make[1]: Leaving directory `/usr/src/trunk/gw’
make: *** [install-recursive] Error 1
Need help!!!
Hi,
On running the below command
./configure –with-kannel-dir=/root/1.5/gateway/trunk/
I am receiving the error
checking Kannel version… svn-r4865
checking Kannel libs… -L/usr/local/lib/kannel -lgw -lwap -lgwlib -lmysqlclient_r -lssl -lrt -lresolv -lnsl -lm -lpthread -lxml2 -lz -lm -L/usr/lib64 -lcrypto -lssl -L/usr/lib64/mysql -lmysqlclient_r -lz -lpthread -lcrypt -lnsl -lm -lpthread -L/usr/lib64 -lssl -lcrypto
checking Kannel includes… -I/usr/local/include/kannel -g -O2 -D_XOPEN_SOURCE=600 -D_BSD_SOURCE -D_LARGE_FILES= -I/usr/include/libxml2 -I/usr/include/openssl -I/usr/include/mysql
checking for cfg_create in -lgwlib… no
configure: error: Kannel gwlib is required!
Please help how to resolve this issue.
Thanks,
Vic/martina
Hi Alex,
My Kannel setup is too simple i.e Bearerbox SqlBox . I have no use of smsbox as i am purely inserting MT messages in send_sms table.
Now i want to match the DLR with the SMS id and update the Status in the very same row.
Do i need dlr-url defined to match the DLR against the message ( i am not using send-sms users )
SqlBox is not finding your kannel installation. You need to point it to a compiled version of kannel, not just the source code.
“You need support for at least one DB engine”. Compile Kannel using the –with-[db engine] switch.
Hello i configured kannel and sqlbox, everything works ok, but i don’t understand what is sqlbox for? what is benefit of using it?
Hello Alex,
I am using sqlbox from quite long time now, suddenly I am in need of priority value for sqlbox. I do not see a field for priority. Using sqlbox how can I set priority for sms, so that it overrides all the sms that is in queue.
try and compile but getting stuck… ./configure all looks ok (kannel compile with-mysql)
Configuring Kannel and DB dependancies …
checking for Ct-Lib support… no
checking for FreeTDS Ct-Lib support… no
checking for gw-config… /usr/local/bin/gw-config
checking Kannel version… svn-r4888
checking Kannel libs… -L/usr/local/lib/kannel -lgw -lwap -lgwlib -lssl -lrt -lresolv -lnsl -lm -lpthread -L/usr/lib -lxml2 -lz -lm -L/usr/lib -lcrypto -lssl
checking Kannel includes… -I/usr/local/include/kannel -g -O2 -D_XOPEN_SOURCE=600 -D_BSD_SOURCE -D_FILE_OFFSET_BITS=64 -D_LARGE_FILES= -I/usr/include/libxml2 -I/usr/include/openssl
checking for cfg_create in -lgwlib… yes
checking for Kannel’s DB support… ok
Generating output files …
configure: creating ./config.status
config.status: creating Makefile
config.status: creating gw/Makefile
config.status: creating rpm/sqlbox.spec
config.status: creating sb-config.h
config.status: sb-config.h is unchanged
config.status: executing depfiles commands
during ./make i get:
if gcc -DHAVE_CONFIG_H -I. -I. -I.. -I../gw -I../gw -g -O2 -D_XOPEN_SOURCE=600 -D_BSD_SOURCE -I/usr/include/openssl -I/usr/local/include/kannel -g -O2 -D_XOPEN_SOURCE=600 -D_BSD_SOURCE -D_FILE_OFFSET_BITS=64 -D_LARGE_FILES= -I/usr/include/libxml2 -I/usr/include/openssl -MT sqlbox_mysql.o -MD -MP -MF “.deps/sqlbox_mysql.Tpo” -c -o sqlbox_mysql.o sqlbox_mysql.c; \
then mv -f “.deps/sqlbox_mysql.Tpo” “.deps/sqlbox_mysql.Po”; else rm -f “.deps/sqlbox_mysql.Tpo”; exit 1; fi
sqlbox_mysql.c: In function ‘mysql_fetch_msg’:
sqlbox_mysql.c:143: error: ‘struct sms’ has no member named ‘meta_data’
sqlbox_mysql.c: In function ‘mysql_save_msg’:
sqlbox_mysql.c:201: error: ‘struct sms’ has no member named ‘meta_data’
make[2]: *** [sqlbox_mysql.o] Error 1
make[2]: Leaving directory `/root/trunk/gw’
make[1]: *** [all-recursive] Error 1
make[1]: Leaving directory `/root/trunk’
make: *** [all] Error 2
hi!!!
pls go throgh the url .
http://linux-4um.blogspot.com/2010/06/how-to-install-kannel-sms-gateway-on.html
in that up to make install step done . but not getting so many parameters r there to configure in file smskannel.conf
how to configure pls help me out.
in that one first we need to install bearer box then wap box but both r giving some error from file smskannel.conf !!!!!
is it corrct way am moving if have done any wrong pls clarify…. and the command sudo apt-get is also not working??
error:apt-get: command not found.
[root@localhost gw]# ./bearerbox -v 1 smskannel.conf
2011-04-22 15:02:23 [27414] [0] INFO: Debug_lvl = 1, log_file = , log_lvl = 0
2011-04-22 15:02:23 [27414] [0] ERROR: Group ‘dlrdb’ is no valid group identifier.
2011-04-22 15:02:23 [27414] [0] ERROR: Error found on line 78 of file `smskannel.conf’.
2011-04-22 15:02:23 [27414] [0] PANIC: Couldn’t read configuration from `smskannel.conf’.
2011-04-22 15:02:23 [27414] [0] PANIC: ./bearerbox(gw_panic+0xc2) [0x80cc0a2]
2011-04-22 15:02:23 [27414] [0] PANIC: ./bearerbox(main+0xdfe) [0x8053d3e]
2011-04-22 15:02:23 [27414] [0] PANIC: /lib/i686/nosegneg/libc.so.6(__libc_start_main+0xdc) [0x661e9c]
2011-04-22 15:02:23 [27414] [0] PANIC: ./bearerbox [0x8052211]
[root@localhost gw]# ./wapbox -v 1 smskannel.conf
2011-04-22 15:03:26 [27444] [0] INFO: Debug_lvl = 1, log_file = , log_lvl = 0
2011-04-22 15:03:26 [27444] [0] ERROR: Group ‘dlrdb’ is no valid group identifier.
2011-04-22 15:03:26 [27444] [0] ERROR: Error found on line 78 of file `smskannel.conf’.
2011-04-22 15:03:26 [27444] [0] PANIC: Couldn’t read configuration from `smskannel.conf’.
2011-04-22 15:03:26 [27444] [0] PANIC: ./wapbox(gw_panic+0xc2) [0x80baba2]
2011-04-22 15:03:26 [27444] [0] PANIC: ./wapbox(main+0xc16) [0x8055f06]
2011-04-22 15:03:26 [27444] [0] PANIC: /lib/i686/nosegneg/libc.so.6(__libc_start_main+0xdc) [0x661e9c]
2011-04-22 15:03:26 [27444] [0] PANIC: ./wapbox [0x80544e1]
[root@localhost gw]#
waiting for the reply!!!!!!
Hey alex,
I have successfully configured freetds for DLR support for MS-SQL and Sybase
Using your tutorial
http://www.blogalex.com/archives/99s:
http://www.blogalex.com/archives/107
now the problem is when I am trying to configure kannel with –msql support
I am getting the following warning:
checking whether to compile with MySQL support… yes
checking whether to compile with LibSDB support… disabled
checking whether to compile with SQLite2 support… disabled
checking whether to compile with SQLite3 support… disabled
checking whether to compile with Oracle support… disabled
checking whether to compile with PostgresSQL support… disabled
Generating output files …
configure: creating ./config.status
config.status: creating gwlib/gw_uuid_types.h
config.status: creating Makefile
config.status: creating gw-config.h
configure: WARNING: Unrecognized options: –with-mssql
please help me out! i am stuck
sorry its :
Configuring DB support …
checking whether to compile with MySQL support… disabled
checking whether to compile with LibSDB support… disabled
checking whether to compile with SQLite2 support… disabled
checking whether to compile with SQLite3 support… disabled
checking whether to compile with Oracle support… disabled
checking whether to compile with PostgresSQL support… disabled
Generating output files …
configure: creating ./config.status
config.status: creating gwlib/gw_uuid_types.h
config.status: creating Makefile
config.status: creating gw-config.h
configure: WARNING: Unrecognized options: –with-mssql
Are you using the latest stable release? –with-mssql=DIR should work (DIR points to the installation path of FreeTDS)