Getting ‘No matching endpoint found’ as using aor different that endpoint. In documentation it has to work. Added identify by option and identify_order yet still can’t register device as i want.
here is the confs:
endpoints
id | auth | aors | context | allow | transport | direct_media | rtp_symmetric | rewrite_contact | force_rport | ice_support | identify_by
------±------------±-------±--------±--------------------±----------±-------------±--------------±----------------±------------±------------±--------------
test | rashad | rashad | dial | !all,h264,ulaw,alaw | transport | no | yes | yes | yes | no | auth_username
aors:
id | max_contacts
--------±-------------
rashad | 1024
auth:
id | username | password | auth_type
--------±---------±---------±----------
rashad | rashad | rashad | userpass
identify:
id | endpoint
--------±---------
rashad | test
pjsip.conf:
[global]
endpoint_identifier_order=request_uri
[transport]
type=transport
protocol=udp
bind=0.0.0.0:9137
local_net=192.0.2.0/24
local_net=127.0.0.1/32
external_media_address=X.X.X.X
external_signaling_address=X.X.X.X
pjsip set logger on:
<— Received SIP request (851 bytes) from UDP:X.X.X.X:X —>
REGISTER sip:X.X.X.X SIP/2.0
Via: SIP/2.0/UDP 192.168.0.5:49067;branch=z9hG4bK.0ohl97~hH;rport
From: <sip:rashad@>X.X.X.X;tag=Nk1Fo9eDG
To: ``sip:rashad@``X.X.X.X
CSeq: 21 REGISTER
Call-ID: zj9ZsewFee
Max-Forwards: 70
Supported: outbound
Accept: application/sdp
Accept: text/plain
Accept: application/vnd.gsma.rcs-ft-http+xml
Contact: <sip:rashad@X.X.X.X:X;transport=udp>;+sip.instance=“<urn:uuid:efde41da-d437-4f1b-b147-7f7b1fa67919>”
Expires: 3600
User-Agent: LinphoneAndroid/6.0.21 (POCO X6 5G) LinphoneSDK/5.4.68 (tags/5.4.68^0)
Authorization: Digest realm=“asterisk”, nonce=“1766575479/8c6a48071b3f0e9bce90acb53279ff43”, algorithm=MD5, opaque=“1e1848aa465dcb85”, username=“rashad”, uri=“sip:X.X.X.X”, response=“7f954ba21793e22f905f6bc512237fd8”, cnonce=“-UdWhW1uL7XBlfoH”, nc=00000001, qop=auth
15:24:39] NOTICE[926160]: res_pjsip/pjsip_distributor.c:688 log_failed_request: Request ‘REGISTER’ from ‘<sip:rashad@>X.X.X.X’ failed for ‘X.X.X.X:X’ (callid: zj9ZsewFee) - No matching endpoint found
<— Transmitting SIP response (462 bytes) to UDP:X.X.X.X:X —>
SIP/2.0 401 Unauthorized
Via: SIP/2.0/UDP 192.168.0.5:49067;rport=49067;received=X.X.X.X;branch=z9hG4bK.0ohl97~hH
Call-ID: zj9ZsewFee
From: <sip:rashad@>X.X.X.X;tag=Nk1Fo9eDG
To: <sip:rashad@>X.X.X.X;tag=z9hG4bK.0ohl97~hH
CSeq: 21 REGISTER
WWW-Authenticate: Digest realm=“asterisk”,nonce=“1766575479/8c6a48071b3f0e9bce90acb53279ff43”,opaque=“12bbe6d27a271737”,algorithm=MD5,qop=“auth”
Server: Asterisk PBX 22.7.0
Content-Length: 0
core set debug 10:
(Note: by changing order to auth_username endpoint identifier error goes but getting “Endpoint not found for Authentication username ‘rashad’ realm ‘asterisk’”)
[Dec 24 15:28:52] DEBUG[922778]: res_pjsip/pjsip_distributor.c:390 find_dialog: Could not find matching transaction for Request msg REGISTER/cseq=21 (rdata0x7f4840002f98)
[Dec 24 15:28:52] DEBUG[922778]: res_pjsip/pjsip_distributor.c:468 ast_sip_get_distributor_serializer: Calculated serializer pjsip/distributor-0000002a to use for Request msg REGISTER/cseq=21 (rdata0x7f4840002f98)
[Dec 24 15:28:52] DEBUG[926404]: res_pjsip_endpoint_identifier_ip.c:359 common_identify: No identify sections to match against
[Dec 24 15:28:52] DEBUG[926404]: netsock2.c:170 ast_sockaddr_split_hostport: Splitting ‘89.219.57.91’ into…
[Dec 24 15:28:52] DEBUG[926404]: netsock2.c:224 ast_sockaddr_split_hostport: …host ‘89.219.57.91’ and port ‘’.
[Dec 24 15:28:52] DEBUG[926404]: res_pjsip_endpoint_identifier_ip.c:359 common_identify: No identify sections to match against
[Dec 24 15:28:52] DEBUG[926404]: res_pjsip_endpoint_identifier_ip.c:359 common_identify: No identify sections to match against
[Dec 24 15:28:52] DEBUG[926404]: res_pjsip_endpoint_identifier_user.c:148 username_identify: Attempting identify by From username ‘rashad’ domain ‘X.X.X.X’
[Dec 24 15:28:52] DEBUG[926404]: res_odbc.c:1045 _ast_odbc_request_obj2: Reusing ODBC handle 0x5612b8c9b350 from class ‘asterisk-connector’
[Dec 24 15:28:52] DEBUG[926404]: res_config_odbc.c:118 custom_prepare: Skip: 0; SQL: SELECT * FROM ps_endpoints WHERE id = ?
[Dec 24 15:28:52] DEBUG[926404]: res_config_odbc.c:137 custom_prepare: Parameter 1 (‘id’) = ‘rashad@X.X.X.X’
[Dec 24 15:28:52] DEBUG[926404]: res_odbc.c:832 ast_odbc_release_obj: Releasing ODBC handle 0x5612b8c9b350 into pool
[Dec 24 15:28:52] DEBUG[926404]: res_odbc.c:1045 _ast_odbc_request_obj2: Reusing ODBC handle 0x5612b8c9b350 from class ‘asterisk-connector’
[Dec 24 15:28:52] DEBUG[926404]: res_config_odbc.c:118 custom_prepare: Skip: 0; SQL: SELECT * FROM ps_endpoints WHERE id = ?
[Dec 24 15:28:52] DEBUG[926404]: res_config_odbc.c:137 custom_prepare: Parameter 1 (‘id’) = ‘rashad’
[Dec 24 15:28:52] DEBUG[926404]: res_odbc.c:832 ast_odbc_release_obj: Releasing ODBC handle 0x5612b8c9b350 into pool
[Dec 24 15:28:52] DEBUG[926404]: res_pjsip_endpoint_identifier_user.c:152 username_identify: Endpoint not found for From username ‘rashad’ domain ‘X.X.X.X’
[Dec 24 15:28:52] DEBUG[926404]: res_pjsip_endpoint_identifier_user.c:173 auth_username_identify: Attempting identify by Authorization username ‘rashad’ realm ‘asterisk’
[Dec 24 15:28:52] DEBUG[926404]: res_odbc.c:1045 _ast_odbc_request_obj2: Reusing ODBC handle 0x5612b8c9b350 from class ‘asterisk-connector’
[Dec 24 15:28:52] DEBUG[926404]: res_config_odbc.c:118 custom_prepare: Skip: 0; SQL: SELECT * FROM ps_endpoints WHERE id = ?
[Dec 24 15:28:52] DEBUG[926404]: res_config_odbc.c:137 custom_prepare: Parameter 1 (‘id’) = ‘rashad@asterisk’
[Dec 24 15:28:52] DEBUG[926404]: res_odbc.c:832 ast_odbc_release_obj: Releasing ODBC handle 0x5612b8c9b350 into pool
[Dec 24 15:28:52] DEBUG[926404]: res_odbc.c:1045 _ast_odbc_request_obj2: Reusing ODBC handle 0x5612b8c9b350 from class ‘asterisk-connector’
[Dec 24 15:28:52] DEBUG[926404]: res_config_odbc.c:118 custom_prepare: Skip: 0; SQL: SELECT * FROM ps_endpoints WHERE id = ?
[Dec 24 15:28:52] DEBUG[926404]: res_config_odbc.c:137 custom_prepare: Parameter 1 (‘id’) = ‘rashad’
[Dec 24 15:28:52] DEBUG[926404]: res_odbc.c:832 ast_odbc_release_obj: Releasing ODBC handle 0x5612b8c9b350 into pool
[Dec 24 15:28:52] DEBUG[926404]: res_pjsip_endpoint_identifier_user.c:178 auth_username_identify: Endpoint not found for Authentication username ‘rashad’ realm ‘asterisk’
[Dec 24 15:28:52] DEBUG[926404]: res_odbc.c:1045 _ast_odbc_request_obj2: Reusing ODBC handle 0x5612b8c9b350 from class ‘asterisk-connector’
[Dec 24 15:28:52] DEBUG[926404]: res_config_odbc.c:118 custom_prepare: Skip: 0; SQL: SELECT * FROM ps_endpoints WHERE id = ?
[Dec 24 15:28:52] DEBUG[926404]: res_config_odbc.c:137 custom_prepare: Parameter 1 (‘id’) = ‘anonymous@X.X.X.X’
[Dec 24 15:28:52] DEBUG[926404]: res_odbc.c:832 ast_odbc_release_obj: Releasing ODBC handle 0x5612b8c9b350 into pool
[Dec 24 15:28:52] DEBUG[926404]: res_odbc.c:1045 _ast_odbc_request_obj2: Reusing ODBC handle 0x5612b8c9b350 from class ‘asterisk-connector’
[Dec 24 15:28:52] DEBUG[926404]: res_config_odbc.c:118 custom_prepare: Skip: 0; SQL: SELECT * FROM ps_endpoints WHERE id = ?
[Dec 24 15:28:52] DEBUG[926404]: res_config_odbc.c:137 custom_prepare: Parameter 1 (‘id’) = ‘anonymous’
[Dec 24 15:28:52] DEBUG[926404]: res_odbc.c:832 ast_odbc_release_obj: Releasing ODBC handle 0x5612b8c9b350 into pool
Assuming the syntax errors are from bad forum markup, the endpoint name here is rashad, but you have no type=endpoint section with that name.
I don’t think the type=identify name is used to match the From header, but I haven’t tried it.
you mean it is phone specific problem? So it just pastes username to all places?
Thanks for tip, i have changed device which has 2 options (username, registered username) which i still don’t get what is difference. Now i see authentication with auth username successed but still fails somehow
[Dec 24 16:02:49] DEBUG[928340]: res_pjsip_endpoint_identifier_user.c:173 auth_username_identify: Attempting identify by Authorization username ‘test1’ realm ‘asterisk’
[Dec 24 16:02:49] DEBUG[928340]: res_odbc.c:1045 _ast_odbc_request_obj2: Reusing ODBC handle 0x55b293607100 from class ‘asterisk-connector’
[Dec 24 16:02:49] DEBUG[928340]: res_config_odbc.c:118 custom_prepare: Skip: 0; SQL: SELECT * FROM ps_endpoints WHERE id = ?
[Dec 24 16:02:49] DEBUG[928340]: res_config_odbc.c:137 custom_prepare: Parameter 1 (‘id’) = ‘test1@asterisk’
[Dec 24 16:02:49] DEBUG[928340]: res_odbc.c:832 ast_odbc_release_obj: Releasing ODBC handle 0x55b293607100 into pool
[Dec 24 16:02:49] DEBUG[928340]: res_odbc.c:1045 _ast_odbc_request_obj2: Reusing ODBC handle 0x55b293607100 from class ‘asterisk-connector’
[Dec 24 16:02:49] DEBUG[928340]: res_config_odbc.c:118 custom_prepare: Skip: 0; SQL: SELECT * FROM ps_endpoints WHERE id = ?
[Dec 24 16:02:49] DEBUG[928340]: res_config_odbc.c:137 custom_prepare: Parameter 1 (‘id’) = ‘test1’
[Dec 24 16:02:49] DEBUG[928340]: res_odbc.c:832 ast_odbc_release_obj: Releasing ODBC handle 0x55b293607100 into pool
[Dec 24 16:02:49] DEBUG[928340]: config.c:4138 ast_parse_arg: extract uint from [0] in [0, 4294967295] gives 0
[Dec 24 16:02:49] DEBUG[928340]: config.c:4138 ast_parse_arg: extract uint from [1800] in [0, 4294967295] gives 1800
[Dec 24 16:02:49] DEBUG[928340]: config.c:4138 ast_parse_arg: extract uint from [0] in [0, 4294967295] gives 0
[Dec 24 16:02:49] DEBUG[928340]: config.c:4138 ast_parse_arg: extract uint from [0] in [0, 4294967295] gives 0
[Dec 24 16:02:49] DEBUG[928340]: config.c:4138 ast_parse_arg: extract uint from [0] in [0, 4294967295] gives 0
[Dec 24 16:02:49] DEBUG[928340]: config.c:4138 ast_parse_arg: extract uint from [1] in [0, 4294967295] gives 1
[Dec 24 16:02:49] DEBUG[928340]: config.c:4138 ast_parse_arg: extract uint from [1] in [0, 4294967295] gives 1
[Dec 24 16:02:49] DEBUG[928340]: config.c:4138 ast_parse_arg: extract uint from [0] in [0, 4294967295] gives 0
[Dec 24 16:02:49] DEBUG[928340]: config.c:4138 ast_parse_arg: extract uint from [0] in [0, 4294967295] gives 0
[Dec 24 16:02:49] DEBUG[928340]: config.c:4138 ast_parse_arg: extract uint from [0] in [0, 4294967295] gives 0
[Dec 24 16:02:49] DEBUG[928340]: config.c:4138 ast_parse_arg: extract uint from [90] in [0, 4294967295] gives 90
[Dec 24 16:02:49] DEBUG[928340]: config.c:4138 ast_parse_arg: extract uint from [0] in [0, 4294967295] gives 0
[Dec 24 16:02:49] DEBUG[928340]: config.c:4138 ast_parse_arg: extract uint from [0] in [0, 4294967295] gives 0
[Dec 24 16:02:49] DEBUG[928340]: stream.c:655 ast_stream_topology_alloc: Topology Create
[Dec 24 16:02:49] DEBUG[928340]: stream.c:667 ast_stream_topology_alloc: Created: 0x55b293a9edc8
[Dec 24 16:02:49] DEBUG[928340]: res_pjsip_endpoint_identifier_user.c:189 auth_username_identify: Identified by Authorization username ‘test1’ realm ‘asterisk’
[Dec 24 16:02:49] DEBUG[928340]: res_pjsip_nat.c:55 save_orig_contact_host: Saving contact ‘192.168.0.6:5060’
[Dec 24 16:02:49] DEBUG[928340]: res_pjsip_authenticator_digest.c:621 digest_check_auth: test1:89.219.57.91
[Dec 24 16:02:49] DEBUG[928340]: res_pjsip_authenticator_digest.c:647 digest_check_auth: test1:89.219.57.91: Using endpoint for authentication
[Dec 24 16:02:49] DEBUG[928340]: res_odbc.c:1045 _ast_odbc_request_obj2: Reusing ODBC handle 0x55b293607100 from class ‘asterisk-connector’
[Dec 24 16:02:49] DEBUG[928340]: res_config_odbc.c:118 custom_prepare: Skip: 0; SQL: SELECT * FROM ps_auths WHERE id = ?
[Dec 24 16:02:49] DEBUG[928340]: res_config_odbc.c:137 custom_prepare: Parameter 1 (‘id’) = ‘1’
[Dec 24 16:02:49] DEBUG[928340]: res_odbc.c:832 ast_odbc_release_obj: Releasing ODBC handle 0x55b293607100 into pool
[Dec 24 16:02:49] DEBUG[928340]: config.c:4138 ast_parse_arg: extract uint from [32] in [0, 4294967295] gives 32
[Dec 24 16:02:49] DEBUG[928340]: res_pjsip_authenticator_digest.c:675 digest_check_auth: test1:1:89.219.57.91: Auth 1 of 1: Verifying
[Dec 24 16:02:49] DEBUG[928340]: res_pjsip_authenticator_digest.c:471 verify: test1:1:89.219.57.91: realm: asterisk
[Dec 24 16:02:49] DEBUG[928340]: res_pjsip_authenticator_digest.c:406 find_authorization: test1:1:89.219.57.91: realm: asterisk
[Dec 24 16:02:49] DEBUG[928340]: res_pjsip_authenticator_digest.c:412 find_authorization: test1:1:89.219.57.91: Checking nonce 1766577648/f5baea2507bf13632404d4cfa4244023 hdr-realm: asterisk hdr-algo: MD5
[Dec 24 16:02:49] DEBUG[928340]: res_pjsip_authenticator_digest.c:431 find_authorization: test1:1:89.219.57.91: realm: asterisk Result STALE
[Dec 24 16:02:49] DEBUG[928340]: res_pjsip_authenticator_digest.c:148 get_authorization_hdr: 1:89.219.57.91: realm: asterisk
[Dec 24 16:02:49] DEBUG[928340]: res_pjsip_authenticator_digest.c:153 get_authorization_hdr: 1:89.219.57.91: realm: asterisk Found header
[Dec 24 16:02:49] DEBUG[928340]: res_pjsip_authenticator_digest.c:190 digest_lookup: 1:89.219.57.91: srv realm: asterisk auth realm: asterisk auth user: 1 hdr user: test1
[Dec 24 16:02:49] DEBUG[928340]: res_pjsip_authenticator_digest.c:256 digest_lookup: 1:89.219.57.91: Username ‘1’ mismatch
[Dec 24 16:02:49] DEBUG[928340]: res_pjsip_authenticator_digest.c:508 verify: test1:1:89.219.57.91: authed: Unknown error 403
[Dec 24 16:02:49] DEBUG[928340]: res_pjsip_authenticator_digest.c:517 verify: test1:1:89.219.57.91: Realm: asterisk Username: 1 Result: FAIL
[Dec 24 16:02:49] DEBUG[928340]: res_pjsip_authenticator_digest.c:691 digest_check_auth: test1:1:89.219.57.91: Auth 1 of 1: Result: FAIL Failure count: 1
[Dec 24 16:02:49] DEBUG[928340]: res_pjsip_authenticator_digest.c:710 digest_check_auth: test1:89.219.57.91: Done with verification. Failures: 1 of 1
[Dec 24 16:02:49] DEBUG[928340]: res_pjsip_authenticator_digest.c:724 digest_check_auth: test1:1:89.219.57.91: Auth 1 of 1: Sending challenges
[Dec 24 16:02:49] DEBUG[928340]: res_pjsip_authenticator_digest.c:732 digest_check_auth: test1:1:89.219.57.91: Auth 1 of 1: Challenging with MD5
[Dec 24 16:02:49] DEBUG[928340]: res_pjsip_authenticator_digest.c:546 challenge: test1:1:89.219.57.91: realm: asterisk time: 1766577769 algorithm: MD5 stale? no
[Dec 24 16:02:49] DEBUG[928340]: res_pjsip_authenticator_digest.c:565 challenge: test1:1:89.219.57.91: Sending challenge for realm: asterisk algorithm: MD5 succeeded
[Dec 24 16:02:49] DEBUG[928340]: res_pjsip_authenticator_digest.c:759 digest_check_auth: test1:1:89.219.57.91: Auth 1 of 1: Challenged with MD5
[Dec 24 16:02:49] DEBUG[928340]: res_pjsip_authenticator_digest.c:763 digest_check_auth: test1:1:89.219.57.91: Auth 1 of 1: Done with challenges
[Dec 24 16:02:49] DEBUG[928340]: res_pjsip_authenticator_digest.c:789 digest_check_auth: test1:89.219.57.91: Result: FAILED
[Dec 24 16:02:49] NOTICE[928340]: res_pjsip/pjsip_distributor.c:688 log_failed_request: Request ‘REGISTER’ from ‘“test1” <sip:1@>x.x.x.x’ failed for ‘x.x.x.x’ (callid: 388521316) - Failed to authenticate
[Dec 24 16:02:49] NOTICE[928340]: res_pjsip/pjsip_distributor.c:688 log_failed_request: Request ‘REGISTER’ from ‘“test1” <sip:1@>x.x.x.x’ failed for ‘x.x.x.x’ (callid: 388521316) - Failed to authenticate
Thanks for tip, i have changed device which has 2 options (username, registered username) which i still don’t get what is difference. Now i see authentication with auth username successed but still fails somehow
[Dec 24 16:02:49] DEBUG[928340]: res_pjsip_endpoint_identifier_user.c:173 auth_username_identify: Attempting identify by Authorization username ‘test1’ realm ‘asterisk’
[Dec 24 16:02:49] DEBUG[928340]: res_odbc.c:1045 _ast_odbc_request_obj2: Reusing ODBC handle 0x55b293607100 from class ‘asterisk-connector’
[Dec 24 16:02:49] DEBUG[928340]: res_config_odbc.c:118 custom_prepare: Skip: 0; SQL: SELECT * FROM ps_endpoints WHERE id = ?
[Dec 24 16:02:49] DEBUG[928340]: res_config_odbc.c:137 custom_prepare: Parameter 1 (‘id’) = ‘test1@asterisk’
[Dec 24 16:02:49] DEBUG[928340]: res_odbc.c:832 ast_odbc_release_obj: Releasing ODBC handle 0x55b293607100 into pool
[Dec 24 16:02:49] DEBUG[928340]: res_odbc.c:1045 _ast_odbc_request_obj2: Reusing ODBC handle 0x55b293607100 from class ‘asterisk-connector’
[Dec 24 16:02:49] DEBUG[928340]: res_config_odbc.c:118 custom_prepare: Skip: 0; SQL: SELECT * FROM ps_endpoints WHERE id = ?
[Dec 24 16:02:49] DEBUG[928340]: res_config_odbc.c:137 custom_prepare: Parameter 1 (‘id’) = ‘test1’
[Dec 24 16:02:49] DEBUG[928340]: res_odbc.c:832 ast_odbc_release_obj: Releasing ODBC handle 0x55b293607100 into pool
[Dec 24 16:02:49] DEBUG[928340]: config.c:4138 ast_parse_arg: extract uint from [0] in [0, 4294967295] gives 0
[Dec 24 16:02:49] DEBUG[928340]: config.c:4138 ast_parse_arg: extract uint from [1800] in [0, 4294967295] gives 1800
[Dec 24 16:02:49] DEBUG[928340]: config.c:4138 ast_parse_arg: extract uint from [0] in [0, 4294967295] gives 0
[Dec 24 16:02:49] DEBUG[928340]: config.c:4138 ast_parse_arg: extract uint from [0] in [0, 4294967295] gives 0
[Dec 24 16:02:49] DEBUG[928340]: config.c:4138 ast_parse_arg: extract uint from [0] in [0, 4294967295] gives 0
[Dec 24 16:02:49] DEBUG[928340]: config.c:4138 ast_parse_arg: extract uint from [1] in [0, 4294967295] gives 1
[Dec 24 16:02:49] DEBUG[928340]: config.c:4138 ast_parse_arg: extract uint from [1] in [0, 4294967295] gives 1
[Dec 24 16:02:49] DEBUG[928340]: config.c:4138 ast_parse_arg: extract uint from [0] in [0, 4294967295] gives 0
[Dec 24 16:02:49] DEBUG[928340]: config.c:4138 ast_parse_arg: extract uint from [0] in [0, 4294967295] gives 0
[Dec 24 16:02:49] DEBUG[928340]: config.c:4138 ast_parse_arg: extract uint from [0] in [0, 4294967295] gives 0
[Dec 24 16:02:49] DEBUG[928340]: config.c:4138 ast_parse_arg: extract uint from [90] in [0, 4294967295] gives 90
[Dec 24 16:02:49] DEBUG[928340]: config.c:4138 ast_parse_arg: extract uint from [0] in [0, 4294967295] gives 0
[Dec 24 16:02:49] DEBUG[928340]: config.c:4138 ast_parse_arg: extract uint from [0] in [0, 4294967295] gives 0
[Dec 24 16:02:49] DEBUG[928340]: stream.c:655 ast_stream_topology_alloc: Topology Create
[Dec 24 16:02:49] DEBUG[928340]: stream.c:667 ast_stream_topology_alloc: Created: 0x55b293a9edc8
[Dec 24 16:02:49] DEBUG[928340]: res_pjsip_endpoint_identifier_user.c:189 auth_username_identify: Identified by Authorization username ‘test1’ realm ‘asterisk’
[Dec 24 16:02:49] DEBUG[928340]: res_pjsip_nat.c:55 save_orig_contact_host: Saving contact ‘192.168.0.6:5060’
[Dec 24 16:02:49] DEBUG[928340]: res_pjsip_authenticator_digest.c:621 digest_check_auth: test1:89.219.57.91
[Dec 24 16:02:49] DEBUG[928340]: res_pjsip_authenticator_digest.c:647 digest_check_auth: test1:89.219.57.91: Using endpoint for authentication
[Dec 24 16:02:49] DEBUG[928340]: res_odbc.c:1045 _ast_odbc_request_obj2: Reusing ODBC handle 0x55b293607100 from class ‘asterisk-connector’
[Dec 24 16:02:49] DEBUG[928340]: res_config_odbc.c:118 custom_prepare: Skip: 0; SQL: SELECT * FROM ps_auths WHERE id = ?
[Dec 24 16:02:49] DEBUG[928340]: res_config_odbc.c:137 custom_prepare: Parameter 1 (‘id’) = ‘1’
[Dec 24 16:02:49] DEBUG[928340]: res_odbc.c:832 ast_odbc_release_obj: Releasing ODBC handle 0x55b293607100 into pool
[Dec 24 16:02:49] DEBUG[928340]: config.c:4138 ast_parse_arg: extract uint from [32] in [0, 4294967295] gives 32
[Dec 24 16:02:49] DEBUG[928340]: res_pjsip_authenticator_digest.c:675 digest_check_auth: test1:1:89.219.57.91: Auth 1 of 1: Verifying
[Dec 24 16:02:49] DEBUG[928340]: res_pjsip_authenticator_digest.c:471 verify: test1:1:89.219.57.91: realm: asterisk
[Dec 24 16:02:49] DEBUG[928340]: res_pjsip_authenticator_digest.c:406 find_authorization: test1:1:89.219.57.91: realm: asterisk
[Dec 24 16:02:49] DEBUG[928340]: res_pjsip_authenticator_digest.c:412 find_authorization: test1:1:89.219.57.91: Checking nonce 1766577648/f5baea2507bf13632404d4cfa4244023 hdr-realm: asterisk hdr-algo: MD5
[Dec 24 16:02:49] DEBUG[928340]: res_pjsip_authenticator_digest.c:431 find_authorization: test1:1:89.219.57.91: realm: asterisk Result STALE
[Dec 24 16:02:49] DEBUG[928340]: res_pjsip_authenticator_digest.c:148 get_authorization_hdr: 1:89.219.57.91: realm: asterisk
[Dec 24 16:02:49] DEBUG[928340]: res_pjsip_authenticator_digest.c:153 get_authorization_hdr: 1:89.219.57.91: realm: asterisk Found header
[Dec 24 16:02:49] DEBUG[928340]: res_pjsip_authenticator_digest.c:190 digest_lookup: 1:89.219.57.91: srv realm: asterisk auth realm: asterisk auth user: 1 hdr user: test1
[Dec 24 16:02:49] DEBUG[928340]: res_pjsip_authenticator_digest.c:256 digest_lookup: 1:89.219.57.91: Username ‘1’ mismatch
[Dec 24 16:02:49] DEBUG[928340]: res_pjsip_authenticator_digest.c:508 verify: test1:1:89.219.57.91: authed: Unknown error 403
[Dec 24 16:02:49] DEBUG[928340]: res_pjsip_authenticator_digest.c:517 verify: test1:1:89.219.57.91: Realm: asterisk Username: 1 Result: FAIL
[Dec 24 16:02:49] DEBUG[928340]: res_pjsip_authenticator_digest.c:691 digest_check_auth: test1:1:89.219.57.91: Auth 1 of 1: Result: FAIL Failure count: 1
[Dec 24 16:02:49] DEBUG[928340]: res_pjsip_authenticator_digest.c:710 digest_check_auth: test1:89.219.57.91: Done with verification. Failures: 1 of 1
[Dec 24 16:02:49] DEBUG[928340]: res_pjsip_authenticator_digest.c:724 digest_check_auth: test1:1:89.219.57.91: Auth 1 of 1: Sending challenges
[Dec 24 16:02:49] DEBUG[928340]: res_pjsip_authenticator_digest.c:732 digest_check_auth: test1:1:89.219.57.91: Auth 1 of 1: Challenging with MD5
[Dec 24 16:02:49] DEBUG[928340]: res_pjsip_authenticator_digest.c:546 challenge: test1:1:89.219.57.91: realm: asterisk time: 1766577769 algorithm: MD5 stale? no
[Dec 24 16:02:49] DEBUG[928340]: res_pjsip_authenticator_digest.c:565 challenge: test1:1:89.219.57.91: Sending challenge for realm: asterisk algorithm: MD5 succeeded
[Dec 24 16:02:49] DEBUG[928340]: res_pjsip_authenticator_digest.c:759 digest_check_auth: test1:1:89.219.57.91: Auth 1 of 1: Challenged with MD5
[Dec 24 16:02:49] DEBUG[928340]: res_pjsip_authenticator_digest.c:763 digest_check_auth: test1:1:89.219.57.91: Auth 1 of 1: Done with challenges
[Dec 24 16:02:49] DEBUG[928340]: res_pjsip_authenticator_digest.c:789 digest_check_auth: test1:89.219.57.91: Result: FAILED
[Dec 24 16:02:49] NOTICE[928340]: res_pjsip/pjsip_distributor.c:688 log_failed_request: Request ‘REGISTER’ from ‘“test1” <sip:1@>x.x.x.x’ failed for ‘x.x.x.x’ (callid: 388521316) - Failed to authenticate
[Dec 24 16:02:49] NOTICE[928340]: res_pjsip/pjsip_distributor.c:688 log_failed_request: Request ‘REGISTER’ from ‘“test1” <sip:1@>x.x.x.x’ failed for ‘x.x.x.x’ (callid: 388521316) - Failed to authenticate
seems like realm error
<— Received SIP request (628 bytes) from UDP:xxxx —>
REGISTER sip:xxxx SIP/2.0
Via: SIP/2.0/UDP 192.168.0.6:5060;rport;branch=z9hG4bK318144386
From: 1 sip:1@xxxx;tag=1360648235
To: 1 sip:1@xxx
Call-ID: 1484135687
CSeq: 2 REGISTER
Contact: sip:1@192.168.0.6:5060;line=e749d2573b00271
Authorization: Digest username=“test1”, realm=“asterisk”, nonce=“1766578249/c4d845bbb03920aae2beaeda273ee1c3”, uri=“sip:xxxx”, response=“1690da44a71a6f348a14becd76fcd6ac”, algorithm=MD5, cnonce=“0a4f113b”, opaque=“6ac37bd86ca54fc6”, qop=auth, nc=00000001
Max-Forwards: 70
User-Agent: HKVS/2.0.0
Expires: 3600
Content-Length: 0
on phone at last successfully registered device. i need to understand those from to auth fields.
I am more near to what i want to do. Now asterisk founds endpoint from auth_username, but username itself gives error
auth_username_identify: Attempting identify by Authorization username ‘test1’ realm ‘asterisk’
auth_username_identify: Identified by Authorization username ‘test1’ realm ‘asterisk’
digest_check_auth: test1:xxxx
digest_check_auth: test1:xxxx: Using endpoint for authentication
[Dec 24 17:12:47] DEBUG[932884]: res_pjsip_authenticator_digest.c:675 digest_check_auth: test1:1:89.219.57.91: Auth 1 of 1: Verifying
[Dec 24 17:12:47] DEBUG[932884]: res_pjsip_authenticator_digest.c:471 verify: test1:1:89.219.57.91: realm: asterisk
[Dec 24 17:12:47] DEBUG[932884]: res_pjsip_authenticator_digest.c:406 find_authorization: test1:1:89.219.57.91: realm: asterisk
[Dec 24 17:12:47] DEBUG[932884]: res_pjsip_authenticator_digest.c:412 find_authorization: test1:1:89.219.57.91: Checking nonce 1766581967/1a2b8b7fa9513aa13753efdfa3c4abd1 hdr-realm: asterisk hdr-algo: MD5
[Dec 24 17:12:47] DEBUG[932884]: res_pjsip_authenticator_digest.c:367 check_nonce: Calculated nonce 1766581967/1a2b8b7fa9513aa13753efdfa3c4abd1. Actual nonce is 1766581967/1a2b8b7fa9513aa13753efdfa3c4abd1
[Dec 24 17:12:47] DEBUG[932884]: res_pjsip_authenticator_digest.c:431 find_authorization: test1:1:89.219.57.91: realm: asterisk Result SUCCESS
[Dec 24 17:12:47] DEBUG[932884]: res_pjsip_authenticator_digest.c:148 get_authorization_hdr: 1:89.219.57.91: realm: asterisk
[Dec 24 17:12:47] DEBUG[932884]: res_pjsip_authenticator_digest.c:153 get_authorization_hdr: 1:89.219.57.91: realm: asterisk Found header
[Dec 24 17:12:47] DEBUG[932884]: res_pjsip_authenticator_digest.c:190 digest_lookup: 1:89.219.57.91: srv realm: asterisk auth realm: asterisk auth user: 1 hdr user: test1
[Dec 24 17:12:47] DEBUG[932884]: res_pjsip_authenticator_digest.c:256 digest_lookup: 1:89.219.57.91: Username ‘1’ mismatch
[Dec 24 17:12:47] DEBUG[932884]: res_pjsip_authenticator_digest.c:508 verify: test1:1:89.219.57.91: authed: Unknown error 403
[Dec 24 17:12:47] DEBUG[932884]: res_pjsip_authenticator_digest.c:517 verify: test1:1:89.219.57.91: Realm: asterisk Username: 1 Result: FAIL
[Dec 24 17:12:47] DEBUG[932884]: res_pjsip_authenticator_digest.c:691 digest_check_auth: test1:1:89.219.57.91: Auth 1 of 1: Result: FAIL Failure count: 1
[Dec 24 17:12:47] DEBUG[932884]: res_pjsip_authenticator_digest.c:710 digest_check_auth: test1:89.219.57.91: Done with verification. Failures: 1 of 1
[Dec 24 17:12:47] DEBUG[932884]: res_pjsip_authenticator_digest.c:724 digest_check_auth: test1:1:89.219.57.91: Auth 1 of 1: Sending challenges
[Dec 24 17:12:47] DEBUG[932884]: res_pjsip_authenticator_digest.c:732 digest_check_auth: test1:1:89.219.57.91: Auth 1 of 1: Challenging with MD5
[Dec 24 17:12:47] DEBUG[932884]: res_pjsip_authenticator_digest.c:546 challenge: test1:1:89.219.57.91: realm: asterisk time: 1766581967 algorithm: MD5 stale? no
[Dec 24 17:12:47] DEBUG[932884]: res_pjsip_authenticator_digest.c:565 challenge: test1:1:89.219.57.91: Sending challenge for realm: asterisk algorithm: MD5 succeeded
[Dec 24 17:12:47] DEBUG[932884]: res_pjsip_authenticator_digest.c:759 digest_check_auth: test1:1:89.219.57.91: Auth 1 of 1: Challenged with MD5
[Dec 24 17:12:47] DEBUG[932884]: res_pjsip_authenticator_digest.c:763 digest_check_auth: test1:1:89.219.57.91: Auth 1 of 1: Done with challenges
[Dec 24 17:12:47] DEBUG[932884]: res_pjsip_authenticator_digest.c:789 digest_check_auth: test1:xxxx: Result: FAILED
[Dec 24 17:12:47] NOTICE[932884]: res_pjsip/pjsip_distributor.c:688 log_failed_request: Request ‘REGISTER’ from ‘sip:1@xxxx’ failed for ‘xxxx’ (callid: Bm4oRUGvjy) - Failed to authenticate
As i understand it tries authentication of username based on auth_username instead of actual username?
I have allowed all identification orders for testing . Weird thing is, if i put endpoint name on username , and actual username on auth_username, asterisk reads actual username from auth.
but if i put username on username , and endpoint on auth_username, asterisk uses auth username again. So now problem is if asterisk compares auth field with auth section. How do i workaround that, i need to give each user seperate contact on same endpoint.