A
A
aleksey_k2014-08-19 14:42:03
Asterisk
aleksey_k, 2014-08-19 14:42:03

Why is asterisk not registering behind NAT (Request sent)?

Good afternoon!
There is asterisk 1.18.22 on Linux, located inside NAT. I'm trying to set up registration with a local provider (located outside NAT). Ports 5060 (for SIP signaling) and 10000-20000 (for RTP) are forwarded on the gateway.
The provider config is in asterisk realtime.
Registration line:
register -> xxxxxx:[email protected]_name/xxxxxx
I registered localnet. externaddr - do not set - because maybe I will have 2 providers.
in realtime:

host = ip_провайдера
nat = yes
type = friend
canreinvite = no
fromuser = xxxxxx (соответствует строке register)
fromdomain = ip_провайдера
secret = yyyyyy (соответствует строке register)
disallow = all
allow = alaw; ulaw; g729; gsm
username = xxxxxx
defaultuser = xxxxxx
insecure = port, invite

Attention, now the question is: after sip reload in asterisk, I get the output "Request Sent"? with the sip show registry command. I take a dump from the network card - the packet leaves, but the answer from the server does not come.
After shamanism with the host parameter, namely with putting my external ip-address into it and receiving No Authentication in the response, I returned the host back to the provider's IP. And all of a sudden, the number registered, this is what asterisk sends in the register packet:
REGISTER sip:ip_провайдера SIP/2.0
Via: SIP/2.0/UDP 192.168.1.11:5060;branch=z9hG4bK561c1ad1;rport
Max-Forwards: 70
From: <sip:[email protected]_провайдера>;tag=as3b954948
To: <sip:[email protected]_провайдера>
Call-ID: [email protected]_провайдера
CSeq: 102 REGISTER
User-Agent: Asterisk PBX 1.8.22.0
Expires: 120
Contact: <sip:[email protected]:5060>
Content-Length: 0

Compared with the packages that I sent before - absolutely the same. Why is the number registered now, but not before? Is it possible that the provider just cached the address of my server and after a while there will be no connection?

Answer the question

In order to leave comments, you need to log in

2 answer(s)
V
Vladislav Gasanov, 2014-08-21
@aleksey_k

We also keep our server behind NAT. And they had problems when Asterisk did not know their external IP, because. he indicated the local IP in the signal fields, then the provider's server did not allow registration.
Therefore, in sip.conf:
externip= or externhost=
and update accordingly when switching providers.

V
Vladimir, 2014-08-19
@rostel

sip.conf
[general]
externaddr or externhost?
localnet?

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question