Cannot set up Asterisk for my SIP provider

Hi all
I have installed an Asterisk version 13.17.2 with FreePBX 14.0.5.25.
The server is on Hyper-V virtual machine on a provate network and it has a private IP 192.168.0.18
I have configured two SIP phones on two extensions and i can make calls between these two.
I had an issue with my SIP provider, but now Asterisk is able to register to them.
My server is behind a SonicWall. I think i have configured correctly the access rules and NAT policies.
This is what i did:
I allowed port 5060 and 5061 UDP, and made a NAT policy which translates it from my public IP to my SIP server’s private IP. This policy is reflexive.
Same way i allowed range 6000-60000 UDP (which my provider asks for media) and made a NAT policy for it.
In this stage this is what happens:
My SIP server registers to my provider.
If i call my public SIP number, the selected extension rings and display’s the callers CID correctly.
When i pick up the extension, i hear nothing and the caller’s phone keeps ringing.
Same way, if i try to dial out, it cannot connect and after a long silence the Asterisk tells me that “The number is not answering”.
I have both inbound and outbound routes set up, also set up the dialling patterns.
I think that it must be Firewall or NAT related, but everything seems te be fine.
If someone can help me, i can provide any log, debug info, tcpdump, etc.
Thanks in advance,

Janos

It sounds like the 200 OK response is not reaching the provider. Obtain a protocol trace and check that it is going to the right place.

It could also be that the ACK is not reaching Asterisk. Check that that the Contact address in the 200 OK contain the public IP address.

Also confirm how you informed Asterisk of its public address and whether you are using chan_sip or chan_pjsip.

1 Like

Thank you David for your fast answer.
How do i do that?

https://wiki.asterisk.org/wiki/display/AST/Collecting+Debug+Information#CollectingDebugInformation-Enablechanneltechorfeaturespecificdebug

Contact address looks like this:
sip:my_public_number@my_external_IP:5060
Myabe this is the problem? It shouldn’t be my external IP?

That is correct.

That would suggest that the OK response isn’t reaching the provider.

The PBX tries 3 times to retransmit the SIP/2.0 200 OK to my SIP provider.
Problem is, that the To does not look to me.
I hope it is not a problem if i mention my provider.
So, the To is like this:
To: "Our_company_name"sip:our_phone_number@iristel.net:5060;tag=as28fe625c
this iristel.net domain is different of the one of the SIP server and will not answer.
In my trunk i don’t have this anywhere, both my host and fromdomain settings are different, an IP of the proxy, provided by the SIP provider.
Why does it want to transmit the 200 OK to this host?

It would have been part of the previous SIP messages. That is not where the packet itself is going, you can see where based on the IP address+port it is being sent to. Providing the full trace would allow a better answer from people here.

I can provide a full trace, but i am not sure that it is OK to share all the sensitive info (external IP, phone number, extensions, names, etc). Please advise.

You can replace certain attributes provided you state what they represent. What is sensitive is unique to each deployment/individual.

Thank you, i will do that.
What event should i log? When i get an incoming call and i cannot answer, or when i try to dial out unsuccessfully?

The more information the better, so you can even do both.

OK… what info should i replace?

What information do you consider sensitive to your deployment? IP address? extensions? names?

Good morning!
I made a debug log for the event when i call our number, the extension rings and i cannot answer it.
It is quite big so i better attach it is a text file:incoming.txt (28.5 KB)
I replaced the following:

our_phone_number
caller_phone_number
our_company_name
caller_name
our_IP

Please let me know if this is OK and if it helps i can make a log for an unsuccessful outgoing call,

Best regards,
Janos

Your 200 OK to the external network (208.x.x.x) is not getting ACKed. I don’t know if the To line would be the issue as they are the ones to have created this line in the first place.

The ACK would be sent to the information in the Contact header. I’m unable to open the file because of the Discourse CDN but if that is not correct, then the ACK would not be received.

The Contact address is the same as the one from which the request came.

It looks to me as though there is no valid route back to the source of the request.

(As a general principle, only the tag parameter on To headers matters.)

The SIP proxy set by me is 208.89.128.80
The 200 OK still wants to go to @iristel.net and NOT to sbc1.iristel.net
I don’t know where from comes that @iristel.net because I did not set it.
Of course in the mean time i am trying to solve the problem with their technical support, but it is still unclear to me if the problem is on their side or on mine.

Your 200 OK is going to sbc1.iristel.net:

<------------>

e[Kfreepbx*CLI>
e[0KRetransmitting #1 (no NAT) to 208.89.128.80:5060:
SIP/2.0 200 OK
Via: SIP/2.0/UDP 208.89.128.80:5060;

nslookup for that IP gives this:

Name: sbc1.iristel.net
Address: 208.89.128.80

I think you’re still looking at the text of the To header, which is something that they inserted (it is their name for you), and this really shouldn’t matter in most cases, but also, the fact is that the To is unchanged from the initial request that they generated except for the addition of the tag.