Kamailio(OpenSER)开源SIP服务器-呼叫重定向(负载均衡)

发布于 2022-08-07 19:19:36 字数 10742 浏览 12 评论 8

Kamailio是一个开源的SIP服务器,原名OpenSER

Kamailio is an Open Source, GPL2, SIP Server Routing Platform. It is written in C for Linux/Unix plaforms and focuses on performance, flexibility and security.

On Nov 04, 2008, Kamailio and SIP Express Router have started the SIP Router Project.

Web links

Features

  • SIP proxy/registrar/redirect server (RFC3261, RFC3263)
  • UDP/TCP/TLS/SCTP support
  • Transactional stateful proxy
  • Modular architecture
  • Programmable configuration file
  • ENUM support
  • Call Processing Language (CPL)
  • Gateway to sms or xmpp
  • Authentication, authorization and accounting via Radius or database
  • NAT traversal system
  • Least cost routing
  • Load balancing
  • Carrier routing
  • Multiple database backends: MySQL, Postgres, Oracle, BDB or flat files
  • SIMPLE Presence Server (IETF SIMPLE extensions - rich presence)
  • Dialog Info Presence - SLA/BLA
  • XCAP and RLS
  • Presence User Agent
  • Dialog Stateful Proxy
  • Instant Messaging
    • Offline message storage
    • Instant messaging conferencing
  • SNMP support
  • Perl Programming Interface
  • Java SIP Servlet Application server
  • Over 80 modules (extensions)

Documentation

我们使用Kamailio主要用在SIP dispatcher server,即SIP redirect server
安装及配置手册如下:

一.安装
1.依赖包:
libmysqlclient & libz (zlib) :mysql DB support (the db_mysql module) Shared libraries
                        MySQL-shared-5.1.32-0.glibc23.i386.rpm
                        MySQL-devel-community-5.1.32-0.rhel5.i386.rpm
libxml2:cpl-c (Call Processing Language) or the presence modules (presence and pua*)
libperl:perl scripting from you config file (perl module)
2.源代码安装
make,make modules,make install
或者make all,make install
参考:
3.启动:kamctl start
4.重启:kamctl restart
5.监控服务状态:kamctl moni
6.MySQL配置:
1)安装:
edit Makefile.var files to include the MySQL module
vim Makefile.vars
Uncomment the next line in the file:
MODS_MYSQL=on
cp /usr/local/lib/mysql/libmysqlclient.so.16 /usr/lib

Edit now /usr/local/etc/kamailio/kamctlrc and add:
DBENGINE=MYSQL
SIP_DOMAIN=pryko.com
6.1 创建数据库:kamdbctl create
6.2管理员登录:user 'admin' with password ' openserrw '
6.3 添加用户:kamctl add <name> <password> <email>
6.4 默认值:database url, users and passwords

  1.   - DEFAULT_DB_URL="mysql://opensips:opensipsrw@localhost/opensips"
  2.   - r/w user: openser; passwd: openserrw
  3.   - r/o user: openserro; passwd: openserro

复制代码二.配置
1.配置文件 kamailio.cfg
/usr/local/etc/kamailio/kamailio.cfg
2.配置文件 kamctlrc
/usr/local/etc/kamailio/kamctlrc

三.脚本
参考文档:
Kamailio Wiki
http://www.kamailio.com/dokuwiki
Cookbooks and Reference
http://www.kamailio.com/dokuwiki/doku.php/core-cookbook:1.5.x
Kamalio 1.5.x Module Functions Index
http://www.kamailio.com/dokuwiki/doku.php/modules:1.5.x:index-functions

四.负载均衡Load Balancing
参考:http://www.kamailio.org/dokuwiki/doku.php/asterisk:load-balancing-and-ha
4.1配置文件 kamailio.cfg

  1. loadmodule("dispatcher.so")
  2. modparam("dispatcher", "list_file", "/usr/local/etc/kamailio/dispatcher.list")
  3. modparam("dispatcher", "force_dst", 1)

