Stap 2: Autostart linphone als een daemon (op kodi)
Wij willen linphone automatisch wordt gestart wanneer het systeem wordt opgestart. Wij willen ook dat het in antwoord AutoWijze en beginnen met verzenden van wat het hoort op het apparaat van de loopback/nep snoop in stap hieronder toegevoegd.
root vim /etc/init.d/linphone#! /bin/sh# /etc/init.d/linphone### BEGIN INIT INFO# Provides: linphone# Required-Start: $local_fs $syslog $remote_fs dbus snd-aloop# Required-Stop: $local_fs $syslog $remote_fs# Default-Start: 2 3 4 5# Default-Stop: 0 1 6# Short-Description: Start linphonec daemons### END INIT INFO# The following part always gets executed.echo "Linphone"# The following part carries out specific functions depending on arguments.case "$1" in start) echo "Starting linphonec daemon" linphonecsh init -a echo "linphonec daemon is alive" ;; stop) echo "Stopping linphonec daemon" linphonecsh exit echo "linphonec daemon is dead" ;; *) echo "Usage: /etc/init.d/foobar {start|stop}" exit 1 ;;esacexit 0
Sla bestanden en afrit vim.
Nu beginnen we linphone handmatig om te controleren of boven script werkt. We maken binnenkort starten automatisch voort opnieuw opstarten.
root /etc/init.d/linphone startLinphoned Starting linphonec daemonlinphonec daemon is alive
Controleer nu of linphone daemon op verbindingen wacht:
root netstat -ntulp | grep linphoneudp 0 0 0.0.0.0:5060 0.0.0.0:* 22101/linphonec
Laat maken van dit script uitvoeren bij opstarten & opnieuw opstarten, dus we moeten de daemon altijd draait:
root update-rc.d linphone defaults
Laat opnieuw opstarten en controleren linphone daemon wacht op verbindingen opnieuw gebruiken:
netstat -ntulp | grep linphone