Quick call test failed (Hello world - Asterisk and Zoiper)

Hello,
I followed this guide (Hello World - Asterisk Documentation).
Asterisk SIP is connected to Zoiper successfully.
But when I dial 100 in Zoiper, but call to phone (100) is rejected. 404 not found error is issued.
What’s missing?

The full log (at least verbosity 3), your dialplan, and the endpoint definition for the originating caller are missing from your original question. The verbose logs are likely to answer the question.

[Dec  6 13:26:48] NOTICE[716062]: res_pjsip_session.c:4022 new_invite:  6001: Call (UDP:65.108.239.102:25217) to extension '100' rejected because extension not found in context 'from-internal'.
[Dec  6 14:25:06] NOTICE[716062]: res_pjsip/pjsip_distributor.c:676 log_failed_request: Request 'OPTIONS' from '"sipvicious" <sip:100@1.1.1.1>' failed for '45.155.91.237:5170' (callid: 1171921489723402068646712) - No matching endpoint found
[Dec  6 14:30:25] NOTICE[716062]: res_pjsip/pjsip_distributor.c:676 log_failed_request: Request 'INVITE' from '"sipvicious" <sip:100@1.1.1.1>' failed for '96.44.142.190:5123' (callid: 292299484286694478566907) - No matching endpoint found
[Dec  6 14:30:51] NOTICE[716062]: res_pjsip/pjsip_distributor.c:676 log_failed_request: Request 'INVITE' from '"sipvicious" <sip:100@1.1.1.1>' failed for '96.44.142.186:5181' (callid: 610502835501183249425163) - No matching endpoint found
[Dec  6 14:33:52] NOTICE[716062]: res_pjsip/pjsip_distributor.c:676 log_failed_request: Request 'INVITE' from '"sipvicious" <sip:100@1.1.1.1>' failed for '96.44.142.10:5086' (callid: 911587086646409894759718) - No matching endpoint found
[Dec  6 14:37:11] NOTICE[716062]: res_pjsip/pjsip_distributor.c:676 log_failed_request: Request 'OPTIONS' from '<sip:nm@nm>' failed for '128.14.237.237:60793' (callid: 50000) - No matching endpoint found
[Dec  6 14:37:22] NOTICE[716062]: res_pjsip/pjsip_distributor.c:676 log_failed_request: Request 'INVITE' from '"sipvicious" <sip:100@1.1.1.1>' failed for '96.44.142.14:5070' (callid: 883452357759521940877550) - No matching endpoint found
[Dec  6 14:37:30] NOTICE[716062]: res_pjsip/pjsip_distributor.c:676 log_failed_request: Request 'INVITE' from '"sipvicious" <sip:100@1.1.1.1>' failed for '96.44.143.190:5219' (callid: 1167388790249792657192639) - No matching endpoint found
[Dec  6 15:08:08] NOTICE[717199]: chan_skinny.c:7531 skinny_session: Starting Skinny session from 165.154.172.108
[Dec  6 15:08:08] ERROR[717199]: chan_skinny.c:7585 skinny_session: Event Message is NULL from socket 19, This is bad
[Dec  6 15:08:08] NOTICE[717199]: chan_skinny.c:7647 skinny_session: Skinny Session returned: Success
[Dec  6 15:08:08] NOTICE[717199]: chan_skinny.c:7473 skinny_session_cleanup: Ending Skinny session from unknown at 165.154.172.108
[Dec  6 15:08:09] NOTICE[717200]: chan_skinny.c:7531 skinny_session: Starting Skinny session from 165.154.172.108
[Dec  6 15:08:19] WARNING[717200]: chan_skinny.c:7578 skinny_session: Unable to read header. Only found 0 bytes.
[Dec  6 15:08:19] NOTICE[717200]: chan_skinny.c:7647 skinny_session: Skinny Session returned: Success
[Dec  6 15:08:19] NOTICE[717200]: chan_skinny.c:7473 skinny_session_cleanup: Ending Skinny session from unknown at 165.154.172.108
[Dec  6 15:08:19] NOTICE[717201]: chan_skinny.c:7531 skinny_session: Starting Skinny session from 165.154.172.108
[Dec  6 15:08:19] WARNING[717201]: chan_skinny.c:7595 skinny_session: Skinny packet too large (1415867720 bytes), max length(2000 bytes)
[Dec  6 15:08:19] NOTICE[717201]: chan_skinny.c:7647 skinny_session: Skinny Session returned: Success
[Dec  6 15:08:19] NOTICE[717201]: chan_skinny.c:7473 skinny_session_cleanup: Ending Skinny session from unknown at 165.154.172.108
[Dec  6 15:08:20] NOTICE[717202]: chan_skinny.c:7531 skinny_session: Starting Skinny session from 165.154.172.108
[Dec  6 15:08:20] WARNING[717202]: chan_skinny.c:7595 skinny_session: Skinny packet too large (1852375574 bytes), max length(2000 bytes)
[Dec  6 15:08:20] NOTICE[717202]: chan_skinny.c:7647 skinny_session: Skinny Session returned: Success
[Dec  6 15:08:20] NOTICE[717202]: chan_skinny.c:7473 skinny_session_cleanup: Ending Skinny session from unknown at 165.154.172.108
[Dec  6 15:08:21] NOTICE[717203]: chan_skinny.c:7531 skinny_session: Starting Skinny session from 165.154.172.108
[Dec  6 15:08:21] WARNING[717203]: chan_skinny.c:7595 skinny_session: Skinny packet too large (542393675 bytes), max length(2000 bytes)
[Dec  6 15:08:21] NOTICE[717203]: chan_skinny.c:7647 skinny_session: Skinny Session returned: Success
[Dec  6 15:08:21] NOTICE[717203]: chan_skinny.c:7473 skinny_session_cleanup: Ending Skinny session from unknown at 165.154.172.108
[Dec  6 15:08:22] NOTICE[717204]: chan_skinny.c:7531 skinny_session: Starting Skinny session from 165.154.172.108
[Dec  6 15:08:22] WARNING[717204]: chan_skinny.c:7578 skinny_session: Unable to read header. Only found 4 bytes.
[Dec  6 15:08:22] NOTICE[717204]: chan_skinny.c:7647 skinny_session: Skinny Session returned: Success
[Dec  6 15:08:22] NOTICE[717204]: chan_skinny.c:7473 skinny_session_cleanup: Ending Skinny session from unknown at 165.154.172.108
[Dec  6 15:08:22] NOTICE[717205]: chan_skinny.c:7531 skinny_session: Starting Skinny session from 165.154.172.108
[Dec  6 15:08:22] WARNING[717205]: chan_skinny.c:7591 skinny_session: Skinny Client sent invalid data.
[Dec  6 15:08:22] NOTICE[717205]: chan_skinny.c:7647 skinny_session: Skinny Session returned: Success
[Dec  6 15:08:22] NOTICE[717205]: chan_skinny.c:7473 skinny_session_cleanup: Ending Skinny session from unknown at 165.154.172.108
[Dec  6 15:08:23] NOTICE[717206]: chan_skinny.c:7531 skinny_session: Starting Skinny session from 165.154.172.108
[Dec  6 15:08:23] WARNING[717206]: chan_skinny.c:7578 skinny_session: Unable to read header. Only found 11 bytes.
[Dec  6 15:08:23] NOTICE[717206]: chan_skinny.c:7647 skinny_session: Skinny Session returned: Success
[Dec  6 15:08:23] NOTICE[717206]: chan_skinny.c:7473 skinny_session_cleanup: Ending Skinny session from unknown at 165.154.172.108
[Dec  6 15:08:24] NOTICE[717207]: chan_skinny.c:7531 skinny_session: Starting Skinny session from 165.154.172.108
[Dec  6 15:08:24] WARNING[717207]: chan_skinny.c:7595 skinny_session: Skinny packet too large (855638023 bytes), max length(2000 bytes)
[Dec  6 15:08:24] NOTICE[717207]: chan_skinny.c:7647 skinny_session: Skinny Session returned: Success
[Dec  6 15:08:24] NOTICE[717207]: chan_skinny.c:7473 skinny_session_cleanup: Ending Skinny session from unknown at 165.154.172.108
[Dec  6 15:13:29] NOTICE[716062]: res_pjsip/pjsip_distributor.c:676 log_failed_request: Request 'OPTIONS' from '<sip:nm@nm>' failed for '128.14.237.237:48607' (callid: 50000) - No matching endpoint found

