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=<IP_ADDRESS>: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=<IP_ADDRESS>
bindport=8088

error

I/flutter (26295): [2020-10-01 19:57:08.421] Level.debug websocket_interface.dart:37 ::: new() [url:ws://<IP_ADDRESS>:8088]
I/flutter (26295): [2020-10-01 19:57:08.512] Level.debug websocket_interface.dart:50 ::: SIP URI: sip:<IP_ADDRESS>: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): [2020-10-01 19:57:08.524] Level.info config.dart:254 ::: Check mandatory parameter => sockets.
I/flutter (26295): [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.889] Level.debug websocket_interface.dart:163 ::: WebSocket ws://<IP_ADDRESS>: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://<IP_ADDRESS>:8088/ws
i take error on asterisk debug:
WARNING[28673]: res_http_websocket.c:831 __ast_websocket_uri_cb: WebSocket connection from '<IP_ADDRESS>: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://<IP_ADDRESS>:8088/ws]
I/flutter (22547): [2020-10-02 00:53:57.295] Level.debug websocket_interface.dart:50 ::: SIP URI: sip:<IP_ADDRESS>: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://<IP_ADDRESS>:8088/ws
I/flutter (22547): [2020-10-02 00:53:57.508] Level.info websocket_dart_impl.dart:25 ::: connect ws://<IP_ADDRESS>:8088/ws, {Origin: <IP_ADDRESS>, Host: <IP_ADDRESS>: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 = <IP_ADDRESS>, 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 = <IP_ADDRESS>, port = 38709]!
I/flutter (22547): [2020-10-02 00:53:59.89] Level.debug websocket_interface.dart:163 ::: WebSocket ws://<IP_ADDRESS>: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 = <IP_ADDRESS>, 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_ADDRESS>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:1oh248uh@p41881umg0df.invalid>;+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'<EMAIL_ADDRESS>      _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): [2020-10-02 14:09:08.188] Level.info config.dart:254 ::: Check mandatory parameter => sockets.
I/flutter ( 6220): [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): [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): [2020-10-02 14:09:08.651] Level.warning registrator.dart:140 ::: <sip:1oh248uh@p41881umg0df.invalid>;+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<EMAIL_ADDRESS>I/flutter ( 6220): From: "Flutter SIP UA" <sip:101@sip.url.by>;tag=7281676672
I/flutter ( 6220): Call-ID: 8il8vt6xfoo6giy9fie5yp
I/flutter ( 6220): CSeq: 1 REGISTER
I/flutter ( 6220): Contact: <sip:1oh248uh@p41881umg0df.invalid>;+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" />

I can't debug your websocket traffic for you.

Ah, I remember now. I had to set the Origin ws extra headers when 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 as per the spec.
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 my certificate chain

yes. it wildcard comodo.
if i open https://sip.url.by:8089/ws in browser - i see guard connection. cert is fine

The wscat error while connecting to wss is not indicative.
This may indicate that the system has old certificates. ( debian )

That doesn't mean the chain is correct.
I would try a non wildcard certificate.
On Fri, 2 Oct 2020, 22:29 prozaklob<EMAIL_ADDRESS>wrote:

yes. it wildcard comodo.
if i open https://sip.url.by:8089/ws in browser - i see guard connection.
cert is fine
—
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-702966301,
or unsubscribe
https://github.com/notifications/unsubscribe-auth/AABG66FEH24QEYZRLKIRFC3SIZA2XANCNFSM4SA32OGA
.

im try self cert. no result ))

What Asterisk version? I'll try the example against it tomorrow night.
Can you create a GitHub repo I can clone with a similar Asterisk config?
Just plain ws first.
Thanks.

now i change flutter channel from master to stable and again take error:
I/flutter ( 7960): [2020-10-02 22:00:21.781] Level.debug websocket_interface.dart:98 ::: Closed [1002, null]!
I/flutter ( 7960): [2020-10-02 22:00:21.783] Level.debug websocket_interface.dart:163 ::: WebSocket ws://<IP_ADDRESS>:8088/ws closed

mb problem on version sdk and webrtc?
    • Flutter version 1.22.0
    • Dart version 2.10.0
    • Platform android-30, build-tools 30.0.2
    • Java version OpenJDK Runtime Environment (build 1.8.0_242-release-1644-b01)

flutter_webrtc-0.3.3

Nope, l works for me on those.
We use OpenSIPS 3.1 with wss in from of FreeSWITCH.
Have you set up like this?
https://wiki.asterisk.org/wiki/pages/viewpage.action?pageId=40818097

yes. it trye manual. sip is old. now use pjsip.
I've been administering an asterisk for more than 10 years, but I've never experienced such humiliation )))))
I can't figure out why the web version works well and connects to wss ( sip ua on chrome ), same way SIPML5 too work fine.
only android not work.

pjsip.conf

[transport-wss]
type=transport
protocol=ws
bind=<IP_ADDRESS>

[webrtc_client]
type=aor
max_contacts=5
remove_existing=yes

[webrtc_client]
type=auth
auth_type=userpass
username=101
password=101

[webrtc_client]
type=endpoint
aors=webrtc_client
auth=webrtc_client
webrtc=yes
context=default
disallow=all
allow=opus,ulaw

http.conf

[general]
enabled=yes
bindaddr=<IP_ADDRESS>
bindport=8088
tlsenable=yes
tlsbindaddr=<IP_ADDRESS>:8089
tlscertfile=/etc/asterisk/keys/asterisk.crt
tlscafile=/etc/asterisk/keys/asterisk.ca-bundle
tlsprivatekey=/etc/asterisk/keys/asterisk.key

Compare the ws traffic and check for missing things
On Fri, 2 Oct 2020 at 23:15, prozaklob<EMAIL_ADDRESS>wrote:

yes. it true manual. sip is old. now use pjsip.
I've been administering an asterisk for more than 10 years, but I've never
experienced such humiliation )))))
I can't figure out why the web version works well and connects to wss (
sip ua on chrome ), same way SIPML5 too work fine.
only android not work.
—
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-702980664,
or unsubscribe
https://github.com/notifications/unsubscribe-auth/AABG66D65ET7QJDVD72L5MLSIZGGPANCNFSM4SA32OGA
.
--
Kind Regards,

Gavin Henry.
Managing Director.
T +44 (0) 330 44 50 000
D +44 (0) 330 44 55 007
M +44 (0) 7930 323266
F +44 (0) 1224 824887
E<EMAIL_ADDRESS>Open Source. Open Solutions(tm).
http://www.suretecsystems.com/
Suretec Systems is a limited company registered in Scotland. Registered
number: SC258005. Registered office: 24 Cormack Park, Rothienorman,
Inverurie, Aberdeenshire, AB51 8GL.
Subject to disclaimer at http://www.suretecgroup.com/disclaimer.html

how Compare? in debug log?

I think you can try this version, https://github.com/flutter-webrtc/dart-sip-ua/commit/cd1e37a79e868c5bfef7ea2c439c2dbc788930f9,
On the old version of FreeSwitch, because of the problem caused by the case sensitivity of the WebSocket Upgrade Header, we got the normal registration after changing to the mandatory case (dart-sdk will convert all HTTP headers to lower case by default), so maybe on asterisk, The same problem exists,

I think you can try this version, cd1e37a,
On the old version of FreeSwitch, because of the problem caused by the case sensitivity of the WebSocket Upgrade Header, we got the normal registration after changing to the mandatory case (dart-sdk will convert all HTTP headers to lower case by default), so maybe on asterisk, The same problem exists,

thanks. I'll try now, but there is little faith. :(
Because the web version from the browser connects without problems

I think you can try this version, cd1e37a,
On the old version of FreeSwitch, because of the problem caused by the case sensitivity of the WebSocket Upgrade Header, we got the normal registration after changing to the mandatory case (dart-sdk will convert all HTTP headers to lower case by default), so maybe on asterisk, The same problem exists,

