|
发表于 2018-3-29 13:11:55
|
显示全部楼层
dotasterisk安装g729和g723编码都很简单,下面以安装g729编码为例进行说明。安装g723编码类似。
1)请先ssh登录到 dotasterisk 系统,使用 【cat /proc/cpuinfo 】 查看机器的cpu型号和指令集,查看dotasterisk的asterisk版本,以及dotasterisk操作系统的架构,详见下面的红色标记,如下:
[root@dotasterisk:~]#cat /proc/cpuinfo
processor : 0
vendor_id : GenuineIntel
cpu family : 6
model : 158
model name : Intel(R) Core(TM) i5-7400 CPU @ 3.00GHz
stepping : 9
cpu MHz : 3000.092
cache size : 6144 KB
fpu : yes
fpu_exception : yes
cpuid level : 22
wp : yes
flags : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush mmx fxsr sse sse2 syscall nx rdtscp lm constant_tsc up rep_good xtopology nonstop_tsc unfair_spinlock pni pclmulqdq monitor ssse3 cx16 sse4_1 sse4_2 x2apic movbe popcnt aes xsave avx rdrand hypervisor lahf_lm abm 3dnowprefetch
bogomips : 6000.18
clflush size : 64
cache_alignment : 64
address sizes : 39 bits physical, 48 bits virtual
power management:
[root@dotasterisk:~]#asterisk -V
Asterisk 1.8.32.3
[root@dotasterisk:~]#
[root@dotasterisk:~]#da-version
DotAsterisk 2.0 (built: Oct 24 2017 09:53:17)
Copyright (c) 2010-2015 DotAsterisk Technology Co. Ltd
Official website: http://www.enjoycti.com/
[root@dotasterisk:~]#
[root@dotasterisk:~]#uname -a
Linux dotasterisk 2.6.32-431.el6.x86_64 #1 SMP Fri Nov 22 03:15:09 UTC 2013 x86_64 x86_64 x86_64 GNU/Linux
[root@dotasterisk:~]#
2)请到 http://asterisk.hosting.lv/ 下载 dotasterisk 对应的 asterisk版本的 g729编码模块。
由于DotAsterisk 2.0 呼叫中心系统是 采用 asterisk1.8 ,基于centos6.5 的 64位 系统,所以 应该选择 【gcc4-glibc-x86_64 】相关编译的库文件。另外,从上面的cpu信息可以看出,我的机器是采用 酷睿架构,而且支持 sse4指令集,所以我们选择下载如下这个库:
codec_g729-ast18-gcc4-glibc-x86_64-core2-sse4.so
也可以从 点星PBX官方论坛 下载该模块库,下载链接如下:
http://www.dotasterisk.cn/downlo ... 86_64-core2-sse4.so
3)请将下载的库 采用ssh客户端工具(secureCRT、WinSCP)等传到 dotasterisk 系统里面的 【/opt/asterisk/lib/asterisk/modules/】目录,并给与755权限,正确上传模块成功后,详见如下:
[root@dotasterisk:~]#cd /opt/asterisk/lib/asterisk/modules/
[root@dotasterisk:/opt/asterisk/lib/asterisk/modules]#
[root@dotasterisk:/opt/asterisk/lib/asterisk/modules]#ls codec_g729-ast18-gcc4-glibc-x86_64-core2-sse4.so
codec_g729-ast18-gcc4-glibc-x86_64-core2-sse4.so
[root@dotasterisk:/opt/asterisk/lib/asterisk/modules]#
[root@dotasterisk:/opt/asterisk/lib/asterisk/modules]#chmod 755 codec_g729-ast18-gcc4-glibc-x86_64-core2-sse4.so ##【很重要】千万别忘记修改权限
[root@dotasterisk:/opt/asterisk/lib/asterisk/modules]#
4)进入asterisk控制台,使用【module load】命令加载该模块
[root@dotasterisk:/opt/asterisk/lib/asterisk/modules]#asterisk -r
Asterisk 1.8.32.3, Copyright (C) 1999 - 2013 Digium, Inc. and others.
Created by Mark Spencer <markster@digium.com>
Asterisk comes with ABSOLUTELY NO WARRANTY; type 'core show warranty' for details.
This is free software, with components licensed under the GNU General Public
License version 2 and other licenses; you are welcome to redistribute it under
certain conditions. Type 'core show license' for details.
=========================================================================
Connected to Asterisk 1.8.32.3 currently running on dotasterisk (pid = 2284)
Verbosity is at least 3
Core debug is at least 3
dotasterisk*CLI>
dotasterisk*CLI> module load codec_g729-ast18-gcc4-glibc-x86_64-core2-sse4.so
Loaded codec_g729-ast18-gcc4-glibc-x86_64-core2-sse4.so
== Registered translator 'g729tolin' from format g729 to slin, cost 1000
== Registered translator 'lintog729' from format slin to g729, cost 999
Loaded codec_g729-ast18-gcc4-glibc-x86_64-core2-sse4.so => (g729 Coder/Decoder, based on IPP)
dotasterisk*CLI>
加载成功后,可以用:core show translation 查看,如下:
dotasterisk*CLI> core show translation
Translation times between formats (in microseconds) for one second of data
Source Format (Rows) Destination Format (Columns)
g723 gsm ulaw alaw g726aal2 adpcm slin lpc10 g729 speex ilbc g726
g723 - - - - - - - - - - - -
gsm - - 2 2 2000 1000 1 1000 1001 - 4000 1001
ulaw - 1001 - 1 2000 1000 1 1000 1001 - 4000 1001
alaw - 1001 1 - 2000 1000 1 1000 1001 - 4000 1001
g726aal2 - 2000 1001 1001 - 1999 1000 1999 2000 - 4999 2000
adpcm - 1001 2 2 2000 - 1 1000 1001 - 4000 1001
slin - 1000 1 1 1999 999 - 999 1000 - 3999 1000
lpc10 - 1001 2 2 2000 1000 1 - 1001 - 4000 1001
g729 - 1999 1000 1000 2998 1998 999 1998 - - 4998 1999
speex - - - - - - - - - - - -
ilbc - 2000 1001 1001 2999 1999 1000 1999 2000 - - 2000
g726 - 1001 2 2 2000 1000 1 1000 1001 - 4000 -
g722 - 2000 1001 1001 2999 1999 1000 1999 2000 - 4999 2000
5)在dotasterisk的sip和iax配置文件中启用g729编码。采用如下命令:
echo -e "disallow=all\nallow=g729" >> /opt/app/ast/asterisk/sip_general_custom.conf
echo -e "disallow=all\nallow=g729" >> /opt/app/ast/asterisk/iax_general_custom.conf
6)重启asterisk,使配置修改生效。
[root@laravel55:/opt/app/ast/asterisk]#/etc/init.d/asterisk restart
Stopping safe_asterisk: [ OK ]
Shutting down asterisk: [ OK ]
Starting asterisk: [ OK ]
[root@laravel55:/opt/app/ast/asterisk]#
|
|