flutter-webrtc / dart-sip-ua

A dart-lang version of the SIP UA stack.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

WebSocket not connecting

Vinayak006 opened this issue · comments

When using asterisk test server mentioned in docs, its working. When i use linphone's SIP service, websocket is not connecting.

I/flutter (24549): [2023-12-28 11:06:38.836] Level.debug websocket_interface.dart:94 ::: Web Socket is now connected
I/flutter (24549): [2023-12-28 11:06:38.839] Level.debug websocket_interface.dart:162 ::: WebSocket wss://sip.linphone.org connected
I/flutter (24549): [2023-12-28 11:06:38.840] Level.debug ua.dart:912 ::: Transport connected
I/flutter (24549): [2023-12-28 11:06:38.843] Level.debug sip_ua_helper.dart:152 ::: connected => Instance of 'EventSocketConnected'
I/flutter (24549): [2023-12-28 11:06:38.845] Level.warning registrator.dart:135 ::: <sip:kqnv0258@400101t35832.invalid;transport=wss>;+sip.ice;reg-id=1;+sip.instance="<urn:uuid:ccf9f5f1-e224-4c5c-884d-00b2bb453d28>"
I/flutter (24549): [2023-12-28 11:06:38.850] Level.debug transport.dart:145 ::: send()
I/flutter (24549): [2023-12-28 11:06:38.854] Level.debug websocket_interface.dart:137 ::: send()
I/flutter (24549): [2023-12-28 11:06:38.859] Level.debug websocket_dart_impl.dart:54 ::: send: 
I/flutter (24549): 
I/flutter (24549): REGISTER sip:sip.linphone.org SIP/2.0
I/flutter (24549): Via: SIP/2.0/WSS 400101t35832.invalid;branch=z9hG4bK992852416
I/flutter (24549): Max-Forwards: 69
I/flutter (24549): To: <sip:username@sip.linphone.org>
I/flutter (24549): From: "username" <sip:username@sip.linphone.org>;tag=6472790849
I/flutter (24549): Call-ID: fpp9rha9qievrshx0bdeq
I/flutter (24549): CSeq: 3 REGISTER
I/flutter (24549): Contact: <sip:kqnv058@400101t35832.invalid;transport=wss>;+sip.ice;reg-id=1;+sip.instance="<urn:uuid:ccf9f5f1-e224-4c5c-884d-00b2bb453d28>";expires=600
I/flutter (24549): Expires: 600
I/flutter (24549): Allow: INVITE,ACK,CANCEL,BYE,UPDATE,MESSAGE,OPTIONS,REFER,INFO,NOTIFY
I/flutter (24549): Supported: path,gruu,outbound
I/flutter (24549): User-Agent: Copper 0.1
I/flutter (24549): [2023-12-28 11:07:00.443] Level.debug websocket_interface.dart:103 ::: Closed [1005, ]!
I/flutter (24549): [2023-12-28 11:07:00.448] Level.debug websocket_interface.dart:167 ::: WebSocket wss://sip.linphone.org closed
I/flutter (24549): [2023-12-28 11:07:00.452] Level.debug non_invite_client.dart:53 ::: transport error occurred, deleting transaction z9hG4bK992852416
I/flutter (24549): [2023-12-28 11:07:00.458] Level.debug sip_ua_helper.dart:179 ::: registrationFailed => Code: [500], Cause: SIP Failure Code, Reason: Connection Error
I/flutter (24549): [2023-12-28 11:07:00.463] Level.debug sip_ua_helper.dart:158 ::: disconnected => Code: [1005], Cause: error, Reason: 

When you see the above log, web socket getting connected at first and then getting disconnected with CONNECTION_ERROR

System Infomation()
Flutter SDK Version: 3.16.3
sip_ua: 0.5.8

Hi did you find any solution for this kindly let me know i'm faceing same issue. @Vinayak006 @cloudwebrtc

my logs:


