Softphone not getting authorized with asterisk in ubuntu

Hi guys, I am new to Asterisk. I have set up asterisk on my Ubuntu 18.04 system. Now I wanted to test it using a Soft-phone. So I have installed Twinkle soft-phone. I have created a new user in sip.conf. I have made necessary changes in sip.conf and extensions.conf but when I use that same username and secret to register with Twinkle , it shows “asterisk, registration failed: 401 Unauthorized”.

Here is my sip.conf file-

[general]
context=default

[6001]
type=friend
context=from-internal
host=dynamic
secret=safepass
disallow=all
allow=ulaw

Here is my extensions.conf file-

[from-internal]
exten = 100,1,Answer()
same = n,Wait(1)
same = n,Playback(hello-world)
same = n,Hangup()

When registering for Twinkle I have used username as 6001 and password as safepass and then domain is used which I have got through the terminal command “hostname -I”.

Also when I look at the logs of the asterisk in /var/log/asterisk/ , there is no log

Can anyone help me to get my sip phone registered so that I can move forward to a bigger project.

Get the Asterisk logging working.

Actually, an unexpected 401 response means that the phone doesn’t think it has a password to give, so the problem will be with the phone.

I have tried with two phones…Twinkle and zoiper softphone but with both I am unable to do get it registered.

As I started, you need to get Asterisk logging working, as people know how to read those.

Hi piyushpilaniya98,
Did you get the softphone registered? And the logging going?
I have the same problem and the answer here does not help much.
Thanks.

There’s not enough info to be able to say what the cause is. This situation happens in tons of scenarios. You’ll just have to make a call when logged into the Asterisk CLI and see why it is failing. If there is not enough detail, you need to enable debugging in logger.conf and then explicitly in the CLI. You can also set up the file for logging to be sent to here (note that the logging also shows when logged into CLI mode – I often use this when troubleshooting with a single call.) More details about setting up logging are here:

https://wiki.asterisk.org/wiki/display/AST/Collecting+Debug+Information