sqlbox with pgsql

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

sqlbox with pgsql

Phillip Grobler
Hi,

I'm trying to get sqlbox with pgsql working. I initialy downloaded the 1.4.0 but the make patch then gives errors.
 
I then downloaded the last daily-snapshot.

I tried the following
1) in sqlbox  I did  "make patch" which worked fine.
2) in gateway I did configure --with-pgsql
3) Start bearerbox  - fine
4) Start smsbox -  fine - logging of DLR to the DB is also working fine.
5) Starting sqlbox gicves
PANIC: Trying to fetch variable `pgsql-username' in group `pgsql-c onnection', not allowed.

6) I then updated sqlbox_pgsql.c changing
    if (!(pgsql_user = cfg_get(grp, octstr_imm("pgsql- username"))))
            panic(0, "SQLBOX: PGSQL: directive 'pgsql-username' is not specified!");
    if (!(pgsql_pass = cfg_get(grp, octstr_imm("
pgsql-password"))))
            panic(0, "SQLBOX: PGSQL: directive '
pgsql-password' is not specified!");
To
    if (!(pgsql_user = cfg_get(grp, octstr_imm("username"))))
            panic(0, "SQLBOX: PGSQL: directive 'username' is not specified!");
    if (!(pgsql_pass = cfg_get(grp, octstr_imm("password"))))
            panic(0, "SQLBOX: PGSQL: directive 'password' is not specified!");


7) I now get  "Unknown dbpool type defined."






--
Phillip Grobler
Reply | Threaded
Open this post in threaded view
|

Re: sqlbox with pgsql

Phillip Grobler
I just realised http://www.mail-archive.com/users@.../msg03575.html refers to the same set of errors as I had struggled with. I saw the post earlier but as it was from 2004 I asumed that it would not be relevant anymore.

Could the the changes perhaps be added to CVS ?

What I needed to do in the end was to get sqlbox working on postgre 7 was
1) In sqlbox_pgsql.c   changing
    if (!(pgsql_user = cfg_get(grp, octstr_imm("pgsql- username"))))
            panic(0, "SQLBOX: PGSQL: directive 'pgsql-username' is not specified!");
    if (!(pgsql_pass = cfg_get(grp, octstr_imm("
pgsql-password"))))
            panic(0, "SQLBOX: PGSQL: directive '
pgsql-password' is not specified!");
To
    if (!(pgsql_user = cfg_get(grp, octstr_imm("username"))))
            panic(0, "SQLBOX: PGSQL: directive 'username' is not specified!");
    if (!(pgsql_pass = cfg_get(grp, octstr_imm("password"))))
            panic(0, "SQLBOX: PGSQL: directive 'password' is not specified!"


2) I then followed Klaus Darilion instructions


3) I also needed to change the select from 
 sql = octstr_format("SELECT sql_id, momt, sender, receiver, udhdata, msgdata, time, smsc_id, service, account, id, sms_type, mclass,
mwi, coding, compress, validity, deferred, dlr_mask, dlr_url, pid, alt_dcs, rpi, charset, boxc_id, binfo FROM %S  LIMIT 1, 0", sqlbox_insert_table);

TO
  sql = octstr_format("SELECT sql_id, momt, sender, receiver, udhdata, msgdata, time, smsc_id, service, account, id, sms_type, mclass,
mwi, coding, compress, validity, deferred, dlr_mask, dlr_url, pid, alt_dcs, rpi, charset, boxc_id, binfo FROM %S  LIMIT 1 OFFSET 0", sqlbox_i nsert_table);


My config file is


group = core
admin-port = 15000
smsbox-port = 15001
admin-password = bar
#status-password = foo
#admin-deny-ip = ""
#admin-allow-ip = ""
log-file = "/tmp/bearerbox2.log"
log-level = 0
box-deny-ip = "*.*.*.*"
box-allow-ip = "172.17.2.42"
#unified-prefix = "+358,00358,0;+,00"
access-log = "/tmp/access2.log"
store-file = "/tmp/kannel2.store"
#ssl-server-cert-file = "cert.pem"
#ssl-server-key-file = "key.pem"
#ssl-certkey-file = "mycertandprivkeyfile.pem"
dlr-storage = pgsql


group = pgsql-connection
id = mydlr
host = localhost
username = pgrobler
password = pgrobler
database = kannel
max-connections = 1


group = dlr-db

id = mydlr
table = dlr
field-smsc = smsc
field-timestamp = ts
field-destination = destination
field-source = source
field-service = service
field-url = url
field-mask = mask
field-status = status
field-boxc-id = boxc


group = pgsql-connection
id = sqlbox_db
host = localhost
port = 5432
username = pgrobler
password = pgrobler
database = kannel
max-connections = 1


group = sqlbox
# id corresponds to id in group = mysql-connection.
# this is analogous to id in group = dlr-db
id = sqlbox_db
smsbox-id = sqlbox2
bearerbox-host = "127.0.0.1"
smsbox-port = 15001
smsbox-port-ssl = false
sql-log-table = sent_sms
sql-insert-table = send_sms
global-sender = 06121
log-file = "/tmp/sqlbox.log"
log-level = 0


Reply | Threaded
Open this post in threaded view
|

Re: sqlbox with pgsql

Rene Kluwen
Thanks!

In fact, I did update the MySQL config directives but not the Postgres
thingies.
Thanks for pointing this out.

Rene Kluwen
Chimit

> I just realised
> http://www.mail-archive.com/users@.../msg03575.html refers
> to the same set of errors as I had struggled with. I saw the post earlier
> but as it was from 2004 I asumed that it would not be relevant anymore.
>
> Could the the changes perhaps be added to CVS ?
>
> What I needed to do in the end was to get sqlbox working on postgre 7 was
> 1) In sqlbox_pgsql.c   changing
>     if (!(pgsql_user = cfg_get(grp, octstr_imm("pgsql- username"))))
>             panic(0, "SQLBOX: PGSQL: directive 'pgsql-username' is not
> specified!");
>     if (!(pgsql_pass = cfg_get(grp, octstr_imm(" pgsql-password"))))
>             panic(0, "SQLBOX: PGSQL: directive ' pgsql-password' is not
> specified!");
> To
>     if (!(pgsql_user = cfg_get(grp, octstr_imm("username"))))
>             panic(0, "SQLBOX: PGSQL: directive 'username' is not
> specified!");
>     if (!(pgsql_pass = cfg_get(grp, octstr_imm("password"))))
>             panic(0, "SQLBOX: PGSQL: directive 'password' is not
> specified!"
>
> 2) I then followed Klaus Darilion instructions
>
>
> 3) I also needed to change the select from
>  sql = octstr_format("SELECT sql_id, momt, sender, receiver, udhdata,
> msgdata, time, smsc_id, service, account, id, sms_type, mclass,
> mwi, coding, compress, validity, deferred, dlr_mask, dlr_url, pid,
> alt_dcs,
> rpi, charset, boxc_id, binfo FROM %S  LIMIT 1, 0", sqlbox_insert_table);
> TO
>   sql = octstr_format("SELECT sql_id, momt, sender, receiver, udhdata,
> msgdata, time, smsc_id, service, account, id, sms_type, mclass,
> mwi, coding, compress, validity, deferred, dlr_mask, dlr_url, pid,
> alt_dcs,
> rpi, charset, boxc_id, binfo FROM %S  LIMIT 1 OFFSET 0", sqlbox_i
> nsert_table);
>
>
> My config file is
>
>
> group = core
> admin-port = 15000
> smsbox-port = 15001
> admin-password = bar
> #status-password = foo
> #admin-deny-ip = ""
> #admin-allow-ip = ""
> log-file = "/tmp/bearerbox2.log"
> log-level = 0
> box-deny-ip = "*.*.*.*"
> box-allow-ip = "172.17.2.42"
> #unified-prefix = "+358,00358,0;+,00"
> access-log = "/tmp/access2.log"
> store-file = "/tmp/kannel2.store"
> #ssl-server-cert-file = "cert.pem"
> #ssl-server-key-file = "key.pem"
> #ssl-certkey-file = "mycertandprivkeyfile.pem"
> dlr-storage = pgsql
>
>
> group = pgsql-connection
> id = mydlr
> host = localhost
> username = pgrobler
> password = pgrobler
> database = kannel
> max-connections = 1
>
>
> group = dlr-db
> id = mydlr
> table = dlr
> field-smsc = smsc
> field-timestamp = ts
> field-destination = destination
> field-source = source
> field-service = service
> field-url = url
> field-mask = mask
> field-status = status
> field-boxc-id = boxc
>
>
> group = pgsql-connection
> id = sqlbox_db
> host = localhost
> port = 5432
> username = pgrobler
> password = pgrobler
> database = kannel
> max-connections = 1
>
>
> group = sqlbox
> # id corresponds to id in group = mysql-connection.
> # this is analogous to id in group = dlr-db
> id = sqlbox_db
> smsbox-id = sqlbox2
> bearerbox-host = "127.0.0.1"
> smsbox-port = 15001
> smsbox-port-ssl = false
> sql-log-table = sent_sms
> sql-insert-table = send_sms
> global-sender = 06121
> log-file = "/tmp/sqlbox.log"
> log-level = 0
>