修改:sip_general_additional.conf

 
  
  1. ; do not edit this file, this is an auto-generated file by freepbx 
  2. all modifications must be done from the web gui 
  3.  
  4.  
  5. vmexten=*97 
  6. bindport=5060 
  7. #使用×××时修改该地方,IP为asterisk主机的内部IP
  8. bindaddr=192.168.1.10 
  9. #这里增加asterisk所支持的编码
  10. #也可增加至sip.conf中
  11. disallow=all 
  12. allow=ulaw 
  13. allow=alaw 
  14. context=from-sip-external 
  15. callerid=Unknown 
  16. notifyringing=yes 
  17. notifyhold=yes 
  18. limitonpeers=yes 
  19. tos_sip=cs3 
  20. tos_audio=ef 
  21. tos_video=af41 

如果以上设置后拨入无法拨通则修改sip_nat.conf

 
  
  1. externip = 62.69.4.121  # 该处为asterisk 机的外部IP
  2. localnet=192.168.0.0/255.255.0.0 

修改  zapata.conf

增加以下三项如果该三项不存在的话

 
  
  • echocancel=yes
  • echocancelwhenbridged=yes
  • echotraining=yes 

使用 ztmonitor <channel num> -vv 该命令查看 rxgain/txgain 的变化 根据变化的值适当调整 rxgain/txgain 的值

ztmontor 中的<channel num>的指你当前通话的通道编号 如 zap/32-xxxxx , 32则为 channel num 该命令一定要在你测试的通话经行过程中使用 运行如下
 
  
  1. [root@elastix ~]# ztmonitor  32 -vv 
  2.  
  3. Visual Audio Levels. 
  4. -------------------- 
  5.  Use zapata.conf file to adjust the gains if needed. 
  6.  
  7. ( # = Audio Level  * = Max Audio Hit ) 
  8. <----------------(RX <----------------(TX 
  9.                                                                                Rx:     0 (    0) Tx:     0 (    0) 
 

以下为我的asterisk中的配置文件:

 

 
  
  1. [trunkgroups] 
  2.  
  3. [channels] 
  4. context=from-pstn 
  5. signalling=fxs_ks 
  6. rxwink=300              ; Atlas seems to use long (250ms) winks 
  7. usecallerid=yes 
  8. hidecallerid=no 
  9. callwaiting=yes 
  10. usecallingpres=yes 
  11. callwaitingcallerid=yes 
  12. threewaycalling=yes 
  13. transfer=yes 
  14. canpark=yes 
  15. cancallforward=yes 
  16. callreturn=yes 
  17. echocancel=yes
  18. echocancelwhenbridged=yes
  19. faxdetect=incoming 
  20. echotraining=yes 
  21. hanguponpolarityswitch=yes ;拆线   
  22. answeronpolarityswitch=yes ;对端应答(用于计费) 
  23. rxgain=-6.3  #该处为修改后的值
  24. txgain=5.3  #该处为修改后的值
  25. callgroup=1 
  26. pickupgroup=1 
  27.  
  28. ;Uncomment these lines if you have problems with the disconection of your analog lines 
  29. ;busydetect=yes 
  30. ;busycount=3 
  31.  
  32.  
  33. immediate=no 
  34.  
  35. #include zapata_additional.conf 
  36. #include zapata-channels.conf 

 可参考: Asterisk卡常见问题汇总