0x00.简介

官网地址:https://www.h323plus.org
项目地址:
https://github.com/willamowius/h323plus
https://github.com/willamowius/ptlib

几个参考链接
H323plus的编译、安装、配置和使用
编译SDL那点事
linux下h323plus简单使用
编译H323plus
H323plus的学习与使用:编译、安装、sample、H.264插件、安装教程总结

0x01.部署环境

宿主机环境为CentOS7-x86_64-Minimal2003

0x02.环境准备

1.防火墙的配置

在实验环境中可以选择直接禁用防火墙,但是在生产环境中根据实际的需求进行规则的配置。
关闭firewalld
在CentOS7上面防火墙是firewalld服务,停止并且禁止开机启动firewalld.service

systemctl stop firewalld.service
systemctl disable firewalld.service
systemctl status firewalld.service

关闭 selinux

setenforce 0
getenforce
sed -i 's#SELINUX=enforcing#SELINUX=disabled#g' /etc/sysconfig/selinux
grep SELINUX=disabled /etc/sysconfig/selinux

2.基础工具环境

yum clean all
yum make cache
yum install -y gcc gcc-c++ make unzip zip  git wget flex bison autoconf automake pkg-config

0x03.软件安装

1.安装依赖环境

yum install -y libstdc++ libvorbis libvpx libogg  libtheora  freetype libjpeg-turbo
yum install -y yasm zlib bzip2 faac lame speex x264 XviD openjpeg15 opencore-amr

2.安装libsdl

本文安装选择的是SDL-1.2.15版本。

源码的安装一般由3个步骤组成:配置(configure)、编译(make)、安装(make install)。

  • SDL-1.2.15版本安装说明
    下载SDL-1.2.15
wget http://www.libsdl.org/release/SDL-1.2.15.tar.gz
tar -xvf SDL-1.2.15.tar.gz

配置与编译:Install SDL by running the following commands:

cd SDL-1.2.15
sed -e '/_XData32/s:register long:register _Xconst long:' \-i src/video/x11/SDL_x11sym.h &&
./configure --prefix=/usr --disable-static &&
make

然后安装:Now, as the root user:

