Sip.conf confusion!

Hello,
I m little confused about context name and username in sip.conf file , i tried to search it on internet but couldn’t find particular explanation on this, i hope i will get answer here (i m new to asterisk)…

This is my code and by this when i register to sip client , i successfully register…

[harry]
type=peer
username=harry
secret=potter
host=dynamic
context = welcome

my account setting in sip client, xlite
username:harry
Authorization user:harry
password:potter
Domain:xxxx:xxxx:xxxx:xxxx

it works fine , but when i use this code in sip.conf–>

[harry-potter]
type=peer
username=harry
secret=potter
host=dynamic
context = welcome

now i cant connect to sip client… even username is same
so what is the use of username in sip.conf???

Please refer to www.asteriskdocs.org

Hello,
Please change username=harry-potter, I think the both of them must be the same. but i’m not sure

The primary documentation (sip.conf.sample), for 1.6.1.0, says

[quote]; Note: The parameter “username” is not the username and in most cases is
; not needed at all. Check below. In later releases, it’s renamed
; to “defaultuser” which is a better name, since it is used in
; combination with the “defaultip” setting.[/quote]

Which means it is the username used for outgoing calls befor the phone has registered, and assuming that defaultip is also set.

This should have been asked on Asterisk Support.

yeah thanks for the answer, but username is needed when we use register in sip.conf
the def says

I think username is required for this , correct me if i m wrong :smile:

Different user name.