sipsorcery-org / sipsorcery

A WebRTC, SIP and VoIP library for C# and .NET. Designed for real-time communications apps.
https://sipsorcery-org.github.io/sipsorcery
Other
1.39k stars 424 forks source link

Register Unauthorized #1114

Closed at1993 closed 2 months ago

at1993 commented 2 months ago

Hello,

I am trying out the Softphone sample app to connect to a FreePbx box. No modification to the code except adding SIP account info to app.config. It fails to register on startup. Below is the message captured. Not sure if I am missing any settings. Please advice. Thank.

No. Time Source Destination Protocol Length Info 12 -17.455802 10.10.10.60 10.10.10.48 SIP 520 Request: REGISTER sip:10.10.10.48 (1 binding) | 13 -17.448670 10.10.10.48 10.10.10.60 SIP 571 Status: 401 Unauthorized | 14 -17.332146 10.10.10.60 10.10.10.48 SIP 776 Request: REGISTER sip:10.10.10.48 (1 binding) | 15 -17.326621 10.10.10.48 10.10.10.60 SIP 571 Status: 401 Unauthorized |

REGISTER sip:10.10.10.48 SIP/2.0 Via: SIP/2.0/UDP 10.10.10.60:5060;branch=z9hG4bK22ad8403e34c4c02b1e7a7828a51707c;rport To: sip:203@10.10.10.48 From: sip:203@10.10.10.48;tag=JCEULYJVUS Call-ID: d878e91f-07e8-462c-b689-affc39f47b65 CSeq: 1 REGISTER Contact: Max-Forwards: 70 User-Agent: sipsorcery_v6.2.3.0 Expires: 180 Allow: ACK, BYE, CANCEL, INFO, INVITE, NOTIFY, OPTIONS, PRACK, REFER, REGISTER, SUBSCRIBE Content-Length: 0

SIP/2.0 401 Unauthorized Via: SIP/2.0/UDP 10.10.10.60:5060;rport=5060;received=10.10.10.60;branch=z9hG4bK22ad8403e34c4c02b1e7a7828a51707c Call-ID: d878e91f-07e8-462c-b689-affc39f47b65 From: sip:203@10.10.10.48;tag=JCEULYJVUS To: sip:203@10.10.10.48;tag=z9hG4bK22ad8403e34c4c02b1e7a7828a51707c CSeq: 1 REGISTER WWW-Authenticate: Digest realm="asterisk",nonce="1714265374/b05739afbd561a9e8a1cd737cbc9979d",opaque="2da01d9210afdacd",algorithm=MD5,qop="auth" Server: FPBX-16.0.40.7(18.20.2) Content-Length: 0

REGISTER sip:10.10.10.48 SIP/2.0 Via: SIP/2.0/UDP 10.10.10.60:5060;branch=z9hG4bK57f9c875706f4d2e86afe28467499ec9;rport To: sip:203@10.10.10.48 From: sip:203@10.10.10.48;tag=JCEULYJVUS Call-ID: d878e91f-07e8-462c-b689-affc39f47b65 CSeq: 2 REGISTER Contact: Max-Forwards: 70 User-Agent: sipsorcery_v6.2.3.0 Expires: 180 Allow: ACK, BYE, CANCEL, INFO, INVITE, NOTIFY, OPTIONS, PRACK, REFER, REGISTER, SUBSCRIBE Authorization: Digest username="203",realm="asterisk",nonce="1714265374/b05739afbd561a9e8a1cd737cbc9979d",uri="sip:10.10.10.48",response="ec289080ee7c443f23c488e9065e6236",cnonce="1912581452",nc=00000001,qop=auth,opaque="2da01d9210afdacd",algorithm=MD5 Content-Length: 0

SIP/2.0 401 Unauthorized Via: SIP/2.0/UDP 10.10.10.60:5060;rport=5060;received=10.10.10.60;branch=z9hG4bK57f9c875706f4d2e86afe28467499ec9 Call-ID: d878e91f-07e8-462c-b689-affc39f47b65 From: sip:203@10.10.10.48;tag=JCEULYJVUS To: sip:203@10.10.10.48;tag=z9hG4bK57f9c875706f4d2e86afe28467499ec9 CSeq: 2 REGISTER WWW-Authenticate: Digest realm="asterisk",nonce="1714265374/b05739afbd561a9e8a1cd737cbc9979d",opaque="6bc71bce33bcb4fa",algorithm=MD5,qop="auth" Server: FPBX-16.0.40.7(18.20.2) Content-Length: 0

at1993 commented 2 months ago

Oops. forgot to apply changes in FreePbx.