FreePBX 12以上的SIP语音问题
关于SIP语音问题相关介绍
NAT issues
VoIP 最大的问题就是通常人们说的单通问题,或者几秒钟以后就掉线的问题。这些问题通常就是NAT配置不当导致。
Make sure you have a resolvable address on the Internet.
如果用户没有购买静态IP地址的话,,用户可能经常会修改IP地址。建议设置一个动态的DNS服务。
Adding NAT information in FreePBX
在高级配置菜单,点击 Asterisk SIP settings
然后点击SIP 配置
右边菜单支持的是 FreePBX 12。 FreePBX 11 以下版本是主界面配置
Set NAT as yes
Static IP from your ISP
选择"Static IP" ,输入外部IP地址
Dynamic IP Updated through dynamic IP service
选择 "Dynamic IP" ,输入主机名称全称,例如"foo.dyndns.net"
完成配置以后,要点击 "submit" 和点击"APPLY" 按钮。
Local Networks
在 "NAT"下,用户会看到一个勾选值 "Local Networks"。
这里输入内网IP地址和子网地址。
如果用户内网地址是192.168.0.254,那么需要设置为192.168.0.0 / 255.255.255.0
点击提交,然后点击APPLY Config
RTP Port Range
Open the SIP and RTP ports to your Asterisk server
用户必须确认开启了正确的端口,检查防火墙UDP端口设置,设置转发端口到用户的Asterisk端口。 对于SIP协议,用户需要开启UDP(不是TCP) 端口5060 (SIP) ,并且开启端口 10000-20000 来传输语音(RTP 在系统文件/etc/asterisk/rtp.conf中定义)。 所有这些端口都是UDP端口,开启TCP不会对NAT有任何帮助。 配置防火墙时,用户可能还要打开 UDP port 4569 (IAX),用户有时可以通过IAX连接到asterisk服务器。
用户可以看到实际开启的端口
如果实例的端口和本地应用有什么不同,用户需要检查自己的防火墙和相应的实际端口配置。
用户可能需要开启端口从10001开始,10000端口可能和Webmin端口冲突。如果没有安装Webmin则无需担心冲突。
CODEC issues
语音编码问题也是导致SIP语音质量问题的关键。当双方建立呼叫时,双方必须确认两者使用的编码。如果一方使用ulaw, 另外一方使用其他编码,那么不会继续通信。 这就是为什么我们推荐初级用户使用 ulaw (也称之为g.711u) 和alaw (也称之为g.711a) 。 通常有五个地方需要指定语音编码:
- 终端或者ATA 配置语音编码。
- 在FreePBX中配置了语音编码,但是大部分情况下,为空值。
- 在FreePBX 的中继 使用了 allow= 赋值和 disallow=all。 如果忽略了那些设置,则使用默认的设置,在 sip.conf 和 iax.conf 。
- 在 Asterisk SIP Settings 中的 "General SIP Settings" 使用了编码。
- 在Asterisk IAX Settings 设置中使用了编码。
如果Asterisk支持了设置的语音编码格式,asterisk将执行语音编码格式转换来支持对端的呼叫。 所以,如果中继使用了gsm ,但是分机使用了ulaw, asterisk同样可以允许双方谈话,只要中继设置中支持了gsm。 检测系统支持的语音编码转换,执行Asterisk CLI命令 core show translation 就可以看到结果。如果两种编码的网格有显示值,那么说明系统支持两种编码之间的转换。 如果显示的值仅是单行,那么说明不支持编码转换,通常情况下是系统没有安装此编码格式。
Missing files/incorrect paths
如果呼叫进入IVR 或者语音邮箱,系统播放的语音文件丢失,那么可能是文件播放路径不对。检查路由模块是否导入此文件,或者录音文件是否在正确的路径。
Permissions/ownership issues
This most commonly occurs when people copy audio files directly onto the system and forget that it's a Linux box and that Linux is finicky about file permissions and ownership. If permissions or ownership aren't correct, Asterisk will be unable to access the file, and therefore can't play it. One thing you can try to resolve this is to run the following from the Linux command prompt:
amportal chown
This is supposed to set appropriate permissions on files used by Asterisk.
Incorrect audio format
Sometimes people create system audio files using an external sound file editor, such as Audacity, in order to get better sound quality. What they don't realize is that Asterisk is very picky about the format of audio files it will play back. For example, if the file is .wav file format, Asterisk wants a file recorded at 8000 Hz, 16 bit, monaural (a.k.a. single channel) format, and if you directly upload a file in any other format, the CLI may show that the file is being played, but callers hear nothing. If normal system files play correctly but the files you've created do not, check the format, especially if you've directly copied it to a particular location on the system instead of importing it with the System Recordings module.
Hardware issues
Yes, even a hardware problem can cause audio failures. In one case, a T1 card had been installed in the system but not configured, and that stopped all recorded audio from being played. So if all else fails, look for any unconfigured or misconfigured hardware device, particularly if it's a DAHDI card (it appears that having ANY non-configured DAHDI card in a system may cause problems with audio output).
Related articles
Error rendering macro 'contentbylabel' : com.atlassian.confluence.macro.params.ParameterException: 'TROUB' is not an existing space's key