为freeswitch 添加h323协议

发布时间 2023-05-08 17:16:43作者: 阿风小子

freeswitch可以支持h323协议,可以通过安装mod_h323才能够使用。如果需要安装mod_h323,首先要安装h323_plus.下面来说说具体步骤:参考 https://freeswitch.org/confluence/display/FREESWITCH/mod_h323。

1.首先去 http://www.h323plus.org/source/
下载h323plus-v1_26_5.tar.gz和ptlib-2.12.8.tar.bz2,并解压到
/data/h323/ptlib 和/data/h323/h323plus下面

2.设置环境变量
export PKG_CONFIG_PATH=/usr/local/lib/pkgconfig
export LD_LIBRARY_PATH=/usr/local/lib
export OPENH323DIR=/data/h323/h323plus
export PTLIBDIR= /data/h323/ptlib

3.安装 ptlib. 执行步骤:
ptlib依赖flex
yum -y install flex

./configure
make&make install

4.安装h323plus
./configure
make&make install

5.上述两个库安装完成以后,到FreeSWITCH的源代码目录下安装mod_h323
由于我们上面的步骤中两个库的安装位置都在/usr/local/bin目录下,因此我们需要改变mod_h323的Makefile(src/mod/endpoint/mod)h323/Makefile),将里面所在的"/usr"路径都替换为“/usr/local/lib”。修改完毕后,就可以在FreeSWITCH源目录中使用如下命令安装了:

make mod_h323-install
或者进入mod_h323源代码目录上,使用如下命令安装:(推荐此种方法)

cd src/mod/endpoint/mod_h323
make install

完整目录为/home/freeswitch-1.10.5.-release/src/mod/endpoints/mod_h323
安装完成以后将h323.conf.xml 拷贝到这个目录下
/usr/local/freeswitch/conf/autoload_configs/
然后打开freeswitch
执行load mod_h323即可成功加载h323模块

如果出现

‘/usr/src/freeswitch/src/mod/endpoints/mod_h323/mod_h323.h:43:18: error: h323.h: No such file or directory’
执行
ln -s /usr/local/include/openh323 /usr/include/openh323

如果出现
cannot open shared object file: No such file or directory 。
则做以下修改
1.如果共享库文件安装到了/lib或/usr/lib目录下, 那么需执行一下ldconfig命令
2. 如果共享库文件安装到了/usr/local/lib(很多开源的共享库都会安装到该目录下)或其它"非/lib或/usr/lib"目录下, 那么在执行ldconfig命令前, 还要把新共享库目录加入到共享库配置文件/etc/ld.so.conf中, 如下:

cat /etc/ld.so.conf
include ld.so.conf.d/*.conf
echo "/usr/local/lib" >> /etc/ld.so.conf
ldconfig

其他相关文档
https://freeswitch.org/confluence/display/FREESWITCH/mod_h323