dart-sip-ua
dart-sip-ua copied to clipboard
sip_ua + asterisk sip over ws
hi. im try up asterisk server with ws,by sip_ua no whana connect to server. im try rebuild server 999+ try :)
sip.conf
[general]
udpbindaddr=0.0.0.0:5060
transport=udp,ws
nat=force_rport,comedia
[webrtc](!)
host=dynamic
context=from-internal
type=friend
encryption=yes
avpf=yes
force_avp=yes
icesupport=yes
directmedia=no
disallow=all
qualify=yes
videosupport=yes
allow=ulaw,alaw,vp8,h264,h263p,mpeg4
dtlsenable=no
dtlsverify=no
;dtlscertfile=/etc/asterisk/keys/asterisk.pem
;dtlscafile=/etc/asterisk/keys/ca.crt
;dtlssetup=actpass
[101](webrtc)
defaultusername=101
secret=101
http.conf
[general]
enabled=yes
bindaddr=0.0.0.0
bindport=8088
error
I/flutter (26295): [2020-10-01 19:57:08.421] Level.debug websocket_interface.dart:37 ::: new() [url:ws://192.168.1.200:8088]
I/flutter (26295): [2020-10-01 19:57:08.512] Level.debug websocket_interface.dart:50 ::: SIP URI: sip:192.168.1.200:8088;transport=ws
I/flutter (26295): [2020-10-01 19:57:08.517] Level.debug ua.dart:103 ::: new() [configuration:Instance of 'Settings']
I/flutter (26295): [38;5;12m[2020-10-01 19:57:08.524] Level.info config.dart:254 ::: Check mandatory parameter => sockets.
I/flutter (26295): [38;5;12m[2020-10-01 19:57:08.542] Level.info config.dart:254 ::: Check mandatory parameter => uri.
I/flutter (26295): [2020-10-01 19:57:08.547] Level.debug config.dart:260 ::: Check optional parameter => authorization_user.
I/flutter (26295): [2020-10-01 19:57:08.549] Level.debug config.dart:260 ::: Check optional parameter => user_agent.
I/flutter (26295): [2020-10-01 19:57:08.556] Level.debug config.dart:260 ::: Check optional parameter => connection_recovery_max_interval.
I/flutter (26295): [2020-10-01 19:57:08.558] Level.debug config.dart:260 ::: Check optional parameter => connection_recovery_min_interval.
I/flutter (26295): [2020-10-01 19:57:08.561] Level.debug config.dart:260 ::: Check optional parameter => contact_uri.
I/flutter (26295): [2020-10-01 19:57:08.564] Level.debug config.dart:260 ::: Check optional parameter => display_name.
I/flutter (26295): [2020-10-01 19:57:08.566] Level.debug config.dart:260 ::: Check optional parameter => instance_id.
I/flutter (26295): [2020-10-01 19:57:08.569] Level.debug config.dart:260 ::: Check optional parameter => no_answer_timeout.
I/flutter (26295): [2020-10-01 19:57:08.571] Level.debug config.dart:260 ::: Check optional parameter => session_timers.
I/flutter (26295): [2020-10-01 19:57:08.574] Level.debug config.dart:260 ::: Check optional parameter => session_timers_refresh_method.
I/flutter (26295): [2020-10-01 19:57:08.576] Level.debug config.dart:260 ::: Check optional parameter => password.
I/flutter (26295): [2020-10-01 19:57:08.579] Level.debug config.dart:260 ::: Check optional parameter => realm.
I/flutter (26295): [2020-10-01 19:57:08.581] Level.debug config.dart:260 ::: Check optional parameter => ha1.
I/flutter (26295): [2020-10-01 19:57:08.583] Level.debug config.dart:260 ::: Check optional parameter => register.
I/flutter (26295): [2020-10-01 19:57:08.585] Level.debug config.dart:260 ::: Check optional parameter => register_expires.
I/flutter (26295): [2020-10-01 19:57:08.587] Level.debug config.dart:260 ::: Check optional parameter => registrar_server.
I/flutter (26295): [2020-10-01 19:57:08.589] Level.debug config.dart:260 ::: Check optional parameter => register_extra_contact_uri_params.
I/flutter (26295): [2020-10-01 19:57:08.591] Level.debug config.dart:260 ::: Check optional parameter => use_preloaded_route.
I/flutter (26295): [2020-10-01 19:57:08.603] Level.debug transport.dart:53 ::: new()
I/flutter (26295): [2020-10-01 19:57:08.639] Level.debug ua.dart:163 ::: start()
I/flutter (26295): [2020-10-01 19:57:08.641] Level.debug transport.dart:111 ::: connect()
I/flutter (26295): [2020-10-01 19:57:08.644] Level.debug ua.dart:845 ::: Transport connecting
I/flutter (26295): [2020-10-01 19:57:08.647] Level.debug sip_ua_helper.dart:114 ::: connecting => Instance of 'EventSocketConnecting'
I/flutter (26295): [2020-10-01 19:57:08.651] Level.debug websocket_interface.dart:71 ::: connect()
I/flutter (26295): [2020-10-01 19:57:08.653] Level.debug websocket_interface.dart:82 ::: connecting to WebSocket ws://192.168.1.200:8088
I/flutter (26295): [38;5;12m[2020-10-01 19:57:08.659] Level.info websocket_dart_impl.dart:25 ::: connect ws://192.168.1.200:8088, {Origin: 192.168.1.200, Host: 192.168.1.200:8088}, [sip]
I/flutter (26295): [2020-10-01 19:57:08.824] Level.debug websocket_interface.dart:89 ::: Web Socket is now connected
I/flutter (26295): [2020-10-01 19:57:08.826] Level.debug websocket_interface.dart:158 ::: WebSocket ws://192.168.1.200:8088 connected
I/flutter (26295): [2020-10-01 19:57:08.829] Level.debug ua.dart:851 ::: Transport connected
I/flutter (26295): [2020-10-01 19:57:08.831] Level.debug sip_ua_helper.dart:120 ::: connected => Instance of 'EventSocketConnected'
I/flutter (26295): [38;5;208m[2020-10-01 19:57:08.837] Level.warning registrator.dart:140 ::: <sip:[email protected]>;+sip.ice;reg-id=1;+sip.instance="<urn:uuid:bf70187e-14fa-486b-a4be-8177772938ef>"
I/flutter (26295): [2020-10-01 19:57:08.855] Level.debug transport.dart:167 ::: send()
I/flutter (26295): [2020-10-01 19:57:08.858] Level.debug websocket_interface.dart:133 ::: send()
I/flutter (26295): [2020-10-01 19:57:08.872] Level.debug websocket_dart_impl.dart:51 ::: send:
I/flutter (26295):
I/flutter (26295): REGISTER sip:192.168.1.200 SIP/2.0
I/flutter (26295): Via: SIP/2.0/WS 3d3yzevfevaa.invalid;branch=z9hG4bK829148245
I/flutter (26295): Max-Forwards: 69
I/flutter (26295): To: <sip:[email protected]>
I/flutter (26295): From: "Flutter SIP UA" <sip:[email protected]>;tag=4v8i37f5t3
I/flutter (26295): Call-ID: fydoelzravralr9vsoi6uw
I/flutter (26295): CSeq: 1 REGISTER
I/flutter (26295): Contact: <sip:[email protected]>;+sip.ice;reg-id=1;+sip.instance="<urn:uuid:bf70187e-14fa-486b-a4be-8177772938ef>";expires=600
I/flutter (26295): Expires: 600
I/flutter (26295): Allow: INVITE,ACK,CANCEL,BYE,UPDATE,MESSAGE,OPTIONS,REFER,INFO
I/flutter (26295): Supported: path,gruu,outbound
I/flutter (26295): User-Agent: Dart SIP Client v1.0.0
I/flutter (26295): Content-Length: 0
I/flutter (26295):
I/flutter (26295): [2020-10-01 19:57:08.887] Level.debug websocket_interface.dart:98 ::: Closed [1002, null]!
I/flutter (26295): [2020-10-01 19:57:08.889] Level.debug websocket_interface.dart:163 ::: WebSocket ws://192.168.1.200:8088 closed
I/flutter (26295): [2020-10-01 19:57:08.893] Level.debug non_invite_client.dart:52 ::: transport error occurred, deleting transaction z9hG4bK829148245
I/flutter (26295): [2020-10-01 19:57:08.899] Level.debug sip_ua_helper.dart:147 ::: registrationFailed => Code: [500], Cause: SIP Failure Code, Reason: Connection Error
I/flutter (26295): [2020-10-01 19:57:08.903] Level.debug sip_ua_helper.dart:126 ::: disconnected => Code: [1002], Cause: error, Reason: null
I/flutter (26295): [2020-10-01 19:57:08.906] Level.debug transport.dart:206 ::: reconnection attempt: 1. next connection attempt in 2 seconds
Application finished.
Exited (sigterm)
What's the Asterisk console saying?
nothing according to the traffic on the server, I see that the connection to the socket is taking place, but it does not reach sip registration
Does tryit.jssipt.net work in your LAN?
https://tryit.jssip.net/
yap. this host work.
ngrep the ws on asterisk and see what's happening.
I had the with opensips as the ws sec key wasn't right.
i think flutter not connected to ws if i try open url on browser http://192.168.1.200:8088/ws i take error on asterisk debug:
WARNING[28673]: res_http_websocket.c:831 __ast_websocket_uri_cb: WebSocket connection from '192.168.1.114:38473' could not be accepted - did not request WebSocket
bt i not see debug http in asterisk if i try connect from flutter
hmm
now im try run app on real phone and take other error
flutter (22547): [2020-10-02 00:53:57.156] Level.debug websocket_interface.dart:37 ::: new() [url:ws://192.168.1.200:8088/ws]
I/flutter (22547): [2020-10-02 00:53:57.295] Level.debug websocket_interface.dart:50 ::: SIP URI: sip:192.168.1.200:8088;transport=ws
I/flutter (22547): [2020-10-02 00:53:57.302] Level.debug ua.dart:103 ::: new() [configuration:Instance of 'Settings']
I/flutter (22547): [2020-10-02 00:53:57.313] Level.info config.dart:254 ::: Check mandatory parameter => sockets.
I/flutter (22547): [2020-10-02 00:53:57.343] Level.info config.dart:254 ::: Check mandatory parameter => uri.
I/flutter (22547): [2020-10-02 00:53:57.350] Level.debug config.dart:260 ::: Check optional parameter => authorization_user.
I/flutter (22547): [2020-10-02 00:53:57.367] Level.debug config.dart:260 ::: Check optional parameter => user_agent.
I/flutter (22547): [2020-10-02 00:53:57.372] Level.debug config.dart:260 ::: Check optional parameter => connection_recovery_max_interval.
I/flutter (22547): [2020-10-02 00:53:57.376] Level.debug config.dart:260 ::: Check optional parameter => connection_recovery_min_interval.
I/flutter (22547): [2020-10-02 00:53:57.381] Level.debug config.dart:260 ::: Check optional parameter => contact_uri.
I/flutter (22547): [2020-10-02 00:53:57.386] Level.debug config.dart:260 ::: Check optional parameter => display_name.
I/flutter (22547): [2020-10-02 00:53:57.390] Level.debug config.dart:260 ::: Check optional parameter => instance_id.
I/flutter (22547): [2020-10-02 00:53:57.393] Level.debug config.dart:260 ::: Check optional parameter => no_answer_timeout.
I/flutter (22547): [2020-10-02 00:53:57.396] Level.debug config.dart:260 ::: Check optional parameter => session_timers.
I/flutter (22547): [2020-10-02 00:53:57.399] Level.debug config.dart:260 ::: Check optional parameter => session_timers_refresh_method.
I/flutter (22547): [2020-10-02 00:53:57.402] Level.debug config.dart:260 ::: Check optional parameter => password.
I/flutter (22547): [2020-10-02 00:53:57.405] Level.debug config.dart:260 ::: Check optional parameter => realm.
I/flutter (22547): [2020-10-02 00:53:57.407] Level.debug config.dart:260 ::: Check optional parameter => ha1.
I/flutter (22547): [2020-10-02 00:53:57.409] Level.debug config.dart:260 ::: Check optional parameter => register.
I/flutter (22547): [2020-10-02 00:53:57.411] Level.debug config.dart:260 ::: Check optional parameter => register_expires.
I/flutter (22547): [2020-10-02 00:53:57.414] Level.debug config.dart:260 ::: Check optional parameter => registrar_server.
I/flutter (22547): [2020-10-02 00:53:57.417] Level.debug config.dart:260 ::: Check optional parameter => register_extra_contact_uri_params.
I/flutter (22547): [2020-10-02 00:53:57.419] Level.debug config.dart:260 ::: Check optional parameter => use_preloaded_route.
I/flutter (22547): [2020-10-02 00:53:57.433] Level.debug transport.dart:53 ::: new()
I/flutter (22547): [2020-10-02 00:53:57.485] Level.debug ua.dart:163 ::: start()
I/flutter (22547): [2020-10-02 00:53:57.487] Level.debug transport.dart:111 ::: connect()
I/flutter (22547): [2020-10-02 00:53:57.489] Level.debug ua.dart:845 ::: Transport connecting
I/flutter (22547): [2020-10-02 00:53:57.493] Level.debug sip_ua_helper.dart:114 ::: connecting => Instance of 'EventSocketConnecting'
I/flutter (22547): [2020-10-02 00:53:57.498] Level.debug websocket_interface.dart:71 ::: connect()
I/flutter (22547): [2020-10-02 00:53:57.500] Level.debug websocket_interface.dart:82 ::: connecting to WebSocket ws://192.168.1.200:8088/ws
I/flutter (22547): [2020-10-02 00:53:57.508] Level.info websocket_dart_impl.dart:25 ::: connect ws://192.168.1.200:8088/ws, {Origin: 192.168.1.200, Host: 192.168.1.200:8088}, [sip]
I/flutter (22547): [2020-10-02 00:53:59.79] Level.error websocket_dart_impl.dart:107 ::: error SocketException: OS Error: No route to host, errno = 113, address = 192.168.1.200, port = 38709
I/flutter (22547): [2020-10-02 00:53:59.85] Level.debug websocket_interface.dart:98 ::: Closed [500, SocketException: OS Error: No route to host, errno = 113, address = 192.168.1.200, port = 38709]!
I/flutter (22547): [2020-10-02 00:53:59.89] Level.debug websocket_interface.dart:163 ::: WebSocket ws://192.168.1.200:8088/ws closed
I/flutter (22547): [2020-10-02 00:53:59.96] Level.debug sip_ua_helper.dart:126 ::: disconnected => Code: [500], Cause: error, Reason: SocketException: OS Error: No route to host, errno = 113, address = 192.168.1.200, port = 38709
I/flutter (22547): [2020-10-02 00:53:59.101] Level.debug transport.dart:206 ::: reconnection attempt: 1. next connection attempt in 2 seconds
mb problem on premissions?
im found trouble pls,dont close topic, i will write a mini manul for setting up an asterisk for sip_ua over wss :)
Nice work!
On Fri, 2 Oct 2020, 11:16 prozaklob, [email protected] wrote:
im found trouble pls,dont close topic, i will write a mini manul for setting up an asterisk for sip_ua over wss :)
— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/flutter-webrtc/dart-sip-ua/issues/132#issuecomment-702647973, or unsubscribe https://github.com/notifications/unsubscribe-auth/AABG66F5SPAK6ZJBIN6GEWLSIWSAHANCNFSM4SA32OGA .
I jumped a little to conclusions. I was able to start the server with sipml5 wss. But in the application I get the error
[2020-10-02 14:09:15.87] Level.warning registrator.dart:140 ::: <sip:[email protected]>;+sip.ice;reg-id=1;+sip.instance="<urn:uuid:d5800269-86c3-417c-be3d-bd0c6d735ab7>"
:(
That line is correct. Just a debug log. You need to confirm WebSockets are establishing correctly.
Map<String, String> _wsExtraHeaders = {
'Origin': ' https://sip.url.by',
'Host': 'sip.url.by:8089'
};
_preferences.getString('ws_uri') ?? 'wss://sip.url.by:8089/ws';
_sipUri = _preferences.getString('sip_uri') ?? 'sip:[email protected]';
_displayName = _preferences.getString('display_name') ?? 'Flutter SIP UA';
_password = _preferences.getString('password') ?? '101';
_authorizationUser = _preferences.getString('auth_user') ?? '101';
I/flutter ( 6220): [2020-10-02 14:09:08.42] Level.debug websocket_interface.dart:37 ::: new() [url:wss://sip.url.by:8089/ws]
I/flutter ( 6220): [2020-10-02 14:09:08.171] Level.debug websocket_interface.dart:50 ::: SIP URI: sip:sip.url.by:8089;transport=ws
I/flutter ( 6220): [2020-10-02 14:09:08.178] Level.debug ua.dart:103 ::: new() [configuration:Instance of 'Settings']
I/flutter ( 6220): [38;5;12m[2020-10-02 14:09:08.188] Level.info config.dart:254 ::: Check mandatory parameter => sockets.
I/flutter ( 6220): [38;5;12m[2020-10-02 14:09:08.220] Level.info config.dart:254 ::: Check mandatory parameter => uri.
I/flutter ( 6220): [2020-10-02 14:09:08.228] Level.debug config.dart:260 ::: Check optional parameter => authorization_user.
I/flutter ( 6220): [2020-10-02 14:09:08.247] Level.debug config.dart:260 ::: Check optional parameter => user_agent.
I/flutter ( 6220): [2020-10-02 14:09:08.252] Level.debug config.dart:260 ::: Check optional parameter => connection_recovery_max_interval.
I/flutter ( 6220): [2020-10-02 14:09:08.256] Level.debug config.dart:260 ::: Check optional parameter => connection_recovery_min_interval.
I/flutter ( 6220): [2020-10-02 14:09:08.260] Level.debug config.dart:260 ::: Check optional parameter => contact_uri.
I/flutter ( 6220): [2020-10-02 14:09:08.265] Level.debug config.dart:260 ::: Check optional parameter => display_name.
I/flutter ( 6220): [2020-10-02 14:09:08.268] Level.debug config.dart:260 ::: Check optional parameter => instance_id.
I/flutter ( 6220): [2020-10-02 14:09:08.271] Level.debug config.dart:260 ::: Check optional parameter => no_answer_timeout.
I/flutter ( 6220): [2020-10-02 14:09:08.274] Level.debug config.dart:260 ::: Check optional parameter => session_timers.
I/flutter ( 6220): [2020-10-02 14:09:08.277] Level.debug config.dart:260 ::: Check optional parameter => session_timers_refresh_method.
I/flutter ( 6220): [2020-10-02 14:09:08.280] Level.debug config.dart:260 ::: Check optional parameter => password.
I/flutter ( 6220): [2020-10-02 14:09:08.283] Level.debug config.dart:260 ::: Check optional parameter => realm.
I/flutter ( 6220): [2020-10-02 14:09:08.285] Level.debug config.dart:260 ::: Check optional parameter => ha1.
I/flutter ( 6220): [2020-10-02 14:09:08.287] Level.debug config.dart:260 ::: Check optional parameter => register.
I/flutter ( 6220): [2020-10-02 14:09:08.289] Level.debug config.dart:260 ::: Check optional parameter => register_expires.
I/flutter ( 6220): [2020-10-02 14:09:08.291] Level.debug config.dart:260 ::: Check optional parameter => registrar_server.
I/flutter ( 6220): [2020-10-02 14:09:08.294] Level.debug config.dart:260 ::: Check optional parameter => register_extra_contact_uri_params.
I/flutter ( 6220): [2020-10-02 14:09:08.296] Level.debug config.dart:260 ::: Check optional parameter => use_preloaded_route.
I/flutter ( 6220): [2020-10-02 14:09:08.310] Level.debug transport.dart:53 ::: new()
I/flutter ( 6220): [2020-10-02 14:09:08.361] Level.debug ua.dart:163 ::: start()
I/flutter ( 6220): [2020-10-02 14:09:08.364] Level.debug transport.dart:111 ::: connect()
I/flutter ( 6220): [2020-10-02 14:09:08.366] Level.debug ua.dart:845 ::: Transport connecting
I/flutter ( 6220): [2020-10-02 14:09:08.369] Level.debug sip_ua_helper.dart:114 ::: connecting => Instance of 'EventSocketConnecting'
I/flutter ( 6220): [2020-10-02 14:09:08.374] Level.debug websocket_interface.dart:71 ::: connect()
I/flutter ( 6220): [2020-10-02 14:09:08.376] Level.debug websocket_interface.dart:82 ::: connecting to WebSocket wss://sip.url.by:8089/ws
I/flutter ( 6220): [38;5;12m[2020-10-02 14:09:08.384] Level.info websocket_dart_impl.dart:25 ::: connect wss://sip.url.by:8089/ws, {Origin: https://sip.url.by, Host: sip.url.by:8089}, [sip]
I/flutter ( 6220): [2020-10-02 14:09:08.633] Level.debug websocket_interface.dart:89 ::: Web Socket is now connected
I/flutter ( 6220): [2020-10-02 14:09:08.636] Level.debug websocket_interface.dart:158 ::: WebSocket wss://sip.url.by:8089/ws connected
I/flutter ( 6220): [2020-10-02 14:09:08.640] Level.debug ua.dart:851 ::: Transport connected
I/flutter ( 6220): [2020-10-02 14:09:08.644] Level.debug sip_ua_helper.dart:120 ::: connected => Instance of 'EventSocketConnected'
I/flutter ( 6220): [38;5;208m[2020-10-02 14:09:08.651] Level.warning registrator.dart:140 ::: <sip:[email protected]>;+sip.ice;reg-id=1;+sip.instance="<urn:uuid:d5800269-86c3-417c-be3d-bd0c6d735ab7>"
I/flutter ( 6220): [2020-10-02 14:09:08.670] Level.debug transport.dart:167 ::: send()
I/flutter ( 6220): [2020-10-02 14:09:08.675] Level.debug websocket_interface.dart:133 ::: send()
I/flutter ( 6220): [2020-10-02 14:09:08.691] Level.debug websocket_dart_impl.dart:51 ::: send:
I/flutter ( 6220):
I/flutter ( 6220): REGISTER sip:sip.url.by SIP/2.0
I/flutter ( 6220): Via: SIP/2.0/WS p41881umg0df.invalid;branch=z9hG4bK436126262
I/flutter ( 6220): Max-Forwards: 69
I/flutter ( 6220): To: <sip:[email protected]>
I/flutter ( 6220): From: "Flutter SIP UA" <sip:[email protected]>;tag=7281676672
I/flutter ( 6220): Call-ID: 8il8vt6xfoo6giy9fie5yp
I/flutter ( 6220): CSeq: 1 REGISTER
I/flutter ( 6220): Contact: <sip:[email protected]>;+sip.ice;reg-id=1;+sip.instance="<urn:uuid:d5800269-86c3-417c-be3d-bd0c6d735ab7>";expires=600
I/flutter ( 6220): Expires: 600
I/flutter ( 6220): Allow: INVITE,ACK,CANCEL,BYE,UPDATE,MESSAGE,OPTIONS,REFER,INFO
I/flutter ( 6220): Supported: path,gruu,outbound
I/flutter ( 6220): User-Agent: Dart SIP Client v1.0.0
I/flutter ( 6220): Content-Length: 0
I/flutter ( 6220):
I/flutter ( 6220): [2020-10-02 14:09:08.706] Level.debug websocket_interface.dart:98 ::: Closed [1002, null]!
I/flutter ( 6220): [2020-10-02 14:09:08.708] Level.debug websocket_interface.dart:163 ::: WebSocket wss://sip.url.by:8089/ws closed
I/flutter ( 6220): [2020-10-02 14:09:08.713] Level.debug non_invite_client.dart:52 ::: transport error occurred, deleting transaction z9hG4bK436126262
I/flutter ( 6220): [2020-10-02 14:09:08.722] Level.debug sip_ua_helper.dart:147 ::: registrationFailed => Code: [500], Cause: SIP Failure Code, Reason: Connection Error
I/flutter ( 6220): [2020-10-02 14:09:08.727] Level.debug sip_ua_helper.dart:126 ::: disconnected => Code: [1002], Cause: error, Reason: null
I/flutter ( 6220): [2020-10-02 14:09:08.730] Level.debug transport.dart:206 ::: reconnection attempt: 1. next connection attempt in 2 seconds
I/flutter ( 6220): [2020-10-02 14:09:10.744] Level.debug transport.dart:111 ::: connect()
I/flutter ( 6220): [2020-10-02 14:09:10.748] Level.debug ua.dart:845 ::: Transport connecting
I/flutter ( 6220): [2020-10-02 14:09:10.750] Level.debug sip_ua_helper.dart:114 ::: connecting => Instance of 'EventSocketConnecting'
I/flutter ( 6220): [2020-10-02 14:09:10.754] Level.debug websocket_interface.dart:71 ::: connect()
I/flutter ( 6220): [2020-10-02 14:09:10.757] Level.debug websocket_interface.dart:115 ::: disconnect()
I/flutter ( 6220): [2020-10-02 14:09:10.758] Level.debug websocket_interface.dart:163 ::: WebSocket wss://sip.url.by:8089/ws closed
I/flutter ( 6220): [2020-10-02 14:09:10.760] Level.debug sip_ua_helper.dart:126 ::: disconnected => Code: [0], Cause: error, Reason: Client send disconnect
I/flutter ( 6220): [2020-10-02 14:09:10.762] Level.debug transport.dart:206 ::: reconnection attempt: 2. next connection attempt in 2 seconds
Stick with ws:// and debug that first on the server side.
ws too not work in app
Well it does :-)
Just not with your config?
app or server? im test server on any app and work fine
I presume you're using the example app?
yes
hmmm... im now try run on web 'chrome' and registr - ok
Do you need to add something to the permissions for android, or additional settings?
my manifest file have:
<uses-permission android:name="android.permission.INTERNET"/>
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" />
<uses-permission android:name="android.permission.CAMERA" />
<uses-feature android:name="android.hardware.camera" />
<uses-feature android:name="android.hardware.camera.autofocus" />
<uses-permission android:name="android.permission.RECORD_AUDIO" />
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
<uses-permission android:name="android.permission.CHANGE_NETWORK_STATE" />
<uses-permission android:name="android.permission.MODIFY_AUDIO_SETTINGS" />
Ah, I remember now. I had to set the Origin
ws extra headers when https://tryit.jssip.net worked but the example app didn't. I do this:
var _wsExtraHeaders = <String, String>{
'X-Example-App':
'Example-App-Name v${_packageInfo.version}+${_packageInfo.buildNumber}: ' +
EnvConf.GIT_REV,
'Origin': _packageInfo.packageName,
};
...
settings.webSocketSettings.extraHeaders = _wsExtraHeaders;
You don't need the X-
header above, but we use it to cross check things.
Technically the Origin header isn't a required header for the WebSocket spec unless you're using a web browser, but most server side implementations need it - https://tools.ietf.org/html/rfc6455#section-10.2
@cloudwebrtc should we add this to the example app as default?
in example now:
Map<String, String> _wsExtraHeaders = {
'Origin': ' https://sip.url.by',
'Host': 'sip.url.by:8089'
};
im try comment settings.webSocketSettings.extraHeaders = _wsExtraHeaders;
browser work fine android - not work
Did you run:
https://github.com/flutter-webrtc/dart-sip-ua/tree/master/example/scripts
and have the same perms?
run add-line.py - install
run sh - create Project [sip_ua_example] already exists!
now. im cleanup and create again testing
had no effect
You'll figure it out. Compare the WebSocket traffic to a working web browser.
ok. now:
wscat -s echo -c wss://sip.url.by:8089/ws
error: unable to verify the first certificate
im use wildcard
ws://sip.url.by:8088/ws
connected
now im try use ws in sip_ua:
I/flutter (30845): [2020-10-03 00:12:11.358] Level.error websocket_dart_impl.dart:108 ::: error Bad state: Insecure HTTP is not allowed by platform: http://sip.url.by:8088
I/flutter (30845): [2020-10-03 00:12:11.363] Level.debug websocket_interface.dart:98 ::: Closed [500, Bad state: Insecure HTTP is not allowed by platform: http://sip.url.by:8088]!
I/flutter (30845): [2020-10-03 00:12:11.367] Level.debug websocket_interface.dart:163 ::: WebSocket ws://sip.url.by:8088/ws closed
hmm...
Do you have the right certificate chain?
https://www.google.com/search?q=test%20my%20certificate%20chain