flutter-webrtc / dart-sip-ua

A dart-lang version of the SIP UA stack.
MIT License
337 stars 268 forks source link

Incoming call issue Android/Web #155

Closed ironpotter closed 3 years ago

ironpotter commented 4 years ago

Describe the bug After receiving the phone call and answer, the call been ended with errors:

WEBRTC_SET_REMOTE_DESCRIPTION_ERROR: Failed to set remote offer sdp: Called with SDP without DTLS fingerprint.

Level.debug sip_ua_helper.dart:199 ::: call failed with cause: Code: [488], Cause: WebRTC Error, Reason: SetRemoteDescription(offer) failed

Level.error rtc_session.dart:633 ::: emit "peerconnection:setremotedescriptionfailed" [error:Unable to RTCPeerConnection::setRemoteDescription: peerConnectionSetRemoteDescription(): WEBRTC_SET_REMOTE_DESCRIPTION_ERROR: Failed to set remote offer sdp: Called with SDP without DTLS fingerprint.]

Full log

[2020-11-12 13:27:02.481] Level.debug null ::: answer()
[2020-11-12 13:27:02.573] Level.debug null ::: dialog 51000cf4502e71734989baab4b4b2ba4@172.21.0.34:50602890qs5092as29042847  changed to CONFIRMED state
v=0
o=root 244011947 244011947 IN IP4 185.105.176.13
s=Asterisk PBX GIT-master-4c084c6M
c=IN IP4 185.105.176.13
t=0 0
m=audio 31708 RTP/AVP 8 18 101
a=maxptime:150
a=rtpmap:8 PCMA/8000
a=rtpmap:18 G729/8000
a=rtpmap:101 telephone-event/8000
a=fmtp:18 annexb=no
a=fmtp:101 0-16
a=sendrecv
a=rtcp:31709
a=ptime:20

[2020-11-12 13:27:02.600] Level.debug null ::: emit "peerconnection"
[2020-11-12 13:27:04.122] Level.debug null ::: emit "sdp"
[2020-11-12 13:27:04.154] Level.debug null ::: send()
[2020-11-12 13:27:04.178] Level.debug null ::: send()
[2020-11-12 13:27:04.194] Level.debug null ::: send: 

SIP/2.0 488 Not Acceptable Here
Via: SIP/2.0/WSS 185.105.176.13:8443;branch=z9hG4bKa9b8.640def70a1395ea0f06b67e3719ec6dd.0
Via: SIP/2.0/UDP 172.21.0.34:5060;rport=5060;branch=z9hG4bK3b45f273
To: <sip:2zTFSowQUKjoSU4IP@185.105.176.13>;tag=2890qs5092
From: "0548019011" <sip:0548019011@172.21.0.34>;tag=as29042847
Call-ID: 51000cf4502e71734989baab4b4b2ba4@172.21.0.34:5060
CSeq: 102 INVITE
Supported: timer,ice,replaces,outbound
Content-Length: 0

[2020-11-12 13:27:04.208] Level.debug null ::: session failed
[2020-11-12 13:27:04.213] Level.debug null ::: emit "_failed"
[2020-11-12 13:27:04.224] Level.debug null ::: close()
[2020-11-12 13:27:04.235] Level.debug null ::: emit "failed"
[2020-11-12 13:27:04.243] Level.debug null ::: call failed with cause: Code: [488], Cause: WebRTC Error, Reason: SetRemoteDescription(offer) failed
##### _handleCallState: CallStateEnum.FAILED
[2020-11-12 13:27:04.256] Level.error null ::: emit "peerconnection:setremotedescriptionfailed" [error:InvalidAccessError: Failed to execute 'setRemoteDescription' on 'RTCPeerConnection': Failed to set remote offer sdp: Called with SDP without DTLS fingerprint.]
dialer calling page # _handleFailState()
disposeRenderers()
_backToDialPad()
[2020-11-12 13:27:04.265] Level.debug null ::: close() | closing local MediaStream
[2020-11-12 13:27:04.275] Level.debug null ::: dialog 51000cf4502e71734989baab4b4b2ba4@172.21.0.34:50602890qs5092as29042847 deleted
[2020-11-12 13:27:04.310] Level.debug null ::: Received WebSocket message
[2020-11-12 13:27:04.320] Level.debug null ::: received text message:

ACK sip:xtf8hkzm@qeotm4c7lvq7.invalid SIP/2.0
Via: SIP/2.0/WSS 185.105.176.13:8443;branch=z9hG4bKa9b8.640def70a1395ea0f06b67e3719ec6dd.0
Max-Forwards: 69
From: "0548019011" <sip:0548019011@172.21.0.34>;tag=as29042847
To: <sip:2zTFSowQUKjoSU4IP@185.105.176.13>;tag=2890qs5092
Call-ID: 51000cf4502e71734989baab4b4b2ba4@172.21.0.34:5060
CSeq: 102 ACK
Content-Length: 0

Error: Assertion failed: "peerconnection.setRemoteDescription() failed"
    at Object.throw_ [as throw] (http://localhost:34633/dart_sdk.js:4339:11)
    at rtc_session.RTCSession.new.answer (http://localhost:34633/packages/sip_ua/src/event_manager/transport_events.dart.lib.js:6729:21)
    at answer.throw (<anonymous>)
    at http://localhost:34633/dart_sdk.js:37685:38
    at _RootZone.runBinary (http://localhost:34633/dart_sdk.js:37538:58)
    at _FutureListener.thenAwait.handleError (http://localhost:34633/dart_sdk.js:32519:48)
    at handleError (http://localhost:34633/dart_sdk.js:33070:51)
    at Function._propagateToListeners (http://localhost:34633/dart_sdk.js:33096:17)
    at _Future.new.[_completeError] (http://localhost:34633/dart_sdk.js:32943:23)
    at async._AsyncCallbackEntry.new.callback (http://localhost:34633/dart_sdk.js:32981:31)
    at Object._microtaskLoop (http://localhost:34633/dart_sdk.js:37794:13)
    at _startMicrotaskLoop (http://localhost:34633/dart_sdk.js:37800:13)
    at http://localhost:34633/dart_sdk.js:33309:9
┌───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────
│ #0   packages/sip_ua/src/sip_ua_helper.dart 342:14                            [_notifyCallStateListeners]
│ #1   packages/sip_ua/src/sip_ua_helper.dart 249:9                             <fn>
├┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄
│ ⛔ Call 51000cf4502e71734989baab4b4b2ba4@172.21.0.34:5060as29042847 not found!
└───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────

System Infomation() Flutter SDK Version: Flutter 1.23.0-18.1.pre Target OS and Version: Web chrome Host OS and Version: Android 10

Thanks in advance.

cloudwebrtc commented 3 years ago

Your asterisk sends sdp and is not compatible with webrtc, because webrtc must be SAVPF, that is, dtls-srtp, rtcp-fb, ice, etc. must be enabled.

dvxgit-rvillanueva commented 1 year ago

Your asterisk sends sdp and is not compatible with webrtc, because webrtc must be SAVPF, that is, dtls-srtp, rtcp-fb, ice, etc. must be enabled.

how can I enable this on asterisk?