我有一个Kannel正在Ubuntu 16.04上运行,带有本地MySQL DLR存储。我想添加sqlbox以将传入的短消息排队到同一数据库中。
当我尝试启动sqlbox sqlbox.conf时,这里是我得到的。

  2017-08-03 14:02:21 [55982] [0] INFO: Starting to log to file /var/log/kannel/kannel-sqlbox.log level 0
  2017-08-03 14:02:21 [55982] [0] INFO: Added logfile `/var/log/kannel/kannel-sqlbox.log' with level `0'.
  2017-08-03 14:02:21 [55982] [0] PANIC: SQLBOX: MSSql: connection settings for id 'sqlbox-db' are not specified!
  2017-08-03 14:02:21 [55982] [0] PANIC: sqlbox(gw_backtrace+0xce) [0x42d07e]
  2017-08-03 14:02:21 [55982] [0] PANIC: sqlbox(gw_panic+0x16f) [0x42d1ff]
  2017-08-03 14:02:21 [55982] [0] PANIC: sqlbox(sqlbox_init_mssql+0x11e) [0x40dffe]
  2017-08-03 14:02:21 [55982] [0] PANIC: sqlbox(sqlbox_init_sql+0x9) [0x413239]
  2017-08-03 14:02:21 [55982] [0] PANIC: sqlbox(main+0x31d) [0x40c24d]
  2017-08-03 14:02:21 [55982] [0] PANIC: /lib/x86_64-linux-gnu/libc.so.6(__libc_start_main+0xf0) [0x7fbb36421830]
  2017-08-03 14:02:21 [55982] [0] PANIC: sqlbox(_start+0x29) [0x40c4d9]

下面是两个配置文件:
group = sqlbox
id = sqlbox-db
smsbox-id = sqlbox-db
global-sender = "My Sender"
bearerbox-host = "192.168.1.2"
bearerbox-port = 14001
smsbox-port = 14005
#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

group = mysql-connection
id = sqlbox-db
host = localhost
username = "user"
password = "pwd"
database = "kannel"

以及sqlbox.conf
group = core
admin-port = 14000
admin-password = pwd
status-password = pwd
# admin-deny-ip = "*.*.*.*"
admin-allow-ip = 192.168.1.2
access-log = "/var/log/kannel/access/log"
log-file = "/var/log/kannel/kannel.log"
box-allow-ip = 192.168.1.2
log-level = 0
smsbox-port= 14001
dlr-storage = mysql

# SMSBOX SETUP

group = smsbox
smsbox-id = sqlbox-id
bearerbox-host = 192.168.1.2
sendsms-port = 14002
global-sender = My Sender
sendsms-chars = "0123456789 +-"
log-file = "/var/log/kannel/smsbox.log"

# SENDING SMS

group = sendsms-user
username = test
password = test
concatenation = true
max-messages = 1

# SMSC
#The sms part

# SQL BOX CONFIG

group = mysql-connection
id = sqlbox-db
host = localhost
username = user
password = pwd
database = kannel

# DLR SETUP

group = mysql-connection
id = mydlr
host = localhost
username = user
password = pwd
database = kannel
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

诀窍是什么?谢谢你
使用:
kannel.confkannel 1.4.4-2build1都通过kannel-sqlbox 0.7.2-4build1安装。

最佳答案

问题
日志中描述的主要问题是:
2017-08-03 14:02:21 [55982] [0] PANIC: SQLBOX: MSSql: connection settings for id 'sqlbox-db' are not specified!
事实上,在你使用的版本中有一个问题(apt-get包是旧版本,你不能在那里使用),我在年初也遇到了同样的问题。
这就是我是怎么做到的。
解决方案
步骤1-卸载所有以前的Kannel包,清除所有内容
如果您已经安装了带有apt-get包的Kannel,那么您必须首先清理您的机器。
这里有一些线索可以找到你必须删除的项目。
我首先检查了发现“凯恩尔”的每个地方:

sudo find / -name "*kannel*"
sudo find / -name "*Kannel*"

然后我运行了以下命令(其中一些命令可能对您没有帮助,具体取决于您的设置等):
sudo apt-get autoremove --purge kannel
sudo rm -rf /etc/kannel/
sudo apt-get autoremove --purge kannel-sqlbox
sudo rm /var/cache/apt/archives/kannel-sqlbox_0.7.2-4build1_amd64.deb
sudo rm /var/cache/apt/archives/kannel-extras_1.4.4-2build1_amd64.deb
rm /home/nico/www-dev/kannelStore/kannel.store*
sudo rm -rf /usr/local/include/kannel
sudo rm -rf /usr/local/kannel
sudo rm -rf /usr/local/lib/kannel
rm /var/tmp/kannel.swp
sudo rm /usr/local/share/man/man8/kannel.8
sudo rm /usr/local/share/man/man8/run_kannel_box.8

还有sudo rm -rf /usr/local/sbin/(但这里要小心,这取决于文件夹中已有的内容!)
步骤2-从源安装最新的Kannel版本
注意:您必须使用1.5.0版
获取依赖项
首先添加未来命令所需的所有包:
sudo apt-get install libxml2-dev(步骤./configure需要,否则您将得到“configure:error:you MUST have the libxml2(aka gnome xml)library installed”)
sudo apt-get install libmysqlclient-dev(需要./configure --with-mysql
sudo apt-get install bison(需要make
sudo apt-get install libssh-dev libssl-dev(为避免出错):“Calcult2:Err:LD返回1退出状态:***[Test/TestHyp]错误1)
获取Kannel源
您必须从svn存储库获取源代码。所以:
make如果您还没有subversion(可以通过运行sudo apt install subversion进行检查:如果没有应答,请使用命令)
然后:
转到将在本地承载源的文件夹。例如在m侧:svn --version
从存储库获取Kannel源:cd ~/www-dev/nicopushkannel/Kannel/Kannel-Source
构建并安装Kannel
从上一步你应该在凯恩尔源根傻瓜。
如Kannel文档中所述,运行:
cd trunk
./bootstrap
./configure --with-mysql --with-mysql-dir=/var/lib/mysql
make

这里重要的是添加到./configure的参数:svn co https://svn.kannel.org/gateway/trunk
然后安装:
sudo make bindir=/usr/local/kannel install

运行Kannel
完成此操作后,可以尝试从命令行运行Kannel:
cd /usr/local/sbin
./bearerbox -v 0 /etc/kannel/kannel.conf

步骤3-从源安装最新的Kannel sqlbox版本
注意:您需要安装Kannel(步骤2)来编译sqlbox。
sqlbox包含在Kannel trunk中:导航到文件夹:
cd addons/sqlbox

补丁引导文件
您可能需要修补引导文件以匹配autoconf版本(对我来说是1.15),因为代码不理解1.15大于1.11。。。
更改以下值以匹配计算机版本的autoconf:
if automake-1.11 --version >/dev/null 2>&1; then
  amvers="-1.11"

所以对我来说:
if automake-1.15 --version >/dev/null 2>&1; then
  amvers="-1.15"

生成并安装sqlbox
./bootstrap
./configure
make
sudo make install

我们完了!
还有一件事:如果要在Kannel启动时添加Sqlbox startup:
sudo gedit /etc/default/kannel
Add "START_SQLBOX=1" line at the end

09-13 05:35