Error login when adding a phone in Asterisk

Hi there.

I’m new with this system (Asterisk). So be nice please. I have to add new phones (grandstream mostly), and I use the asterisk web interface to do so. What is the correct procedure?

  • Actually if I want to add a new phone, no problem, default password works all the time (admin). But as soon as I want to switch an old phone for another used one I get “error login” when adding this with MAC adress or IP adress.
  • Normaly a technician should have configured asterisk to push the conf automaticaly without me going into the server. But it’s not working.
  • When I go into the phone configuration directly I can see that no configuration is pushed, no SIP user/password, no server.
  • I can still log into the telephone with the default admin password (admin), but I can’t add it using the asterisk web portal.
  1. I have a bunch of phone that I can’t use right now because of that. Does anybody can give me the procedure to add/remove a phone?

  2. How can I retrieve/reset the password? I have access to the CLI, but i’m not really used to it already.

Thanks in advance.

Here is my user.conf


; Auto provision the phone with res_phoneprov
;
;autoprov = yes
;
; Line Keys for hardphone
;
;LINEKEYS = 1
;
; Line number for hardphone
;
;linenumber = 1
;
; Local Caller ID number used with res_phoneprov and Asterisk GUI
;
;cid_number = 6000
;
; Remaining options are not specific to users.conf entries but are general.
;
callwaiting = yes
threewaycalling = yes
callwaitingcallerid = yes
transfer = yes
canpark = yes
cancallforward = yes
callreturn = yes
callgroup = 1
pickupgroup = 1
;nat = no

;[6000]
;fullname = Joe User
;description = Courtesy Phone In Lobby    ; Used to provide a description of the
                                          ; peer in console output
;email = joe@foo.bar
;secret = 1234
;dahdichan = 1
;hasvoicemail = yes
;vmsecret = 1234
;hassip = yes
;hasiax = no
;hash323 = no
;hasmanager = no
;callwaiting = no
;context = international
;
; Some administrators choose alphanumeric extensions, but still want their
; users to be reachable by traditional numeric extensions, specified by the
; alternateexts entry.
;
;alternateexts = 7057,3249
;macaddress = 112233445566
;autoprov = yes
;LINEKEYS = 1
;linenumber = 1
;cid_number = 6000

manager.conf

[general]
enabled = yes
webenabled = no
port = 5038
bindaddr = 0.0.0.0
;bindaddr = 192.168.0.10
;bindaddr = 127.0.0.1

tlsenable=no

[astportal]
secret = astmaster
displayconnects = yes
read = all ; system,call,log,verbose,agent,user,config,dtmf,reporting,cdr,dialplan
write = all ; system,call,agent,user,config,command,reporting,originate
deny=0.0.0.0/0.0.0.0
permit=127.0.0.1/255.255.255.255
permit=192.168.0.0/255.255.0.0
eventfilter=!Event: RTCP*

manager.conf has nothing to do with sip peer configuration, but as you are using a GUI I assume it is used by the GUI client. Related to the user.conf file I’ve never used it, but based on the Wiki

The asterisk-gui sets up extensions, SIP/IAX2 peers, and a host of other settings. User-specific settings are stored in users.conf. If the asterisk-gui is not being used, manual entries to users.conf can be made.

The asterisk-gui project is dead, if you are planning to use GUI, try FreePBX

1 Like

Hello everything is in production, I can’t change it right now. I’m planning to implement FreePBX in the future.
When I want to add a new phone, I’ll search for his mac adress using the GUI, add the phone number, associate to the user and that’s it. It’s working perfectly.
The problem occured when I’m trying to attribute an already registered phone to a new user, or when I restore the phone factory settings. Normaly it should push the SIP configuration from our SIP server. This is what I’ve paid for. But it’s not.
I’m pretty sure it’s not something too complicated. I just don’t know how it works, and I’m pretty much in a big hurry to get this done. Here is a thread that helps me : Wrong password - Registration Failed - #5 by Averell. But how to do that is beyond my knowledge for now. I’m reading all the documentation I can.

Thanks :wink:

That’s a pull request from phone device to (probably) pbx server.
They can do this with tftp network address manually inputted on device or over dhcp via bootp option.

I think you have the first option once your device can’t pull settings after factory reset.

1 Like

I’ve found a file name sip.conf inside a folder in /etc/asterisk/ called /astportal/ here is one entry :


[cK0ZFgJK]
secret = j69ylc8e
type = friend
host = dynamic
context = cK0ZFgJK
allow = g722
allow = alaw
callerid = Tute Titaina <478437>
mailbox = 437@astportal

It seems that it controls SIP registration if I am correct? Can I edit this file to suit my needs and register phone/user here? I’ve search a little a bit and found out it’s a web application to configure Asterisk : GitHub - balkonsky/astportal: Simple portal for configuration Asterisk Server.

Here are the files inside /astportal/ :

-rw-r--r--  1 asterisk asterisk 45250 25 mai   08:11 extensions.conf
-rw-r--r--. 1 asterisk asterisk   183  4 mai    2013 musiconhold.conf
-rw-r--r--  1 asterisk asterisk   414 27 mai   08:23 queues.conf
-rw-r--r--  1 asterisk asterisk 20769 25 mai   08:11 sip.conf
-rw-r--r--  1 root     root     12154 18 mars   2014 sip.confSV+1
-rw-rw-r--  1 asterisk asterisk  2982 20 juil.  2020 svi.conf
-rw-rw-r--  1 asterisk asterisk  2982 20 juil.  2020 svi.conf.old
-rw-r--r--. 1 asterisk asterisk  4977 25 mai   08:11 voicemail.conf

I’ll try to use ARI to Push configuration from SIP server : ARI Push Configuration - Asterisk Project - Asterisk Project Wiki

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.