【问题标题】:NAT configuration for SIPSIP 的 NAT 配置
【发布时间】:2016-06-21 07:23:55
【问题描述】:

我有这个网络配置:

SIP Provider -> Mikrotik CCR 作为我的网络网关 (NAT) -> Asterisk PBX -> Mikrotik RB 作为 CPE 设备 (NAT) -> RB 后面的 SIP 设备。

我必须如何在星号和客户设备上配置 NAT?

实际上我有一些单向音频的问题,但不是所有通话。

感谢您的建议

【问题讨论】:

    标签: asterisk sip nat pbx


    【解决方案1】:
    Asterisk can both act as a SIP client and a SIP server. Asterisk as a SIP client is configured with type=peer (or type=friend) in one or more client sections of sip.conf and, optionally, one or more register=> lines in the [general] section of sip.conf. Asterisk as a SIP server connects clients (SIP Phones) configured by specifying their own username, secret, etc. (and either type=peer or type=friend) in client sections of sip.conf.
    
    Asterisk SIP channels in a NATed network can be generalized like this:
    
        Asterisk as a SIP client behind nat, connecting to outside SIP Proxies
        Asterisk as a SIP client behind nat, connecting to inside SIP proxies
        Asterisk as a SIP server behind nat, clients on the outside connecting to Asterisk
        Asterisk as a SIP server behind nat, clients on the outside behind a second NAT connecting to Asterisk
        Asterisk as a SIP server behind nat, clients on the inside connecting to Asterisk
        Asterisk as a SIP client outside nat, connecting to outside SIP proxies
        Asterisk as a SIP client outside nat, connecting to inside SIP proxies
        Asterisk as a SIP server outside nat, clients on the outside connecting to Asterisk
        Asterisk as a SIP server outside nat, clients on the inside connecting to Asterisk
    
    
    
    Every setup works somewhere, but it depends on the client, the NAT, the server and many other factors. In most cases, 1 and 3 is broken. SIP is a peer-to-peer protocol and a NAT can be generalized and simplified as a solution that allows clients on the inside to connect to servers on the outside and _not_ allow clients on the outside to connect to any server on the inside.
    
        #1 works with a NAT-supporting proxy as SIP Express router as the outside proxy. (Get an account at IPtel.org and try!). Fails with Free World Dialup.
        #2 Works- no NAT in between
        #3 Works with port forwarding and some header mangling magic tips
        #4 Works with port forwarding, STUN on the remote and some fine tuning of RTP port allocation
        #5 Works - no NAT in between
        #6 is no problem. No NAT in the middle
        #7 is a problem if no port forwarding is done, similar to 3 above.
        #8 is no problem. No NAT in the middle
        #9 is solved with nat=yes and qualify=xxx in sip.conf for the client in most cases. Some clients (X-lite) assist themselves by using STUN and sending UDP keep-alive packets. Qualify sends keep-alive packets from Asterisk to the client on the inside.
    

    http://www.voip-info.org/wiki/view/Asterisk+SIP+NAT+solutions

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2014-01-27
      • 1970-01-01
      • 2011-08-17
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2018-11-17
      相关资源
      最近更新 更多