dart-sip-ua icon indicating copy to clipboard operation
dart-sip-ua copied to clipboard

web socket error: 1002 1005

Open a42279395 opened this issue 2 years ago • 2 comments

Describe the bug

1002 or 1005 error occurs probabilistically when websocket sends a message. Please guide me and let me know where I am going wrong? Thank you very much!

flutter: [2022-05-25 17:11:39.494] Level.debug ua.dart:239 ::: call() flutter: [2022-05-25 17:11:39.496] Level.debug rtc_session.dart:69 ::: new flutter: [2022-05-25 17:11:39.499] Level.debug rtc_session.dart:262 ::: connect() flutter: [2022-05-25 17:11:39.588] Level.debug rtc_session.dart:1634 ::: emit "peerconnection" flutter: [2022-05-25 17:11:39.590] Level.debug rtc_session.dart:2924 ::: newRTCSession() flutter: [2022-05-25 17:11:39.592] Level.debug sip_ua_helper.dart:166 ::: newRTCSession => Instance of 'EventNewRTCSession' flutter: 呼叫状态= CallStateEnum.CALL_INITIATION flutter: [2022-05-25 17:11:39.595] Level.debug rtc_session.dart:2929 ::: session connecting flutter: [2022-05-25 17:11:39.596] Level.debug rtc_session.dart:2930 ::: emit "connecting" flutter: [2022-05-25 17:11:39.597] Level.debug sip_ua_helper.dart:205 ::: call connecting flutter: 呼叫状态= CallStateEnum.CONNECTING flutter: [2022-05-25 17:11:39.599] Level.debug rtc_session.dart:1641 ::: createLocalDescription() flutter: dest = Instance of 'RTCSessionDescription' flutter: 呼叫状态= CallStateEnum.STREAM flutter: [2022-05-25 17:11:39.700] Level.debug websocket_interface.dart:173 ::: Received WebSocket message flutter: [2022-05-25 17:11:39.705] Level.debug transport.dart:313 ::: received text message: SIP/2.0 480 Temporarily Unavailable Via: SIP/2.0/WSS c59201h9084r.invalid;branch=z9hG4bK19179831660000000;received=192.168.0.1;rport=54180 Max-Forwards: 69 From: "45-29" sip:[email protected]:7443;tag=ixukyevxtz To: sip:[email protected]:7443;tag=c4gr0DH7NDQje Call-ID: wxjesbk9cfjwp6b9evlw CSeq: 6021 INVITE User-Agent: ddtswitch Allow: INVITE, ACK, BYE, CANCEL, OPTIONS, MESSAGE, INFO, UPDATE, REGISTER, REFER, NOTIFY Supported: timer, path, replaces Allow-Events: talk, hold, conference, refer Reason: Q.850;cause=31;text="NORMAL_UNSPECIFIED" Content-Length: 0 Remote-Party-ID: "Outbound Call" sip:[email protected];party=calling;privacy=off;screen=no flutter: [2022-05-25 17:11:39.726] Level.debug transport.dart:167 ::: send() flutter: [2022-05-25 17:11:39.732] Level.debug websocket_interface.dart:135 ::: send() flutter: [2022-05-25 17:11:39.737] Level.debug rtc_session.dart:2313 ::: receiveInviteResponse() flutter: [2022-05-25 17:11:39.746] Level.debug invite_client.dart:90 ::: Timer D expired for transaction z9hG4bK19179831660000000 flutter: [2022-05-25 17:11:39.893] Level.debug websocket_dart_impl.dart:51 ::: send: ACK sip:[email protected]:7443 SIP/2.0 Via: SIP/2.0/WSS c59201h9084r.invalid;branch=z9hG4bK19179831660000000 Max-Forwards: 69 To: sip:[email protected]:7443;tag=c4gr0DH7NDQje From: "45-29" sip:[email protected]:7443;tag=ixukyevxtz Call-ID: wxjesbk9cfjwp6b9evlw CSeq: 6021 ACK Allow: INVITE,ACK,CANCEL,BYE,UPDATE,MESSAGE,OPTIONS,REFER,INFO Supported: outbound User-Agent: Dart SIP Client v1.0.0 Content-Length: 0 flutter: [2022-05-25 17:11:40.119] Level.debug rtc_session.dart:1685 ::: emit "sdp" flutter: [2022-05-25 17:11:40.122] Level.debug rtc_session.dart:2293 ::: emit "sending" [request] flutter: [2022-05-25 17:11:40.125] Level.debug transport.dart:167 ::: send() flutter: [2022-05-25 17:11:40.128] Level.debug sip_message.dart:275 ::: Outgoing Message: v=0 o=- 2102370010760460136 2 IN IP4 127.0.0.1 s=- t=0 0 a=group:BUNDLE 0 a=extmap-allow-mixed a=msid-semantic: WMS 8F8A3019-BDBB-46EE-82D9-7B1A9728E824 m=audio 58913 UDP/TLS/RTP/SAVPF 111 63 103 104 9 102 0 8 106 105 13 110 112 113 126 c=IN IP4 192.168.0.180 a=rtcp:9 IN IP4 0.0.0.0 a=candidate:1333723911 1 udp 2122260223 192.168.0.180 58913 typ host generation 0 network-id 1 network-cost 10 a=candidate:2712794821 1 udp 2122194687 169.254.143.248 63755 typ host generation 0 network-id 2 network-cost 10 a=candidate:33357815 1 tcp 1518280447 192.168.0.180 54204 typ host tcptype passive generation 0 network-id 1 network-cost 10 a=candidate:4013034037 1 tcp 1518214911 169.254.143.248 54205 typ host tcptype passive generation 0 network-id 2 network-cost 10 a=ice-ufrag:/1PW a=ice-pwd:jfseywVLYAqXL1J4f74BN5za a=ice-options:trickle renomination a=fingerprint:sha-256 7D:0A:AB:CB:AA:B7:F1:7A:48:24:6E:3E:51:44:B6:56:EC:97:ED:87:7A:57:97:B8:42:3C:C9:41:B8:A6:E6:46 a=setup:actpass a=mid:0 a=extmap:1 urn:ietf:params:rtp-hdrext:ssrc-audio-level a=extmap:2 http://www.webrtc.org/experiments/rtp-hdrext/abs-send-time a=extmap:3 http://www.ietf.org/id/draft-holmer-rmcat-transport-wide-cc-extensions-01 a=extmap:4 urn:ietf:params:rtp-hdrext:sdes:mid a=sendrecv a=msid:8F8A3019-BDBB-46EE-82D9-7B1A9728E824 DC77AC82-EC20-4073-8E72-C351D79CD120 a=rtcp-mux a=rtpmap:111 opus/48000/2 a=rtcp-fb:111 transport-cc a=fmtp:111 minptime=10;useinbandfec=1 a=rtpmap:63 red/48000/2 a=fmtp:63 111/111 a=rtpmap:103 ISAC/16000 a=rtpmap:104 ISAC/32000 a=rtpmap:9 G722/8000 a=rtpmap:102 ILBC/8000 a=rtpmap:0 PCMU/8000 a=rtpmap:8 PCMA/8000 a=rtpmap:106 CN/32000 a=rtpmap:105 CN/16000 a=rtpmap:13 CN/8000 a=rtpmap:110 telephone-event/48000 a=rtpmap:112 telephone-event/32000 a=rtpmap:113 telephone-event/16000 a=rtpmap:126 telephone-event/8000 a=ssrc:1296735261 cname:PeRE/tRu+J5roJuP a=ssrc:1296735261 msid:8F8A3019-BDBB-46EE-82D9-7B1A9728E824 DC77AC82-EC20-4073-8E72-C351D79CD120 a=ssrc:1296735261 mslabel:8F8A3019-BDBB-46EE-82D9-7B1A9728E824 a=ssrc:1296735261 label:DC77AC82-EC20-4073-8E72-C351D79CD120 flutter: [2022-05-25 17:11:40.133] Level.debug websocket_interface.dart:135 ::: send() flutter: [2022-05-25 17:11:40.146] Level.debug websocket_interface.dart:100 ::: Closed [1002, null]! flutter: [2022-05-25 17:11:40.150] Level.debug websocket_interface.dart:165 ::: WebSocket wss://dev.haoxin.cn:7443 closed flutter: [2022-05-25 17:11:40.157] Level.debug non_invite_client.dart:53 ::: transport error occurred, deleting transaction z9hG4bK387061027 flutter: [2022-05-25 17:11:40.164] Level.debug sip_ua_helper.dart:158 ::: registrationFailed => Code: [500], Cause: SIP Failure Code, Reason: Connection Error flutter: 注册状态 = RegistrationStateEnum.REGISTRATION_FAILED flutter: [2022-05-25 17:11:40.169] Level.debug sip_ua_helper.dart:151 ::: unregistered => Code: [500], Cause: Connection Error, Reason: Connection Error flutter: 注册状态 = RegistrationStateEnum.UNREGISTERED flutter: [2022-05-25 17:11:40.174] Level.debug invite_client.dart:60 ::: transport error occurred, deleting transaction z9hG4bK759216310000000 flutter: ^[[38;5;196m[2022-05-25 17:11:40.178] Level.error rtc_session.dart:1405 ::: onTransportError()<…> flutter: [2022-05-25 17:11:40.182] Level.debug rtc_session.dart:720 ::: terminate() flutter: [2022-05-25 17:11:40.187] Level.debug rtc_session.dart:745 ::: canceling session flutter: [2022-05-25 17:11:40.191] Level.debug rtc_session.dart:2967 ::: session failed flutter: [2022-05-25 17:11:40.195] Level.debug rtc_session.dart:2970 ::: emit "_failed" flutter: [2022-05-25 17:11:40.199] Level.debug rtc_session.dart:1483 ::: close() flutter: [2022-05-25 17:11:40.204] Level.debug rtc_session.dart:2981 ::: emit "failed" flutter: [2022-05-25 17:11:40.208] Level.debug sip_ua_helper.dart:214 ::: call failed with cause: Code: [500], Cause: Canceled, Reason: SIP ;cause=500 ;text="Connection Error"

