falcot.com
(see also 例 10.13 “Excerpt of /etc/bind/db.falcot.com
”:
; the server where everything will run server1 IN A 198.51.100.19 server1 IN AAAA 2001:DB8:1000:2000::19 ; IPv4 only for TURN for now, some clients are buggy with IPv6 turn-server IN A 198.51.100.19 ; IPv4 and IPv6 addresses for SIP sip-proxy IN A 198.51.100.19 sip-proxy IN AAAA 2001:DB8:1000:2000::19 ; IPv4 and IPv6 addresses for XMPP xmpp-gw IN A 198.51.100.19 xmpp-gw IN AAAA 2001:DB8:1000:2000::19 ; DNS SRV and NAPTR for STUN / TURN _stun._udp IN SRV 0 1 3467 turn-server.falcot.com. _turn._udp IN SRV 0 1 3467 turn-server.falcot.com. @ IN NAPTR 10 0 "s" "RELAY:turn.udp" "" _turn._udp.falcot.com. ; DNS SRV and NAPTR records for SIP _sips._tcp IN SRV 0 1 5061 sip-proxy.falcot.com. @ IN NAPTR 10 0 "s" "SIPS+D2T" "" _sips._tcp.falcot.com. ; DNS SRV records for XMPP Server and Client modes: _xmpp-client._tcp IN SRV 5 0 5222 xmpp-gw.falcot.com. _xmpp-server._tcp IN SRV 5 0 5269 xmpp-gw.falcot.com.
/etc/turnserver.conf
配置文件。SQLite 数据库默认在 /var/db/turndb
中配置用户账户设置,而如果需要的话可以替代设置 PostgreSQL、MySQL 或 Redis。 要做的最重要的事情是插入服务器的 IP 地址。
turnserver
from the coturn package. We want the server to be an automatically started system service. This is the default behavior using systemd. Only when using the older SysVinit you have to edit the /etc/default/coturn
file like this:
# # Uncomment it if you want to have the turnserver running as # an automatic system service daemon # TURNSERVER_ENABLED=1
#
turnadmin -a -u roland -p secret_password -r falcot.com
#
turnadmin -A -u admin -p secret_password
-a
参数来添加普通用户,而用 -A
来添加管理用户。
/etc/kamailio/kamctlrc
is the configuration file for the control tools kamctl
and kamdbctl
. You need to edit and set the SIP_DOMAIN
to your SIP service domain and set the DBENGINE
to MySQL, another database backend can be used.
[...] ## your SIP domain SIP_DOMAIN=sip.falcot.com ## chrooted directory # CHROOT_DIR="/path/to/chrooted/directory" ## database type: MYSQL, PGSQL, ORACLE, DB_BERKELEY, DBTEXT, or SQLITE # by default none is loaded # # If you want to setup a database with kamdbctl, you must at least specify # this parameter. DBENGINE=MYSQL [...]
/etc/kamailio/kamailio.cfg
上。Falcot 公司需要用户认证和持续的用户位置,所以他们在文件的顶部添加了后面的指令 #!define
:
#!KAMAILIO # # Kamailio (OpenSER) SIP Server v5.2 - default configuration script # - web: https://www.kamailio.org # - git: https://github.com/kamailio/kamailio #!define WITH_MYSQL #!define WITH_AUTH #!define WITH_USRLOCDB [...]
kamdbctl create
as root. Finally, we can add some users with kamctl
.
#
kamdbctl create
[...] #
kamctl add roland secret_password
systemctl restart kamailio
, you can connect with a SIP client providing the IP address and the port (5090 is the default port). The users have the following id: roland@sip.falcot.com
, and they can login using a client (see 第 13.9 节 “即时通讯软件”).
/etc/prosody/prosody.cfg.lua
配置文件。要做的最重要的事情是插入被允许管理这台服务器的用户的 JID。
admins = { "[email protected]" }
/etc/prosody/conf.avail/example.com.cfg.lua
的示例,并用它作为起点,这里是 falcot.com.cfg.lua
:
VirtualHost "falcot.com" enabled = true ssl = { key = "/etc/ssl/private/falcot.com.key"; certificate = "/etc/ssl/certs/falcot.com.pem"; } -- Set up a MUC (multi-user chat) room server on conference.example.com: Component "conference.falcot.com" "muc"
/etc/prosody/conf.d/
的符号链接。以这样的方式来创建:
#
ln -s /etc/prosody/conf.avail/falcot.com.cfg.lua /etc/prosody/conf.d/
prosodyctl
command line utility. For example, to add the administrator account specified in /etc/prosody/prosody.cfg.lua
:
#
prosodyctl adduser [email protected]
config.js
文件。DruCall 源代码说明了如何使用 PHP 来实现。