复制代码4.2 ---dispatcher.list----文件
# group sip addresses of your * units
1 sip:221.5.152.171:5060
1 sip:221.5.152.170:5060
4.3 kamctl命令:kamctl dispatcher show
-- command 'dispatcher' - manage dispatcher
  * Examples:  dispatcher addgw 1 sip:1.2.3.1:5050 1 'outbound gateway'
  *            dispatcher addgw 2 sip:1.2.3.4:5050 3 ''
  *            dispatcher rmgw 4
dispatcher show ..................... show dispatcher gateways
dispatcher reload ................... reload dispatcher gateways
dispatcher dump ..................... show in memory dispatcher gateways
dispatcher addgw <setid> <destination> <flags> <description>
            .......................... add gateway
dispatcher rmgw <id> ................ delete gateway

查看载入的配置:kamctl dispatcher dump
修改后重新载入配置:kamctl dispatcher reload

如需使用,需安装MySQL-client-community-5.1.32-0.rhel5.i386.rpm
否则报错:ERROR: This command requires a database engine - none was loaded

五.与Asterisk对接负载均衡
注意事项:sip.conf
注释如下行
;canreinvite=no ; Asterisk by default tries to redirect

Asterisk#1  10.10.10.56
配置sip.conf
[5000]
type=friend
;username=5000
secret=5000_phone2
callerid=5000
qualify=yes ; Qualify peer is no more than 2000 ms away
nat=no ; This phone is natted
host=dynamic ; This device registers with us
;canreinvite=no ; Asterisk by default tries to redirect
配置extension.conf

  1. [default]
  2. exten => 6000,1,Dial(SIP/6000@10.10.10.57,60)
  3. exten => 5000,1,Dial(SIP/5000,60)

复制代码Asterisk#2  10.10.10.57
配置sip.conf
[6000]
type=friend
;username=6000
secret=6000_phone2
callerid=6000
qualify=yes ; Qualify peer is no more than 2000 ms away
nat=no ; This phone is natted
host=dynamic ; This device registers with us
;canreinvite=no ; Asterisk by default tries to redirect
配置extension.conf

  1. [default]
  2. exten => 6000,1,Dial(SIP/6000,60)
  3. exten => 5000,1,Dial(SIP/5000@10.10.10.136,60)

复制代码Kamailio 10.10.10.136
配置kamailio.cfg

  1. loadmodule "dispatcher.so"
  2. modparam("dispatcher", "list_file", "/usr/local/etc/kamailio/dispatcher.list")
  3. route{
  4. if ( !mf_process_maxfwd_header("10") )
  5. {
  6.   sl_send_reply("483","To Many Hops");
  7.   drop();
  8. };
  9. ds_select_dst("1", "0");
  10. forward();
  11. }

复制代码配置dispatcher.list
# line format
# setit(integer) destination(sip uri) flags (integer, optional)
1 sip:10.10.10.56:5060

测试
登录10.10.10.57上的6000,登录10.10.10.56上的5000
从6000呼叫5000,会呼叫10.10.10.136上的5000,10.136重定向到10.56

六.按号码段重定向网关
配置kamailio.cfg
使用正则表达式

  1. route{
  2.         if (!mf_process_maxfwd_header("10")) {
  3.                 sl_send_reply("483","Too Many Hops");
  4.                 exit;
  5.         }
  6. if (uri=~"^sip:5[0-9]+@10.10.10.136$") {
  7.   if (is_method("INVITE")) {
  8.   ds_select_dst("1", "0");
  9.   forward();
  10.   exit;
  11.   }
  12. }
  13. if (uri=~"^sip:8[0-9]+@10.10.10.136$") {
  14.   if (is_method("INVITE")) {
  15.   ds_select_dst("2", "0");
  16.   forward();
  17.   exit;
  18.   }
  19. }
  20. sl_send_reply("404","Not here");
  21. exit;
  22. }

