Re: sqlbox with pgsql

"Rene Kluwen" <[email protected]>
Newsgroups gmane.comp.mobile.kannel.devel
Message-ID <[email protected]>
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/[email protected]/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
>
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.