make install &&
install -v -m755 -d /usr/share/doc/SDL-1.2.15/html &&
install -v -m644    docs/html/*.html \/usr/share/doc/SDL-1.2.15/html

测试安装结果

cd test &&
./configure &&
make

结束,进入下一个部分,下载H323和ptlib

  • SDL2-2.0.12版本安装说明
    下载SDL2-2.0.12
wget http://www.libsdl.org/release/SDL2-2.0.12.tar.gz

配置与编译:Install SDL by running the following commands:

./configure --prefix=/usr &&
make

If you have Doxygen-1.8.20 installed and want to build the html documentation, run the following commands:

pushd docs  &&doxygen   &&
popd

然后安装:Now, as the root user:

make install              &&
rm -v /usr/lib/libSDL2*.a

If you built the documentation, install it as the root user:

install -v -m755 -d        /usr/share/doc/SDL2-2.0.12/html &&
cp -Rv  docs/output/html/* /usr/share/doc/SDL2-2.0.12/html

0x04.下载h323plus和ptlib

打开H323的官网,进入Download下载页面,找到H.323 Plus (Linux),下载H.323 Plus Core 和PTLib (req)
Linux

cd
wget https://github.com/willamowius/h323plus/archive/v1_27_1.tar.gz
wget https://github.com/willamowius/ptlib/archive/v2_10_9_3.tar.gz

0x05.安装h323plus和ptlib

源码的安装一般由3个步骤组成:配置(configure)、编译(make)、安装(make install)。

1.解压文件

tar -xvf ptlib-v2_10_9_3.tar.gz
tar -xvf h323plus-v1_27_1.tar.gz

2.移动文件

移动ptlib至h323plus文件夹

mv ./ptlib/ ./h323plus/

3.安装ptlib

配置编译安装ptlib

cd /root/h323plus/ptlib
./configure --enable-SDL
make && make install

4.安装h323

配置编译安装h323

H323plus的学习使用(1)——编译安装h323plus

cd /root/h323plus
./configure
make && make install

5.视频编码插件

配置编译安装视频编码插件plugins

cd /root/h323plus/plugins
./configure --enable-SDL
make && make install

6.编译simple

进入samples/simple,开始编译

cd /root/h323plus/samples/simple
make
ls

操作情况如下

[root@host ~]# cd /root/h323plus/samples/simple
[root@host simple]# make
[CC] main.cxx
[LD] obj_linux_x86_64/simph323
[root@host simple]# ls
main.cxx  Makefile          simple_2005.vcproj  simple_2010.vcxproj  simple_2015.vcxproj          simple.cbp
main.h    obj_linux_x86_64  simple_2008.vcproj  simple_2012.vcxproj  simple_2015.vcxproj.filters
[root@host simple]#

0x06.运行sample

1.运行

cd /root/h323plus/samples/simple/obj_linux_x86_64
ls
./simph323 -n -l

运行simph323结果如下:

[root@host obj_linux_x86_64]# ls
main.o  simph323
[root@host obj_linux_x86_64]# ./simph323 -n -l
./simph323: error while loading shared libraries: libh323_linux_x86_64_.so.1.27.1: cannot open shared object file: No such file or directory
[root@host obj_linux_x86_64]#

2.报错如下

./simph323: error while loading shared libraries: libh323_linux_x86_64_.so.1.27.1: cannot open shared object file: No such file or directory
解决方式参考链接

3.处理报错

观察h323plus编译安装过程:

echo "*** 'make install' is usually a bad idea, use 'make optnoshared' and point OPENH323DIR to your source dir ***"
*** 'make install' is usually a bad idea, use 'make optnoshared' and point OPENH323DIR to your source dir ***
mkdir -p /usr/local//lib
rm -f /usr/local//lib/libh323_*_r.so*
/usr/bin/install -c -m 444 lib/libh323_linux_x86_64_.so.1.27.1 /usr/local//lib
(cd /usr/local//lib ; \rm -f  libh323_linux_x86_64_.so.1.27 ; \ln -sf libh323_linux_x86_64_.so.1.27.1 libh323_linux_x86_64_.so.1.27 \
)
(cd /usr/local//lib ; \rm -f  libh323_linux_x86_64_.so.1 ; \ln -sf libh323_linux_x86_64_.so.1.27.1 libh323_linux_x86_64_.so.1 \
)
(cd /usr/local//lib ; \rm -f  libh323_linux_x86_64_.so ; \ln -sf libh323_linux_x86_64_.so.1.27.1 libh323_linux_x86_64_.so \
)
(cd /usr/local//lib; \rm -f  libopenh323.so ; \ln -sf libh323_linux_x86_64_.so libopenh323.so \
)
( for dir in /usr/local//lib \/usr/local//include/openh323 \/usr/local//include/openh323/codec \/usr/local//include/openh323/h224 \/usr/local//include/openh323/h230 \/usr/local//include/openh323/h235 \/usr/local//include/openh323/h341 \/usr/local//include/openh323/h350 \/usr/local//include/openh323/h450 \/usr/local//include/openh323/h460 \/usr/local//share/openh323 ;\do mkdir -p $dir ; chmod 755 $dir ; \
done)

而后重新进行h323的配置和编译,但是没有进行make install,而是
make optnoshared

cd /root/h323plus
./configure
make && make optnoshared

重新运行

cd /root/h323plus/samples/simple/obj_linux_x86_64
ls
./simph323 -n -l

报同样的错,下面针对性解决

./simph323: error while loading shared libraries: libh323_linux_x86_64_.so.1.27.1: cannot open shared object file: No such file or directory
解决方式参考链接

恢复原配置编译安装h323

cd /root/h323plus
./configure
make && make install

观察安装过程中

mkdir -p /usr/local//lib
rm -f /usr/local//lib/libh323_*_r.so*
/usr/bin/install -c -m 444 lib/libh323_linux_x86_64_.so.1.27.1 /usr/local//lib
(cd /usr/local//lib ; \rm -f  libh323_linux_x86_64_.so.1.27 ; \ln -sf libh323_linux_x86_64_.so.1.27.1 libh323_linux_x86_64_.so.1.27 \
)
(cd /usr/local//lib ; \rm -f  libh323_linux_x86_64_.so.1 ; \ln -sf libh323_linux_x86_64_.so.1.27.1 libh323_linux_x86_64_.so.1 \
)
(cd /usr/local//lib ; \rm -f  libh323_linux_x86_64_.so ; \ln -sf libh323_linux_x86_64_.so.1.27.1 libh323_linux_x86_64_.so \
)
(cd /usr/local//lib; \rm -f  libopenh323.so ; \ln -sf libh323_linux_x86_64_.so libopenh323.so \
)

查看sample的运行依赖

cd /root/h323plus/samples/simple/obj_linux_x86_64
ls
ldd simph323

运行结果如下,唯独libh323_linux_x86_64_.so.1.27.1没有找到。

[root@host ~]# cd /root/h323plus/samples/simple/obj_linux_x86_64
[root@host obj_linux_x86_64]# ls
main.o  simph323
[root@host obj_linux_x86_64]# ldd simph323linux-vdso.so.1 =>  (0x00007ffed96fa000)libh323_linux_x86_64_.so.1.27.1 => not foundlibresolv.so.2 => /lib64/libresolv.so.2 (0x00007f8b70c7e000)libpt.so.2.10.9 => not foundlibpthread.so.0 => /lib64/libpthread.so.0 (0x00007f8b70a62000)librt.so.1 => /lib64/librt.so.1 (0x00007f8b7085a000)libdl.so.2 => /lib64/libdl.so.2 (0x00007f8b70656000)libstdc++.so.6 => /lib64/libstdc++.so.6 (0x00007f8b7034f000)libm.so.6 => /lib64/libm.so.6 (0x00007f8b7004d000)libgcc_s.so.1 => /lib64/libgcc_s.so.1 (0x00007f8b6fe37000)libc.so.6 => /lib64/libc.so.6 (0x00007f8b6fa69000)/lib64/ld-linux-x86-64.so.2 (0x00007f8b70e98000)
[root@host obj_linux_x86_64]#

参考链接Linux中error while loading shared libraries错误解决办法
1、首先打开/etc/ld.so.conf文件
2、加入动态库文件所在的目录:执行vi /etc/ld.so.conf,在"include ld.so.conf.d/*.conf"下方增加"/usr/local/lib"。
3、保存后,在命令行终端执行:/sbin/ldconfig -v;其作用是将文件/etc/ld.so.conf列出的路径下的库文件缓存到/etc/ld.so.cache以供使用,因此当安装完一些库文件,或者修改/etc/ld.so.conf增加了库的新搜索路径,需要运行一下ldconfig,使所有的库文件都被缓存到文件/etc/ld.so.cache中,如果没做,可能会找不到刚安装的库。

cp /etc/ld.so.conf /etc/ld.so.conf.bak
vim /etc/ld.so.conf
include ld.so.conf.d/*.conf
/usr/local/lib
/sbin/ldconfig -v
ldconfig

4.问题解决

查看依赖情况

cd /root/h323plus/samples/simple/obj_linux_x86_64
ldd simph323
[root@host ~]# cd /root/h323plus/samples/simple/obj_linux_x86_64
[root@host obj_linux_x86_64]# ldd simph323linux-vdso.so.1 =>  (0x00007ffdf17a9000)libh323_linux_x86_64_.so.1.27.1 => /usr/local/lib/libh323_linux_x86_64_.so.1.27.1 (0x00007fdaed803000)libresolv.so.2 => /lib64/libresolv.so.2 (0x00007fdaed5e9000)libpt.so.2.10.9 => /usr/local/lib/libpt.so.2.10.9 (0x00007fdaed0fa000)libpthread.so.0 => /lib64/libpthread.so.0 (0x00007fdaecede000)librt.so.1 => /lib64/librt.so.1 (0x00007fdaeccd6000)libdl.so.2 => /lib64/libdl.so.2 (0x00007fdaecad2000)libstdc++.so.6 => /lib64/libstdc++.so.6 (0x00007fdaec7cb000)libm.so.6 => /lib64/libm.so.6 (0x00007fdaec4c9000)libgcc_s.so.1 => /lib64/libgcc_s.so.1 (0x00007fdaec2b3000)libc.so.6 => /lib64/libc.so.6 (0x00007fdaebee5000)/lib64/ld-linux-x86-64.so.2 (0x00007fdaee276000)
[root@host obj_linux_x86_64]#

5.运行

H323plus的学习使用(2)——simple实现音视频通话

cd /root/h323plus/samples/simple/obj_linux_x86_64
./simph323 -n -l
[root@host obj_linux_x86_64]# cd /root/h323plus/samples/simple/obj_linux_x86_64
[root@host obj_linux_x86_64]# ./simph323 -n -l
simple Version 1.27.1 by H323Plus on Unix Linux (3.10.0-1127.el7.x86_64-x86_64)2020/11/05 08:46:57.326  0                   (0)     Version 1.27.1 by H323Plus on Unix Linux (3.10.0-1127.el7.x86_64-x86_64) with PTLib (v2.10.9 (svn:0)) at 2020/11/5 8:46:57.326
Available Video Drivers:
FakeVideo
Shm
YUVFile
FFMPEG
V4L2
Using video driver *
Local username: root
Silence compression is Disabled
Auto answer is 0
FastConnect is Disabled
H245Tunnelling is Enabled
H245QoS is Enabled
Jitter buffer: 50-250 ms
Sound output device: "Null Audio"
Sound  input device: "Null Audio"
Codecs (in preference order):Table:G.711-ALaw-64k <1>G.711-uLaw-64k <2>UserInput/hookflash <3>UserInput/basicString <4>UserInput/dtmf <5>UserInput/RFC2833 <6>Set:0:0:G.711-ALaw-64k <1>G.711-uLaw-64k <2>1:UserInput/hookflash <3>2:UserInput/basicString <4>UserInput/dtmf <5>UserInput/RFC2833 <6>Available Features:
Std9    QoS Monitoring-H.460.9
Std18   NatTraversal-H.460.18
Std19   NatTraversal-H.460.19
Std23   P2Pnat Detect-H.460.23
Std24   P2Pnat Media-H.460.24Available NAT Methods:
STUN
H46019
H46024
GnuGkAvailable Security:
SimpleCAT
SimpleMD5
TimeSyncWaiting for incoming calls for "root"
Press X to exit.
H323>

提示输入X,可以退出当前运行过程。
下面查看端口运行情况

netstat -lntp
[root@host ~]# netstat -lntp
Active Internet connections (only servers)
Proto Recv-Q Send-Q Local Address           Foreign Address         State       PID/Program name
tcp        0      0 0.0.0.0:22              0.0.0.0:*               LISTEN      970/sshd
tcp        0      0 0.0.0.0:1720            0.0.0.0:*               LISTEN      1505/./simph323
tcp        0      0 127.0.0.1:25            0.0.0.0:*               LISTEN      1295/master
tcp6       0      0 :::22                   :::*                    LISTEN      970/sshd
tcp6       0      0 ::1:25                  :::*                    LISTEN      1295/master
[root@host ~]#

6.优化

为方便sample程序运行,在根目录下建立软连接,参考链接

cd
pwd
ls
ln -s /root/h323plus/samples/simple/obj_linux_x86_64/simph323 simph323
ls
ll
[root@host ~]# cd
[root@host ~]# pwd
/root
[root@host ~]# ls
anaconda-ks.cfg  h323plus  softwarepackages
[root@host ~]# ln -s /root/h323plus/samples/simple/obj_linux_x86_64/
main.o    simph323
[root@host ~]# ln -s /root/h323plus/samples/simple/obj_linux_x86_64/simph323 simph323
[root@host ~]# ls
anaconda-ks.cfg  h323plus  simph323  softwarepackages
[root@host ~]# ll
total 8
-rw-------. 1 root root 1435 Jul 27 14:16 anaconda-ks.cfg
drwxrwxr-x. 8 root root 4096 Nov  4 17:02 h323plus
lrwxrwxrwx. 1 root root   55 Nov  5 09:32 simph323 -> /root/h323plus/samples/simple/obj_linux_x86_64/simph323
drwxr-xr-x. 3 root root  277 Nov  5 09:32 softwarepackages
[root@host ~]#

在根目录运行测试

cd
./simph323 -n -l
[root@host ~]# cd
[root@host ~]# ./simph323 -n -l
simple Version 1.27.1 by H323Plus on Unix Linux (3.10.0-1127.el7.x86_64-x86_64)2020/11/05 09:36:38.191  0                   (0)     Version 1.27.1 by H323Plus on Unix Linux (3.10.0-1127.el7.x86_64-x86_64) with PTLib (v2.10.9 (svn:0)) at 2020/11/5 9:36:38.191
Available Video Drivers:
FakeVideo
Shm
YUVFile
FFMPEG
V4L2
Using video driver *
Local username: root
Silence compression is Disabled
Auto answer is 0
FastConnect is Disabled
H245Tunnelling is Enabled
H245QoS is Enabled
Jitter buffer: 50-250 ms
Sound output device: "Null Audio"
Sound  input device: "Null Audio"
Codecs (in preference order):Table:G.711-ALaw-64k <1>G.711-uLaw-64k <2>UserInput/hookflash <3>UserInput/basicString <4>UserInput/dtmf <5>UserInput/RFC2833 <6>Set:0:0:G.711-ALaw-64k <1>G.711-uLaw-64k <2>1:UserInput/hookflash <3>2:UserInput/basicString <4>UserInput/dtmf <5>UserInput/RFC2833 <6>Available Features:
Std9    QoS Monitoring-H.460.9
Std18   NatTraversal-H.460.18
Std19   NatTraversal-H.460.19
Std23   P2Pnat Detect-H.460.23
Std24   P2Pnat Media-H.460.24Available NAT Methods:
STUN
H46019
H46024
GnuGkAvailable Security:
SimpleCAT
SimpleMD5
TimeSyncWaiting for incoming calls for "root"
Press X to exit.
H323>
netstat -lntp
[root@host ~]# netstat -lntp
Active Internet connections (only servers)
Proto Recv-Q Send-Q Local Address           Foreign Address         State       PID/Program name
tcp        0      0 0.0.0.0:22              0.0.0.0:*               LISTEN      970/sshd
tcp        0      0 0.0.0.0:1720            0.0.0.0:*               LISTEN      1851/./simph323
tcp        0      0 127.0.0.1:25            0.0.0.0:*               LISTEN      1295/master
tcp6       0      0 :::22                   :::*                    LISTEN      970/sshd
tcp6       0      0 ::1:25                  :::*                    LISTEN      1295/master
[root@host ~]# 

0x07.TODO接入视频采集设备

H323plus的编译、安装、配置和使用
linux下h323plus简单使用

H323plus的编译安装配置与使用:从头开始相关推荐

  1. linux nginx编译安装mysql_Centos7下编译安装配置Nginx+PHP+MySql环境

    序言 这次玩次狠得.除了编译器使用yum安装,其他全部手动编译.哼~ 看似就Nginx.PHP.MySql三个东东,但是它们太尼玛依赖别人了. 没办法,想用它们就得老老实实给它们提供想要的东西. 首先 ...

  2. LAMP源码编译安装配置+wordpress

    什么是LAMP呢?LAMP就是Linux+apache+mysql+php,一组常用来搭建动态网站或者静态网站的开源软件,本身都是各自独立的程序,但是因为常被放在一起使用,拥有了越来越高的兼容度,共同 ...

  3. gcovr 安装_Kudu 1.8.0 编译安装配置

    安装环境:CentOS6.8*3 解决系统依赖: yum install autoconf automake cyrus-sasl-devel cyrus-sasl-gssapi cyrus-sasl ...

  4. 【转】VTK + QT + VS 编译安装配置

    VTK Vtk,(visualization toolkit)是一个开源的免费软件系统,主要用于三维计算机图形学.图像处理和可视化.Vtk是在面向对象原理的基础上设计和实现的,它的内核是用C++构建的 ...

  5. mysql5.7.13编译安装_MySQL 5.7.13 源码编译安装配置方法图文教程

    安装环境:centos7 64位 mini版 官网源码编译安装文档: 一.系统安装条件 官方文档说明: 1> cmake mysql使用cmake跨平台工具预编译源码,用于设置mysql的编译参 ...

  6. centos编译安装配置支持ssl加密的mysql replication

    参考文章:http://www.howtoforge.com/how-to-set-up-mysql-database-replication-with-ssl-encryption-on-cento ...

  7. Nginx编译-安装-配置-优化实践总结

    http://www.zhuxiaodong.net/2016/configure-nginx-server-support-https-http2-on-centos7/ 一些更新说明: 2016- ...

  8. httpd-2.4.9.tar.bz2的编译安装配置以及CGI、虚拟主机、https、mod_deflate、mod_status的实现。...

       Apache-2.4.9增加了一些新特新,编译安装Apache之前先要准备好安装环境即各种开发包组的安装这里我们就不一一介绍,    Apache-2.4会依赖更高版本的apr.apr-util ...

  9. mysql ssl编译_centos编译安装配置支持ssl加密的mysql replication

    参考文章:http://www.howtoforge.com/how-to-set-up-mysql-database-replication-with-ssl-encryption-on-cento ...

最新文章

  1. 基于Vue+nodejs实现的前后端分离疫情防控系统
  2. SQLSERVER 2008 R2中的全文检索
  3. matlab上位机串口通信,MATLAB GUIDE 上位机串口通信开发 绘制图形
  4. 如何判断对象是否存活之根搜索算法
  5. EFCore Lazy Loading + Inheritance = 干净的数据表 (一)
  6. 1839行政领导学 (2)
  7. Eclipse中src/main/resources配置文件启动问题
  8. http://www.a.cn/?a.b=1 取a.b的值
  9. Swift泛型Protocol对比C#泛型Interface
  10. Leetcode--152. 乘积最大子序列
  11. 如何将松散的dll打包进需要发布的exe
  12. 【JavaScript】支持js代码的博客有…
  13. 9月18日博文阅读数异常波动公告
  14. 微信小程序—给图片添加相框
  15. 开启binary log功能
  16. IT是什么行业?就业前景怎么样
  17. 算法数据结构(三十五)----子数组达到累加和的最大长度系列
  18. 电子琴节奏包制作_MIDI音乐制作基础必备
  19. Win10笔记本触控板关闭/打开
  20. php谷歌地图,php – 使用谷歌地图提交位置

热门文章

  1. 当安全遇上AI 阿里聚安全算法挑战赛 队伍经验分享
  2. Grainger 固安捷 EDI 需求分析
  3. 开始搞WinCE-------关于定制WinCE操作系统的大概步骤
  4. 任杰中山大学计算机技术,喜讯 | 港中大(深圳)学子在2020年“外研社·国才杯”全国英语大赛(广东复赛)创造佳绩...
  5. ping命令一直测试网络丢包原因及处理解决方法
  6. 一招搞定win10网络图标显示问题-网络图标不见了
  7. 优思学院|六西格玛黑带大师MBB是什么?兩大认证比较
  8. 动手制作QQ找茬游戏外挂
  9. 【Day8.3】黄河第一桥
  10. 一、考研数据结构笔记——引言及目录