Zavr2008 писал(а): Астеру четко нужно прописать что у него и как, ..
Нет, не нужно чётко прописать, а Вам - нужно.
Напишу ещё раз:
Код: Выделить всё
Asterisk как SIP сервер на публичном адресе
Вы считаете, что надо использовать externip/externhost? Потому что иногда помогало?
Процитирую первоисточник - файл sip.conf:
Код: Выделить всё
;----------------------------------------- NAT SUPPORT ------------------------
;
; WARNING: SIP operation behind a NAT is tricky and you really need
; to read and understand well the following section.
;
; When Asterisk is behind a NAT device, the "local" address (and port) that
; a socket is bound to has different values when seen from the inside or
; from the outside of the NATted network. Unfortunately this address must
; be communicated to the outside (e.g. in SIP and SDP messages), and in
; order to determine the correct value Asterisk needs to know:
;
; + whether it is talking to someone "inside" or "outside" of the NATted network.
; This is configured by assigning the "localnet" parameter with a list
; of network addresses that are considered "inside" of the NATted network.
; IF LOCALNET IS NOT SET, THE EXTERNAL ADDRESS WILL NOT BE SET CORRECTLY.
; Multiple entries are allowed, e.g. a reasonable set is the following:
;
; localnet=192.168.0.0/255.255.0.0 ; RFC 1918 addresses
; localnet=10.0.0.0/255.0.0.0 ; Also RFC1918
; localnet=172.16.0.0/12 ; Another RFC1918 with CIDR notation
; localnet=169.254.0.0/255.255.0.0 ; Zero conf local network
;
; + the "externally visible" address and port number to be used when talking
; to a host outside the NAT. This information is derived by one of the
; following (mutually exclusive) config file parameters:
;
; a. "externaddr = hostname[:port]" specifies a static address[:port] to
; be used in SIP and SDP messages.
; The hostname is looked up only once, when [re]loading sip.conf .
; If a port number is not present, use the port specified in the "udpbindaddr"
; (which is not guaranteed to work correctly, because a NAT box might remap the
; port number as well as the address).
; This approach can be useful if you have a NAT device where you can
; configure the mapping statically. Examples:
;
; externaddr = 12.34.56.78 ; use this address.
; externaddr = 12.34.56.78:9900 ; use this address and port.
; externaddr = mynat.my.org:12600 ; Public address of my nat box.
; externtcpport = 9900 ; The externally mapped tcp port, when Asterisk is behind a static NAT or PAT.
; ; externtcpport will default to the externaddr or externhost port if either one is set.
; externtlsport = 12600 ; The externally mapped tls port, when Asterisk is behind a static NAT or PAT.
; ; externtlsport port will default to the RFC designated port of 5061.
;
; b. "externhost = hostname[:port]" is similar to "externaddr" except
; that the hostname is looked up every "externrefresh" seconds
; (default 10s). This can be useful when your NAT device lets you choose
; the port mapping, but the IP address is dynamic.
; Beware, you might suffer from service disruption when the name server
; resolution fails. Examples:
;
; externhost=foo.dyndns.net ; refreshed periodically
; externrefresh=180 ; change the refresh interval
;
; Note that at the moment all these mechanism work only for the SIP socket.
; The IP address discovered with externaddr/externhost is reused for
; media sessions as well, but the port numbers are not remapped so you
; may still experience problems.
When Asterisk is behind a NAT device, the "local" address (and port)..........
Авторизоавнный перевод: Если Астериск за НАТ устройством, локальный адрес (и порт).............
И ЭТО НЕ ТОТ СЛУЧАЙ. А иногда и кроличьей лапкой постучать по серверу помогало, нет?
externaddr и externhost используются только в этом случае. Я готов доказать, что на сервере с двумя интерфейсами - eth0 & eth1, публичным и внутренним ИП адресом, никаких externaddr и externhost также указыввать не нужно.