Sip user register faild

hello
i`m a new user in asterisk
i cant to register my username in softphone correctly and it cant be register compeletly
i have created some sip user in asterisk sip.conf like this :

=========================================================================================
[general]
context=unauthenticated ; default context for incoming calls
allowguest=no ; disable unauthenticated calls
srvlookup=yes ; enabled DNS SRV record lookup on outbound calls
udpbindaddr=0.0.0.0 ; listen for UDP requests on all interfaces
tcpenable=no ; disable TCP support

office-phone ; create a template for our devices
type=user ; the channel driver will match on username first, IP second
context=LocalSets ; this is where calls from the device will enter the dialplan
host=dynamic ; the device will register with asterisk
nat=yes ; assume device is behind NAT
; *** NAT stands for Network Address Translation, which allows
; multiple internal devices to share an external IP address.
secret=s3CuR#p@s5 ; a secure password for this device – DON’T USE THIS PASSWORD!
dtmfmode=auto ; accept touch-tones from the devices, negotiated automatically
disallow=all ; reset which voice codecs this device will accept or offer
allow=ulaw ; which audio codecs to accept from, and request to, the device
allow=alaw ; in the order we prefer

; define a device name and use the office-phone template
0000FFFF0001
host=192.168.0.10
500
secret=123!@#
; define another device name using the same template
0000FFFF0002

=====================================================================================================

and for user “500” i try to register it with zoiper
but it cant register compeltly,register status dosn`t be done in softphone but i can call with softphone and i will heare a sound( as i defined in my dial peer )
here is “sip set debug on” result :

<— SIP read from UDP:192.168.0.10:5060 —>
SUBSCRIBE sip:500@192.168.0.70;transport=UDP SIP/2.0
Via: SIP/2.0/UDP 192.168.0.10:5060;branch=z9hG4bK-d8754z-4dea8c491d6be875-1—d8754z-
Max-Forwards: 70
Contact: sip:500@192.168.0.10:5060;transport=UDP
To: "500"sip:500@192.168.0.70;transport=UDP
From: "500"sip:500@192.168.0.70;transport=UDP;tag=631c0421
Call-ID: ZGJiNGU3NzFkNjE4YjQyNjA3ZmEzM2JmYzRlN2Y5NDc.
CSeq: 1 SUBSCRIBE
Expires: 3600
Accept: application/simple-message-summary
Allow: INVITE, ACK, CANCEL, BYE, NOTIFY, REFER, MESSAGE, OPTIONS, INFO, SUBSCRIBE
Supported: replaces, norefersub, extended-refer, X-cisco-serviceuri
User-Agent: Zoiper rev.11137
Event: message-summary
Allow-Events: presence, kpml
Content-Length: 0

<------------->
— (16 headers 0 lines) —
Creating new subscription
Sending to 192.168.0.10:5060 (NAT)
list_route: hop: sip:500@192.168.0.10:5060;transport=UDP
Found peer ‘500’ for ‘500’ from 192.168.0.10:5060

<— Transmitting (NAT) to 192.168.0.10:5060 —>
SIP/2.0 401 Unauthorized
Via: SIP/2.0/UDP 192.168.0.10:5060;branch=z9hG4bK-d8754z-4dea8c491d6be875-1—d8754z-;received=192.168.0.10;rport=5060
From: "500"sip:500@192.168.0.70;transport=UDP;tag=631c0421
To: "500"sip:500@192.168.0.70;transport=UDP;tag=as6c9d348f
Call-ID: ZGJiNGU3NzFkNjE4YjQyNjA3ZmEzM2JmYzRlN2Y5NDc.
CSeq: 1 SUBSCRIBE
Server: Asterisk PBX 1.8.13.0
Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REFER, SUBSCRIBE, NOTIFY, INFO, PUBLISH
Supported: replaces, timer
WWW-Authenticate: Digest algorithm=MD5, realm=“asterisk”, nonce="7e394477"
Content-Length: 0

and hre is the result of dialing 200 ( as defined for say hello-word in dial-peer

Scheduling destruction of SIP dialog ‘ZGM4NTRjYTExMmI4MjMwNjgxNWI4ODhlNmYzMGExYmM.’ in 32000 ms (Method: REGISTER)
Really destroying SIP dialog ‘MTcxMTcxMzljZjNmMjA5MzkxZmE5Y2IxNDMyYmYyOWM.’ Method: REGISTER
asterisk*CLI> sip set debug off
SIP Debugging Disabled
== Using SIP RTP CoS mark 5
– Executing [200@LocalSets:1] Answer(“SIP/500-00000001”, “”) in new stack
– Executing [200@LocalSets:2] Playback(“SIP/500-00000001”, “hello-world”) in new stack
– <SIP/500-00000001> Playing ‘hello-world.ulaw’ (language ‘en’)
– Executing [200@LocalSets:3] Hangup(“SIP/500-00000001”, “”) in new stack
== Spawn extension (LocalSets, 200, 3) exited non-zero on ‘SIP/500-00000001’

==============================================================

how can i solve my problem and find the problem with user registration,
as a reminder i tryed it on asterisk now also and have same result,but in elastix i can create user in sip.conf and register it correctly

the problem is type=user, you need to use type=peer
btw, where did you get the idea for type=user ? :unamused:

thank you
by change to freind it be ok
but as i read in oreilly ebook type=user means that
"user= Match incoming requests to a configuration entry using the username in the From header of the SIP
request. This name is matched to a section in sip.conf with the same name in square brackets."
so with authenticating by username it should register on server,what is problem?

I told you to change it to peer, why did you change it to friend ? Friend is an overkill.

The passage from the book you quote refers to INVITE requests (“incoming requests” ) and not REGISTER.
I guess the code word for REGISTER is different.
The lack of consistent terminology has been a bane of the VoIP world for a very long time.