Skip to content

Commit

Permalink
add reSIProcate (SIP proxy and TURN server) package
Browse files Browse the repository at this point in the history
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA256

I've packaged the reSIProcate SIP stack (shared library), repro proxy
and reTurn, the ICE/STUN/TURN server.  Please find the Makefile and
related artifacts attached

Benefits to OpenWRT:

This provides a comprehensive platform for true federated VoIP from
OpenWRT, thanks to the following:
- - repro has a built-in web interface and no database dependency, so it
highly suitable for a router
- - repro provides strong mutual TLS authentication
- - reTurn provides robust and efficient NAT traversal for RTP streams

Dependencies:

This depends on my previous patches today, for building the C++
support for db47, and also adding libasio package

Testing:

I've tested the binaries on a TP-Link TL-WR1043ND with 32MB RAM and
8MB flash.  This seems to be the bare minimum amount of flash for the
combination of reSIProcate + openssl + libdb + other dependencies
http://wiki.openwrt.org/toh/tp-link/tl-wr1043nd

More info on reSIProcate:

  http://www.resiprocate.org/

and a quick start HowTo guide for federated VoIP with reSIProcte:

  http://www.opentelecoms.org/federated-voip-quick-start-howto
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.12 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iQIcBAEBCAAGBQJQXNJ/AAoJEOm1uwJp1aqDsxcP/2EXMsVZl0tAet7nU+XJOA3U
Nxm8d/aPjOcI11VsZXo909Eiuo2MLmVqT3o044GARwxY5lWlMl3kQUGFbhNdho2m
6ffmvlqkjQn+DOEkHo3Bz4sAidYpuoTqr8Uz2YgpSLXQ1JYUpqch8SjqK0XFrX7E
pbq5haCL9kqeZmDiyHoKS/MihZfBw+vDTaQMsczICGnqCSnXuF09rrUa4kGZ2xb3
vx3k/DCnLZVLCGG0TwRpoM65ov/6xYBhtTyglJHCQslZ5wCRR5Q4O6F4u7YPIpMO
mACwsAWT4li88kM4mvBz5ikmGMSIEPMPIFceKxZAB45VWQy82SH4tTt89ER6Zt/2
39lABgPj+0iyWnckwvHF/C6Uzchjakp3qVsI6QarNtVBxE0jUO4c/msYghOmYUNS
hWkyU3Aefuc9kyN+kHWtlAg14q+NeEhJr0ONIJmZ3M6VRPdcSRj91tb5pbG04/X0
55Ae8veYPn4MT3l0vbID1hcfBPaRVwavaEO3MrBOwzKXTYNHbYH6jmeQH/BAif3w
Tbeh44hF+yXdkdBr1HNqrDkewmpAle9/bcQ36XXZIShdlx3m1sBPyozDAhozxDoA
DIeBo9MMu18C7r1i14KRujqfxo6GhN2evElnKwMmXWRvLKDvHNoVTArdSsHBoC07
kAFcj3K2LPlRwkNSlEBL
=TTUm
-----END PGP SIGNATURE-----
  • Loading branch information
dpocock authored and Dave Taht committed Jan 25, 2014
1 parent 1415dde commit 93840e8
Show file tree
Hide file tree
Showing 6 changed files with 866 additions and 0 deletions.
108 changes: 108 additions & 0 deletions net/resiprocate/Makefile
@@ -0,0 +1,108 @@
#
# Copyright (C) 2012 OpenWrt.org
# Copyright (C) 2012 Daniel Pocock <daniel@pocock.com.au>
#
# This is free software, licensed under the GNU General Public License v2.
# See /LICENSE for more information.
#

include $(TOPDIR)/rules.mk

PKG_NAME:=resiprocate
PKG_VERSION:=1.8.5
PKG_RELEASE:=1

PKG_BUILD_DIR:=$(BUILD_DIR)/resiprocate-$(PKG_VERSION)
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
PKG_SOURCE_URL:=https://www.resiprocate.org/files/pub/reSIProcate/releases/
PKG_MD5SUM:=70754747edf22cfd752a39eb81f0d2a1

PKG_INSTALL:=1
PKG_BUILD_PARALLEL:=1
PKG_BUILD_DEPENDS:=+libasio

include $(INCLUDE_DIR)/package.mk

#TARGET_CFLAGS += $(FPIC)
TARGET_LDFLAGS += -lcrypto

define Package/resiprocate/Default
SECTION:=net
CATEGORY:=Network
SUBMENU:=Telephony
DEFAULT:=m
TITLE:=reSIProcate
URL:=http://www.resiprocate.org/
DEPENDS:=+libopenssl +libdb47 +libcares +boost +libstdcpp
endef

define Package/libresiprocate
$(call Package/resiprocate/Default)
SECTION:=libs
CATEGORY:=Libraries
TITLE+= libraries
endef

