Benutzer-Werkzeuge

Webseiten-Werkzeuge


kamailio

Unterschiede

Hier werden die Unterschiede zwischen zwei Versionen angezeigt.

Link zu dieser Vergleichsansicht

Beide Seiten der vorigen RevisionVorhergehende Überarbeitung
Nächste Überarbeitung
Vorhergehende Überarbeitung
kamailio [08.08.2023 08:17] – [RTPProxy] thoogekamailio [18.12.2023 16:23] (aktuell) – [Kamailio SIP Server] thooge
Zeile 12: Zeile 12:
 #!define WITH_TLS #!define WITH_TLS
 #!define WITH_PRESENCE #!define WITH_PRESENCE
 +#!define WITH_USRLOCDB
  
 alias="sip.mydomain.com" alias="sip.mydomain.com"
 listen=udp:192.168.0.2:5060 listen=udp:192.168.0.2:5060
 listen=tcp:192.168.0.2:5061 listen=tcp:192.168.0.2:5061
 +</file>
 +
 +<file conf /etc/kamailio/kamctlrc>
 +SIP_DOMAIN=mydomain.com
 +DBENGINE=MYSQL
 +DBHOST=localhost
 +DBNAME=kamailio
 +DBRWUSER="kamailio"
 +DBRWPW="********"
 +DBROUSER="kamailioro"
 +DBROPW="******"
 +</file>
 +
 +Für den Fall daß der RPTProxy verwendet werden soll, noch folgendes ergänzen:
 +<code>
 +#!define WITH_NAT
 +</code>
 +
 +Datenbank erstellen mit
 +  kamdbctl create
 +
 +===== Logging =====
 +
 +Ergänzung in ''rsyslog.conf''
 +<code>
 +# Kamailio
 +local0.* -/var/log/kamailio.log
 +</code>
 +
 +<file conf /etc/logrotate.d/kamailio>
 +/var/log/kamailio*.log {
 +  daily
 +  missingok
 +  rotate 14
 +  compress
 +  delaycompress
 +  create 0644 root adm
 +  postrotate
 +    /usr/lib/rsyslog/rsyslog-rotate
 +  endscript
 +}
 </file> </file>
 ===== TLS ===== ===== TLS =====
Zeile 38: Zeile 80:
 Erstellen aus den Quellen: Erstellen aus den Quellen:
 <code> <code>
 +apt-get install libssl-dev libsrtp2-dev
 cd /usr/local/src cd /usr/local/src
 git clone -b master https://github.com/sippy/rtpproxy.git git clone -b master https://github.com/sippy/rtpproxy.git
 git -C rtpproxy submodule update --init --recursive git -C rtpproxy submodule update --init --recursive
 cd rtpproxy cd rtpproxy
 +git checkout v3.0.1
 ./configure ./configure
 make clean all make clean all
Zeile 47: Zeile 91:
 </code> </code>
  