I posted my error logs above. any idea?

So, the very first line of the logs you posted tells you what is wrong with the
dialplan:

[Dec 6 13:26:48] NOTICE[716062]: res_pjsip_session.c:4022
new_invite: 6001: Call (UDP:65.108.239.102:25217) to extension ‘100’
rejected because extension not found in context ‘from-internal’.

There is no extension “100” in your contenxt “from-internal”.

The second line from your logs tells us that you have set up an Asterisk
server and exposed it to the Internet, which is in general a bad thing to do,
but is a very bad thing to do before you know what you’re doing with
Asterisk.

If you cannot set up Asterisk on a private network and play with it there
until you’re familiar with it, at the very least implement a firewall to allow
access to it only from your own IP addresses, and not to the Internet in
general.

[Dec 6 14:25:06] NOTICE[716062]: res_pjsip/pjsip_distributor.c:676
log_failed_request: Request ‘OPTIONS’ from ‘“sipvicious”
sip:100@1.1.1.1’ failed for ‘45.155.91.237:5170’ (callid:
1171921489723402068646712) - No matching endpoint found

If you do not know what “sipvicious” is, I suggest you look it up on the
Internet.

Antony.

When I enter Asterisk console by cmd “asterisk -rvvvvv”, endless error messages are issued.
Here is a part of error msg. Error is endless…