I/flutter (30953): [2024-02-27 10:19:02.282] Level.debug websocket_interface.dart:13 ::: new() [url:wss://10.1.1.5:5060]
I/flutter (30953): [2024-02-27 10:19:02.289] Level.debug websocket_interface.dart:30 ::: SIP URI: sip:10.1.1.5:5060;transport=wss
I/flutter (30953): [2024-02-27 10:19:02.290] Level.debug ua.dart:89 ::: new() [configuration:Instance of 'Settings']
I/flutter (30953): [2024-02-27 10:19:02.295] Level.debug config.dart:266 ::: Check optional parameter => authorization_user.
I/flutter (30953): [2024-02-27 10:19:02.297] Level.debug config.dart:266 ::: Check optional parameter => user_agent.
I/flutter (30953): [2024-02-27 10:19:02.297] Level.debug config.dart:266 ::: Check optional parameter => connection_recovery_max_interval.
I/flutter (30953): [2024-02-27 10:19:02.299] Level.debug config.dart:266 ::: Check optional parameter => connection_recovery_min_interval.
I/flutter (30953): [2024-02-27 10:19:02.300] Level.debug config.dart:266 ::: Check optional parameter => contact_uri.
I/flutter (30953): [2024-02-27 10:19:02.301] Level.debug config.dart:266 ::: Check optional parameter => display_name.
I/flutter (30953): [2024-02-27 10:19:02.302] Level.debug config.dart:266 ::: Check optional parameter => instance_id.
I/flutter (30953): [2024-02-27 10:19:02.303] Level.debug config.dart:266 ::: Check optional parameter => no_answer_timeout.
I/flutter (30953): [2024-02-27 10:19:02.304] Level.debug config.dart:266 ::: Check optional parameter => session_timers.
I/flutter (30953): [2024-02-27 10:19:02.304] Level.debug config.dart:266 ::: Check optional parameter => session_timers_refresh_method.
I/flutter (30953): [2024-02-27 10:19:02.305] Level.debug config.dart:266 ::: Check optional parameter => password.
I/flutter (30953): [2024-02-27 10:19:02.306] Level.debug config.dart:266 ::: Check optional parameter => realm.
I/flutter (30953): [2024-02-27 10:19:02.307] Level.debug config.dart:266 ::: Check optional parameter => ha1.
I/flutter (30953): [2024-02-27 10:19:02.308] Level.debug config.dart:266 ::: Check optional parameter => register.
I/flutter (30953): [2024-02-27 10:19:02.309] Level.debug config.dart:266 ::: Check optional parameter => register_expires.
I/flutter (30953): [2024-02-27 10:19:02.310] Level.debug config.dart:266 ::: Check optional parameter => registrar_server.
I/flutter (30953): [2024-02-27 10:19:02.311] Level.debug config.dart:266 ::: Check optional parameter => register_extra_contact_uri_params.
I/flutter (30953): [2024-02-27 10:19:02.311] Level.debug config.dart:266 ::: Check optional parameter => use_preloaded_route.
I/flutter (30953): [2024-02-27 10:19:02.313] Level.debug config.dart:266 ::: Check optional parameter => dtmf_mode.
I/flutter (30953): [2024-02-27 10:19:02.314] Level.debug config.dart:266 ::: Check optional parameter => ice_gathering_timeout.
I/flutter (30953): [2024-02-27 10:19:02.317] Level.debug transport.dart:42 ::: new()
I/flutter (30953): [2024-02-27 10:19:02.322] Level.debug ua.dart:151 ::: start()
I/flutter (30953): [2024-02-27 10:19:02.324] Level.debug transport.dart:89 ::: connect()
I/flutter (30953): [2024-02-27 10:19:02.325] Level.debug ua.dart:906 ::: Transport connecting
I/flutter (30953): [2024-02-27 10:19:02.325] Level.debug sip_ua_helper.dart:146 ::: connecting => Instance of 'EventSocketConnecting'
I/flutter (30953): [2024-02-27 10:19:02.327] Level.debug websocket_interface.dart:71 ::: connect()
I/flutter (30953): [2024-02-27 10:19:02.327] Level.debug websocket_interface.dart:87 ::: connecting to WebSocket wss://10.1.1.5:5060
I/flutter (30953): [2024-02-27 10:19:02.583] Level.debug websocket_interface.dart:103 ::: Closed [500, SocketException: Connection refused (OS Error: Connection refused, errno = 111), address = 10.1.1.5, port = 38542]!
I/flutter (30953): [2024-02-27 10:19:02.585] Level.debug websocket_interface.dart:167 ::: WebSocket wss://10.1.1.5:5060 closed
I/flutter (30953): [2024-02-27 10:19:02.586] Level.debug sip_ua_helper.dart:158 ::: disconnected => Code: [500], Cause: error, Reason: SocketException: Connection refused (OS Error: Connection refused, errno = 111), address = 10.1.1.5, port = 38542
I/flutter (30953): [2024-02-27 10:19:02.588] Level.debug ua.dart:307 ::: stop()
I/flutter (30953): [2024-02-27 10:19:02.590] Level.debug transport.dart:116 ::: close()
I/flutter (30953): [2024-02-27 10:19:02.592] Level.debug websocket_interface.dart:120 ::: disconnect()
I/flutter (30953): [2024-02-27 10:19:02.593] Level.debug websocket_interface.dart:167 ::: WebSocket wss://10.1.1.5:5060 closed
I/flutter (30953): [2024-02-27 10:19:02.596] Level.debug sip_ua_helper.dart:158 ::: disconnected => Code: [0], Cause: disconnect, Reason: close by local
I/flutter (30953): [2024-02-27 10:19:02.597] Level.debug ua.dart:307 ::: stop()
I/flutter (30953): [2024-02-27 10:19:02.599] Level.debug ua.dart:313 ::: UA already closed

Same trouble

Same trouble

As i have checked it is Server issue. Server is not accecpting requestes

@sajjadjaved01 Could you please elaborate on the server issue and specify the configuration changes required to address it? Any additional details would be appreciated. Thank you!