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
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
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.