According to RFC 3325 if a call has the From field set to anonymous, the server can add the real user id from the authentication exchange in the p-asserted-identity added to a trunk.
This requires anonymous users to be authenticated.
The only way I’ve been able to achieve this is to create an auth section for anonymous with the real username of the client.
But I want all my clients to be able to use anonymous.
I assume this must be possible but I cant find the syntax necessary.
Also, when I use send_pai on the trunk it is populated with “anonymous@…” not with the user_id extracted from the authentication.
Here’s my PJSIP
;=============== ENDPOINT DEFINITIONS ===========
;Students
[student_template](!)
type = endpoint
context = internal
disallow = all
allow = ulaw
[auth_template](!)
type = auth
auth_type = userpass
password = testpassword
[aor_template](!)
type = aor
support_path = yes
max_contacts = 1
;-------------------------------------------
;Student2
[Student2](student_template)
auth = Student2
aors = Student2
[Student2](auth_template)
username = Student2
password = testpassword
[Student2](aor_template)
;-------------------------------------------
;anonymous
[anonymous](student_template)
auth = anonymous
[anonymous](auth_template)
username = Student2
password = testpassword
;-------------------------------------------
;trunk
[mytrunk]
type=endpoint
aors=mytrunk
context=external
disallow = all
allow = ulaw,alaw
rewrite_contact=no
send_pai=yes
[mytrunk]
type=aor
support_path=yes
contact=sip:192.0.2.4
[mytrunk]
type=identify
endpoint=mytrunk
match=192.0.2.4