复制代码配置dispatcher.list
# line format
# setit(integer) destination(sip uri) flags (integer, optional)
1 sip:10.10.10.56:5060 #1
2 sip:10.10.10.54:5060

测试
登录10.10.10.57上的6000,登录10.10.10.56上的5000
从6000呼叫5000,会呼叫10.10.10.136上的5000,10.136重定向到10.56
从6000呼叫8002,会呼叫10.10.10.136上的8002,10.136重定向到10.54

[ 本帖最后由 jackyin 于 2009-3-13 18:49 编辑 ]

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(8

窗影残 2022-08-21 10:08:30

哥哥能帮我看看,我的编译为什么出错吗?
谢谢,错误码如下:

Makefile:363: config.mak: No such file or directory
target architecture <i386>, host architecture <i386>
generating autover.h ...
making config...

CC (gcc) [M sipcapture.so]                sipcapture.o
In file included from sipcapture.c:45:
/usr/include/linux/filter.h:21: error: syntax error before "__u16"
/usr/include/linux/filter.h:23: error: syntax error before "jf"
/usr/include/linux/filter.h:24: error: syntax error before "k"
sipcapture.c:214: error: elements of array `BPF_code' have incomplete type
sipcapture.c:214: warning: excess elements in struct initializer
sipcapture.c:214: warning: (near initialization for `BPF_code[0]')
sipcapture.c:214: warning: excess elements in struct initializer
sipcapture.c:214: warning: (near initialization for `BPF_code[0]')
sipcapture.c:214: warning: excess elements in struct initializer
sipcapture.c:214: warning: (near initialization for `BPF_code[0]')
sipcapture.c:214: warning: excess elements in struct initializer
sipcapture.c:214: warning: (near initialization for `BPF_code[0]')
sipcapture.c:214: warning: excess elements in struct initializer
sipcapture.c:214: warning: (near initialization for `BPF_code[1]')
sipcapture.c:214: warning: excess elements in struct initializer
sipcapture.c:214: warning: (near initialization for `BPF_code[1]')
sipcapture.c:214: warning: excess elements in struct initializer
sipcapture.c:214: warning: (near initialization for `BPF_code[1]')
sipcapture.c:214: warning: excess elements in struct initializer
sipcapture.c:214: warning: (near initialization for `BPF_code[1]')
sipcapture.c:215: warning: excess elements in struct initializer
sipcapture.c:215: warning: (near initialization for `BPF_code[2]')
sipcapture.c:215: warning: excess elements in struct initializer
sipcapture.c:215: warning: (near initialization for `BPF_code[2]')
sipcapture.c:215: warning: excess elements in struct initializer
sipcapture.c:215: warning: (near initialization for `BPF_code[2]')
sipcapture.c:215: warning: excess elements in struct initializer
sipcapture.c:215: warning: (near initialization for `BPF_code[2]')
sipcapture.c:215: warning: excess elements in struct initializer
sipcapture.c:215: warning: (near initialization for `BPF_code[3]')
sipcapture.c:215: warning: excess elements in struct initializer
sipcapture.c:215: warning: (near initialization for `BPF_code[3]')
sipcapture.c:215: warning: excess elements in struct initializer
sipcapture.c:215: warning: (near initialization for `BPF_code[3]')
sipcapture.c:215: warning: excess elements in struct initializer
sipcapture.c:215: warning: (near initialization for `BPF_code[3]')
sipcapture.c:215: warning: excess elements in struct initializer
sipcapture.c:215: warning: (near initialization for `BPF_code[4]')
sipcapture.c:215: warning: excess elements in struct initializer
sipcapture.c:215: warning: (near initialization for `BPF_code[4]')
sipcapture.c:215: warning: excess elements in struct initializer
sipcapture.c:215: warning: (near initialization for `BPF_code[4]')
sipcapture.c:215: warning: excess elements in struct initializer
sipcapture.c:215: warning: (near initialization for `BPF_code[4]')
sipcapture.c:216: warning: excess elements in struct initializer
sipcapture.c:216: warning: (near initialization for `BPF_code[5]')
sipcapture.c:216: warning: excess elements in struct initializer
sipcapture.c:216: warning: (near initialization for `BPF_code[5]')
sipcapture.c:216: warning: excess elements in struct initializer
sipcapture.c:216: warning: (near initialization for `BPF_code[5]')
sipcapture.c:216: warning: excess elements in struct initializer
sipcapture.c:216: warning: (near initialization for `BPF_code[5]')
sipcapture.c:216: warning: excess elements in struct initializer
sipcapture.c:216: warning: (near initialization for `BPF_code[6]')
sipcapture.c:216: warning: excess elements in struct initializer
sipcapture.c:216: warning: (near initialization for `BPF_code[6]')
sipcapture.c:216: warning: excess elements in struct initializer
sipcapture.c:216: warning: (near initialization for `BPF_code[6]')
sipcapture.c:216: warning: excess elements in struct initializer
sipcapture.c:216: warning: (near initialization for `BPF_code[6]')
sipcapture.c:216: warning: excess elements in struct initializer
sipcapture.c:216: warning: (near initialization for `BPF_code[7]')
sipcapture.c:216: warning: excess elements in struct initializer
sipcapture.c:216: warning: (near initialization for `BPF_code[7]')
sipcapture.c:216: warning: excess elements in struct initializer
sipcapture.c:216: warning: (near initialization for `BPF_code[7]')
sipcapture.c:216: warning: excess elements in struct initializer
sipcapture.c:216: warning: (near initialization for `BPF_code[7]')
sipcapture.c:217: warning: excess elements in struct initializer
sipcapture.c:217: warning: (near initialization for `BPF_code[8]')
sipcapture.c:217: warning: excess elements in struct initializer
sipcapture.c:217: warning: (near initialization for `BPF_code[8]')
sipcapture.c:217: warning: excess elements in struct initializer
sipcapture.c:217: warning: (near initialization for `BPF_code[8]')
sipcapture.c:217: warning: excess elements in struct initializer
sipcapture.c:217: warning: (near initialization for `BPF_code[8]')
sipcapture.c:217: warning: excess elements in struct initializer
sipcapture.c:217: warning: (near initialization for `BPF_code[9]')
sipcapture.c:217: warning: excess elements in struct initializer
sipcapture.c:217: warning: (near initialization for `BPF_code[9]')
sipcapture.c:217: warning: excess elements in struct initializer
sipcapture.c:217: warning: (near initialization for `BPF_code[9]')
sipcapture.c:217: warning: excess elements in struct initializer
sipcapture.c:217: warning: (near initialization for `BPF_code[9]')
sipcapture.c:217: warning: excess elements in struct initializer
sipcapture.c:217: warning: (near initialization for `BPF_code[10]')
sipcapture.c:217: warning: excess elements in struct initializer
sipcapture.c:217: warning: (near initialization for `BPF_code[10]')
sipcapture.c:217: warning: excess elements in struct initializer
sipcapture.c:217: warning: (near initialization for `BPF_code[10]')
sipcapture.c:217: warning: excess elements in struct initializer
sipcapture.c:217: warning: (near initialization for `BPF_code[10]')
sipcapture.c:218: warning: excess elements in struct initializer
sipcapture.c:218: warning: (near initialization for `BPF_code[11]')
sipcapture.c:218: warning: excess elements in struct initializer
sipcapture.c:218: warning: (near initialization for `BPF_code[11]')
sipcapture.c:218: warning: excess elements in struct initializer
sipcapture.c:218: warning: (near initialization for `BPF_code[11]')
sipcapture.c:218: warning: excess elements in struct initializer
sipcapture.c:218: warning: (near initialization for `BPF_code[11]')
sipcapture.c:218: warning: excess elements in struct initializer
sipcapture.c:218: warning: (near initialization for `BPF_code[12]')
sipcapture.c:218: warning: excess elements in struct initializer
sipcapture.c:218: warning: (near initialization for `BPF_code[12]')
sipcapture.c:218: warning: excess elements in struct initializer
sipcapture.c:218: warning: (near initialization for `BPF_code[12]')
sipcapture.c:218: warning: excess elements in struct initializer
sipcapture.c:218: warning: (near initialization for `BPF_code[12]')
sipcapture.c:218: warning: excess elements in struct initializer
sipcapture.c:218: warning: (near initialization for `BPF_code[13]')
sipcapture.c:218: warning: excess elements in struct initializer
sipcapture.c:218: warning: (near initialization for `BPF_code[13]')
sipcapture.c:218: warning: excess elements in struct initializer
sipcapture.c:218: warning: (near initialization for `BPF_code[13]')
sipcapture.c:218: warning: excess elements in struct initializer
sipcapture.c:218: warning: (near initialization for `BPF_code[13]')
sipcapture.c:219: warning: excess elements in struct initializer
sipcapture.c:219: warning: (near initialization for `BPF_code[14]')
sipcapture.c:219: warning: excess elements in struct initializer
sipcapture.c:219: warning: (near initialization for `BPF_code[14]')
sipcapture.c:219: warning: excess elements in struct initializer
sipcapture.c:219: warning: (near initialization for `BPF_code[14]')
sipcapture.c:219: warning: excess elements in struct initializer
sipcapture.c:219: warning: (near initialization for `BPF_code[14]')
sipcapture.c:219: warning: excess elements in struct initializer
sipcapture.c:219: warning: (near initialization for `BPF_code[15]')
sipcapture.c:219: warning: excess elements in struct initializer
sipcapture.c:219: warning: (near initialization for `BPF_code[15]')
sipcapture.c:219: warning: excess elements in struct initializer
sipcapture.c:219: warning: (near initialization for `BPF_code[15]')
sipcapture.c:219: warning: excess elements in struct initializer
sipcapture.c:219: warning: (near initialization for `BPF_code[15]')
sipcapture.c:219: warning: excess elements in struct initializer
sipcapture.c:219: warning: (near initialization for `BPF_code[16]')
sipcapture.c:219: warning: excess elements in struct initializer
sipcapture.c:219: warning: (near initialization for `BPF_code[16]')
sipcapture.c:219: warning: excess elements in struct initializer
sipcapture.c:219: warning: (near initialization for `BPF_code[16]')
sipcapture.c:219: warning: excess elements in struct initializer
sipcapture.c:219: warning: (near initialization for `BPF_code[16]')
sipcapture.c:220: warning: excess elements in struct initializer
sipcapture.c:220: warning: (near initialization for `BPF_code[17]')
sipcapture.c:220: warning: excess elements in struct initializer
sipcapture.c:220: warning: (near initialization for `BPF_code[17]')
sipcapture.c:220: warning: excess elements in struct initializer
sipcapture.c:220: warning: (near initialization for `BPF_code[17]')
sipcapture.c:220: warning: excess elements in struct initializer
sipcapture.c:220: warning: (near initialization for `BPF_code[17]')
sipcapture.c:220: warning: excess elements in struct initializer
sipcapture.c:220: warning: (near initialization for `BPF_code[18]')
sipcapture.c:220: warning: excess elements in struct initializer
sipcapture.c:220: warning: (near initialization for `BPF_code[18]')
sipcapture.c:220: warning: excess elements in struct initializer
sipcapture.c:220: warning: (near initialization for `BPF_code[18]')
sipcapture.c:220: warning: excess elements in struct initializer
sipcapture.c:220: warning: (near initialization for `BPF_code[18]')
sipcapture.c:220: warning: excess elements in struct initializer
sipcapture.c:220: warning: (near initialization for `BPF_code[19]')
sipcapture.c:220: warning: excess elements in struct initializer
sipcapture.c:220: warning: (near initialization for `BPF_code[19]')
sipcapture.c:220: warning: excess elements in struct initializer
sipcapture.c:220: warning: (near initialization for `BPF_code[19]')
sipcapture.c:220: warning: excess elements in struct initializer
sipcapture.c:220: warning: (near initialization for `BPF_code[19]')
sipcapture.c:221: warning: excess elements in struct initializer
sipcapture.c:221: warning: (near initialization for `BPF_code[20]')
sipcapture.c:221: warning: excess elements in struct initializer
sipcapture.c:221: warning: (near initialization for `BPF_code[20]')
sipcapture.c:221: warning: excess elements in struct initializer
sipcapture.c:221: warning: (near initialization for `BPF_code[20]')
sipcapture.c:221: warning: excess elements in struct initializer
sipcapture.c:221: warning: (near initialization for `BPF_code[20]')
sipcapture.c:221: warning: excess elements in struct initializer
sipcapture.c:221: warning: (near initialization for `BPF_code[21]')
sipcapture.c:221: warning: excess elements in struct initializer
sipcapture.c:221: warning: (near initialization for `BPF_code[21]')
sipcapture.c:221: warning: excess elements in struct initializer
sipcapture.c:221: warning: (near initialization for `BPF_code[21]')
sipcapture.c:221: warning: excess elements in struct initializer
sipcapture.c:221: warning: (near initialization for `BPF_code[21]')
sipcapture.c:221: warning: excess elements in struct initializer
sipcapture.c:221: warning: (near initialization for `BPF_code[22]')
sipcapture.c:221: warning: excess elements in struct initializer
sipcapture.c:221: warning: (near initialization for `BPF_code[22]')
sipcapture.c:221: warning: excess elements in struct initializer
sipcapture.c:221: warning: (near initialization for `BPF_code[22]')
sipcapture.c:221: warning: excess elements in struct initializer
sipcapture.c:221: warning: (near initialization for `BPF_code[22]')
sipcapture.c: In function `raw_capture_socket':
sipcapture.c:1375: error: invalid application of `sizeof' to incomplete type `({anonymous})'
sipcapture.c:1375: error: invalid use of undefined type `struct sock_filter'
sipcapture.c:1381: error: invalid use of undefined type `struct sock_filter'
sipcapture.c:1381: warning: excess elements in struct initializer
sipcapture.c:1381: warning: (near initialization for `(anonymous)')
sipcapture.c:1381: warning: excess elements in struct initializer
sipcapture.c:1381: warning: (near initialization for `(anonymous)')
sipcapture.c:1381: warning: excess elements in struct initializer
sipcapture.c:1381: warning: (near initialization for `(anonymous)')
sipcapture.c:1381: warning: excess elements in struct initializer
sipcapture.c:1381: warning: (near initialization for `(anonymous)')
sipcapture.c:1382: error: invalid use of undefined type `struct sock_filter'
sipcapture.c:1382: warning: excess elements in struct initializer
sipcapture.c:1382: warning: (near initialization for `(anonymous)')
sipcapture.c:1382: warning: excess elements in struct initializer
sipcapture.c:1382: warning: (near initialization for `(anonymous)')
sipcapture.c:1382: warning: excess elements in struct initializer
sipcapture.c:1382: warning: (near initialization for `(anonymous)')
sipcapture.c:1382: warning: excess elements in struct initializer
sipcapture.c:1382: warning: (near initialization for `(anonymous)')
sipcapture.c:1383: error: invalid use of undefined type `struct sock_filter'
sipcapture.c:1383: warning: excess elements in struct initializer
sipcapture.c:1383: warning: (near initialization for `(anonymous)')
sipcapture.c:1383: warning: excess elements in struct initializer
sipcapture.c:1383: warning: (near initialization for `(anonymous)')
sipcapture.c:1383: warning: excess elements in struct initializer
sipcapture.c:1383: warning: (near initialization for `(anonymous)')
sipcapture.c:1383: warning: excess elements in struct initializer
sipcapture.c:1383: warning: (near initialization for `(anonymous)')
sipcapture.c:1384: error: invalid use of undefined type `struct sock_filter'
sipcapture.c:1384: warning: excess elements in struct initializer
sipcapture.c:1384: warning: (near initialization for `(anonymous)')
sipcapture.c:1384: warning: excess elements in struct initializer
sipcapture.c:1384: warning: (near initialization for `(anonymous)')
sipcapture.c:1384: warning: excess elements in struct initializer
sipcapture.c:1384: warning: (near initialization for `(anonymous)')
sipcapture.c:1384: warning: excess elements in struct initializer
sipcapture.c:1384: warning: (near initialization for `(anonymous)')
sipcapture.c:1386: error: invalid use of undefined type `struct sock_filter'
sipcapture.c:1386: warning: excess elements in struct initializer
sipcapture.c:1386: warning: (near initialization for `(anonymous)')
sipcapture.c:1386: warning: excess elements in struct initializer
sipcapture.c:1386: warning: (near initialization for `(anonymous)')
sipcapture.c:1386: warning: excess elements in struct initializer
sipcapture.c:1386: warning: (near initialization for `(anonymous)')
sipcapture.c:1386: warning: excess elements in struct initializer
sipcapture.c:1386: warning: (near initialization for `(anonymous)')
sipcapture.c:1387: error: invalid use of undefined type `struct sock_filter'
sipcapture.c:1387: warning: excess elements in struct initializer
sipcapture.c:1387: warning: (near initialization for `(anonymous)')
sipcapture.c:1387: warning: excess elements in struct initializer
sipcapture.c:1387: warning: (near initialization for `(anonymous)')
sipcapture.c:1387: warning: excess elements in struct initializer
sipcapture.c:1387: warning: (near initialization for `(anonymous)')
sipcapture.c:1387: warning: excess elements in struct initializer
sipcapture.c:1387: warning: (near initialization for `(anonymous)')
sipcapture.c:1388: error: invalid use of undefined type `struct sock_filter'
sipcapture.c:1388: warning: excess elements in struct initializer
sipcapture.c:1388: warning: (near initialization for `(anonymous)')
sipcapture.c:1388: warning: excess elements in struct initializer
sipcapture.c:1388: warning: (near initialization for `(anonymous)')
sipcapture.c:1388: warning: excess elements in struct initializer
sipcapture.c:1388: warning: (near initialization for `(anonymous)')
sipcapture.c:1388: warning: excess elements in struct initializer
sipcapture.c:1388: warning: (near initialization for `(anonymous)')
make[1]: *** [sipcapture.o] Error 1
make: *** [modules] Error 1

橙幽之幻 2022-08-21 09:30:11

OpenSER
{:3_192:}

蓝天 2022-08-21 08:18:05

有人知道吗?那位知道帮一下了!

往昔成烟 2022-08-21 07:43:46

顶...

满栀 2022-08-21 00:44:16

写错了,是kamailio3.0.1的版本

瑕疵 2022-08-20 21:53:24

你好,我在编译kamailio时,在make cfg之后在源代码路径中就会产生modules.lst文件,打开文件去掉exclude_modules中的db_mysql保存,然后编译,则编译不能通过,提示错误是大概是km_dbase.c:38:25: 错误:mysql/mysql.h:没有那个文件或目录
km_dbase.c:39:26: 错误:mysql/errmsg.h:没有那个文件或目录
km_dbase.c:40:33: 错误:mysql/mysql_version.h:没有那个文件或目录
make[1]: *** [km_dbase.o] 错误 1
make[1]: Leaving directory `/home/coffee/sip/kamailio-3.0.0/modules/db_mysql'

我编译的是kamailio3.0.3版本。
如果在modules.lst文件中不去掉db_mysql,就可以通过编译,但是在创建数据库时,报错提示:
ERROR: could not load the script in /usr/local/lib/kamailio//kamctl/kamdbctl.mysql for database engine MYSQL ERROR: database engine not loaded - tried 'MYSQL'

我的mysql已经正确安装。。

扬花落满肩 2022-08-20 18:11:11

好详细啊

世界如花海般美丽 2022-08-10 00:59:03

顶起来!

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文