Need Help Adding foreign_id in Current SVN SQLBox

Willy Mularto <[email protected]>
Newsgroups gmane.comp.mobile.kannel.devel
Message-ID <[email protected]>
Hi List,
It's me again. I'm adding foreign_id field in the current sqlbox. And these are what I have done.

sqlbox_mysql.c
Msg *mysql_fetch_msg()
{
…
msg->sms.foreign_id  = octstr_null_create(row[27]);
…
}

void mysql_save_msg(Msg *msg, Octstr *momt /*, Octstr smsbox_id */)
{
…
sql = octstr_format(SQLBOX_MYSQL_INSERT_QUERY….st_str(msg->sms.foreign_id));
…
}


sqlbox_mysql.h
#define SQLBOX_MYSQL_CREATE_LOG_TABLE "CREATE TABLE IF NOT EXISTS %S ( \
sql_id BIGINT(20) NOT NULL AUTO_INCREMENT PRIMARY KEY, \
...foreign_id VARCHAR(255) NULL)"

#define SQLBOX_MYSQL_CREATE_INSERT_TABLE "CREATE TABLE IF NOT EXISTS %S ( \
....foreign_id VARCHAR(255) NULL)"

#define SQLBOX_MYSQL_SELECT_QUERY "SELECT sql_id, momt, sender, receiver, udhdata, \
...foreign_id FROM %S LIMIT 0,1"

#define SQLBOX_MYSQL_INSERT_QUERY "INSERT INTO %S ( sql_id, momt, sender, \
...%S)"

The compilation smooth and the daemon launched well. But when I tried to  inject row then SQLBox dies on panic
2012-09-06 18:27:29 [27785] [4] PANIC: Internal error: unknown message type: 10507536
2012-09-06 18:27:29 [27785] [4] PANIC: /home/sprabv/kanopi/test/sbin/sqlbox(gw_backtrace+0xae) [0x42656e]
2012-09-06 18:27:29 [27785] [4] PANIC: /home/sprabv/kanopi/test/sbin/sqlbox(gw_panic+0x155) [0x4266d5]
2012-09-06 18:27:29 [27785] [4] PANIC: /home/sprabv/kanopi/test/sbin/sqlbox(msg_pack+0x4c) [0x40d28c]
2012-09-06 18:27:29 [27785] [4] PANIC: /home/sprabv/kanopi/test/sbin/sqlbox() [0x40a666]
2012-09-06 18:27:29 [27785] [4] PANIC: /home/sprabv/kanopi/test/sbin/sqlbox() [0x40a789]
2012-09-06 18:27:29 [27785] [4] PANIC: /home/sprabv/kanopi/test/sbin/sqlbox() [0x41dfae]
2012-09-06 18:27:29 [27785] [4] PANIC: /lib/libpthread.so.0(+0x69ca) [0x7f77896469ca]
2012-09-06 18:27:29 [27785] [4] PANIC: /lib/libc.so.6(clone+0x6d) [0x7f778918ccdd]

It is said "unknown message type" AFAIK foreign_id is already in msg-decl.h

Would you give some clue? Many thanks for your assistance.


Willy Mularto
F300HD+MR18DE (NLC1725)
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.