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

Comments (30)

MichaelJuly 5th, 2009 at 11:00 am

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? :-)

alexJuly 5th, 2009 at 7:48 pm

Misha,

Just use the –with-kannel-dir=/path/to/kannel switch when running ./configure and you should be all set.

MichaelJuly 6th, 2009 at 2:48 am

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 :-)

MichaelJuly 6th, 2009 at 4:57 am

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.

alexSeptember 30th, 2009 at 11:43 am

How can i tell sqlbox , that i have to send SMS with TON=3 ?

alexSeptember 30th, 2009 at 12:00 pm

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.

KaranOctober 20th, 2009 at 10:31 am

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

alexOctober 20th, 2009 at 11:33 am

SqlBox does not support optional parameters yet. I’m working on a patch to fix that soon.

Regards,

Alex

KaranOctober 21st, 2009 at 4:20 am

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.

daruNovember 21st, 2009 at 10:39 am

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 ?

alexNovember 21st, 2009 at 1:33 pm

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.

SreekanthNovember 28th, 2009 at 3:02 am

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

alexNovember 28th, 2009 at 7:54 am

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

SreekanthNovember 29th, 2009 at 8:00 am

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

alexNovember 29th, 2009 at 8:40 am

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

sandoJanuary 4th, 2010 at 9:38 am

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

alexJanuary 4th, 2010 at 9:55 am

Have a quick look to the README file, you’re missing the running the “bootstrap” script.

sandoJanuary 5th, 2010 at 5:52 am

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

sandoJanuary 5th, 2010 at 5:55 am

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

alexJanuary 5th, 2010 at 5:55 am

You’re missing something on bootstrap, after running you should have a “configure” script. Do NOT try to run configure.in, won’t work.

sandoJanuary 5th, 2010 at 9:08 am

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 :)

alexJanuary 5th, 2010 at 9:34 am

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.

sandoJanuary 9th, 2010 at 10:15 am

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

alexJanuary 9th, 2010 at 5:13 pm

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.

sandoJanuary 13th, 2010 at 9:07 am

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

alexJanuary 13th, 2010 at 9:11 am

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.

sandoJanuary 13th, 2010 at 12:01 pm

thanks alex that solved it perfectly.:D

preeteeshJanuary 14th, 2010 at 7:25 pm

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.

Mark W.February 19th, 2010 at 9:23 pm

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

alexFebruary 21st, 2010 at 6:37 pm

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

Leave a comment

Your comment