add the username and the type parameters. Example :
[500]
username=xxx
secret=xxx
type=friend
Remember according to the Asterisk documentation: The parameter “username” is not the username and in most cases isnot needed at all.In later releases, it’s renamed
to “defaultuser” which is a better name, since it is used in
combination with the “defaultip” setting. Example :
[polycom]
type=friend ; Friends place calls and receive calls
context=from-sip ; Context for incoming calls from this user
secret=blahpoly
host=dynamic ; This peer register with us
dtmfmode=rfc2833 ; Choices are inband, rfc2833, or info
defaultuser=polly ; Username to use in INVITE until peer registers
defaultip=192.168.40.123
; Normally you do NOT need to set this parameter
disallow=all
allow=ulaw ; dtmfmode=inband only works with ulaw or alaw!
progressinband=no
David , i don’t understand why always in the Asterisk documentation like asteriskdocs.org/ and too in the sip.conf sample file they make reference and encourage to use type=friend in the configuration of the sip devices.
peer Match incoming requests to a configuration entry using the source IP address and port number.
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.
friend This enables matching rules for both peer and user. This is the setting most commonly used for SIP phones.
is there something that is beyond the above statement
People tend to copy other people and there is a real difference for IAX.
For SIP, type=peer matches on IP address only, after registration, and type=friend matches on IP address or the SIP username.
If you have type=friend and invite=insecure, an attacker can simulate the ITSP, if they know the sip.conf section name. There are also cases, that have happened in real life, where a call arriving on a trunk has a caller ID that matches a local, type=friend, “extension”, and has matched the extension, rather than the trunk.