[Dec  6 18:03:07] NOTICE[719051]: res_pjsip/pjsip_distributor.c:676 log_failed_request: Request 'REGISTER' from '"152" <sip:152@164.90.198.210>' failed for '96.44.143.34:5441' (callid: 1239949624) - Failed to authenticate
[Dec  6 18:03:07] NOTICE[719051]: res_pjsip/pjsip_distributor.c:676 log_failed_request: Request 'REGISTER' from '"5001" <sip:5001@164.90.198.210>' failed for '96.44.143.58:5238' (callid: 2639314773) - No matching endpoint found
[Dec  6 18:03:07] NOTICE[719051]: res_pjsip/pjsip_distributor.c:676 log_failed_request: Request 'REGISTER' from '"5001" <sip:5001@164.90.198.210>' failed for '96.44.143.58:5238' (callid: 2639314773) - Failed to authenticate
[Dec  6 18:03:07] NOTICE[719051]: res_pjsip/pjsip_distributor.c:676 log_failed_request: Request 'REGISTER' from '"8001" <sip:8001@164.90.198.210>' failed for '96.44.143.58:5360' (callid: 202928281) - No matching endpoint found
[Dec  6 18:03:07] NOTICE[719051]: res_pjsip/pjsip_distributor.c:676 log_failed_request: Request 'REGISTER' from '"501" <sip:501@164.90.198.210>' failed for '96.44.143.62:5226' (callid: 4126044963) - No matching endpoint found
[Dec  6 18:03:07] NOTICE[719051]: res_pjsip/pjsip_distributor.c:676 log_failed_request: Request 'REGISTER' from '"501" <sip:501@164.90.198.210>' failed for '96.44.143.62:5226' (callid: 4126044963) - Failed to authenticate
[Dec  6 18:03:07] NOTICE[719051]: res_pjsip/pjsip_distributor.c:676 log_failed_request: Request 'REGISTER' from '"5001" <sip:5001@164.90.198.210>' failed for '96.44.143.58:5238' (callid: 3919036548) - No matching endpoint found
[Dec  6 18:03:07] NOTICE[719052]: res_pjsip/pjsip_distributor.c:676 log_failed_request: Request 'REGISTER' from '"8001" <sip:8001@164.90.198.210>' failed for '96.44.143.58:5360' (callid: 3138675170) - No matching endpoint found
[Dec  6 18:03:07] NOTICE[719052]: res_pjsip/pjsip_distributor.c:676 log_failed_request: Request 'REGISTER' from '"8001" <sip:8001@164.90.198.210>' failed for '96.44.143.58:5360' (callid: 3138675170) - Failed to authenticate
[Dec  6 18:03:07] NOTICE[719051]: res_pjsip/pjsip_distributor.c:676 log_failed_request: Request 'REGISTER' from '"5001" <sip:5001@164.90.198.210>' failed for '96.44.143.58:5238' (callid: 3919036548) - Failed to authenticate
[Dec  6 18:03:07] NOTICE[719051]: res_pjsip/pjsip_distributor.c:676 log_failed_request: Request 'REGISTER' from '"5001" <sip:5001@164.90.198.210>' failed for '96.44.143.62:5458' (callid: 2119168561) - No matching endpoint found
[Dec  6 18:03:07] NOTICE[719051]: res_pjsip/pjsip_distributor.c:676 log_failed_request: Request 'REGISTER' from '"5001" <sip:5001@164.90.198.210>' failed for '96.44.143.62:5458' (callid: 2119168561) - Failed to authenticate
[Dec  6 18:03:07] NOTICE[719051]: res_pjsip/pjsip_distributor.c:676 log_failed_request: Request 'REGISTER' from '"222" <sip:222@164.90.198.210>' failed for '96.44.143.34:5093' (callid: 2274421753) - No matching endpoint found
[Dec  6 18:03:07] NOTICE[719051]: res_pjsip/pjsip_distributor.c:676 log_failed_request: Request 'REGISTER' from '"222" <sip:222@164.90.198.210>' failed for '96.44.143.34:5093' (callid: 2274421753) - Failed to authenticate
[Dec  6 18:03:07] NOTICE[719051]: res_pjsip/pjsip_distributor.c:676 log_failed_request: Request 'REGISTER' from '"9000" <sip:9000@164.90.198.210>' failed for '96.44.143.34:5480' (callid: 3986983565) - No matching endpoint found
[Dec  6 18:03:07] NOTICE[719051]: res_pjsip/pjsip_distributor.c:676 log_failed_request: Request 'REGISTER' from '"9000" <sip:9000@164.90.198.210>' failed for '96.44.143.34:5480' (callid: 3986983565) - Failed to authenticate
[Dec  6 18:03:07] NOTICE[719051]: res_pjsip/pjsip_distributor.c:676 log_failed_request: Request 'REGISTER' from '"8001" <sip:8001@164.90.198.210>' failed for '96.44.143.58:5360' (callid: 18094042) - No matching endpoint found
[Dec  6 18:03:07] NOTICE[719051]: res_pjsip/pjsip_distributor.c:676 log_failed_request: Request 'REGISTER' from '"8001" <sip:8001@164.90.198.210>' failed for '96.44.143.58:5360' (callid: 18094042) - Failed to authenticate
[Dec  6 18:03:07] NOTICE[719052]: res_pjsip/pjsip_distributor.c:676 log_failed_request: Request 'REGISTER' from '"5001" <sip:5001@164.90.198.210>' failed for '96.44.143.58:5238' (callid: 2979513624) - No matching endpoint found
[Dec  6 18:03:07] NOTICE[719051]: res_pjsip/pjsip_distributor.c:676 log_failed_request: Request 'REGISTER' from '"7001" <sip:7001@164.90.198.210>' failed for '96.44.143.58:5339' (callid: 1600072975) - No matching endpoint found

