H323plus的学习使用(1)——编译安装h323plus
首先是从官网上下载h323plus与ptlib源码
在ptlib库中的readme可知,最好将俩个开源库放在个人home目录下,否则将需要更改路径,并将其改名为ptlib与h323plus,这样子在接下去的编译过程中,便无需增添路径
-
le@ubuntu:~$ ls
-
Desktop Downloads h323plus Pictures Public Videos
-
Documents examples.desktop Music ptlib Templates
-
le@ubuntu:~$ cd ptlib
-
le@ubuntu:~/ptlib$ ./configure
接下去便是进去开源库中安装了,但如果这样子直接编译,会出错,根据出错信息,明显可以知道是缺少flex和bison这俩个库
sudo apt-get install flex bison
接下去就可以进入ptlib开源库中编译安装了,根据国外的教程,官方建议不要直接使用make,而是使用make depend 同make bothnoshared,这样子就能同时得到debug版本和优化版本,实际上的意义似乎不大,主要是加载动态库的问题,以及减少需要添加的环境变量的问题
-
cd ~/ptlib
-
./configure
-
make bothdepend
-
make bothnoshared
-
cd ~/h323plus
-
./configure
-
make bothdepend
-
make bothnoshared
如果上述都做完了,而且没有出现问题,那么便可以进入h323plus库中的sample中编译simph323使用看看
-
cd ~/h323plus/samples/simple
-
make bothnoshared
-
cd obj_linux_86_64_d_s
-
./simph323 -h
便可以看到simph323输出其使用教程了,其中包括了可用能力集同输出输入音频设备等,一般来说,此时音频设备应该都不存在,这是由于其他依赖库的问题,暂时先不考虑
-
simple Version 1.27.0 by H323Plus on Unix Linux (4.13.0-45-generic-x86_64)
-
Usage : simple [options] -l
-
: simple [options] [alias@]hostname (no gatekeeper)
-
: simple [options] alias[@hostname] (with gatekeeper)
-
Options:
-
-l --listen : Listen for incoming calls.
-
-g --gatekeeper host : Specify gatekeeper host.
-
-n --no-gatekeeper : Disable gatekeeper discovery.
-
-r --require-gatekeeper : Exit if gatekeeper discovery fails.
-
-a --auto-answer : Automatically answer incoming calls.
-
-u --user name : Set local alias name(s) (defaults to login name).
-
-p --password pwd : Set the H.235 password to use for calls.
-
-b --bandwidth bps : Limit bandwidth usage to bps bits/second.
-
-j --jitter [min-]max : Set minimum (optional) and maximum jitter buffer (in milliseconds).
-
-D --disable codec : Disable the specified codec (may be used multiple times)
-
-P --prefer codec : Prefer the specified codec (may be used multiple times)
-
-i --interface ipnum : Select interface to bind to.
-
-B --forward-busy party : Forward to remote party if busy.
-
-e --silence : Disable transmitter silence detection.
-
-f --fast-enable : Enable fast start.
-
-T --h245tunneldisable : Disable H245 tunnelling.
-
--h245setupenable : Enable H245 in Setup.
-
-Q --h245qosdisable : Disable H245 QoS Exchange.
-
--h46018disable : Disable H.460.18.
-
-s --sound device : Select sound input/output device.
-
--sound-in device : Select sound input device.
-
--sound-out device : Select sound output device.
-
-v --video device : Select video input/output device.
-
-t --trace : Enable trace, use multiple times for more detail.
-
-o --output : File for trace output, default is stderr.
-
-x --listenport : Listening port (default 1720).
-
-S --sleep : Sleep instead of listening for commands on STDIN.
-
-h --help : This help message.
在使用simph323编译时,建议不要使用make,会导致出现的程序没办法使用,具体原因是由于动态库加载失败的问题,解决方法是添加环境变量,或将对应动态库移到对应目录
在俩台机器上运行simph323,可实现文字交流(俩台虚拟机也行)
-
运行需要找两台linux机器,分别运行命令:
-
服务端: $./simph323 -n -l -v FakeVideo
-
客户端: $./simph323 -n 服务端IP地址 -v FakeVideo
如果机器上的音频设备同麦克风都可使用,可以使用以下命令,实现音频交流(理想情况)
-
服务端: $./simph323 -n -l -v FakeVideo -s Default
-
客户端: $./simph323 -n 服务端IP地址 -v FakeVideo -s Default
在运行时,simph323会输出对应的设备同能力集,如果是如下图,那么音频设备便是都不能使用的
-
Available Video Drivers:
-
FakeVideo
-
YUVFile
-
FFMPEG
-
Using video driver FakeVideo
-
Local username: le
-
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>
下一篇如何加载音视频设备问题,从而达到音视频聊天功能,上述方法是为最简单的安装教程,