How to troubleshoot "Failed to authenticate on REGISTER"

siptrunk
Tags: #<Tag:0x00007f70263f31b0>

(Dandumit) #1

Hello,
I have installed FreePBX , I have defined a CHAN_SIP trunk and I have managed to place calls from FreePBX to outside world using that trunk (at outgoing section there are a lot of parameters but it’s working)

Stupid situation that on incoming section where is only one string , does not work and I cannot receive calls.

I have left “Allow SIP Guests” to on and “allow anonymous sip calls " to no.
I am getting always annoying " Failed to authenticate on REGISTER to”
How could I troubleshoot this ?

Thank you,
Daniel


(Jeremy Lizzotte) #2

Did you be sure to create an incoming route? It this cloud based or on premise?


(Dandumit) #3

I have created an incoming route (nothing much to configure there) it’s on premise (local computer)


(Jeremy Lizzotte) #4

is it IP based or registration based sip trunk? and is it set to 5060? with ports open on firewall for 5060 and RTP?


(Dandumit) #5

somehow connection it’s in intern I do not have to worry about ports open.

But IP based it’s a track to dig. I am now on registration.


#6

In PEER Details section, add
insecure=port,invite

If you still have trouble, post all trunk settings (mask secret, account and phone numbers, anything else you consider personal).


(Dandumit) #7

@jlizzotte04 @Stewart1 please help because I think that I will loose my minds soon.

only way to get inbound calls is with “Allow Anonymous Inbound SIP Calls”

This is my connection string (but again to place calls from freepbx to outside it’s working )

defaultuser=user
secret=pass
host=sip.rcs-rds.ro
fromdomain=sip.rcs-rds.ro
fromuser=user
type=peer
qualify=yes
insecure=port,invite
disallow=all
context=from-trunk
canreinvite=no
allow=alaw&ulaw
nat=yes

and for outgoing

user:pass@sip.rcs-rds.ro/pass

Trunk it’s defined as chan_sip .
I guess that I am using registration . I guess that credentials and config string it’s completed well since outgoing ok.

I was guessing / suspecting / digging around NAT configuration . My little NTW setup looks like

Internet (pbx agents) -> pfsense ->192.168.1.23 ETH1 ->FreePBX

SIpTrunkPRovider-> ONT box -> 192.168.32.110-> ETH0->FreePBX

I have declared 2 static routes toward my SIP trunk provider. all ntw setup it’s detected like in picture below in settings>asterisk sip settings.

Thank you for any suggestion I am simply clueless.


(Dave Burgess) #8

Your trunk definition has to allow for the incoming connections. It sounds like your provider is using IP Authentication to send the calls to your machine. If that’s the case, you need to look at what IP addresses the calls are coming from. Once you know those addresses, you will need to do one of the following:

  1. In Chan-SIP, set up a trunk for each and every IP address. The settings will be the same for each one, they just need to identify the IP address of your provider’s server.
  2. In PJ-SIP, set up your trunk and on the Advanced Settings page, add the list of all of your provider’s IP address in the “Permit” field (about 6 lines down from the top).

(Dandumit) #9

@cynjut thank you for suggestion !
I am using chan-SIP. PJSIP didn’t work.
I have read this on other threads. there are only 2 IP addresses .I have tried this . Please suggest what should I fill in Settings > Asterisk Sip settings NAT section and sip legacy settings ?
Do those settings matter on IN route ? (Amazing out route that I consider far more complicated it’s working)


(Dave Burgess) #10

We can wrestle that bear later. My suspicion is that your config would be a lot easier with PJ-SIP.

In your current config, instead of “type=peer” use these settings:

This sets up your inbound to use the settings in your chan-sip setup. The x.x.x.x is the IP address of the server. If there’s only one, you only need one trunk, but you need one for each IP address of the ITSP phone server. If they have two, you need two trunks. If they have 50, you need 50 trunks (something that PJ-SIP simplifies).


(Dandumit) #11

How could I put 2 trunks with same user context ? because I have to configure USER Context and this one it’s restricted to only one for all trunks


(Dave Burgess) #12

You can’t. You need two trunks, one for each host. That’s why PJ-SIP is an improvement - you only need one trunk for both of the addresses (one in the main section and one in the “Permit” section).

Also, all of the settings can go in your Outgoing settings when you use “type=friend”. This way, your settings are used for the entire trunk. Get rid of the “type=peer” there and replace it with the “type=friend” and you should get a 50% reduction in your Anonymous errors. Once you get that one working, copy the settings to a second trunk definition and add the second server address and you should be on your way.