Add mediaproxy package. MediaProxy is a media relay for RTP/RTCP and UDP streams that works in tandem with OpenSIPS/Kamailio to provide NAT traversal capability for media streams from SIP user agents located behind NAT.
Mediaproxy depends on packages python-thor, python-application and python-gnutls. Without them mediaproxy cannot be submitted. Signed-off-by: Jiri Slachta <[email protected]> Index: net/mediaproxy/Makefile =================================================================== --- net/mediaproxy/Makefile (revision 0) +++ net/mediaproxy/Makefile (revision 0) @@ -0,0 +1,118 @@ +# +# Copyright (C) 2013 OpenWrt.org +# +# This is free software, licensed under the GNU General Public License v2. +# See /LICENSE for more information. +# + +include $(TOPDIR)/rules.mk + +PKG_NAME:=mediaproxy +PKG_VERSION:=2.5.2 +PKG_RELEASE:=2 +PKG_MD5SUM:=840de8f52e656991be728c15ec30bb5e + +PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz +PKG_SOURCE_URL:=http://download.ag-projects.com/MediaProxy/ +PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-$(PKG_VERSION) + +include $(INCLUDE_DIR)/package.mk +$(call include_mk, python-package.mk) + +define Package/mediaproxy-common + SUBMENU:=Telephony + SECTION:=net + CATEGORY:=Network + TITLE:=mediaproxy-common + URL:=http://mediaproxy.ag-projects.com/ + DEPENDS:=+python +python-application +python-cjson +python-gnutls \ + +python-thor +zope-interface +twisted +twisted-names \ + +libnetfilter-conntrack +libip4tc +endef + +define Package/mediaproxy-dispatcher + SUBMENU:=Telephony + SECTION:=net + CATEGORY:=Network + TITLE:=mediaproxy-dispatcher + URL:=http://mediaproxy.ag-projects.com/ + DEPENDS:=+mediaproxy-common +endef + +define Package/mediaproxy-relay + SUBMENU:=Telephony + SECTION:=net + CATEGORY:=Network + TITLE:=mediaproxy-relay + URL:=http://mediaproxy.ag-projects.com/ + DEPENDS:=+mediaproxy-common +endef + +define Package/mediaproxy/description +MediaProxy is a media relay for RTP/RTCP and UDP streams that works in tandem with OpenSIPS +to provide NAT traversal capability for media streams from SIP user agents located behind NAT. +MediaProxy supports ICE negotiation by behaving like a TURN relay candidate and the policy can +be controlled from OpenSIPS configuration. +endef + +define Package/mediaproxy-common/description +$(call Package/mediaproxy/description) +This package includes files common to all MediaProxy packages. +endef + +define Package/mediaproxy-dispatcher/description +$(call Package/mediaproxy/description) +This package provides the Mediaproxy dispatcher. +endef + +define Package/mediaproxy-relay/description +$(call Package/mediaproxy/description) +This package provides the Mediaproxy relay. +endef + +define Build/Compile + $(call Build/Compile/PyMod,,build) + $(call Build/Compile/PyMod,,install --prefix=/usr --root=$(PKG_INSTALL_DIR)) +endef + +define Package/mediaproxy-common/install + $(INSTALL_DIR) $(1)/etc/mediaproxy + $(CP) \ + $(PKG_BUILD_DIR)/config.ini.sample \ + $(1)/etc/mediaproxy/config.ini + $(INSTALL_DIR) $(1)/etc/mediaproxy/tls + $(INSTALL_DIR) $(1)/etc/mediaproxy/radius + $(CP) \ + $(PKG_BUILD_DIR)/radius/dictionary \ + $(1)/etc/mediaproxy/dictionary + $(INSTALL_DIR) $(1)$(PYTHON_PKG_DIR)/ + $(CP) \ + $(PKG_INSTALL_DIR)$(PYTHON_PKG_DIR)/* \ + $(1)$(PYTHON_PKG_DIR)/ +endef + +define Package/mediaproxy-dispatcher/install + $(INSTALL_DIR) $(1)/etc/init.d + $(INSTALL_BIN) \ + ./files/mediaproxy-dispatcher.init \ + $(1)/etc/init.d/mediaproxy-dispatcher + $(INSTALL_DIR) $(1)/usr/bin + $(INSTALL_BIN) \ + $(PKG_INSTALL_DIR)/usr/bin/media-dispatcher \ + $(1)/usr/bin/ +endef + +define Package/mediaproxy-relay/install + $(INSTALL_DIR) $(1)/etc/init.d + $(INSTALL_BIN) \ + ./files/mediaproxy-relay.init \ + $(1)/etc/init.d/mediaproxy-relay + $(INSTALL_DIR) $(1)/usr/bin + $(INSTALL_BIN) \ + $(PKG_INSTALL_DIR)/usr/bin/media-relay \ + $(1)/usr/bin/ +endef + +$(eval $(call BuildPackage,mediaproxy-common)) +$(eval $(call BuildPackage,mediaproxy-dispatcher)) +$(eval $(call BuildPackage,mediaproxy-relay)) Index: net/mediaproxy/files/mediaproxy-dispatcher.init =================================================================== --- net/mediaproxy/files/mediaproxy-dispatcher.init (revision 0) +++ net/mediaproxy/files/mediaproxy-dispatcher.init (revision 0) @@ -0,0 +1,29 @@ +#!/bin/sh /etc/rc.common +# +# Copyright (C) 2013 OpenWrt.org +# +### BEGIN INIT INFO +# Provides: mediaproxy-dispatcher init functions +### END INIT INFO + +START=99 +DEST= +APP=media-dispatcher +DEFAULT=$DEST/etc/default/$APP +OPTIONS="" +BIN_FILE=$DEST/usr/bin/$APP +PID_FILE=$DEST/var/run/$APP/$APP.pid + +start() { + start-stop-daemon -S -x $BIN_FILE -p $PID_FILE -b -m -- $OPTIONS +} + +stop() { + start-stop-daemon -K -x $BIN_FILE -p $PID_FILE -q + rm -rf $PID_FILE +} + +reload() { + stop + start +} Property changes on: net/mediaproxy/files/mediaproxy-dispatcher.init ___________________________________________________________________ Added: svn:executable + * Index: net/mediaproxy/files/mediaproxy-relay.init =================================================================== --- net/mediaproxy/files/mediaproxy-relay.init (revision 0) +++ net/mediaproxy/files/mediaproxy-relay.init (revision 0) @@ -0,0 +1,29 @@ +#!/bin/sh /etc/rc.common +# +# Copyright (C) 2013 OpenWrt.org +# +### BEGIN INIT INFO +# Provides: mediaproxy-dispatcher init functions +### END INIT INFO + +START=99 +DEST= +APP=media-relay +DEFAULT=$DEST/etc/default/$APP +OPTIONS="" +BIN_FILE=$DEST/usr/bin/$APP +PID_FILE=$DEST/var/run/$APP/$APP.pid + +start() { + start-stop-daemon -S -x $BIN_FILE -p $PID_FILE -b -m -- $OPTIONS +} + +stop() { + start-stop-daemon -K -x $BIN_FILE -p $PID_FILE -q + rm -rf $PID_FILE +} + +reload() { + stop + start +} Property changes on: net/mediaproxy/files/mediaproxy-relay.init ___________________________________________________________________ Added: svn:executable + * Index: net/mediaproxy/patches/001-mediaproxy-modprobe-replacement.patch =================================================================== --- net/mediaproxy/patches/001-mediaproxy-modprobe-replacement.patch (revision 0) +++ net/mediaproxy/patches/001-mediaproxy-modprobe-replacement.patch (revision 0) @@ -0,0 +1,22 @@ +--- mediaproxy-2.5.2/media-relay ++++ mediaproxy-2.5.2/media-relay +@@ -7,6 +7,10 @@ + + from __future__ import with_statement + ++def runCommand(cmd): ++ p = subprocess.Popen(cmd,stdout=subprocess.PIPE,stderr=subprocess.PIPE) ++ p.wait() ++ return p.stdout.readlines() + + if __name__ == "__main__": + import errno +@@ -44,7 +48,7 @@ + sys.exit(1) + + try: +- subprocess.call(['modprobe', 'ip_tables'], env={'PATH': '/usr/sbin:/sbin:/usr/bin:/bin'}) ++ subprocess.call(['insmod', '/lib/modules/'+str(runCommand(["uname","-r"]))+'/ip_tables.ko'], env={'PATH': '/usr/sbin:/sbin:/usr/bin:/bin'}) + except OSError, e: + log.fatal("Cannot start %s: failed to load the ip_tables kernel module: %s" % (fullname, e)) + sys.exit(1) _______________________________________________ openwrt-devel mailing list [email protected] https://lists.openwrt.org/mailman/listinfo/openwrt-devel
