DID Logic + FreePBX behind NAT

Hi,

I am very new to FreePBX and am trying to setup a DDI Logic trunk.

My problem is that all the registration requests FreePBX sends to DD Logic time out. This is the outgoing envelope (fifth attempt):

Retransmitting #5 (NAT) to 178.63.143.236:5060:
REGISTER sip:sip.didlogic.net SIP/2.0
Via: SIP/2.0/UDP 10.1.1.200:5061;branch=z9hG4bK7e0b49f1;rport
Max-Forwards: 70
From: sip:XXXXX_sip.didlogic.net;tag=as6a40c342
To: sip:XXXXX_sip.didlogic.net
Call-ID: [email protected]
CSeq: 146 REGISTER
Supported: replaces, timer
User-Agent: FPBX-13.0.11(13.5.0)
Expires: 120
Contact: sip:[email protected]:5061
Content-Length: 0

I am pretty sure the problem is in the “CONTACT” line, as it refers to my internal IP.

The router is forwarding 5060 and 5061 to this machine and I have setup the external host name. I would expect that name to be in the contact line instead of the internal IP.

Any hints ?

Thank you very much.

PS: I had to replace @ by _ and remove pointy brackets otherwise the board wouldn’t allow me to post

Hi,

Change your settings in the “Asterisk SIP Settings” module. Select the static IP and try to auto configure it. If it fails, set it manually and apply the settings.

Thank you,

Daniel Friedman
Trixton LTD.

Hi,

Thanks for the reply.

This is what I was doing just now, with little changes. The envelope now looks like this:

Retransmitting #3 (NAT) to 178.63.143.236:5060:
REGISTER sip:sip.didlogic.net SIP/2.0
Via: SIP/2.0/UDP XXX.XXX.XXX.XXX:5061;branch=z9hG4bK10101b96;rport
Max-Forwards: 70
From: sip:XXXXX_sip.didlogic.net>;tag=as56b43f4b
To: sip:XXXXX_sip.didlogic.net
Call-ID: [email protected]
CSeq: 138 REGISTER
Supported: replaces, timer
User-Agent: FPBX-13.0.11(13.5.0)
Expires: 120
Contact: sip:443300108980_XXX.XXX.XXX.XXX:5061
Content-Length: 0

Still times out though.

As my IP is dynamic, I would definitely need to use a domain name instead of an IP, or I would have to manually come to SIP Settings and change it, no ?

Hi,

Every time that your public ip is changing, you must change the nat settings in your sip configuration. If you will not change it, you will have problems with calls.

Thank you,

Daniel Friedman
Trixton LTD.

I refuse to believe this is the case. This is not the early 90s anymore and surely there is a mechanism for NAT’ed boxes behind a dynamic IP.

Hi,

If you refuse to accept this, you can always join the Asterisk development team and help to design a new NAT module.

Thank you,

Daniel Friedman
Trixton LTD.

I just checked and there is support for dynamic IP, via means of a domain name.

Are you implying this don’t work properly ?

Hello,

I am not implying, I am telling you that it is not working properly, but not because of the Asterisk, it is because of the SIP protocol.

Anyway, if you are using a dynamic public ip (that changes all the time) you will need to install a client that will update your ip in dynamic services (dyndns, no-ip etc.) if you want to use a domain instead an ip.

Thank you,

Daniel Friedman
Trixton LTD.

Hi Daniel,

Thanks for your reply.

I have a client updating my domain records already for other services already.

Just to be sure: what do you know for sure is not working? Setting up “dynamic” and using a hostname in asterisk ?

Hi,

I am sorry my friend, but you lost me completely. Can you start over? Please paste your sip trunk settings here.

Thank you,

Daniel Friedman
Trixton LTD.

Hi,

Apologies.

I sorted out the trunk problem now, but I got interested in the dynamic IP feature.

I’m going to configure Dynamic IP with Dynamic Host. Is this the combination you know is not working ?

Thanks,
G.

Hi,

When you write host=dynamic it means that the end device should register to you (the server). As you are the client and not the server (in cse of sip providers), you need to send the registration request (the sip register command).

As for the dynamic ip (the public ip of the server) in a NAT environment, you should always update your external ip in the sip nat settings if it changes in order to avoid one way audio problems.

Thank you,

Daniel Friedman
Trixton LTD.