Kannel Sqlbox无法正常工作(尝试连接到SQL Server而不是MySQL)? [英] Kannel Sqlbox not working (trying to connect to SQL Server instead of MySQL)?

查看:137
本文介绍了Kannel Sqlbox无法正常工作(尝试连接到SQL Server而不是MySQL)?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我启动了Kannel并在具有本地MySQL DLR存储的Ubuntu 16.04机器上运行.我想添加sqlbox以便将传入的SMS排队在同一数据库中.

I have a Kannel up and running on an Ubuntu 16.04 box, with local MySQL DLR storage. I want to add sqlbox to queue the incoming SMS in the same database.

当我尝试启动sqlbox sqlbox.conf时,这就是我得到的.

When I try to launch the sqlbox sqlbox.conf, here is what I get.

  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]

这是两个配置文件sqlbox.conf:

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"

kannel.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 1.4.4-2build1kannel-sqlbox 0.7.2-4build1都通过apt安装.

Using: kannel 1.4.4-2build1 and kannel-sqlbox 0.7.2-4build1 both installed via apt.

推荐答案

问题

日志中描述的主要问题在那里:

Problem

The main problem as depicted in the log is there:

2017-08-03 14:02:21 [55982] [0] PANIC: SQLBOX: MSSql: connection settings for id 'sqlbox-db' are not specified!

实际上,您所使用的版本存在问题( apt-get软件包是您无法在其中使用的旧版本),我在一开始就遇到了相同的问题年.

In fact, there is a problem in the version that you are using (apt-get packages are old versions that you can't use there), I got the same problem at the beginning of the year.

这就是我的工作方式.

如果您已经使用apt-get软件包安装了Kannel,则必须先清洁计算机.

If you already installed Kannel with apt-get packages, you have to clean your machine first.

这里有一些线索可以找到您必须删除的项目. 我首先检查了发现狗窝"的每个地方:

Here are some clues to find the items that you have to remove. I first checked every place where "kannel" was found:

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

然后我运行了以下命令(其中一些命令可能对您没有用,具体取决于您的设置等)

Then I ran the following commands (some of them may not be useful for you, depending on your settings, etc):

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/(但要小心,具体取决于文件夹中已有的内容!)

And also sudo rm -rf /usr/local/sbin/ (but be careful here, depending on what you already have in the folder!)

注意:您将必须使用1.5.0版

Note: you will have to use version 1.5.0

首先添加将来的命令所需的所有软件包:

First add all the packages that you need for the future commands:

  • sudo apt-get install libxml2-dev(步骤./configure所需),否则您将获得配置:错误:必须安装libxml2(aka gnome-xml)库")

  • sudo apt-get install libxml2-dev (needed for step ./configure, or you will get "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(为避免出现此错误,需要make:"collect2:错误:ld返回1个退出状态,make:*** [test/test_http]错误1")

sudo apt-get install libssh-dev libssl-dev (needed for make to avoid getting this error: "collect2: error: ld returned 1 exit status make: *** [test/test_http] Error 1 ")

您将必须从svn存储库获取源.所以:

You will have to get the sources from a svn repository. So:

  • sudo apt install subversion如果您还没有Subversion(可以通过运行svn --version进行检查:如果没有答复,请使用命令)
  • sudo apt install subversion if you don't have subversion yet (you can check by running svn --version: if no reply, use the command)

然后:

  • 转到将在本地托管源的文件夹.例如在m端:cd ~/www-dev/nicopushkannel/Kannel/Kannel-Source

从存储库中获取Kannel源:svn co https://svn.kannel.org/gateway/trunk

Get Kannel sources from the repository: svn co https://svn.kannel.org/gateway/trunk

在上一步中,您应该位于Kannel源root foolder上. 如Kannel文档中所述,运行:

From the previous step you should be on Kannel sources root foolder. As described in Kannel documentation, run:

cd trunk
./bootstrap
./configure --with-mysql --with-mysql-dir=/var/lib/mysql
make

重要的是添加到./configure的参数:--with-mysql --with-mysql-dir=/var/lib/mysql

Here the important things are the parameters added to ./configure: --with-mysql --with-mysql-dir=/var/lib/mysql

然后安装:

sudo make bindir=/usr/local/kannel install

运行Kannel

完成此操作后,您可以尝试从命令行运行Kannel:

Run Kannel

Once this has been done, you can try to run Kannel from command line:

cd /usr/local/sbin
./bearerbox -v 0 /etc/kannel/kannel.conf


步骤3-从源代码安装最新的Kannel-sqlbox版本

注意:您需要安装Kannel(第2步)才能编译sqlbox.


Step 3 - Install latest Kannel-sqlbox version from the source

Note: You need to have Kannel installed (step 2) to compile sqlbox.

sqlbox包含在Kannel中继中:导航到文件夹:

sqlbox is included in Kannel trunk: navigate to the folder:

cd addons/sqlbox

修补程序引导文件

您可能需要修补引导文件以匹配您的autoconf版本(对我来说是1.15),因为代码不知道1.15大于1.11 ...

Patch bootstrap file

You may have to patch the bootstrap file to match your autoconf version (was 1.15 for me), as the code don't understand that 1.15 is > than 1.11...

更改以下值以匹配您的计算机版本的autoconf:

Change the following value to match your machine version of 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启动:

One more thing: if you want to add Sqlbox startup at Kannel startup:

sudo gedit /etc/default/kannel
Add "START_SQLBOX=1" line at the end

这篇关于Kannel Sqlbox无法正常工作(尝试连接到SQL Server而不是MySQL)?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