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
Whenever a call is placed, both ends of the call must agree on the codecs they want to use. If one end speaks only ulaw and the other end refuses to communicate using anything other than gsm, no communication is going to take place. This is why I would recommend that beginners always allow ulaw (also known as g.711u) and alaw (also known as g.711a) unless specifically instructed not to by whomever you are connecting to. There are actually five different places that codecs can be specified:
- At an endpoint/device (phone or ATA), typically in the device's configuration.
- In a FreePBX EXTENSION configuration; however, it's best to leave those settings blank in most cases.
- In a FreePBX TRUNK configuration using allow= statements coupled with disallow=all. If these are omitted, then the defaults in sip.conf and iax.conf are used.
- In Settings > Asterisk SIP Settings > "General SIP Settings"
- In Settings > Asterisk IAX Settings
Asterisk will attempt to translate formats if the codecs are available on the system and allowed for that leg of the call. So if you have a trunk that only allows gsm but your extensions will only communicate in ulaw, that's not a problem as long as you have allowed gsm in the trunk configuration. To see the available codecs and translations, type core show translation (or just show translation in Asterisk 1.2 and earlier) from the Command Line Interface. If there is a number showing between two codecs in the grid, then translations are possible. If it's a single line (and it's not to the same codec), then translations are not possible, usually because one of the codecs isn't installed on the system.
Missing files/incorrect paths
If calling into an IVR or voicemail box, and the expected recording isn't played, it's possible that it's missing or not in the expected location. Did you use the System Recordings module to import the recording? If not, are you sure it's in the correct location?
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