define Package/repro
$(call Package/resiprocate/Default)
TITLE+= repro SIP proxy
DEPENDS+= +libresiprocate
endef

define Package/resiprocate-turn-server
$(call Package/resiprocate/Default)
TITLE+= repro TURN server (reTurn)
DEPENDS+= +libresiprocate
endef

define Package/resiprocate/description
SIP stack, proxy, ICE/STUN/TURN implementation
endef

define Package/repro/conffiles
/etc/repro/repro.config
endef

define Package/resiprocate-turn-server/conffiles
/etc/reTurnServer.config
endef

define Build/Configure
$(call Build/Configure/Default, --enable-shared --disable-static --with-ssl --with-c-ares )
endef

define Build/Compile
$(MAKE) $(PKG_JOBS) -C $(PKG_BUILD_DIR)
endef

define Package/libresiprocate/install
$(INSTALL_DIR) $(1)/usr/lib
$(CP) $(PKG_INSTALL_DIR)/usr/lib/librutil*.so* $(1)/usr/lib/
$(CP) $(PKG_INSTALL_DIR)/usr/lib/libresip*.so* $(1)/usr/lib/
$(CP) $(PKG_INSTALL_DIR)/usr/lib/libdum*.so* $(1)/usr/lib/
endef

define Package/repro/install
$(INSTALL_DIR) $(1)/usr/sbin
$(INSTALL_BIN) $(PKG_BUILD_DIR)/repro/repro $(1)/usr/sbin/
$(INSTALL_DIR) $(1)/usr/lib
$(CP) $(PKG_INSTALL_DIR)/usr/lib/librepro*.so* $(1)/usr/lib/
$(INSTALL_DIR) $(1)/etc/repro/ssl
$(INSTALL_CONF) ./files/repro.config $(1)/etc/repro/
$(INSTALL_DIR) $(1)/etc/init.d
$(INSTALL_BIN) ./files/repro.init $(1)/etc/init.d/repro
endef

define Package/resiprocate-turn-server/install
$(INSTALL_DIR) $(1)/usr/sbin
$(INSTALL_BIN) $(PKG_BUILD_DIR)/reTurn/reTurnServer $(1)/usr/sbin/
$(INSTALL_CONF) ./files/reTurnServer.config $(1)/etc/
$(INSTALL_DIR) $(1)/etc/init.d
$(INSTALL_BIN) ./files/reTurnServer.init $(1)/etc/init.d/reTurnServer
endef

$(eval $(call BuildPackage,libresiprocate))
$(eval $(call BuildPackage,repro))
$(eval $(call BuildPackage,resiprocate-turn-server))


33 changes: 33 additions & 0 deletions net/resiprocate/files/reTurnServer.config
@@ -0,0 +1,33 @@
TurnPort = 3478
TlsTurnPort = 5349
AltStunPort = 0
TurnAddress = 0.0.0.0
AltStunAddress = 0.0.0.0
AuthenticationMode = 2
AuthenticationRealm = reTurn
NonceLifetime = 3600
AllocationPortRangeMin = 49152
AllocationPortRangeMax = 65535
DefaultAllocationLifetime = 600
MaxAllocationLifetime = 3600
MaxAllocationsPerUser = 0
TlsServerCertificateFilename = server.pem
TlsTempDhFilename = dh512.pem
# leave blank if key is not encrypted
#TlsPrivateKeyPassword =
# Logging Type: syslog|cerr|cout|file
LoggingType = syslog
# Logging level: NONE|CRIT|ERR|WARNING|INFO|DEBUG|STACK
LoggingLevel = INFO
LogFilename = reTurnServer.log
LogFileMaxLines = 50000
# It is highly recommended that these values are NOT left at their
# default setting
LongTermAuthUsername = test
LongTermAuthPassword = 1234
# Must be true or false, default = false, not supported on Windows
Daemonize = true
# On UNIX it is normal to create a PID file
# if unspecified, no attempt will be made to create a PID file
#PidFile = /var/run/reTurnServer/reTurnServer.pid

20 changes: 20 additions & 0 deletions net/resiprocate/files/reTurnServer.init
@@ -0,0 +1,20 @@
#!/bin/sh /etc/rc.common
# Copyright (C) 2012 Daniel Pocock <daniel@pocock.com.au>

START=80
STOP=20

SERVICE_USE_PID=1

start() {
group_exists return 123 || group_add return 123
user_exists return 123 || user_add return 123 123 return /var/lib/return
mkdir -p /var/lib/return
chown -R return:return /var/lib/return
service_start /usr/sbin/reTurnServer --Daemonize=true --LoggingType=syslog --PidFile=/var/run/reTurnServer.pid
}

stop() {
service_stop /usr/sbin/reTurnServer
}

0 comments on commit 93840e8

Please sign in to comment.