A very simple way for citizens to stream pictures to the 112 PSAP's. Demo: https://112.camera.
This is only intended for test & demo purposes. github.com/ccloquet/showme, or a complete integration in existing tools would be better alternatives (easier for the citizens & the dispatchers).
Don't have a server? Fork it & host the static files on Github and the php code on fortrabbit.com or, eg., Heroku.
The citizen (most probably a trained citizen)
- calls the 112/911 and describes his/her emergency situation
- tells the dispatch that a live streaming will be available from 112.camera/his-her-phone-number (eg: 112.camera/123456789
- opens 112.camera.
- enters his/her phone number in international format.
- presses on GO.
- opens 112.camera/the-phone-number (eg: 112.camera/123456789)
- copy the file in a directory on your server
- in .htaccess, replace the /light/ by your folder. Pay attention to the HSTS config, and if not sure, remove it
- in config.js, maje peerjs_url point to the peer server (eg, on Heroku, see below)
- in params.php, define TWILIO_SID and TWILIO_APIKEY for the TURN & STUN servers
- ideally, make a domain name point to that folder, so that the user can call, say, domain.com/123456789
a Peer Server is needed to use the video set up. You can deploy yours on Heroku using : https://elements.heroku.com/buttons/peers/peerjs-server. The cloud server provided by peerJS is not suitable as it does not support https and there is a risk of identifiers collision. The Heroku server should be dimensioned taking into account the forecasted usage.
for real world use cases, a STUN & a TURN server is needed. This example uses Twilio's. See eg: peerjs.com, avaya.com & html5rocks.com/en/tutorials/webrtc, twilio.com. STUN Server usage is free, but TURN is not.
- All the files in the same folder (later, it shuold be professionalized)
- server side: query.php & params.php
- client side:
- iam.html for the citizen & psap.html for the PSAP
- params.js & showme.js for common functions
- .htaccess routes to iam.html or psap.html depending wether or not there is a number after the domain name:
- 112.camera/ -> iam.html
- 112.camera/123456789 -> psap.html
- /lib contains the dependencies
See discussions on https://github.com/ccloquet/showme for non-technical issues