Colleagues, please tell me what could be wrong…
I have a certain sip client that I wrote on the PJSIP platform. Everything is very simple there and differs little from the example recommended in the documentation.
Then the riddles begin. I have two installations of asterisk. On the same version of the same operating system. With almost identical versions. 18.20.2 and 18.21.0. On asterisk, where chan_sip is installed, registration goes without problems. On the asterisk where res_pjsip is installed, registration does not work.
Message on asterisk:
[Oct 19 03:57:39] NOTICE[104579]: res_pjsip/pjsip_distributor.c:676 log_failed_request: Request 'REGISTER' from '<sip:sipcc@pbx.ogogon.org>' failed for '192.168.1.23:5070' (callid: 23846d8c-8db5-11ef-babd-c86000bcf23c) - Failed to authenticate
Message on client:
03:57:39.626 pjsua_acc.c ..Acc 0: Registration sent
Press 'h' to hangup all calls, 'q' to quit
03:57:39.627 pjsua_core.c .RX 571 bytes Response msg 401/REGISTER/cseq=7739 (rdata0x277a0a795028) from UDP 192.168.1.10:5060:
SIP/2.0 401 Unauthorized
Via: SIP/2.0/UDP 192.168.1.23:5070;rport=5070;received=192.168.1.23;branch=z9hG4bKPj23847784-8db5-11ef-babd-c86000bcf23c
Call-ID: 23846d8c-8db5-11ef-babd-c86000bcf23c
From: <sip:sipcc@pbx.ogogon.org>;tag=23847227-8db5-11ef-babd-c86000bcf23c
To: <sip:sipcc@pbx.ogogon.org>;tag=z9hG4bKPj23847784-8db5-11ef-babd-c86000bcf23c
CSeq: 7739 REGISTER
WWW-Authenticate: Digest realm="asterisk",nonce="1729299459/d3cdc94005136b0eda8401644e4cc55d",opaque="0072867958a1cdcb",algorithm=MD5,qop="auth"
Server: Asterisk PBX 18.20.2
Content-Length: 0
--end msg--
03:57:39.628 sip_auth_client.c ...Digest algorithm is "MD5"
03:57:39.628 pjsua_core.c ....TX 792 bytes Request msg REGISTER/cseq=7740 (tdta0x277a0a80f0a8) to UDP 192.168.1.10:5060:
REGISTER sip:pbx.ogogon.org SIP/2.0
Via: SIP/2.0/UDP 192.168.1.23:5070;rport;branch=z9hG4bKPj2384e3e0-8db5-11ef-babd-c86000bcf23c
Max-Forwards: 70
From: <sip:sipcc@pbx.ogogon.org>;tag=23847227-8db5-11ef-babd-c86000bcf23c
To: <sip:sipcc@pbx.ogogon.org>
Call-ID: 23846d8c-8db5-11ef-babd-c86000bcf23c
CSeq: 7740 REGISTER
Contact: <sip:sipcc@192.168.1.23:5070;ob>
Expires: 300
Allow: PRACK, INVITE, ACK, BYE, CANCEL, UPDATE, INFO, SUBSCRIBE, NOTIFY, REFER, MESSAGE, OPTIONS
Authorization: Digest username="sipcc", realm="asterisk", nonce="1729299459/d3cdc94005136b0eda8401644e4cc55d", uri="sip:pbx.ogogon.org", response="d5ca72aad014e0002bb1340c5f41744b", algorithm=MD5, cnonce="2384d9258db511efbabdc86000bcf23c", opaque="0072867958a1cdcb", qop=auth, nc=00000001
Content-Length: 0
--end msg--
03:57:39.630 pjsua_core.c .RX 571 bytes Response msg 401/REGISTER/cseq=7740 (rdata0x277a0a795028) from UDP 192.168.1.10:5060:
SIP/2.0 401 Unauthorized
Via: SIP/2.0/UDP 192.168.1.23:5070;rport=5070;received=192.168.1.23;branch=z9hG4bKPj2384e3e0-8db5-11ef-babd-c86000bcf23c
Call-ID: 23846d8c-8db5-11ef-babd-c86000bcf23c
From: <sip:sipcc@pbx.ogogon.org>;tag=23847227-8db5-11ef-babd-c86000bcf23c
To: <sip:sipcc@pbx.ogogon.org>;tag=z9hG4bKPj2384e3e0-8db5-11ef-babd-c86000bcf23c
CSeq: 7740 REGISTER
WWW-Authenticate: Digest realm="asterisk",nonce="1729299459/d3cdc94005136b0eda8401644e4cc55d",opaque="7a3a7b7d3800886b",algorithm=MD5,qop="auth"
Server: Asterisk PBX 18.20.2
Content-Length: 0
--end msg--
03:57:39.630 sip_auth_client.c ...Authorization failed for sipcc@asterisk: server rejected with stale=false
03:57:39.630 pjsua_acc.c ....SIP registration error: Credential failed to authenticate (PJSIP_EFAILEDCREDENTIAL) [status=171100]
pjsip.conf:
...
[sipcc]
type=endpoint
context=ogogon
disallow=all
allow=ulaw
auth=sipcc
aors=sipcc
[sipcc]
type=auth
auth_type=userpass
password=XXXXXXXXXXXXXXXXXXXXX
username=sipcc
[sipcc]
type=aor
max_contacts=1
...
I would appreciate any advice and opinions,
Ogogon.