or

flutter: [2022-05-25 17:20:40.625] Level.debug ua.dart:239 ::: call() flutter: [2022-05-25 17:20:40.628] Level.debug rtc_session.dart:69 ::: new flutter: [2022-05-25 17:20:40.630] Level.debug rtc_session.dart:262 ::: connect() flutter: Instance of 'Routing' [GETX] GOING TO ROUTE /calloutSurveyDetails flutter: [2022-05-25 17:20:40.650] Level.debug rtc_session.dart:1634 ::: emit "peerconnection" flutter: [2022-05-25 17:20:40.652] Level.debug rtc_session.dart:2924 ::: newRTCSession() flutter: [2022-05-25 17:20:40.654] Level.debug sip_ua_helper.dart:166 ::: newRTCSession => Instance of 'EventNewRTCSession' flutter: 呼叫状态= CallStateEnum.CALL_INITIATION flutter: [2022-05-25 17:20:40.656] Level.debug rtc_session.dart:2929 ::: session connecting flutter: [2022-05-25 17:20:40.657] Level.debug rtc_session.dart:2930 ::: emit "connecting" flutter: [2022-05-25 17:20:40.658] Level.debug sip_ua_helper.dart:205 ::: call connecting flutter: 呼叫状态= CallStateEnum.CONNECTING flutter: [2022-05-25 17:20:40.659] Level.debug rtc_session.dart:1641 ::: createLocalDescription() [GETX] Instance "CalloutSurveyDetailsViewModel" has been created [GETX] Instance "CalloutSurveyDetailsViewModel" has been initialized flutter: dest = Instance of 'RTCSessionDescription' flutter: [2022-05-25 17:20:41.234] Level.debug rtc_session.dart:1685 ::: emit "sdp" flutter: [2022-05-25 17:20:41.236] Level.debug rtc_session.dart:2293 ::: emit "sending" [request] flutter: [2022-05-25 17:20:41.239] Level.debug transport.dart:167 ::: send() flutter: [2022-05-25 17:20:41.241] Level.debug sip_message.dart:275 ::: Outgoing Message: v=0 o=- 2060398187826088475 2 IN IP4 127.0.0.1 s=- t=0 0 a=group:BUNDLE 0 a=extmap-allow-mixed a=msid-semantic: WMS 05E58EAB-FC1F-4855-8D86-188AFA770885 m=audio 53515 UDP/TLS/RTP/SAVPF 111 63 103 104 9 102 0 8 106 105 13 110 112 113 126 c=IN IP4 113.4.236.210 a=rtcp:9 IN IP4 0.0.0.0 a=candidate:1333723911 1 udp 2122260223 192.168.0.180 53515 typ host generation 0 network-id 1 network-cost 10 a=candidate:2712794821 1 udp 2122194687 169.254.143.248 64372 typ host generation 0 network-id 2 network-cost 10 a=candidate:33357815 1 tcp 1518280447 192.168.0.180 54568 typ host tcptype passive generation 0 network-id 1 network-cost 10 a=candidate:4013034037 1 tcp 1518214911 169.254.143.248 54569 typ host tcptype passive generation 0 network-id 2 network-cost 10 a=candidate:3459712435 1 udp 1686052607 113.4.236.210 53515 typ srflx raddr 192.168.0.180 rport 53515 generation 0 network-id 1 network-cost 10 a=ice-ufrag:9LWw a=ice-pwd:yspwyRN2fYMD/JJSIwtUaJgi a=ice-options:trickle renomination a=fingerprint:sha-256 E6:8E:D3:48:AC:42:72:B3:A8:E9:98:7D:08:5D:E3:9F:30:7A:5B:94:AC:CB:3A:1C:49:D1:A6:9C:E5:B5:98:43 a=setup:actpass a=mid:0 a=extmap:1 urn:ietf:params:rtp-hdrext:ssrc-audio-level a=extmap:2 http://www.webrtc.org/experiments/rtp-hdrext/abs-send-time a=extmap:3 http://www.ietf.org/id/draft-holmer-rmcat-transport-wide-cc-extensions-01 a=extmap:4 urn:ietf:params:rtp-hdrext:sdes:mid a=sendrecv a=msid:05E58EAB-FC1F-4855-8D86-188AFA770885 0141F190-292C-4102-9117-268790A901E1 a=rtcp-mux a=rtpmap:111 opus/48000/2 a=rtcp-fb:111 transport-cc a=fmtp:111 minptime=10;useinbandfec=1 a=rtpmap:63 red/48000/2 a=fmtp:63 111/111 a=rtpmap:103 ISAC/16000 a=rtpmap:104 ISAC/32000 a=rtpmap:9 G722/8000 a=rtpmap:102 ILBC/8000 a=rtpmap:0 PCMU/8000 a=rtpmap:8 PCMA/8000 a=rtpmap:106 CN/32000 a=rtpmap:105 CN/16000 a=rtpmap:13 CN/8000 a=rtpmap:110 telephone-event/48000 a=rtpmap:112 telephone-event/32000 a=rtpmap:113 telephone-event/16000 a=rtpmap:126 telephone-event/8000 a=ssrc:1508100463 cname:4a4ZJmKpg0I9vD9Z a=ssrc:1508100463 msid:05E58EAB-FC1F-4855-8D86-188AFA770885 0141F190-292C-4102-9117-268790A901E1 a=ssrc:1508100463 mslabel:05E58EAB-FC1F-4855-8D86-188AFA770885 a=ssrc:1508100463 label:0141F190-292C-4102-9117-268790A901E1 flutter: [2022-05-25 17:20:41.244] Level.debug websocket_interface.dart:135 ::: send() flutter: [2022-05-25 17:20:41.248] Level.debug websocket_dart_impl.dart:56 ::: send: INVITE sip:[email protected]:7443 SIP/2.0 Via: SIP/2.0/WSS 68a46222318m.invalid;branch=z9hG4bK18373712310000000 Max-Forwards: 69 To: sip:[email protected]:7443 From: "45-29" sip:[email protected]:7443;tag=5b68xbyq64 Call-ID: dmqjny811m3c7ptxk8yj CSeq: 7171 INVITE X-missionid:270 Contact: sip:[email protected];transport=wss;ob Content-Type: application/sdp Session-Expires: 120 Allow: INVITE,ACK,CANCEL,BYE,UPDATE,MESSAGE,OPTIONS,REFER,INFO Supported: timer,ice,replaces,outbound User-Agent: Dart SIP Client v1.0.0 Content-Length: 2277 v=0 o=- 2060398187826088475 2 IN IP4 127.0.0.1 s=- t=0 0 a=group:BUNDLE 0 a=extmap-allow-mixed a=msid-semantic: WMS 05E58EAB-FC1F-4855-8D86-188AFA770885 m=audio 53515 UDP/TLS/RTP/SAVPF 111 63 103 104 9 102 0 8 106 105 13 110 112 113 126 c=IN IP4 113.4.236.210 a=rtcp:9 IN IP4 0.0.0.0 a=candidate:1333723911 1 udp 2122260223 192.168.0.180 53515 typ host generation 0 network-id 1 network-cost 10 a=candidate:2712794821 1 udp 2122194687 169.254.143.248 64372 typ host generation 0 network-id 2 network-cost 10 a=candidate:33357815 1 tcp 1518280447 192.168.0.180 54568 typ host tcptype passive generation 0 network-id 1 network-cost 10 a=candidate:4013034037 1 tcp 1518214911 169.254.143.248 54569 typ host tcptype passive generation 0 network-id 2 network-cost 10 a=candidate:3459712435 1 udp 1686052607 113.4.236.210 53515 typ srflx raddr 192.168.0.180 rport 53515 generation 0 network-id 1 network-cost 10 a=ice-ufrag:9LWw a=ice-pwd:yspwyRN2fYMD/JJSIwtUaJgi a=ice-options:trickle renomination a=fingerprint:sha-256 E6:8E:D3:48:AC:42:72:B3:A8:E9:98:7D:08:5D:E3:9F:30:7A:5B:94:AC:CB:3A:1C:49:D1:A6:9C:E5:B5:98:43 a=setup:actpass a=mid:0 a=extmap:1 urn:ietf:params:rtp-hdrext:ssrc-audio-level a=extmap:2 http://www.webrtc.org/experiments/rtp-hdrext/abs-send-time a=extmap:3 http://www.ietf.org/id/draft-holmer-rmcat-transport-wide-cc-extensions-01 a=extmap:4 urn:ietf:params:rtp-hdrext:sdes:mid a=sendrecv a=msid:05E58EAB-FC1F-4855-8D86-188AFA770885 0141F190-292C-4102-9117-268790A901E1 a=rtcp-mux a=rtpmap:111 opus/48000/2 a=rtcp-fb:111 transport-cc a=fmtp:111 minptime=10;useinbandfec=1 a=rtpmap:63 red/48000/2 a=fmtp:63 111/111 a=rtpmap:103 ISAC/16000 a=rtpmap:104 ISAC/32000 a=rtpmap:9 G722/8000 a=rtpmap:102 ILBC/8000 a=rtpmap:0 PCMU/8000 a=rtpmap:8 PCMA/8000 a=rtpmap:106 CN/32000 a=rtpmap:105 CN/16000 a=rtpmap:13 CN/8000 a=rtpmap:110 telephone-event/48000 a=rtpmap:112 telephone-event/32000 a=rtpmap:113 telephone-event/16000 a=rtpmap:126 telephone-event/8000 a=ssrc:1508100463 cname:4a4ZJmKpg0I9vD9Z a=ssrc:1508100463 msid:05E58EAB-FC1F-4855-8D86-188AFA770885 0141F190-292C-4102-9117-268790A901E1 a=ssrc:1508100463 mslabel:05E58EAB-FC1F-4855-8D86-188AFA770885 a=ssrc:1508100463 label:0141F190-292C-4102-9117-268790A901E1 flutter: [2022-05-25 17:20:41.288] Level.debug websocket_interface.dart:100 ::: Closed [1005, ]! flutter: [2022-05-25 17:20:41.294] Level.debug websocket_interface.dart:165 ::: WebSocket wss://dev.haoxin.cn:7443 closed flutter: [2022-05-25 17:20:41.305] Level.debug invite_client.dart:60 ::: transport error occurred, deleting transaction z9hG4bK18373712310000000 flutter: ^[[38;5;196m[2022-05-25 17:20:41.313] Level.error rtc_session.dart:1405 ::: onTransportError()<…> flutter: [2022-05-25 17:20:41.324] Level.debug rtc_session.dart:720 ::: terminate() flutter: [2022-05-25 17:20:41.330] Level.debug rtc_session.dart:745 ::: canceling session flutter: [2022-05-25 17:20:41.337] Level.debug rtc_session.dart:2967 ::: session failed flutter: [2022-05-25 17:20:41.343] Level.debug rtc_session.dart:2970 ::: emit "_failed" flutter: [2022-05-25 17:20:41.350] Level.debug rtc_session.dart:1483 ::: close() flutter: [2022-05-25 17:20:41.357] Level.debug rtc_session.dart:2981 ::: emit "failed" flutter: [2022-05-25 17:20:41.364] Level.debug sip_ua_helper.dart:214 ::: call failed with cause: Code: [500], Cause: Canceled, Reason: SIP ;cause=500 ;text="Connection Error" flutter: 呼叫状态= CallStateEnum.FAILED flutter: 55555 = Closure: ({dynamic arg}) => void from Function '_callDidFailureAction@1424276529':. flutter: [2022-05-25 17:20:41.371] Level.debug sip_ua_helper.dart:137 ::: disconnected => Code: [1005], Cause: error, Reason: flutter: 传输状态 = TransportStateEnum.DISCONNECTED flutter: [2022-05-25 17:20:41.380] Level.debug sip_ua_helper.dart:151 ::: unregistered => Code: [0], Cause: unregistered, Reason: flutter: 注册状态 = RegistrationStateEnum.UNREGISTERED flutter: [2022-05-25 17:20:41.385] Level.debug transport.dart:206 ::: reconnection attempt: 1. next connection attempt in 2 seconds flutter: [2022-05-25 17:20:43.393] Level.debug transport.dart:111 ::: connect() flutter: [2022-05-25 17:20:43.397] Level.debug ua.dart:800 ::: Transport connecting flutter: [2022-05-25 17:20:43.401] Level.debug sip_ua_helper.dart:125 ::: connecting => Instance of 'EventSocketConnecting'

System Infomation() Flutter SDK Version: 0.5.1 Target OS and Version: iOS

a42279395 avatar May 25 '22 09:05 a42279395

Server: Freeswitch

a42279395 avatar May 26 '22 06:05 a42279395

I am also facing the same issue. Does anyone have an idea how to solve this?

siddharthJadhav avatar Apr 13 '23 14:04 siddharthJadhav