Pjsip with authentication error

Hello guys,
Im trying to create new asterisk installation for a provider who requires authentication and they are not so helpful with their support so i hope that someone might be able to help from here.
Here is part of my pjsip code

; provider Settings
[transport-udp-nat]
type=transport
protocol=udp
bind=0.0.0.0:5060
local_net=local-ip add

[provider-trunk-reg]
type=registration
outbound_auth=provider-trunk-auth
server_uri=sip:trunk.provider.com
client_uri=sip:username@trunk.provider.com
retry_interval=60

[provider-trunk-auth]
type=auth
auth_type=userpass
password=password-provided-by-provider
username=username@trunk.provider.com

[provider-trunk-aor]
type=aor
contact=sip:trunk.provider.com:5060

[provider-trunk-endpoint]
type=endpoint
context=outer
outbound_auth=provider-trunk-auth
aors=provider-trunk-aor
transport=transport-udp-nat
disallow = all
allow = alaw
allow = ulaw
;provider staff
insecure=invite
type=peer
qualify=yes
; NAT parameters:
rtp_symmetric = yes
rewrite_contact = yes
send_rpid = yes
direct_media = no

[provider-trunk-id]
type=identify
endpoint=provider-trunk-endpoint
match=trunk.provider.com

;Extention- working

[internal-ext-endpoint-tmpl]!
type = endpoint
context = outer
disallow = all
allow = alaw
direct_media = no

[internal-ext-auth-tmpl]!
type = auth
auth_type = userpass

[internal-ext-aor-tmpl]!
type = aor
max_contacts=10

[100](internal-ext-endpoint-tmpl)
type=endpoint
auth = 100
aors = 100

[100](internal-ext-auth-tmpl)
password = userpassword
username = 100

[100](internal-ext-aor-tmpl)

You’ll need to provide a SIP trace as well using “pjsip set logger on” as well as further information - are you referring to a call failing? Is the outbound registration failing?

My Configuration was correct the problem was that the server “trunk.provider.com” wasnt able to resolve ip. So i replace server name with server IP and worked perfect. That was ISP problem… so in case some has this issue just add the ip instead of the server and make sure that you have server route in your network configuration file.

Thanks for the help.