SIP register fails: No username on digest authentication
This bug has been driving me mad for quite some time. I just installed Ring for Ubuntu 16.04 following official instructions, opened, set up a SIP account with hostname=10.139.205.101, username=10, password=test and it fails to register.
My Asterisk server sends:
From: "main" <sip:10@10.139.205.101>;tag=8005b703-201b-47e8-be88-03d7564a5ba8
To: "main" <sip:10@10.139.205.101>;tag=as3f952c47
...
WWW-Authenticate: Digest algorithm=MD5, realm="asterisk", nonce="0074f5d0"
And Ring then sends:
From: "main" <sip:10@10.139.205.101>;tag=8005b703-201b-47e8-be88-03d7564a5ba8
To: "main" <sip:10@10.139.205.101>
...
Authorization: Digest , realm="asterisk", nonce="0074f5d0", uri="sip:10.139.205.101", response="631415fcf3715907a48f11fec1e6a880", algorithm=MD5
i.e. notice the space and comma after Digest
ring-daemon version 2018-07-07. Bug could be on upstream, for some reason username is not set on pjsip/src/pjsip/sip_auth_client.c
when adding the Authorization header, header printed here.