-Die Kommunikation mit Kamailio erfolgt über einen Unix-Socket+++++ Init-Script | 
 +<file bash /etc/init.d/rtpproxy> 
 +#! /bin/sh 
 +### BEGIN INIT INFO 
 +# Provides:          rtpproxy 
 +# Required-Start:    $remote_fs $syslog 
 +# Required-Stop:     $remote_fs $syslog 
 +# Default-Start:     2 3 4 5 
 +# Default-Stop:      0 1 6 
 +# Short-Description: RTP Proxy 
 +# Description:       Relay for VoIP media streams 
 +### END INIT INFO 
 + 
 +PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin 
 +NAME=rtpproxy 
 +DESC="RTP relay" 
 +DAEMON=/usr/local/bin/$NAME 
 +USER=$NAME 
 +GROUP=$USER 
 +PIDFILE="/var/run/$NAME/$NAME.pid" 
 +PIDFILE_DIR=`dirname $PIDFILE` 
 +CONTROL_SOCK="unix:$PIDFILE_DIR/$NAME.sock" 
 + 
 +test -x $DAEMON || exit 0 
 +umask 002 
 + 
 +. /lib/lsb/init-functions 
 + 
 +# Include defaults if available 
 +if [ -f /etc/default/$NAME ] ; then 
 + . /etc/default/$NAME 
 +fi 
 + 
 +DAEMON_OPTS="-s $CONTROL_SOCK -u $USER:$GROUP -p $PIDFILE $EXTRA_OPTS" 
 + 
 +if [ ! -d "$PIDFILE_DIR" ];then 
 + mkdir "$PIDFILE_DIR" 
 +    chown $USER:$GROUP "$PIDFILE_DIR" 
 +fi 
 + 
 +set -e 
 + 
 +case "$1" in 
 +  start) 
 + echo -n "Starting $DESC: " 
 + start-stop-daemon --start --quiet --pidfile $PIDFILE --exec $DAEMON -- $DAEMON_OPTS 
 + echo "$NAME." 
 + ;; 
 +  stop) 
 + echo -n "Stopping $DESC: " 
 + start-stop-daemon --stop --quiet --oknodo --pidfile $PIDFILE --exec $DAEMON 
 + echo "$NAME." 
 + ;; 
 +  status) 
 + echo -n "Status $DESC: " 
 + if [ ! -e "$PIDFILE" ]; then 
 + echo "$NAME is NOT running. No PID-File." 
 + exit 7 
 + fi 
 + PID=$(cat $PIDFILE) 
 + kill -0 $PID 
 + rc=$? 
 + # Check exit code 
 + if [ "$rc" -ne 0 ] 
 + then 
 + echo "$NAME is NOT running." 
 + exit 7 
 + else 
 + echo "$NAME is running with PID: $PID" 
 + fi 
 + ;; 
 +  restart|force-reload) 
 + echo -n "Restarting $DESC: " 
 + start-stop-daemon --stop --quiet --oknodo --pidfile $PIDFILE --exec $DAEMON 
 + sleep 1 
 + start-stop-daemon --start --quiet --pidfile $PIDFILE --exec $DAEMON -- $DAEMON_OPTS 
 + echo "$NAME." 
 + ;; 
 +  *) 
 + N=/etc/init.d/$NAME 
 + echo "Usage: $N {start|stop|status|restart|force-reload}" >&
 + exit 1 
 + ;; 
 +esac 
 + 
 +exit 0 
 +</file> 
 +++++ 
 + 
 +Einstellungen für das Init-Skript
 <file conf /etc/default/rtpproxy> <file conf /etc/default/rtpproxy>
 USER=kamailio USER=kamailio
 GROUP=kamailio GROUP=kamailio
 CONTROL_SOCK="unix:/var/run/rtpproxy/rtpproxy.sock" CONTROL_SOCK="unix:/var/run/rtpproxy/rtpproxy.sock"
 +EXTRA_OPTS="-l <external ip address> -d INFO"
 </file> </file>
  
 Die Kommunikation lassen wir über einen Unix-Socket stattfinden und nicht Die Kommunikation lassen wir über einen Unix-Socket stattfinden und nicht
-wie im Standard über UDP. Dafür ist noch eine Anpassung erforderlich:+wie im Standard über UDP. Dafür ist noch eine Anpassung in Kamailio erforderlich:
 <file conf /etc/kamailio/kamailio.cfg> <file conf /etc/kamailio/kamailio.cfg>
 #!define WITH_NAT #!define WITH_NAT
Zeile 62: Zeile 196:
 modparam("rtpproxy", "rtpproxy_sock", "unix:/var/run/rtpproxy/rtpproxy.sock") modparam("rtpproxy", "rtpproxy_sock", "unix:/var/run/rtpproxy/rtpproxy.sock")
 </file> </file>
 +
 +===== Befehle =====
 +Anzeige der angelegten Geräte
 +  kamctl db show subscriber
 +
 +Anzeige der angemeldeten Geräte (kamailio muß laufen)
 +  kamctl ul show
 +  kamctl online
 +
 +Nummern (Subscriber) anlegen
 +  kamctl add <nummer> <kennwort>
 +
 +Nummer wieder entfernen
 +  kamctl  rm <nummer>
 +
 +===== VoIP-Clients =====
 +
 +Selbstverständliche kann jedes IP-Telefon verwendet werden.
 +Hersteller sind z.B. Grandstream und Snom.
 +
 +Softphones auf dem PC:
 +  * Twikle
 +  * Linphone, anscheinend kein vernänftiges Logging
 +
 +Apps auf dem Smartphone:
 +  * ??? 
 +
  
kamailio.1691482627.txt.gz · Zuletzt geändert: 08.08.2023 08:17 von thooge

Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki