SIP provider account registration problem

Hi here.
Please help me with my issue:
I have two SIP accounts with different SIP providers registered in my Freepbx (FreePBX 15.0.16.81), one of them registered status and works correctly but the second one lost registration and and the status is “120 Request Sent”. But this account always worked coorectly, I did only one thing: I changed the point in Settings --> Asterisk SIP settings --> General SIP settings --> Allow Anonymous Inbound SIP Calls to “YES” and after that I’ve lost the registration, and now I’m changing to “NO” nothing was changed. Please halp me anyone. Thank you.

Hi @armano,
its difficult to guess without Asterisk Debug log and PCAP. But you can try below changes. I hope to works. Next time try to add Asterisk Debug ON core set debug on log to show us from which direction your are receiving this error message.

1- For security purpose set Allow SIP Guests : NO and Allow Anonymous Inbound SIP Calls : NO
2- Add your SIP Trunk FQDN or IP address on PBX Firewall and on Your Router Firewall TRUSTED network.
3- Your Router if you have SIP ALG must be Disable.

Note: you can use in Linux CLI sngrep command will give you more idea.

Thanks.

Shahin

Hi Shahin,

Thank you for your answer and advieces.
I did all you write here but NO results.
Here is debug info:

[2020-12-11 12:52:56] NOTICE[4902]: chan_sip.c:15906 sip_reg_timeout: – Registration for ‘[email protected]’ timed out, trying again (Attempt #6)

[2020-12-11 12:53:16] NOTICE[4902]: chan_sip.c:15906 sip_reg_timeout: – Registration for ‘[email protected]’ timed out, trying again (Attempt #7)

[2020-12-11 12:53:36] NOTICE[4902]: chan_sip.c:15906 sip_reg_timeout: – Registration for ‘[email protected]’ timed out, trying again (Attempt #8)

[2020-12-11 12:53:56] NOTICE[4902]: chan_sip.c:15906 sip_reg_timeout: – Registration for ‘[email protected]’ timed out, trying again (Attempt #9)

[2020-12-11 12:53:57] WARNING[31191][C-00000396]: app_dial.c:2527 dial_exec_full: Unable to create channel of type ‘SIP’ (cause 20 - Subscriber absent)

[2020-12-11 12:54:16] NOTICE[4902]: chan_sip.c:15906 sip_reg_timeout: – Registration for ‘[email protected]’ timed out, trying again (Attempt #10)

[2020-12-11 12:54:36] NOTICE[4902]: chan_sip.c:15906 sip_reg_timeout: – Registration for ‘[email protected]’ timed out, trying again (Attempt #11)

[2020-12-11 12:54:56] NOTICE[4902]: chan_sip.c:15906 sip_reg_timeout: – Registration for ‘[email protected]’ timed out, trying again (Attempt #12)

[2020-12-11 12:55:16] NOTICE[4902]: chan_sip.c:15906 sip_reg_timeout: – Registration for ‘[email protected]’ timed out, trying again (Attempt #13)

[2020-12-11 12:55:36] NOTICE[4902]: chan_sip.c:15906 sip_reg_timeout: – Registration for ‘[email protected]’ timed out, trying again (Attempt #14)

[2020-12-11 12:55:56] NOTICE[4902]: chan_sip.c:15906 sip_reg_timeout: – Registration for ‘[email protected]’ timed out, trying again (Attempt #15)

[2020-12-11 12:56:16] NOTICE[4902]: chan_sip.c:15906 sip_reg_timeout: – Registration for ‘[email protected]’ timed out, trying again (Attempt #16)

[2020-12-11 12:56:32] WARNING[31461][C-0000039b]: chan_sip.c:22996 func_header_read: This function can only be used on SIP channels.

[2020-12-11 12:56:32] WARNING[31461][C-0000039b]: chan_sip.c:22996 func_header_read: This function can only be used on SIP channels.

[2020-12-11 12:56:32] WARNING[31461][C-0000039b]: chan_sip.c:22996 func_header_read: This function can only be used on SIP channels.

[2020-12-11 12:56:32] WARNING[31461][C-0000039b]: chan_sip.c:22996 func_header_read: This function can only be used on SIP channels.

[2020-12-11 12:56:32] WARNING[31461][C-0000039b]: chan_sip.c:22996 func_header_read: This function can only be used on SIP channels.

[2020-12-11 12:56:32] WARNING[31461][C-0000039b]: chan_sip.c:22996 func_header_read: This function can only be used on SIP channels.

[2020-12-11 12:56:32] WARNING[31461][C-0000039b]: chan_sip.c:22996 func_header_read: This function can only be used on SIP channels.

[2020-12-11 12:56:32] WARNING[31461][C-0000039b]: chan_sip.c:22996 func_header_read: This function can only be used on SIP channels.

[2020-12-11 12:56:32] WARNING[31461][C-0000039b]: chan_sip.c:22996 func_header_read: This function can only be used on SIP channels.

[2020-12-11 12:56:32] WARNING[31461][C-0000039b]: chan_sip.c:22996 func_header_read: This function can only be used on SIP channels.

[2020-12-11 12:56:32] WARNING[31461][C-0000039b]: chan_sip.c:22996 func_header_read: This function can only be used on SIP channels.

[2020-12-11 12:56:32] WARNING[31461][C-0000039b]: chan_sip.c:22996 func_header_read: This function can only be used on SIP channels.

[2020-12-11 12:56:36] NOTICE[4902]: chan_sip.c:15906 sip_reg_timeout: – Registration for ‘[email protected]’ timed out, trying again (Attempt #17)

[2020-12-11 12:56:40] WARNING[31463][C-0000039c]: Ext. s:7 @ from-sip-external: “Rejecting unknown SIP connection from 156.96.117.190”

[2020-12-11 12:56:47] WARNING[31464][C-0000039d]: Ext. s:7 @ from-sip-external: “Rejecting unknown SIP connection from 156.96.156.242”

[2020-12-11 12:56:56] NOTICE[4902]: chan_sip.c:15906 sip_reg_timeout: – Registration for ‘[email protected]’ timed out, trying again (Attempt #18)

[2020-12-11 12:57:12] WARNING[4902]: chan_sip.c:4068 retrans_pkt: Retransmission timeout reached on transmission 1588171367-1168395085-80921383 for seqno 1 (Critical Response) – See https://wiki.asterisk.org/wiki/display/AST/SIP+Retransmissions

Packet timed out after 31999ms with no response

[2020-12-11 12:57:16] NOTICE[4902]: chan_sip.c:15906 sip_reg_timeout: – Registration for ‘[email protected]’ timed out, trying again (Attempt #19)

[2020-12-11 12:57:19] WARNING[4902]: chan_sip.c:4068 retrans_pkt: Retransmission timeout reached on transmission 1517627256-1943580550-925136789 for seqno 1 (Critical Response) – See https://wiki.asterisk.org/wiki/display/AST/SIP+Retransmissions

Packet timed out after 32000ms with no response

[2020-12-11 12:57:36] WARNING[31540][C-0000039e]: Ext. s:7 @ from-sip-external: “Rejecting unknown SIP connection from 156.96.117.190”

[2020-12-11 12:57:36] NOTICE[4902]: chan_sip.c:15906 sip_reg_timeout: – Registration for ‘[email protected]’ timed out, trying again (Attempt #20)

[2020-12-11 12:57:56] NOTICE[4902]: chan_sip.c:15906 sip_reg_timeout: – Registration for ‘[email protected]’ timed out, trying again (Attempt #21)

[2020-12-11 12:58:08] WARNING[4902]: chan_sip.c:4068 retrans_pkt: Retransmission timeout reached on transmission 685828132-37438645-696843105 for seqno 1 (Critical Response) – See https://wiki.asterisk.org/wiki/display/AST/SIP+Retransmissions

Packet timed out after 32001ms with no response

[2020-12-11 12:58:16] NOTICE[4902]: chan_sip.c:15906 sip_reg_timeout: – Registration for ‘[email protected]’ timed out, trying again (Attempt #22)

[2020-12-11 12:58:29] WARNING[31615][C-0000039f]: Ext. s:7 @ from-sip-external: “Rejecting unknown SIP connection from 156.96.117.190”

[2020-12-11 12:58:36] NOTICE[4902]: chan_sip.c:15906 sip_reg_timeout: – Registration for ‘[email protected]’ timed out, trying again (Attempt #23)

[2020-12-11 12:58:56] NOTICE[4902]: chan_sip.c:15906 sip_reg_timeout: – Registration for ‘[email protected]’ timed out, trying again (Attempt #24)

[2020-12-11 12:59:01] WARNING[4902]: chan_sip.c:4068 retrans_pkt: Retransmission timeout reached on transmission 907812729-838927107-1211432787 for seqno 1 (Critical Response) – See https://wiki.asterisk.org/wiki/display/AST/SIP+Retransmissions

Packet timed out after 31999ms with no response

[2020-12-11 12:59:16] NOTICE[4902]: chan_sip.c:15906 sip_reg_timeout: – Registration for ‘[email protected]’ timed out, trying again (Attempt #25)

Hi @armano
Did you catch anything on sngrep ? try to run it and you can do Filter ( F7 )
Press F7 --> Destination add your SIP Trunk IP address and Save. Then you should see all SIP packages between SIP Trunk and your PBX.

Also try to run below command. ( if Trunk IP is wrong pls change it )
nmap -sU -p 5060 195.90.150.235

my example.
35

Thanks.

Shahin

Hi Shahin,

Thank you for your help and all you suggestions. Here is all the results please:

  1. sngrep
    [ ] 3 REGISTER [email protected] [email protected] 24 192.168.50.222:5062 195.90.150.235:5060
    [ ] 9 OPTIONS [email protected] 195.90.150.235 5 192.168.50.222:5062 195.90.150.235:5060
    [ ] 10 OPTIONS [email protected] 195.90.150.235 5 192.168.50.222:5062 195.90.150.235:5060
    [ ] 39 OPTIONS [email protected] 195.90.150.235 5 192.168.50.222:5062 195.90.150.235:5060
    [ ] 40 OPTIONS [email protected] 195.90.150.235 5 192.168.50.222:5062 195.90.150.235:5060
    [ ] 66 OPTIONS [email protected] 195.90.150.235 5 192.168.50.222:5062 195.90.150.235:5060
    [ ] 68 OPTIONS [email protected] 195.90.150.235 5 192.168.50.222:5062 195.90.150.235:5060
    [ ] 109 OPTIONS [email protected] 195.90.150.235 5 192.168.50.222:5062 195.90.150.235:5060
    [ ] 110 OPTIONS [email protected] 195.90.150.235 5 192.168.50.222:5062 195.90.150.235:5060

  2. nmap -sU -p 5060 195.90.150.235

Starting Nmap 6.40 ( http://nmap.org ) at 2020-12-11 13:22 MSK
Nmap scan report for 195.90.150.235
Host is up (0.00023s latency).
PORT STATE SERVICE
5060/udp open|filtered sip

Nmap done: 1 IP address (1 host up) scanned in 0.31 seconds

Press on it and see Which direction you are receiving 120 code.

Here is results pleaser

Could you pls pass here your PBX Trunk configuration settings. ***( Pls hide your Trunk User name and Password )

Yes, sure.
here it please:

username=hiden
type=friend
secret=hiden
registersip=yes
qualify=yes
port=5060
insecure=port,invite
host=195.90.150.235
fromuser=hiden
fromdomain=195.90.150.235
dtmfmode=auto
disallow=all
canreinvite=no
allow=alaw,ulaw

Hello. Is there any suggestions?

You are sending REGISTER requests but getting no reply.

Possibly, your router/firewall is blocking the request and/or the reply or there is an incorrect port forward set up.

Are you sure that is correct? Most providers supply a domain name for their server, rather than a numeric IP address. If they did publish a numeric IP, one would expect a Google search to have many hits (support pages, other users posting their configs, other users with problems, etc.) But
https://www.google.com/search?q="195.90.150.235"
shows only your posts and generic IP info sites.

Can you successfully register to this account from an IP phone, softphone or SIP app? If so, please post those settings, which we can compare to your Asterisk settings. If not, try to troubleshoot that first, using a softphone, which should be much easier to debug.

Hello Stewart1.

Thank you for your reply. I think you are right that my firewall blocks ports, but what port block I can’t find.

The IP address is true as my SIP provider use IP address not domain, and I can successfully register from Zoiper and everutying works.

But here is one mystery, I have anoyher SIP account from the other SIP provider registered in my Asterisk freepbx wich uses 5061 port and everything works great without any port forwarding. The not working SIP provider use IP address blocking system which can block my static IP address I think. Is there any ideas about this?

If Zoiper is working on the same LAN as your PBX, then the provider couldn’t be blocking your IP address, assuming that you have only one public address.

If you didn’t need to forward any ports to get Zoiper working, then you shouldn’t need any to get Asterisk to register (though you might need forwarding for external extensions, etc.)

By default, FreePBX has pjsip listening on port 5060 and chan_sip on 5160, but your chan_sip bind port seems to be 5062. Did you have some reason to change that?

Useful data for troubleshooting would be your Zoiper settings, Zoiper logs showing a REGISTER request and the resulting response, router make/model and any special settings in it that are related to VoIP.

Zoiper working from absolutely another IP address and works fine, but when I am connecting to my local wifi where Asterisk is represented Zoiper stopped working.

I have two other SIP account from different SIP providers and those working correctly without any port forwarding on firewall.

My don’t working SIP provider use IP address filtering and I think he is blocking my static IP address.

I will try to get from my mobile phone Zoiper log files.

I recommend that you solve this problem first. You could ask your provider about the block, or determine whether your router/firewall is causing trouble, for example by connecting a PC directly to the modem, or by capturing traffic on the WAN interface of the router.

I attached a screenshot for you, can you tell me please how can I disable to do not receive parametr OPTIONS? Only to get register.
My provider told that I shouldn’t need to get OPTIONS.

Press F7 to filter in sngrep

I already did it. See the picture please

The picture shows that you did NOT press F7 and deselect OPTIONS from the main screen

1 Like

Are you saying that they are blocking your IP address because you are sending OPTIONS, they don’t accept them and don’t want the traffic? If so, set
qualify=no
for the trunk and Asterisk will no longer send OPTIONS. However, you will still have to contact the provider and ask them to unban you.