I am getting such errors endless. How can I fix this critical problem?

“164.90.198.210”

Somebody at Digital Ocean doesn’t like you :slight_smile:

iptables is your friend here.

Make a list of everybody you want/need to exchange SIP with. This is your ‘whitelist.’

Block everything not on the whitelist.

Consider adding fail2ban.

Just a tip, if you are fed up of typing all those “v” characters, edit your asterisk.conf and change the verbose setting to, e.g.

verbose = 100

Now you don’t have to type any “v” characters at all; just “asterisk -r” is enough.

2 Likes

you’re being hacked via sip vicious. Make sure your firewall is turned on and deny any service to bad ips

1 Like

Thank you for your reply.
Could you please help me offer the useful guide or direct commands?
Please give me your guide, how can I do these things?

“Please give me your guide, how can I do these things?”

  1. Turn off your Asterisk instance.

  2. Learn about the firewall configuration for whichever hosting provider you
    have installed Asterisk on.

  3. Disable all access to TCP and UDP ports 5060 other then from the IP
    address/es of your own SIP client/s.

  4. Turn your Asterisk instance back on again and learn how to manage it.

2 Likes

A search of this forum or google should yield clues.

The specifics would need a lot of detail about your network topology. Also, each OS seems to have different ideas about where and how iptables rules should be formatted and stored.

It’s important to learn a bit about iptables and security. It’s too easy to ‘cut-n-paste’ your way into a compromise.

1 Like

I activated my vps firewall.
After that, I can’t connect my Asterisk server to Zoiper softphone.
I think firewall rejects this request.
How to enable access to Asterisk according to specific IP?
I have to add TCP /UDP 5060 port to Firewall?

Try stopping firewalld then reload asterisk/ then check to see if that gets you registered with Zoiper. If not make sure you have the port added after the domain in zoiper

I can connect Asterisk server to Zoiper by turning off the firewall.
But in this case, endless requests came to my Asterisk server.

turn firewalld back on zoiper should still work

  • Turn off the firewall
  • Connect Asterisk to Zoiper
  • Turn on firewall
    Do you mean this?

Yes that seems to work for me in some of my servers.

Hi @Seymen2023 and @everyone.
I followed the Hello world guide too with asterisk 20.5.0 on ubuntu Focal (20.04 LTS) but I’m not even connecting to the server. Can’t register the SIP user accounts I create. I’m getting Request Timeout (code: 408) error. And when I run “netstat -antlp | grep 5060” to check activities on port 5060. It returns nothing so I think my server isn’t even listening to that default port.
This is quite confusing because I followed the guide carefully and really don’t have any idea about what the problem actually is. Can anyone help me? Here are my sip.conf and extensions.conf files:
sip.conf

root@parc2023:/etc/asterisk# cat sip.conf 
[general]
context=default

[intern_caller]
type=friend
context=from-internal
host=192.168.1.102
username=6001
port=5060
secret=unsecurepassword
;disallow=all This line is commented
allow=all

extensions.conf

root@parc2023:/etc/asterisk# cat extensions.conf 
[from-internal]
exten = 100,1,Answer()
same = n,Wait(1)
same = n,Playback(hello-world)
same = n,Hangup()

I considered those modifications in the sip.conf file but it doesn’t work