[asterisk-bugs] [JIRA] (ASTERISK-29095) 401 Unauthorized on every request

Yury Kirsanov (JIRA) noreply at issues.asterisk.org
Thu Sep 24 08:54:37 CDT 2020


    [ https://issues.asterisk.org/jira/browse/ASTERISK-29095?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=252236#comment-252236 ] 

Yury Kirsanov commented on ASTERISK-29095:
------------------------------------------

This is an example of un-register attempt after successful registration is already active and AOR is saved by Asterisk:

```[Aug 27 06:10:18] REGISTER sip:10.22.20.29:7060;transport=TCP SIP/2.0
[Aug 27 06:10:18] Via: SIP/2.0/TCP 10.22.21.190:5060;branch=z9hG4bK64ef.0e91fb34.0
[Aug 27 06:10:18] To: sip:104571@ХХХХХХХХХХХХ:7060;transport=TCP
[Aug 27 06:10:18] From: <sip:104571@ХХХХХХХХХХХХХХХ:7060;transport=TCP>;tag=50861319473291bdf2ee9351467673b7-e0dd
[Aug 27 06:10:18] CSeq: 3 REGISTER
[Aug 27 06:10:18] Call-ID: ruTdWqEWGUkEH8PQptf9Qg..
[Aug 27 06:10:18] Max-Forwards: 70
[Aug 27 06:10:18] Content-Length: 0
[Aug 27 06:10:18] User-Agent: OpenSIPS (3.1.0 (x86_64/linux))
[Aug 27 06:10:18] Contact: <sip:104571 at 10.22.21.190:60125;transport=TCP;ctid=8391961688487170>;expires=0
[Aug 27 06:10:18] 
[Aug 27 06:10:18] 
[Aug 27 06:10:18] DEBUG[85380]: res_pjsip/pjsip_distributor.c:394 find_dialog: Could not find matching transaction for Request msg REGISTER/cseq=3 (rdata0x7f9d8c0d8ee8)
[Aug 27 06:10:18] DEBUG[85380]: res_pjsip/pjsip_distributor.c:472 ast_sip_get_distributor_serializer: Calculated serializer pjsip/distributor-0000007f to use for Request msg REGISTER/cseq=3 (rdata0x7f9d8c0d8ee8)
[Aug 27 06:10:18] DEBUG[85381]: res_pjsip_endpoint_identifier_user.c:148 username_identify: Attempting identify by From username '104571' domain 'ХХХХХХХХХХХХХХХХХХХХХ'
[Aug 27 06:10:18] DEBUG[85381]: res_pjsip_endpoint_identifier_user.c:160 username_identify: Identified by From username '104571' domain 'ХХХХХХХХХХХХХХХХХХХХХХХХХХ'
[Aug 27 06:10:18] DEBUG[85381]: res_pjsip_authenticator_digest.c:454 digest_check_auth: Using default realm 'ХХХХХХХХХХХХХХХХХХХХХ' on incoming auth '104571'.
[Aug 27 06:10:18] DEBUG[85381]: netsock2.c:170 ast_sockaddr_split_hostport: Splitting '10.22.20.29' into...
[Aug 27 06:10:18] DEBUG[85381]: netsock2.c:224 ast_sockaddr_split_hostport: ...host '10.22.20.29' and port ''.
[Aug 27 06:10:18] DEBUG[85381]: netsock2.c:170 ast_sockaddr_split_hostport: Splitting '10.22.21.190' into...
[Aug 27 06:10:18] DEBUG[85381]: netsock2.c:224 ast_sockaddr_split_hostport: ...host '10.22.21.190' and port ''.
[Aug 27 06:10:18] DEBUG[85381]: netsock2.c:170 ast_sockaddr_split_hostport: Splitting '10.22.21.190' into...
[Aug 27 06:10:18] DEBUG[85381]: netsock2.c:224 ast_sockaddr_split_hostport: ...host '10.22.21.190' and port ''.
[Aug 27 06:10:18] <--- Transmitting SIP response (569 bytes) to TCP:10.22.21.190:59017 --->
[Aug 27 06:10:18] SIP/2.0 401 Unauthorized
[Aug 27 06:10:18] Via: SIP/2.0/TCP 10.22.21.190:5060;rport=59017;received=10.22.21.190;branch=z9hG4bK64ef.0e91fb34.0
[Aug 27 06:10:18] Call-ID: ruTdWqEWGUkEH8PQptf9Qg..
[Aug 27 06:10:18] From: <sip:104571@ХХХХХХХХХХХХХХХХХХХХХ>;tag=50861319473291bdf2ee9351467673b7-e0dd
[Aug 27 06:10:18] To: <sip:104571@ХХХХХХХХХХХХХХХХХХХХ>;tag=z9hG4bK64ef.0e91fb34.0;transport=TCP
[Aug 27 06:10:18] CSeq: 3 REGISTER
[Aug 27 06:10:18] WWW-Authenticate: Digest realm="ХХХХХХХХХХХХХХХХХХХХХХХ",nonce="1598472618/13f170422dd641af4a0e6175d185d555",opaque="1f042b941280b1d6",algorithm=md5,qop="auth"
[Aug 27 06:10:18] Server: ХХХХХ/1.7.1
[Aug 27 06:10:18] Content-Length:  0```

> 401 Unauthorized on every request
> ---------------------------------
>
>                 Key: ASTERISK-29095
>                 URL: https://issues.asterisk.org/jira/browse/ASTERISK-29095
>             Project: Asterisk
>          Issue Type: Bug
>      Security Level: None
>          Components: pjproject/pjsip
>    Affects Versions: 16.12.0, 16.13.0
>         Environment: Ubuntu 18.04.5 LTS
>            Reporter: Yury Kirsanov
>
> Hi,
> We have an Asterisk server that has PJSIP configured in UDP transport mode. As this is a test server - only one SIP endpoint created with AOR and AUTH sections. Authentication mode is set to "auth_username,username,ip,anonymous". I can register to the PBX fine with my softphone, but upon each request Asterisk for some reason asks for credentials, even for de-registration, which is important to me. According to Asterisk documentation:
> https://wiki.asterisk.org/wiki/display/AST/Tests+for+Registration+Functionality
> section 'Un-registration tests' it shouldn't be asking for credentials as user is already registered in system. Same applies to calls, after successful registration when softphone sends INVITE packet Asterisk first replies with 401 Unauthorized and after authentication processes the call ok. What could be an issue of such behaviour? Thanks!



--
This message was sent by Atlassian JIRA
(v6.2#6252)



More information about the asterisk-bugs mailing list