yap. its not work :(

@prozaklob What version of Asterisk are you using? Can you package a copy of /etc/asterisk/*.conf for me? This way I can try to test on docker.

@prozaklob What version of Asterisk are you using? Can you package a copy of /etc/asterisk/*.conf for me? This way I can try to test on docker.

16 and 17
need only 2 config
pjsip and http
https://github.com/flutter-webrtc/dart-sip-ua/issues/132#issuecomment-702981376

Do an ngrep on the plain text ws
On Sat, 3 Oct 2020, 00:14 prozaklob<EMAIL_ADDRESS>wrote:

how Compare? in debug log?
—
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-702995771,
or unsubscribe
https://github.com/notifications/unsubscribe-auth/AABG66DZH2WEZ74IQ72HYNLSIZNEVANCNFSM4SA32OGA
.

Do an ngrep on the plain text ws

?

Run this on the Asterisk server:
ngrep -W byline -td any . port 8088
Run sip-ua in plain websocket mode on the mobile and Web browser and
compare both traces.
Make sense?
Thanks

Run this on the Asterisk server: ngrep -W byline -td any . port 8088 Run sip-ua in plain websocket mode on the mobile and Web browser and compare both traces. Make sense? Thanks

oh... sorry )) ofc. try now it

T 2020/10/03 16:21:41.163149 <IP_ADDRESS>:8088 -> <IP_ADDRESS>:28219 [AP] #6
HTTP/1.1 404 Not Found.
Server: Asterisk/16.13.0.
Date: Sat, 03 Oct 2020 13:21:41 GMT.
Cache-Control: no-cache, no-store.
Content-type: text/html.
Content-Length: 248.
.
<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN">.
<html><head>.
<title>404 Not Found</title>.
</head><body>.
<h1>Not Found</h1>.
<p>The requested URL was not found on this server.</p>.
<hr />.
<address>Asterisk/16.13.0</address>.
</body></html>.

#
T 2020/10/03 16:21:41.169782 <IP_ADDRESS>:28219 -> <IP_ADDRESS>:8088 [AP] #7
...9..._
#
T 2020/10/03 16:21:41.169931 <IP_ADDRESS>:28219 -> <IP_ADDRESS>:8088 [AP] #8
J...K...8../"../6..6~..+6...K..p*..R...>"...H..q(...8..k*..i ..m(..1n..6|..-y..7%..7_...!..m...j*...y...w..>j..e8..R...e8..6h..o)..6h..4q..:l..&&...j..e8..3m..:j...H...:..,q..n(..,q..,s..1}..=a..+y..'u..>l..8v...y..rQ...z..9-..'-..5|..;a..7/..U[..."..h8...Q...J...w..>{...$../"..g...k+..g,..o...g*..6v..3q..d3../6..:#..85..b)..,q..6v..>v..b:..-v..*q..i+..i...r,..;5..=-..i|..iz..>}..: ..a:..'h..:k..o(...`..-}......R...3w...Q...L...[...Y...T...]...\...4...K...4...Q...4...]...V..R.../h..+}...h..74..*m..*l..*v..UM..-5..:v...\..+8...8..6}...n..o6..U[..+}..rT..8l...(..R.
##
T 2020/10/03 16:21:41.171269 <IP_ADDRESS>:28219 -> <IP_ADDRESS>:8088 [AP] #10
..z3;.
#
T 2020/10/03 16:21:41.171455 <IP_ADDRESS>:28219 -> <IP_ADDRESS>:8088 [AP] #11
y.....
##
T 2020/10/03 16:21:41.177983 <IP_ADDRESS>:28219 -> <IP_ADDRESS>:8088 [AF] #13
......
#
T 2020/10/03 16:21:41.178074 <IP_ADDRESS>:8088 -> <IP_ADDRESS>:28219 [AP] #14
HTTP/1.1 400 Bad Request.
Server: Asterisk/16.13.0.
Date: Sat, 03 Oct 2020 13:21:41 GMT.
Connection: close.
Cache-Control: no-cache, no-store.
Content-type: text/html.
Content-Length: 212.
.
<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN">.
<html><head>.
<title>400 Bad Request</title>.
</head><body>.
<h1>Bad Request</h1>.
<p>Timeout</p>.
<hr />.
<address>Asterisk/16.13.0</address>.
</body></html>.

##
T 2020/10/03 16:21:41.178222 <IP_ADDRESS>:28219 -> <IP_ADDRESS>:8088 [A] #16
......
^Cexit
16 received, 10 matched
##
T 2020/10/03 16:21:41.178222 <IP_ADDRESS>:28219 -> <IP_ADDRESS>:8088 [A] #16
......
^Cexit
16 received, 10 matched

So wrong ws url?
Compare a working request and failing one. Please reread what I was asking.
Come on :)

no. im use one url for android and web.
now: thet web log
###
T 2020/10/03 16:40:59.837228 <IP_ADDRESS>:30954 -> <IP_ADDRESS>:8088 [A] #3
......
#
T 2020/10/03 16:40:59.837465 <IP_ADDRESS>:30954 -> <IP_ADDRESS>:8088 [AP] #4
GET /ws HTTP/1.1.
Host: sip.url.by:8088.
Connection: Upgrade.
Pragma: no-cache.
Cache-Control: no-cache.
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/85.0.4183.121 Safari/537.36.
Upgrade: websocket.
Origin: http://localhost:30850.
Sec-WebSocket-Version: 13.
Accept-Encoding: gzip, deflate.
Accept-Language: ru-RU,ru;q=0.9,en-US;q=0.8,en;q=0.7.
Sec-WebSocket-Key: mt+Zna5O1BmDtIjwhh3npg==.
Sec-WebSocket-Extensions: permessage-deflate; client_max_window_bits.
Sec-WebSocket-Protocol: sip.
.

##
T 2020/10/03 16:40:59.837573 <IP_ADDRESS>:8088 -> <IP_ADDRESS>:30954 [AP] #6
HTTP/1.1 101 Switching Protocols.
Upgrade: websocket.
Connection: Upgrade.
Sec-WebSocket-Accept: hspMfFvffQBILUbYMmqY3nKH1GY=.
Sec-WebSocket-Protocol: sip.
.

#
T 2020/10/03 16:40:59.877656 <IP_ADDRESS>:30954 -> <IP_ADDRESS>:8088 [A] #7
......
#
T 2020/10/03 16:40:59.887120 <IP_ADDRESS>:30954 -> <IP_ADDRESS>:8088 [AP] #8
...8r.%. .b.!.`.R.L.H.L.\.N...@.\.\.!.u<EMAIL_ADDRESS>.b.!.`...f...D.......U...U...A.2.....R...G...L...I.......U...@...B.....I.V...L...D.....N.W.H.P...F.....G...G...F..._...K...F.F.B...K...I.]...@.O.....`...W.....B.(.3.I.....<.l.7.d.9.f.<.`.^.|.^.u.3.`.?.v.3.`.=.q.=.v. .c. .l.4.(.!.U...Q.......M...P.^.P...P.../...W.3.@.......Q.!.u.1.L.....C...B./...Q.......B.......(.
#
T 2020/10/03 16:40:59.897596 <IP_ADDRESS>:8088 -> <IP_ADDRESS>:30954 [AP] #9
.~..SIP/2.0 401 Unauthorized.
Via: SIP/2.0/WS v0bgfwytfb5b.invalid;branch=z9hG4bK621112384;received=<IP_ADDRESS>;rport=30954.
From: "Flutter SIP UA" <sip:101@sip.url.by>;tag=h47d8wx7i3.
To: <sip:101@sip.url.by>;tag=as31afc043.
Call-ID: 8a0d6055479554o39p4r35.
CSeq: 1 REGISTER.
Server: Asterisk PBX 16.13.0.
Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REFER, SUBSCRIBE, NOTIFY, INFO, PUBLISH, MESSAGE.
Supported: replaces, timer.
WWW-Authenticate: Digest algorithm=MD5, realm="sip.url.by", nonce="7f1703bc".
Content-Length: 0.
.

#
T 2020/10/03 16:40:59.938212 <IP_ADDRESS>:30954 -> <IP_ADDRESS>:8088 [A] #10
......
#
T 2020/10/03 16:40:59.957260 <IP_ADDRESS>:30954 -> <IP_ADDRESS>:8088 [AP] #11
.....u'..0`..!b...N...N...L...B...^..<w..[...#N..Ut..Z...Zp.......P...E..[N...K..NE...D......AE..A...A...D*..._...U...C..U....s..U.......Dg.......A......K*...H..U....S......%...W....W..E....W...N...S.......@..A...._..F*...K..<c..MF..C...A...@...LW..F...6t..O...'b..&s..x-...O...]...H..Uc...T...K...N<EMAIL_ADDRESS><EMAIL_ADDRESS>..ME..B...G.......@A..K....W...T..E...0_...B..U...x-...H..Un..<s..4d..6f..0k..,b..%c..0...&t..0...!n..&...3b..<i..x-...W...B..UW.......R...S...I...r...
...I..Uc......%....B..UQ..E....d...B..Xk...S..U...x-
#
T 2020/10/03 16:40:59.957659 <IP_ADDRESS>:8088 -> <IP_ADDRESS>:30954 [AP] #12
.~.GOPTIONS<EMAIL_ADDRESS>SIP/2.0.
Via: SIP/2.0/WS <IP_ADDRESS>:5060;branch=z9hG4bK0644339a;rport.
Max-Forwards: 70.
From: "asterisk" <sip:asterisk@<IP_ADDRESS>>;tag=as4c2d477a.
To<EMAIL_ADDRESS>Contact: <sip:asterisk@<IP_ADDRESS>:5060;transport=ws>.
Call-ID: 3d6c3e4121e8a9313e885a3040ef9f96@<IP_ADDRESS>:5060.
CSeq: 102 OPTIONS.
User-Agent: Asterisk PBX 16.13.0.
Date: Sat, 03 Oct 2020 13:40:59 GMT.
Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REFER, SUBSCRIBE, NOTIFY, INFO, PUBLISH, MESSAGE.
Supported: replaces, timer.
Content-Length: 0.
.

#
T 2020/10/03 16:40:59.957821 <IP_ADDRESS>:8088 -> <IP_ADDRESS>:30954 [AP] #13
.~.)SIP/2.0 200 OK.
Via: SIP/2.0/WS v0bgfwytfb5b.invalid;branch=z9hG4bK1407642031;received=<IP_ADDRESS>;rport=30954.
From: "Flutter SIP UA" <sip:101@sip.url.by>;tag=h47d8wx7i3.
To: <sip:101@sip.url.by>;tag=as31afc043.
Call-ID: 8a0d6055479554o39p4r35.
CSeq: 2 REGISTER.
Server: Asterisk PBX 16.13.0.
Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REFER, SUBSCRIBE, NOTIFY, INFO, PUBLISH, MESSAGE.
Supported: replaces, timer.
Expires: 600.
Contact: <sip:nupgnfdo@v0bgfwytfb5b.invalid>;expires=600.
Date: Sat, 03 Oct 2020 13:40:59 GMT.
Content-Length: 0.
.

#
T 2020/10/03 16:40:59.957889 <IP_ADDRESS>:30954 -> <IP_ADDRESS>:8088 [A] #14
......
#
T 2020/10/03 16:40:59.992931 <IP_ADDRESS>:30954 -> <IP_ADDRESS>:8088 [AP] #15
.....l.F.%.i.B.f.\.f.'.L...|.?...^.v.;.f.\.w.B.w.^.v.Y.p.W.4.........X...Z.r._.'...)...L...f...6...6...".,.v...1...$.../...*...}...{...r.^.)._.L...+.L.'...4...d.P./.V.5.../...w.B.v.].h.\.x...!...r.^.r.[.K./.*.A...L."...#.].w.T...].#.T.'.\.v.
. .Z.w.B.v.].h.\.|.\.v.f.....f.\.f.<...".K.-.*...f."...)...'..."...@...@...-...!...-...#...#...>...>...*.K.-.%...|...6...'...(...6.L.6...%...).C.2.
.4...?.f.3...4...|...2...(.a.....#...
...2.V.v.f.L
##
T 2020/10/03 16:41:02.543067 <IP_ADDRESS>:30954 -> <IP_ADDRESS>:8088 [AF] #17
......
##
T 2020/10/03 16:41:47.610153 <IP_ADDRESS>:30954 -> <IP_ADDRESS>:8088 [A] #19
......

chrome - master channel
android - stable channel
if i try run android in master channel:
I/flutter ( 9978): [2020-10-03 13:45:14.667] Level.info websocket_dart_impl.dart:25 ::: connect ws://sip.url.by:8088/ws, {Origin: http://sip.skifnet.by, Host: sip.skifnet.by:8088/ws}, [sip]
I/flutter ( 9978): [2020-10-03 13:45:14.671] Level.error websocket_dart_impl.dart:108 ::: error Bad state: Insecure HTTP is not allowed by platform: http://sip.url.by:8088
I/flutter ( 9978): [2020-10-03 13:45:14.674] Level.debug websocket_interface.dart:98 ::: Closed [500, Bad state: Insecure HTTP is not allowed by platform: http://sip.url.by:8088]!
I/flutter ( 9978): [2020-10-03 13:45:14.675] Level.debug websocket_interface.dart:163 ::: WebSocket ws://sip.url.by:8088/ws closed
I/flutter ( 9978): [2020-10-03 13:45:14.676] Level.debug sip_ua_helper.dart:126 ::: disconnected => Code: [500], Cause: error, Reason: Bad state: Insecure HTTP is not allowed by platform: http://sip.url.by:8088
I/flutter ( 9978): [2020-10-03 13:45:14.679] Level.debug transport.dart:206 ::: reconnection attempt: 7. next connection attempt in 30 seconds
Lost connection to device.

chrome - master channel
android - stable channel
if i try run android on master channel:
I/flutter ( 9978): [2020-10-03 13:45:14.667] Level.info websocket_dart_impl.dart:25 ::: connect ws://sip.url.by:8088/ws, {Origin: http://sip.url.by, Host: sip.url.by:8088/ws}, [sip]
I/flutter ( 9978): [2020-10-03 13:45:14.671] Level.error websocket_dart_impl.dart:108 ::: error Bad state: Insecure HTTP is not allowed by platform: http://sip.url.by:8088
I/flutter ( 9978): [2020-10-03 13:45:14.674] Level.debug websocket_interface.dart:98 ::: Closed [500, Bad state: Insecure HTTP is not allowed by platform: http://sip.url.by:8088]!
I/flutter ( 9978): [2020-10-03 13:45:14.675] Level.debug websocket_interface.dart:163 ::: WebSocket ws://sip.url.by:8088/ws closed
I/flutter ( 9978): [2020-10-03 13:45:14.676] Level.debug sip_ua_helper.dart:126 ::: disconnected => Code: [500], Cause: error, Reason: Bad state: Insecure HTTP is not allowed by platform: http://sip.url.by:8088
I/flutter ( 9978): [2020-10-03 13:45:14.679] Level.debug transport.dart:206 ::: reconnection attempt: 7. next connection attempt in 30 seconds
Lost connection to device.

and so...
android send bad url? (ws://sip.url.by:8080/ws)
he send ws://sip.url.by:8080 ?

ok. im finde temp solution
in android wsuri ws://sip.url.by:8080/ws , bt android for some reason send ws://sip.url.by:8080/ and cut "ws"

T 2020/10/03 22:38:23.689157 <IP_ADDRESS>:13231 -> <IP_ADDRESS>:8088 [AP] #6
**GET / HTTP/1.1.**
user-agent: Dart/2.8 (dart:io) for OpenSIPS..
connection: Upgrade.
origin:  http://sip.skifnet.by.
accept-encoding: gzip.
content-length: 0.
sec-websocket-version: 13.
host: <IP_ADDRESS>:8088.
sec-websocket-key: i96ka98hsk3q8g2tot8mjw==.
sec-websocket-protocol: sip.
upgrade: websocket.

what i do for fix it:
i set redirect on html.conf asterisk
redirect = / /ws
did i find a bug? :)

ok. im finde temp solution
in android i set wsuri ws://sip.url.by:8080/ws , bt android for some reason send ws://sip.url.by:8080/ and cut "ws"
T 2020/10/03 22:38:23.689157 <IP_ADDRESS>:13231 -> <IP_ADDRESS>:8088 [AP] #6
GET / HTTP/1.1.
user-agent: Dart/2.8 (dart:io) for OpenSIPS..
connection: Upgrade.
origin:  http://sip.url.by.
accept-encoding: gzip.
content-length: 0.
sec-websocket-version: 13.
host: <IP_ADDRESS>:8088.
sec-websocket-key: i96ka98hsk3q8g2tot8mjw==.
sec-websocket-protocol: sip.
upgrade: websocket.
what i do for fix it:
i set redirect on html.conf asterisk
redirect = / /ws
did i find a bug? :)

Maybe. Did you read the source code to check how the URL is parsed?

Maybe. Did you read the source code to check how the URL is parsed?

no.
i'm new to flutter and dart )

Perfect!! Prove the bug!

heh.
challenge accepted! :D

It's been 3 days. Did you find it yet?

Looks like @cloudwebrtc fixed that 3 days ago https://github.com/flutter-webrtc/dart-sip-ua/commit/97ca2d7742db793dccec44f4ac98e1e420c0f3a7

@prozaklob can you help with a guideline on how to setup asterisk with sip_ua. currently, im having issue getting this to work together.
Thanks

Hello,
I have the same problem, did you discover any solution ?

Hello,
I have the same problem, did you discover any solution ?

Yes, i was able to get it to work.

Hello,
I have the same problem, did you discover any solution ?

Yes, i was able to get it to work.

Please How ?

Hello,
I have the same problem, did you discover any solution ?

Yes, i was able to get it to work.

Please How ?

Are you able to register?
What's the response you are getting, which stage of the setup are you, so we can know where to start from

Here is a working docker example, you can copy the big conf file to your asterisk.
https://github.com/flutter-webrtc/dockers/tree/main/asterisk

I have kamailio Server

I think you need to open the log of kamailio, check the maintenance WebSocket connection is established, the client disconnected after sending the first REGISTER message

Am also experiencing the same issue however on my end am using free PBX(Asterisk).

Here is a working docker example, you can copy the conf file to your asterisk.
https://github.com/flutter-webrtc/dockers/tree/main/asterisk
Which config needs altering to make it work if you already have a system running its close to impossible to reset the whole system.

I have kamailio Server

have you been able to solve this?

Check the wss details. Looks closed.

Please has anyone solved this?

Check the wss details. Looks closed.

Something funny is happening
it registers with
'Origin': ' https://tryit.jssip.net',
'Host': 'tryit.jssip.net:10443'
but i am not using jssip

That's part of the WebSocket spec and needs to be there. Was needed for
OpenSIPS for us.

That's part of the WebSocket spec and needs to be there. Was needed for OpenSIPS for us.

So i will need my own Origin and host for it to work?

Just try setting up one and switch debug on the Asterisk side to see why it's failing.
We do this for full RFC8599 support using OpenSIPS:
    var _wsExtraHeaders = <String, String>{
      'X-SureVoIP-App':
      'SureVoIP-Talk v${_packageInfo.version}+${_packageInfo.buildNumber}: ' +
          EnvConf.GIT_REV,
      'Origin': _packageInfo.packageName,
    };
    var _version = _packageInfo.appName +
        '-Talk app v' +
        _packageInfo.version +
        '+' +
        _packageInfo.buildNumber +
        ' on ' +
        model;

    var _fcmToken = GetStorage().read('savedFcmToken');
    var _apnsToken = GetStorage().read('savedApnsToken');

    UaSettings settings = UaSettings();
    settings.webSocketUrl = sc.data.value.sipDetail.suretecTalkAppSIPWssUri;
    settings.uri = sc.data.value.sipDetail.suretecTalkAppSIPUri;
    settings.authorizationUser =
        sc.data.value.sipDetail.suretecTalkAppSIPAuthorizationUser;
    settings.password = sc.data.value.sipDetail.suretecTalkAppSIPPassword;
    settings.displayName = sc.data.value.sipDetail.suretecTalkAppSIPDisplayName;
    settings.webSocketSettings.extraHeaders = _wsExtraHeaders;
    settings.userAgent = _version + ' ' + EnvConf.GIT_REV;
    settings.dtmfMode = DtmfMode.RFC2833;
    settings.register_expires = 86400;
    if (GetPlatform.isAndroid || GetPlatform.isWeb) {
      settings.registerParams.extraContactUriParams = <String, String>{
        'pn-provider': 'fcm',
        'pn-param': FCM_PROJECT_ID,
        'pn-prid': _fcmToken
      };
    } else {
      settings.registerParams.extraContactUriParams = <String, String>{
        'pn-provider': 'apns',
        'pn-param': APPLE_BUNDLE_ID_VOIP,
        'pn-prid': _apnsToken
      };
    }

Ok i will try this and revert back

I am still a little bit confused,
Apparently my websocket url works for different sip clients but not for this package, I shere anyway you can help me out?

Still there @ghenry

I think my main question is if i am meant to point my origin and host to
'Origin': ' https://tryit.jssip.net',
'Host': 'tryit.jssip.net:10443'
or use mine

For us, both of those are irrelevant, but just need to be present. Is this
Asterisk?

yes its asterisk

Version?

18

Hello, excuse me for the inconvenience, I am trying to develop an application in flutter, using SIP_UA, after having filled in all the parameters here is the error that I find I have been stuck on it for a while, you can help me please!

Hello, excuse me for the inconvenience, I am trying to develop an application in flutter, using SIP_UA, after having filled in all the parameters here is the error that I find I have been stuck on it for a while, you can help me please!

hi, were you able to solve this issue? i am also facing the issue now. thanks

I have the same issue and the below debug appears however it/s working normally and registered on android devices and desktops and successfully makes calls but when running on a web platform not working I am using FreePBX 16 does anyone solve this issue please?
2024-02-05 22:53:56.260] Level.debug null ::: connecting to WebSocket wss://<IP_ADDRESS>:8089/ws
[2024-02-05 22:53:56.266] Level.info null ::: connect wss://<IP_ADDRESS>:8089/ws, {}, [sip]
[2024-02-05 22:53:56.353] Level.debug null ::: Closed [1006, ]!
[2024-02-05 22:53:56.356] Level.debug null ::: WebSocket wss://<IP_ADDRESS>:8089/ws closed
[2024-02-05 22:53:56.360] Level.debug null ::: disconnected => Code: [1006], Cause: error, Reason:
[2024-02-05 22:53:56.367] Level.debug null ::: reconnection attempt: 63. next connection attempt in 30 seconds

Had any solutions for this?


ensure the driver file is also present after validating the cache file

This is kind of whack-a-mole with the race conditions for #77...
User is reporting ChildProcess::LaunchError: Text file busy, which means that it is attempting to start a file that is currently open for writing.
The scenario I'm picturing for 2 processes running in parallel:
1 - Sees no version file and creates it
2 - Sees a version file and continues on
1 - Downloads / Extracts driver
2 - Tries to use the driver before it is finished being downloaded/extracted
Waiting for the driver to exist after validating that it should not be downloaded again should be sufficient for this particular race condition.
The tricky part here is determining how long it should take for a driver to be downloaded and extracted, etc, and how to recover from an unforeseen state.
I don't think there's going to be a good way to completely solve this 100%. The right answer might be the rake tasks in #28

I guess the full solution to this would be to go to a cross process mutex solution. Easy enough in non-windows using flock - I’m not sure how to implement on windows though

We could have a windows and non-windows solutions. I suspect that most people wanting to run parallel aren't doing it on windows.
Also, I think I'm going to have to refactor a bunch of things in the System class to make the mocks I'm using more reasonable, to get the specs to pass with this PR.

Isn't the better short term solution for parallel to just set a different install dir for each process? That removes all the race conditions. Yes it would download the driver multiple times, but that time should be negligible in cases where parallel testing is providing the most benefit.

A different install directory per process would mean that you would end up downloading a new driver every single execution, and we'd potentially have trouble cleaning up afterwards. I'd almost rather punt on this whole thing and require people to use a rake task ahead of the parallel execution.

I'd almost rather punt on this whole thing and require people to use a rake task ahead of the parallel execution.

I think that might be a better or at least an easier solution than trying to add OS specific code.

the more I think about this the less I want to have this in the project, so I'm closing.


govendor update & list is slow

After doing a go get -u github.com/kardianos/govendor
Running it with strace shows it repeatedly reading from files inside the ./vendor directory
This is a somewhat large repository, but not this large!
> go version
go version go1.5.1 darwin/amd64
16:46:37 (master) jack@Jacks-MacBook-Pro.local:~/.go/src/github.com/signalfx/xyz
< go env
GOARCH="amd64"
GOBIN=""
GOEXE=""
GOHOSTARCH="amd64"
GOHOSTOS="darwin"
GOOS="darwin"
GOPATH="/Users/jack/.go"
GORACE=""
GOROOT="/opt/boxen/go"
GOTOOLDIR="/opt/boxen/go/pkg/tool/darwin_amd64"
GO15VENDOREXPERIMENT="1"
CC="clang"
GOGCCFLAGS="-fPIC -m64 -pthread -fno-caret-diagnostics -Qunused-arguments -fmessage-length=0 -fno-common"
CXX="clang++"
CGO_ENABLED="1"
16:46:38 (master) jack@Jacks-MacBook-Pro.local:~/.go/src/github.com/signalfx/xyz
< time govendor list +ext
real    1m30.624s
user    2m6.234s
sys 0m6.496s

Yeah, That does appear to be a bit excessive. Probably it is just re-reading files when it needs to just look at cache.

We're also having trouble using govendor update.  It will also run for a very long time then end without actually updating any code.  The only way we currently have to update code is rm -rf vendor && govendor init && govendor add +ext.  It's very disappointing and reproducible on multiple macs, but on our private repository.  There is no verbose log option for govendor so I don't have any information on why update isn't working.

Eep. I'll profile.
On Mon, Nov 16, 2015, 16:57 Jack Lindamood<EMAIL_ADDRESS>wrote:

We're also having trouble using govendor update. It will also run for a
very long time then end without actually updating any code. The only way we
currently have to update code is rm -rf vendor && govendor init &&
govendor add +ext. It's very disappointing and reproducible on multiple
macs, but on our private repository. There is no verbose log option for
govendor so I don't have any information on why update isn't working.
—
Reply to this email directly or view it on GitHub
https://github.com/kardianos/govendor/issues/63#issuecomment-157224692.

Fixed in a0adb8be6318afff204a39a67c04c4d41087a810 and 5c6a5e5fca6d1c7a5f5bd51bacdd4435472e23b7 .

We admittedly haven't done any profiling, but are experiencing tons of lag (100s on a fast modern machine with an SSD) in https://github.com/keybase/client/go whenever we run govendor update.  It works fast on smaller repos, so something feels quadratic in the size of the repo. This of course with the most recent version.  Anyone else still seeing slowness in large repositories?


gow -g expects script arguments when they are not required

gow -g is requiring that a command argument be passed, even if the script being called does not need them. Passing an empty argument seems to work around this, but it is not intuitive.
Example:
% cat script.sh
#!/bin/bash
echo "hello world"

% gow -g ./script.sh
"gow" is the missing watch mode for the "go" command.
Runs an arbitrary "go" subcommand, watches files, and restarts on changes.

Usage:

	gow <gow_flags> <cmd> <cmd_flags> <cmd_args ...>
...

% gow -g ./script.sh ""
hello world

This happens when the user passes only gow flags, without subsequent arguments and flags for the underlying executable such as go. This isn't specific to -g. This behavior assumes that the subprocess always requires a subcommand, and the motivation is to help the user learn the tool.
We do also have gow -h and gow help, as well as the repository readme. This could be changed to print help only if the user provided no CLI arguments, but I think it's logically inconsistent. It might be more logical to drop this behavior, so that simply running gow runs the subprocess with default gow settings and no CLI arguments.
The one thing that stops me is: the parsing of CLI arguments depends on the assumption that the subcommand is required. All flags before the first non-flag are taken for gow. Everything starting at the first non-flag (the subcommand) is passed to the subprocess. If we no longer assume a subcommand, then separating gow flags from subprocess flags requires a different approach, which could also leak into the normal usage. I could add support for -- but it's not a one-liner and complicates the interface. Thoughts are welcome.


pyarrow fatal error: arrow/c/abi.h: No such file or directory

Debian 10
Python 3.7
Arrow CPP libs installed from apache repo
python3 setup.py build_ext --inplace
running build_ext
-- Running cmake for pyarrow
cmake -DPYTHON_EXECUTABLE=/usr/bin/python3  -DPYARROW_BUILD_CUDA=on -DPYARROW_BUILD_FLIGHT=off -DPYARROW_BUILD_GANDIVA=off -DPYARROW_BUILD_DATASET=off -DPYARROW_BUILD_ORC=off -DPYARROW_BUILD_PARQUET=off -DPYARROW_BUILD_PLASMA=off -DPYARROW_BUILD_S3=off -DPYARROW_BUILD_HDFS=off -DPYARROW_USE_TENSORFLOW=off -DPYARROW_BUNDLE_ARROW_CPP=off -DPYARROW_BUNDLE_BOOST=off -DPYARROW_GENERATE_COVERAGE=off -DPYARROW_BOOST_USE_SHARED=on -DPYARROW_PARQUET_USE_SHARED=on -DCMAKE_BUILD_TYPE=release /code/arrow/python
-- Arrow build warning level: PRODUCTION
Using ld linker
Configured for RELEASE build (set with cmake -DCMAKE_BUILD_TYPE={release,debug,...})
-- Build Type: RELEASE
-- Build output directory: /code/arrow/python/build/temp.linux-x86_64-3.7/release
-- Found Arrow: /usr/include (found version "0.16.0")
-- Arrow version: 0.16.0 (CMake package configuration: Arrow)
-- Arrow SO and ABI version: 16
-- Arrow full SO version: 16.0.0
-- Found the Arrow core shared library: /usr/lib/x86_64-linux-gnu/libarrow.so
-- Found the Arrow core import library:
-- Found the Arrow core static library: /usr/lib/x86_64-linux-gnu/libarrow.a
-- Could NOT find ArrowPython (missing: ArrowPython_DIR)
-- Found ArrowPython: /usr/include (found version "0.16.0")
-- Found the Arrow Python by pkg-config: arrow-python
-- Found the Arrow Python shared library: /usr/lib/x86_64-linux-gnu/libarrow_python.so
-- Found the Arrow Python import library:
-- Found the Arrow Python static library: /usr/lib/x86_64-linux-gnu/libarrow_python.a
-- Could NOT find ArrowCUDA (missing: ArrowCUDA_DIR)
-- Checking for module 'arrow-cuda'
--   Found arrow-cuda, version 0.16.0
-- Found ArrowCUDA: /usr/include (found version "0.16.0")
-- Found the Arrow CUDA by pkg-config: arrow-cuda
-- Found the Arrow CUDA shared library: /usr/lib/x86_64-linux-gnu/libarrow_cuda.so
-- Found the Arrow CUDA import library:
-- Found the Arrow CUDA static library: /usr/lib/x86_64-linux-gnu/libarrow_cuda.a
-- Configuring done
-- Generating done
-- Build files have been written to: /code/arrow/python/build/temp.linux-x86_64-3.7
-- Finished cmake for pyarrow
-- Running cmake --build for pyarrow
cmake --build . --config release --
Scanning dependencies of target _cuda_pyx
[  5%] Compiling Cython CXX source for _cuda...
[  5%] Built target _cuda_pyx
Scanning dependencies of target _cuda
[ 11%] Building CXX object CMakeFiles/_cuda.dir/_cuda.cpp.o
/code/arrow/python/build/temp.linux-x86_64-3.7/_cuda.cpp:666:10: fatal error: arrow/c/abi.h: No such file or directory
#include "arrow/c/abi.h"
^~~~~~~~~~~~~~~
compilation terminated.
make[2]: *** [CMakeFiles/_cuda.dir/build.make:63: CMakeFiles/_cuda.dir/_cuda.cpp.o] Error 1
make[1]: *** [CMakeFiles/Makefile2:92: CMakeFiles/_cuda.dir/all] Error 2
make: *** [Makefile:84: all] Error 2
error: command 'cmake' failed with exit status 2

You didn't find Apache Arrow C++ you installed from source.
The following command line (you must replace ${ARROW_CPP_PREFIX} with the path you specified to Apache Arrow C++ as -DCMAKE_INSTALL_PREFIX= when you installed from source) will fix this:
$ PYARROW_CMAKE_OPTIONS="-DCMAKE_MODULE_PATH=${ARROW_CPP_PREFIX}/lib/cmake/arrow" python3 setup.py build_ext --inplace

I installed arrow using the instructions on their mainpage
Debian GNU/Linux and Ubuntu:
sudo apt update
sudo apt install -y -V lsb-release wget
if [ $(lsb_release --codename --short) = "stretch" ]; then
sudo tee /etc/apt/sources.list.d/backports.list <<APT_LINE
deb http://deb.debian.org/debian $(lsb_release --codename --short)-backports main
APT_LINE
fi
wget https://apache.bintray.com/arrow/$(lsb_release --id --short | tr 'A-Z' 'a-z')/apache-arrow-archive-keyring-latest-$(lsb_release --codename --short).deb
sudo apt install -y -V ./apache-arrow-archive-keyring-latest-$(lsb_release --codename --short).deb
sudo apt update
sudo apt install -y -V libarrow-dev # For C++
sudo apt install -y -V libarrow-glib-dev # For GLib (C)
sudo apt install -y -V libarrow-flight-dev # For Flight C++
sudo apt install -y -V libplasma-dev # For Plasma C++
sudo apt install -y -V libplasma-glib-dev # For Plasma GLib (C)
sudo apt install -y -V libgandiva-dev # For Gandiva C++
sudo apt install -y -V libgandiva-glib-dev # For Gandiva GLib (C)
sudo apt install -y -V libparquet-dev # For Apache Parquet C++
sudo apt install -y -V libparquet-glib-dev # For Apache Parquet GLib (C)
Which appears to install libraries into /usr/lib/x86_64-linux-gnu/cmake/arrow
PYARROW_CMAKE_OPTIONS="-DCMAKE_MODULE_PATH=/usr/lib/x86_64-linux-gnu/cmake/arrow" python3 setup.py build_ext --inplace
Same error
cmake --build . --config release --
Scanning dependencies of target _cuda_pyx
[  5%] Compiling Cython CXX source for _cuda...
[  5%] Built target _cuda_pyx
Scanning dependencies of target _cuda
[ 11%] Building CXX object CMakeFiles/_cuda.dir/_cuda.cpp.o
/code/arrow/python/build/temp.linux-x86_64-3.7/_cuda.cpp:666:10: fatal error: arrow/c/abi.h: No such file or directory
#include "arrow/c/abi.h"
^~~~~~~~~~~~~~~
compilation terminated.
make[2]: *** [CMakeFiles/_cuda.dir/build.make:63: CMakeFiles/_cuda.dir/_cuda.cpp.o] Error 1
make[1]: *** [CMakeFiles/Makefile2:92: CMakeFiles/_cuda.dir/all] Error 2
make: *** [Makefile:84: all] Error 2
error: command 'cmake' failed with exit status 2

Ah, "Arrow CPP libs installed from apache repo" means you installed Apache Arrow C++ from our APT repository not https://github.com/apache/arrow .
You can't use pyarrow master with the released Apache Arrow C++. You need to use pyarrow master with Apache Arrow C++ master.


Feature: Protect handler with GitHub Webhook Secret

In the current implementation, any user can send to the open URL hosted on Deno Deploy and spam the Telegram channel/group.
We need the way to handle this scenario @katsuki-yuri

The github secret key has been added whereas service throws error on !config.secret


Replace camelCase with snake_case keys in all JSON files

This is to maintain the convention.

After more research, I think we need to stick to camelCase. Now we need to change all snake_case keys back to camelCase lol


Bulk add rows functionality

Is there any hope of a bulkAddRows in future to save having to implement synchronous solutions like #40?

i wrote a helper which uses the bulkAddCells (so you don't get the timeout issues like #40 - and it's much much faster)
I call a custom addRowsBulk function:
addRowsBulk(createRows(data), createRowOptions(data))

the createRows just creates and array of rows containing an arrow of cells.
i.e. if you have a normal json object, an array (rows) containing objects (cells)), then you could do the same:
const createRows = (rows) => rows.map((cells) => {
//first cell is null... not sure why
  return [null].concat(Object.keys(cells).map(key => cells[key]))
})

the createRowOptions just return some options based on the data length:
const createRowOptions = (data) => ({
  'return-empty': true,
  'min-row': 1 + 1,
  'max-row': data.length + 1
});

function addRowsBulk(worksheet, rows, opts) {
   getCells(worksheet, opts)
        .then((cells) => {
          cells.forEach((cell, i) => {
            try {
              cell.value = String(rows[cell.row - 2][cell.col]); // eslint-disable-line
            } catch (e) {
              log(`NOT FOUND ${i} : R${cell.row} C${cell.col} rows:${rows.length}`);
            }
          });
          log('Updating Cells...');
          return bulkUpdateCells(worksheet, cells);
        });
    });
};

this uses a promised version of getCells
const getCells = (doc, opts) => new Promise((resolve, reject) => {
  doc.getCells(opts, (err, cells) => {
    if (err) reject(err);
    resolve(cells);
  });
});

So this module is using the v3 API. There is nothing in the docs about bulk adding rows, although maybe it would work...?
Otherwise you would have to use the bulk cells edit as explained above.
Happy to take a PR! :D

V3 API docs: https://developers.google.com/google-apps/spreadsheets/data

Important: Only the cells feed supports batching requests.

Seems like the helper function approach is the way to go. Thanks for the code sample.

if one of you guys wants to turn that helper above into a PR (with some tests) I'll very happily merge it in. I'm sure lots of people have this need.

FYI - I've just a published a new version of this module which is a complete rewrite using Google's V4 Sheets API (v3 is being deprecated on March 3, 2020).
Docs available here - https://theoephraim.github.io/node-google-spreadsheet
I think it should be pretty easy to make a bulk add rows method with the new API.
I'll add to the to-do list now that I'm working on this package again.
Thanks! 😄


Tournamentmode

2 players are able to compete

11 Points

1v1

[ ] add start button
[ ] initialise 1v1 game

Rate the game

[x] add global reducer for points (see resource collection)
[x] add event for increase points
[x] add event for decrease points

Renderer

[x] render the points for each team
[ ] add different colours for bots or add separate model for different teams

GameOver

[ ] add game over component (triggers game over event after x turns)
[ ] add game over dialog - which player won (see modals)

First parts pull request robotopia-x/robotopia#46

Rate the game
Renderer / render points


Event parsing needs work.

Implementation of two additional events has made it clear to me that event parsing needs some serious work. This issue will serve as a reminder.
I will work on it this come this weekend.

This has been completed.


Create a Python script that identifies the total number of students with a specific status (STU.TG) by grade (STU.GR) and by program code (STU.SP))

[ ] Step#1:

Using the Aeries API Documentation use the following url to make a request:

https://demo.aeries.net/aeries/api/v5/schools/994/students/99400001

SchoolCode ("994")(required) – the Aeries School Code. This is normally 1-999.

StudentID ("99400001")(optional) – the Aeries Student District Student ID Number.

Request the following and put them in a json and csv file locally. The header should be the code names: (format: Code Name  ->   Aeries Table.Column Name -> Description)

"StudentID"  -> STU.ID  -> Student ID

"Grade" -> STU.GR   -> 0-18 Student’s grade level

"AttendanceProgramCodePrimary" -> STU.SP -> The primary specialized attendance program to which this student currently belongs. Attendance programs are used to separate certain students’ attendance data in the                                                                     monthly apportionment (ADA) calculations.

"InactiveStatusCode"  -> STU.TG   -> Student’s status (blank is active)

Return:

Json File
CSV File
a table that shows the total number of student with a specific status (STU.TG) by grade (STU.GR) and by program code (STU.SP))

[ ] Step#2

Turn that request into a pythonic method that requests for value 994 (a specific school id) and value 99400001 (student id number)

[ ] Step#3

Using Python Method example (currently residing in "proj-learning-blocks" slack) as a guide turn that method into a class

[ ] Future steps:

Adapt request to two more urls:

/api/v5/schools/{SchoolCode}/students/grade/{GradeLevel}

SchoolCode (required) – the Aeries School Code. This is normally 1-999.
GradeLevel (required) – the academic grade level of the set of students to return.

/api/v5/schools/{SchoolCode}/students/sn/{StudentNumber}

SchoolCode (required) – the Aeries School Code. This is normally 1-999.
GradeLevel (required) – the academic grade level of the set of students to return.

Query String Filters:
StartingRecord – (numeric) The Record-Count value of the first record to return (inclusive).
EndingRecord – (numeric) The Record-Count value of the last record to return (inclusive).
Notes:
If Student ID is not passed, all students for the given school will be returned.
Results are always returned in the form of an "Array of Students" because often students have multiple records in a district if they are concurrently enrolled or have switched between schools during the school year.

Hi! I'm a little confused by the title of the issue; should this script return a number of students that match specific criteria as well as returning a JSON file and CSV file?

My apologies the user will enter a series of id numbers and will return:

store/return a number of student names that correspond to the id numbers in string
store/return the program code (STU.SP)) that the students in the list have
generate a list of total number of students by their program code (STU.SP)): X students with Program C code

Feel free to stop by a Code 4 Sac meeting to discuss more!


build: Update requirements.txt for main branch

This PR has the following changes -

Update requirements.txt for the main branch so that a Streamlit application can be hosted using main branch of this repository.

Self-Merging this PR


Routing keys with wildcards are not matched

While using version 0.4 we are seeing a bunch of key errors when the routing key has a wildcard.
We have an exchange + routing key ['internal', 'users.user.*'] which works just fine, but the hirefire package throws a KeyError  because it's not an exact match.

KeyError: ('internal', 'users.user.created')

It sounds like you're using Celery. Is that correct?

Yes.  Django + Celery

Can also provide a bit more of the errors we were seeing:

TypeError hirefire.procs.celery in identify_queue
get_status_task_counts() missing 1 required positional argument: 'status
KeyError: ('internal', 'users.user.created')
hirefire/utils.py in missing at line 114

Had a bit more time to actually debug this.  It looks like it was the changes introduced in hirefire 0.4 .  I went back to version 0.3 for now and everything is working fine.  Indeed the status isn't always sent 100% of the time.  If I get more of a chance, I'll look into fixing it and submitting a PR (unless someone beats me to it).

Interestingly, while attempting to upgrade to Celery 4, I had this same error happen to me. For whatever reason (I don't understand yet), the queue is registered as having (exchange, routing_key) of ('queuename', 'queuename'), but the tasks themselves are identified with ('queuename', ''). I don't understand why the routing_key is empty.
@deppy : If you've got any insight on my issue, that would be great. For the issue you mention, on version 0.4 you can add tasks_statuses = [] to the class.
I was wondering how many people even use routing_keys that are different from their queue name. Clearly there is at least one (you), so I'll need to make sure that whatever solution I come up with, it doesn't break your implementation, assuming that you have indeed upgraded to 0.4.
I'm debating adding a flag to let us just assume that the exchange, routing_key, and queue_name are all the same. It would sidestep the issue that I'm having currently, and probably be correct for the general case, though it would, if used, break the use-case that from the OP. It seems like, if it fixes Celery 4 inspecting, that it may be a reasonable default even.
@jezdez , @mjtamlyn , and anyone else: have any thoughts on the right approach?

I'm still happy for this to be implemented if somebody ever cares about it enough to write it. It's not something that's important to my uses, though, so I'm going to close it until there's somebody that would like to take it on.


Scheduled job gets delayed by the running time of the job in a long running (daemon like) program

I have written a little tool to backup my database every day at 0:00 and 13:00, thus:
gocron.Every(1).Day().At("00:00").Do(mainRoutine)
gocron.Every(1).Day().At("13:00").Do(mainRoutine)
<-gocron.Start()

The backup action itself takes around 10~12 seconds. I have set up a logger inside the program, and these are the log output:
INFO[2016-02-19 15:26:29.008 +0800] Backup program is starting.
INFO[2016-02-19 15:26:29.008 +0800] Scheduled backup job on 00:00
INFO[2016-02-19 15:26:29.008 +0800] Scheduled backup job on 13:00
INFO[2016-02-20 00:00:00.016 +0800] Below are databases owned by maddie, they will be backed up:
INFO[2016-02-20 00:00:00.016 +0800] db
INFO[2016-02-20 00:00:10.399 +0800] Database db is backed up as /home/db/database-backups/2016/02/db-20160220-00.bak.
INFO[2016-02-20 00:00:10.399 +0800] Backup finished.
INFO[2016-02-20 13:00:00.016 +0800] Below are databases owned by maddie, they will be backed up:
INFO[2016-02-20 13:00:00.017 +0800] db
INFO[2016-02-20 13:00:11.872 +0800] Database db is backed up as /home/db/database-backups/2016/02/db-20160220-13.bak.
INFO[2016-02-20 13:00:11.873 +0800] Backup finished.
INFO[2016-02-21 00:00:11.016 +0800] Below are databases owned by maddie, they will be backed up:
INFO[2016-02-21 00:00:11.016 +0800] db
INFO[2016-02-21 00:00:22.338 +0800] Database db is backed up as /home/db/database-backups/2016/02/db-20160221-00.bak.
INFO[2016-02-21 00:00:22.338 +0800] Backup finished.

INFO[2016-02-21 13:00:22.767 +0800] Backup finished.
INFO[2016-02-22 00:00:23.017 +0800] Below are databases owned by maddie, they will be backed up:
INFO[2016-02-22 00:00:23.017 +0800] db
INFO[2016-02-22 00:00:32.908 +0800] Database db is backed up as /home/db/database-backups/2016/02/db-20160222-00.bak.
INFO[2016-02-22 00:00:32.908 +0800] Backup finished.
INFO[2016-02-22 13:00:23.016 +0800] Below are databases owned by maddie, they will be backed up:
INFO[2016-02-22 13:00:23.016 +0800] db
INFO[2016-02-22 13:00:34.653 +0800] Database db is backed up as /home/db/database-backups/2016/02/db-20160222-13.bak.
INFO[2016-02-22 13:00:34.653 +0800] Backup finished.
INFO[2016-02-23 00:00:33.018 +0800] Below are databases owned by maddie, they will be backed up:
INFO[2016-02-23 00:00:33.018 +0800] db
INFO[2016-02-23 00:00:43.447 +0800] Database db is backed up as /home/db/database-backups/2016/02/db-20160223-00.bak.
INFO[2016-02-23 00:00:43.447 +0800] Backup finished.
INFO[2016-02-23 13:00:35.016 +0800] Below are databases owned by maddie, they will be backed up:
INFO[2016-02-23 13:00:35.016 +0800] db
INFO[2016-02-23 13:00:46.023 +0800] Database db is backed up as /home/db/database-backups/2016/02/db-20160223-13.bak.
INFO[2016-02-23 13:00:46.023 +0800] Backup finished.

INFO[2016-02-24 00:00:53.945 +0800] Backup finished.
INFO[2016-02-24 13:00:47.016 +0800] Below are databases owned by maddie, they will be backed up:
INFO[2016-02-24 13:00:47.016 +0800] db
INFO[2016-02-24 13:00:58.153 +0800] Database db is backed up as /home/db/database-backups/2016/02/db-20160224-13.bak.
INFO[2016-02-24 13:00:58.153 +0800] Backup finished.
INFO[2016-02-25 00:00:54.016 +0800] Below are databases owned by maddie, they will be backed up:
INFO[2016-02-25 00:00:54.016 +0800] db
INFO[2016-02-25 00:01:05.071 +0800] Database db is backed up as /home/db/database-backups/2016/02/db-20160225-00.bak.
INFO[2016-02-25 00:01:05.071 +0800] Backup finished.

INFO[2016-02-25 13:01:10.720 +0800] Backup finished.

As you can see, after each scheduled job being executed, the next job will be delayed by 10~12 seconds which is the execution time of the backup routine.
Is this by design? If yes, is there a way to change the behaviour?

I have the same problems with my projects. All delay by some time. It's not exactly the time the tasks take to execute.
If I execute tasks every 10 seconds (which takes 1 second of processing time) they get delayed by 1 second most of the time. This is an incredible impact if I run tasks on another projects once a day. They take up to 2 hours to process and the delayed amount is always more than 30mins+ ! Please fix this. You cannot schedule a task at 03:00 AM and after a week it's running at 07:00 AM...

I was looking at this project after searching "Golang cron", and liked the idea, but wanted to build it differently without reflection, so I rolled my own. I think the issue is that all the jobs are being run on the same thread, thus if a job of yours takes more than a second, all of your jobs will be delayed by that much.
Looking at the code, it'll take some tinkering to make it work properly, as the job.run() function returns some values from the task, making spinning off a new goroutine a little more tricky. I guess, my question is why do we need to return the result of the task? It looks like the only time that's used is in NextRun().
I'm finding it a little hard to see where that would be useful. If we dropped needing to return the result of the task, we could rewrite the job.run() function like:
func (j *Job) run() {
	// ...
	// Instead of throwing an error here when the task is running,
	// why not throw an error when the task is added to the scheduler?
	// if len(params) != f.Type().NumIn() {
	// 	err = errors.New("The number of param is not adapted.")
	// 	return
	// }
	// ...
	go f.Call(in) // spin off a goroutine so as not to delay subsequent tasks
	j.lastRun = time.Now()
	j.scheduleNextRun()
}

My cursory testing shows this to work, but I've hardly been exhaustive with it. That's my suggestion anyway.

Does https://github.com/jasonlvhit/gocron/pull/57 could resolve this issue ?

Yes #57 solves it, I had the same issue


Reinstate CARGO_PRIMARY_PACKAGE

#7069 removed CARGO_PRIMARY_PACKAGE since it's no longer needed by Clippy. It is, however, useful for other rustc wrappers. It'd be great to have this back.

Thanks for the pull request, and welcome! The Rust team is excited to review your changes, and you should hear from @Eh2406 (or someone else) soon.
If any changes to this PR are deemed necessary, please add them as extra commits. This ensures that the reviewer can see what has changed since they last reviewed the code. Due to the way GitHub handles out-of-date commits, this should also make it reasonably obvious what issues have or haven't been addressed. Large or tricky changes may require several passes of review and changes.
Please see the contribution instructions for more information.

This was added a long time ago in https://github.com/rust-lang/cargo/pull/5824 for cargo fix, so it wasn't really intended to be a first-class feature of Cargo per se. Could you elaborate on what you're thinking this would be useful for?

Could you elaborate on what you're thinking this would be useful for?

It's for when you have a rustc wrapper that you want to run only for the primary package--just like Clippy. Detecting this without CARGO_PRIMARY_PACKAGE is rather application specific and depends on yet other implementation details like the ___ proc macro crate and the name of build_script_build.

Hm yes that was the old purpose of this env var but can you elaborate what the specific use cases you're thinking of are? The idea of a "primary package" is pretty fuzzy and changes quite a bit over time as we add features and fix things, so it's not clear that there's something we could commit to stabilizing.

Sorry, let me be less vague.
My specific use case is to generate something akin to protobuf from the types and impls in what was previously called the primary package. I don't want to run the generator on dependencies because that would incur unnecessary computation or, otherwise, complicate the generator logic (e.g., "is something missing because the user forgot it, or because it's running on a dependency?").
As far as I can tell, Clippy used it similarly to ensure that users don't get errors and warnings from code they didn't write.
In my mind, a primary package is a stable concept:

a binary or library
not a dependency, build script, or test/bench harness
the thing that the user has in mind when they cargo build -p

Strictly speaking, this can be worked around--even somewhat stably by reading the Cargo.toml---but it's unfortunate to re-implement what the compiler is already determining for itself.
Maybe the right answer isn't to put back CARGO_PRIMARY_PACKAGE, but at least here's a vote for something like it. There probably aren't enough users of rustc_driver::Callbacks to make a well informed decision either, I guess. Please feel free to close this issue.

Egad sorry for the delay @nhynes!
Can you also clarify how you're overriding rustc to see this? That seems like it would be difficult to do from crates.io as a dependency.
In terms of an unstable concept what I'm thinking about is things like what do we do with workspaces, what do we do with multiple -p arguments on the command line, things like test binaries vs test targets, etc. The concept of a "primary package" has evolved in Cargo itself over time to adapt to new features we've added to Cargo and otherwise just rationalizing how all the features fit together.
I'm not necessarily saying we can't have a stable concept of a primary package, what I'm saying is that we probably shouldn't just take exactly what's there today and call it stable. Rather we should probably sit down and think about this and see if it's the right thing to stabilize.

Egad sorry for the delay

Hey no worries! You've only got, what? The entire rest of the Rust ecosystem to look at :)

Can you also clarify how you're overriding rustc to see this

Oh, it's just a RUSTC_WRAPPER that uses rustc_driver. Nothing complicated.

what do we do with workspaces, what do we do with multiple -p arguments on the command line, things like test binaries vs test targets

That's a great point. The idea of "primary package" is application specific. In the case of bins and libs, it's fairly straightforward: whatever is (implicitly) passed to -p  depending on whether there's a --bin(s) or --lib flag. For test and bench targets it gets a bit more complicated since one could think of either the object-under-test or the test driver as primary.
From a rustc_wrapper implementer's point of view, the only difficult thing to detect is the lib specified by -p since the dependencies are also libs and share the same args. The simplest "fix" would be IS_TERMINAL_LIB, but that's messy.
Ideally, one would parse the result of cargo b --build-plan, but that destroys incremental build, for some reason. I should probably look into that...
In any case, I'll close this for now and hope that someone else with a similar problem comes along someday :)
Thanks!


[RFC] Adding Sf vardumper caster for Stripe

Hello,
I just saw this article from JoliCode, and I immediately though that it would be a nice feature to add to this bundle. WDYT?
https://jolicode.com/blog/leverage-symfony-vardumper-component-to-enhance-your-dumps

Hello @Nek-
Thank you for sharing this ! I read it this morning too and think about adding it to the Payum Stripe lib (that's why I moved your issue here 😉).

To me, it's more a bundle thing (since it's tight to Symfony) but fine.


Canonicalize the docker composes

To use the evaluation apps with a lockbox,
it requires that the docker-composes are in canonicalized format

Just a tip, you don't need to do anything, but when the same change is applied over and over, possibly automatically, it's perfectly ok to have a single big commit - it's easier to go back/revert/blame etc.


Android to pick from document picker instead of camera library

Thanks for submitting a PR! Please read these instructions carefully:

[x] Explain the motivation for making this change.
[x] Provide a test plan demonstrating that the code is solid.
[x] Match the code formatting of the rest of the codebase.
[x] Target the master branch, NOT a "stable" branch.

Motivation (required)
What existing problem does the pull request solve?
Image picker only picks from camera library using ACTION_PICK intent. We change to ACTION_OPEN_DOCUMENT to pick photos and videos in other phone directories.
Test Plan (required)

Use

ImagePicker.launchImageLibrary(options, async (data) => {
        console.log(data);
});

A document library picker should open instead of camera image picker

Please what is the state of this PR? Is it working at the moment?


Remove generate endpoints

What this PR does / why we need it:
Remove the generate and generate_stream endpoints in favor of the OpenAI completions endpoints that were added in a previous PR.
Type of changes
Please delete options that are not relevant.

[x] Bug fix (non-breaking change which fixes an issue)
[ ] New feature (non-breaking change which adds functionality)
[ ] Breaking change (fix or feature that would cause existing functionality to not work as expected)
[ ] This change requires a documentation update

Release note:

Re-running failed tests

/rerun-all - rerun all failed workflows.
/rerun-workflow <workflow name> - rerun a specific failed workflow. Only one workflow name can be specified. Multiple /rerun-workflow commands are allowed per comment.

/lgtm
/approve

New York to Montreal


Remove today keyword argument from parse_date() function.

This is unnecessary and testing should be done via mocking.

[Current coverage][cc-pull] is 56.65%

Merging [#325][cc-pull] into [master][cc-base-branch] will decrease coverage by 0.04%

@@             master       #325   diff @@
==========================================
  Files            12         12
  Lines          1000        999     -1
  Methods           0          0
  Messages          0          0
  Branches          0          0
==========================================
- Hits            567        566     -1
  Misses          433        433
  Partials          0          0

Powered by Codecov. Last updated by [046c65b...0968837][cc-compare]
[cc-base-branch]: https://codecov.io/gh/aumayr/fava/branch/master?src=pr
[cc-compare]: https://codecov.io/gh/aumayr/fava/compare/046c65bbae158c6067542d5a13e8890bf7ec5da3...09688377c2bd88f1f74cc828035f6e8f37594daf
[cc-pull]: https://codecov.io/gh/aumayr/fava/pull/325?src=pr


style: homepage

What does this PR do?
Improve homepage layout
Related Issue(s)
No previous issue
Changes

Applied a gradient color to the title.
Made minor revisions to the text content.
Implemented a hover effect for the button.
Updated the background color using gradient.
Eliminated inline styles and transitioned to Tailwind CSS classes.
Created a new folder to store images also added few images inside.
Improve height page and scroll-bar logic

Screenshots or GIFs (if applicable)
Before:

After:

Checklist

[x] I have read and followed the contributing guidelines.
[x] My code follows the project's coding style and conventions.
[ ] I have added unit tests (if applicable) to ensure the code works as expected.
[ ] I have updated the project documentation (if necessary).

Additional Comments
Add any additional comments, context, or information about this PR.
By submitting this PR, I confirm that:

[x] I have reviewed my code and believe it is ready for merging.
[x] I understand that this PR may be subject to review and changes.
[x] I agree to abide by the code of conduct and contributing guidelines of this project.

Might fix: #194

May you could add the animation also to the image something like fade-in @bryanlundberg
As right now all other elements are animating but the image is loading without any effects on it

@bryanlundberg Please don't change the effects of Headers and buttons. Keep it same!
Only image should hae that fade-in animation

I can't do that, there is a rain of different animations and speed transitions also images take a little bit longer load so everything is not synchronized.
Ends with a strange effect

Oh then I think we can go with the last effect ...not fade-in but before that animate to left..

Are you working on it @bryanlundberg Because I'm prioritizing this thing now

Are you working on it @bryanlundberg Because I'm prioritizing this thing now

No, I deleted my branch.
Sorry 😐


Create a ViewSet test for the Game model

Create a file called "GameViewSetTest.py" at backend/rorapp/tests.
In this script, create a class called GameViewSetTest, with methods called setUp and test_get_all_games. The setUp method is a function that gets executed prior to execution of each test method. The test_get_all_games method is the test method. Use backend/rorapp/tests/user_viewset.p as an example.
Implement these methods:

setUp must create a test user and two test games. It must also call self.client = APIClient() so that the test method can access the API client for testing.
test_get_all_games must get all test games using the test user. To authenticate, you will have to get an access token for the test user. Make sure the API request targets the correct URL for games: /api/games/. With the backend running locally, use the web browsable API to check what data to expect in the response (for me this is at http://<IP_ADDRESS>:8000/api/games/).

Resources

Django REST Framework testing guide: https://www.django-rest-framework.org/api-guide/testing/
If unsure about how any of the code works in backend/rorapp/tests/user_viewset.py, I suggest copy and pasting the code it into ChatGPT or Phind and asking any questions you have about it, or ask me if you prefer.

Closing at this is not a priority anymore.


docs: generate and embed flag docs

@Bplotka

I hope you are ok, that I improved it a little bit - it did not work for me.


ISPN-6409 Fix NPE when attempting to view Relay channel metrics of a non-master node

https://issues.jboss.org/browse/ISPN-6409

Pulling..

Integrated in master and 8.2.x. Thanks @tristantarrant!


EnforceCodeStyleInBuild in csproj causes .editorconfig to be ignored

It looks as if having the
    <EnforceCodeStyleInBuild>true</EnforceCodeStyleInBuild>

set in your csproj file makes dotnet build enforce ALL rules, even if they are disabled in .editorconfig.
This may need more investigation.
Removing the line solves the problem, but this has to be at least documented, probably addressed somehow in the atc-coding-rules-updater (either autofix or warn about it).

We currently can't reproduce this error, even on the project where it originally occurred, so maybe we should just close the issue.
It might have been an error that only occurs when this setting exists in collaboration with other settings that are no longer present?


Webhooks for events

User story

As a cluster admin I'd like to hook up my deployment pipeline to a new cluster and automate the installation of basic components or configuration on the new cluster.

As a cluster admin, I want an automation to be started whenever a workload cluster is deleted, so I can initiate the removal of custom AWS resources (e. g. security groups) linked to the workload cluster's VPC, which would otherwise remain in place, create cost, and prevent the deletion of the workload cluster.

Rationale
Create a hook system that lets people automate their Kubernetes cluster operations.
Use case example: Set up a standard set of manifests as soon as a cluster has been created, e. g. to set up RBAC roles, network policies.
Background
Analog to event stream, but as hooks that the customer can react on.
Open questions
Possible side effects
Dependencies/prerequisites

EVENT-HISTORY

Related stories

EVENT-STREAM

closing as a duplicate of https://github.com/giantswarm/adidas/issues/839


List all supported platforms in the readme

Would be great if you could see at a glance from the readme if sveltekit-embed has a component for a given platform.

Hey @janosh yeah, I think I had something like that but it turns out it's just a Tweet 😅
https://twitter.com/spences10/status/1521444473212788897


devilutionx: 1.0.1 -> 1.1.0 @ 1432fbc8e

Motivation for this change
This fixes the issue of devilutionx build failing.
The fix was committed upstream, and there is not yet an official release containing it, so I used this commit temporarily. As soon as a new release is available, we should update  to it.
Things done

[x] Tested using sandboxing (nix.useSandbox on NixOS, or option sandbox in nix.conf on non-NixOS linux)
Built on platform(s)

[x] NixOS
[ ] macOS
[ ] other Linux distributions

[ ] Tested via one or more NixOS test(s) if existing and applicable for the change (look inside nixos/tests)
[ ] Tested compilation of all pkgs that depend on this change using nix-shell -p nixpkgs-review --run "nixpkgs-review wip"
[x] Tested execution of all binary files (usually in ./result/bin/)
[ ] Determined the impact on package closure size (by running nix path-info -S before and after)
[ ] Ensured that relevant documentation is up to date
[x] Fits CONTRIBUTING.md.

Fails to build for darwin:

Hey @SuperSandro2000, thanks for checking this up. I don't know how to fix it though... Any ideas? Otherwise I'd remove the darwin until someone has a fix.

Hey @SuperSandro2000, thanks for checking this up. I don't know how to fix it though... Any ideas? Otherwise I'd remove the darwin build until someone has a fix.

No clue. Could be an upstream issue.

Disabled darwin build. Seems that it works fine on linux. Can it be merged?

Hello @Mic92, could you please merge this?

@karolchmist can you please update this to follow the package naming conventions? I'm more than happy to merge once we have that in place.
Thank you!

Hello @aanderse , I changed the naming according to the convention, sorry for that :) I can squash the commits if it's ok with you now.

Sounds good, thanks! I appreciate your efforts on this.

@aanderse squashed, thanks!

Sorry for the hassle @SuperSandro2000. Thanks for the catch and cleanup.


Create kks-kiel.txt

Please add our german Gymnasium (High-School equivalent) to your list.
Homepage URL: http://kks-kiel.info (Only available in german)
The email domain @kks-kiel.de is only used by students and teachers.
If you visit https://kks-kiel.de you will see the login screen of our intranet.
We are distinguished as a MINT-Shool as you can see here: http://kks-kiel.info/index.php/mint.html
It is german as well but if you go to AUSGEZEICHNET: MINT-FREUNDLICHE SCHULE! you will see the logo of the certificate:

MINT stands for Mathematik Informatik Naturwissenschaften Technik which translates to Mathematics, Computer-Science, Natural-Science and Technology. The Duration of our MINT course is 2 years.
Greetings
Yannik

@Cave17 I am sorry for a delay with processing your request.
Pull request merged. Thank you!


feat(password_generator): [PPT-90] add configurable password generator

Adds a configurable password generator to:

place/booking_notifier
place/event_mailer
place/visitor_mailer
cisco/ice/network_access

with the following defaults:
DEFAULT_PASSWORD_LENGTH            = 6
DEFAULT_PASSWORD_EXCLUDE           = "0Oo1Il`'\\/"
DEFAULT_PASSWORD_MINIMUM_LOWERCASE = 1
DEFAULT_PASSWORD_MINIMUM_UPPERCASE = 0
DEFAULT_PASSWORD_MINIMUM_NUMBERS   = 1
DEFAULT_PASSWORD_MINIMUM_SYMBOLS   = 0

The #password_generator function is located in place/password_generator_helper.cr and then required in the drivers. Is there a better place for it?


[FIX] Update Dockerfile to fix build error

In the original build, the build failed because there was no tsconfig.json, and I adjusted the order of the npm install to take advantage of the cache and avoid tweaking the code to reinstall the dependencies.

The Dockerfiles in master branch are working. They just aren't published yet. We'll publish new version of Crawlee today.

New templates are published, let us know if they dont work for you.


Site isnt  responsive

Describe the bug
text and image and everything isnt responsive
Steps to reproduce

Go to '...'
Click on '....'
Scroll down to '....'
See error

Expected behavior
should be responsive
Screenshots
No response
Desktop

OS: [e.g. iOS]
Browser: [e.g. chrome, safari]
Version: [e.g. 22]

Smartphones

Device: [e.g. iPhone6]
OS: [e.g. iOS8.1]
Browser [e.g. stock browser, safari]
Version [e.g. 22]

Additional context
No response

Asign This To Me and add a hacktoberfest label


feat(send-all): Created 'send all' function in minimal-slp-wallet

PR related to this trello task --> https://trello.com/c/TxIuQsEE

:tada: This PR is included in version 1.6.0 :tada:
The release is available on npm package (@latest dist-tag)
Your semantic-release bot :package::rocket:


adds http(s) request timeout support

Built in node timeout can be too long. Helpful to be able to override at client level.

adds timeout option to HttpAdapter
will throw HttpError which mimics nodes built in timeout error
to test, will need to kill your network connection (otherwise will silently succeed)

You can set the timeout directly on the request like this request.setTimeout

Well that certainly makes things easier.

:+1: Just for the error I am currently rethinking the error handling in node-geocoder and I think a better Error handling should be
var error = HttpError(message, causeError);

// and you could retrieve the causeError
console.log(error.cause)

So causeError would be the native Error object? Would the expectation be this object is null for cases when no native error is available such as a pre-emptive timeout? If so, would ideally like to keep something such as the error code around, makes for a better test case comparison than an error message.

Just merging like that, I will refacto in an upcoming major version

Thanks for the PR version v3.5.0

Sweet. Thanks!


ci(e2e): added cypress execution

Closes #114
Signed-off-by: Lukas Mertens<EMAIL_ADDRESS>
Stack:

#124
#121
#120
#119
#117 ⬅
#113

⚠ Part of a stack created by spr. Do not merge manually using the UI - doing so may have unexpected results.

✓ Commit merged in pull request #124


Can't find configuration to show only last dir name

With all fancy complexity directory naming configuration
POWERLEVEL9K_SHORTEN_DIR_LENGTH
POWERLEVEL9K_SHORTEN_DELIMITER
POWERLEVEL9K_SHORTEN_STRATEGY
etc, I couldn't find any combination to show only the last dir name offered by the simple %1~
Eg.
~/Documents/I_symply_want_to_show_the_last_name/movies/last_name
would become
last_name

Well. More or less:
POWERLEVEL9K_SHORTEN_DIR_LENGTH=1
POWERLEVEL9K_SHORTEN_STRATEGY=truncate_folders

And, if you want to get rid of the abbreviation:
POWERLEVEL9K_SHORTEN_DELIMITER=""

To pick up your example:
~/Documents/I_symply_want_to_show_the_last_name/movies/last_name would become …/last_name, and if you set the delimiter to blank, you'll get /last_name.

Hmm, nice. If I add POWERLEVEL9K_DIR_OMIT_FIRST_CHARACTER=true I get exactly what I want. But if the direcotry contains only one char, as in the case when I'm at home dir, the omit char option will disappear with the ~

As in you want to also remove the leading / from the filename?
Hm, don't think we actually have an option to do that, honestly. It would be fairly easy to modify the code for this, if you were so inclined, but I don't think we have a way to only show the parent dirname.
Am I correct on that, @dritter? If so, this option would be a fairly easy feature to add since there isn't much logic to it.

I want an exactly behaviour as in %1~. I had indded modified powerlevel9k.zsh-theme line 623 from  local current_path="$(print -P "%~")" to
local current_path="$(print -P "%1~")"
since it was the only way I found to achieve this. Maybe you guys could add an option to this :)

As said, there is no easy way to achieve exactly the same as %1~..
But I found a hacky way, without changing the code in the theme..

The Idea is to override the prompt_dir function, and set POWERLEVEL9K_DIR_OMIT_FIRST_CHARACTER dynamically.
# Backup original prompt_dir function to _prompt_dir
eval "`declare -f prompt_dir | sed '1s/.*/_&/'`"
prompt_dir() {
  # Never omit first character
  POWERLEVEL9K_DIR_OMIT_FIRST_CHARACTER=false
  # Except if current directory is longer than one character
  local currentDirectory=$(print -P "%~")
  [[ ${#currentDirectory} -gt 1 ]] && POWERLEVEL9K_DIR_OMIT_FIRST_CHARACTER=true

  # Call original prompt_dir function
  _prompt_dir "${1}" "${2}"
}

That code must be after you source P9K. I put it in my ~/.zshrc at the very end.
@bhilburn I agree, we should put such an option into the theme. Maybe we could give POWERLEVEL9K_DIR_OMIT_FIRST_CHARACTER more logic. ;)

@dritter - Nice hack! Very clever :)
@FreddieOliveira - Does @dritter's hack work for you?
I'm going to leave this issue open as a tracking item for the enhancement. I agree with @dritter - this would be a good thing to add to the OMIT_FIRST_CHARACTER logic.

Thanks for the attention guys. Now I've got exactly what I wanted :+1: The hack works perfectly and is an ugly but functional replacement for the %1~
: P

@dritter With the hack above, what would be the best way to change the color of the foreground?
After using the workaround, the foreground went into the default black text despite having the code below in my .zshrc
POWERLEVEL9K_DIR_HOME_FOREGROUND="white"
POWERLEVEL9K_DIR_HOME_SUBFOLDER_FOREGROUND="white"
POWERLEVEL9K_DIR_DEFAULT_FOREGROUND="white"

@faewin Sorry, just stumbled upon your comment.
The answer lies in how we generate that color overwrite variable names. In our very basic *_prompt_segment functions we take the name of the actual segment and substitute prompt_ (this is how we name the segments internally prompt_dir, prompt_vcs, etc) from the name and check if a back or foreground variable exists. So, now that we redeclared our prompt_dir function to _prompt_dir (note the underscore in the beginning), this mechanism does not work any more. The same applies to other variable names as well (like *_VISUAL_IDENTIFIER).
Disclaimer for both solutions: The prompt_dir function checks internally for some variables. Here the name is hardcoded. So, if you use these variables, they do not get renamed.
Solution 1
Short, but ugly: Rename your variables as if the segment name was never stripped. Rename your variables to POWERLEVEL9K__PROMPT_DIR_HOME_FOREGROUND="white" (double underscore here).
Btw. if you want to set all segments to white foreground color, you might try setting POWERLEVEL9K_COLOR_SCHEME='light'. That might not set foreground always to white, but probably in a lot of cases.
Solution 2
Change the redeclared name to something else:
# Backup original prompt_dir function to prompt_my_dear
eval "`declare -f prompt_dir | sed '1s/.*/prompt_my_dear() {/'`"
prompt_dir() {
  # Never omit first character
  POWERLEVEL9K_DIR_OMIT_FIRST_CHARACTER=false
  # Except if current directory is longer than one character
  local currentDirectory=$(print -P "%~")
  [[ ${#currentDirectory} -gt 1 ]] && POWERLEVEL9K_DIR_OMIT_FIRST_CHARACTER=true

  # Call original prompt_dir function
  # no pun intended
  prompt_my_dear "${1}" "${2}"
}

The tricky part is how the declare statement works. declare -f prompt_dir outputs the source of prompt_dir, and we pipe that output through sed to replace the function name with something else. This whole expression gets evaluated and is by that a real function in your shell.
With this approach your color variables should be renamed to POWERLEVEL9K_MY_DEAR_FOREGROUND="white"..

Going to close this one out due to staleness, and the fact that this should be a bit easier in our new codebase, so this discussion isn't totally relevant anymore.

A year late to the party, but:

this should be a bit easier in our new codebase
Is there now an easier, more straightforward solution to the issue above? This is pretty much my only niggling issue with powerlevel9k; overall, it's an awesome little thing, keep up the good work. :)

@nathanielevan You are in luck. There is indeed a straightforward solution: POWERLEVEL9K_SHORTEN_STRATEGY=truncate_to_last.

It works, thank you!

You are very welcome.


Add Citrix Virtual Apps and Desktops & VMware Horizon

Resolves #540

Made some minor changes, including links/redirects and marking LTSR releases as LTS: true. I haven't validated the dates yet though.

Thanks a lot @lryanuk for your contribution 🥇!