Starting WebRTC2SIP as a service without screen or console.Tweet
Making webrtc2sip a service
NOTE: If you are trying or want to get rid of webrtc2sip and use a plain asterisk installation, see "WebRTC with Asterisk and Amazon AWS".
Webrtc2sip is a much needed tool created by the Doubango guys, to enable the use of SIP as the signaling protocol in a webrtc application, used with Asterisk and/or FreeSWITCH mostly. If you want to know how to actually compile and install it, please refer to the article titled Compiling and Installing WebRTC2SIP.
Unfortunately this handy tool can't be started as a service as it is, since it will always start and read from standard input for commands (as of today, the only command available seems to be quit).
A lot of folks have resorted to use screen to start webrtc2sip as a service. This solution might work for some people, but it is a kludgy way to get around this.
So I've made this simple patch available as a gist that adds a new option to webrtc2sip that can be used at startup: --without-console.
To apply the patch just download the gist to your local copy of the webrtc2sip svn repo:
Then continue building as usual:
After that you can start webrtc2sip normally with console:
Or (by specifying the new option), without a console, like:
Using webrtc2sip from within daemontools
If you use daemontools (you can find how to install it in this article titled "Installing DaemonTools in Amazon Linux (or CentOS like OS)"), these sample scripts will help you run webrtc2sip when the system boots.
Create a user for it, with:
Then create the following files with the following content for each one:
/etc/service/webrtc2sip/log/run (mode 0700)
/etc/service/webrtc2sip/run (mode 0700)
Create the directory /etc/service/webrtc2sip/env (mode 0700)
No contents needed for this one.