From: <abe...@us...> - 2014-08-22 15:53:21
|
Revision: 6650 http://sourceforge.net/p/astlinux/code/6650 Author: abelbeck Date: 2014-08-22 15:53:18 +0000 (Fri, 22 Aug 2014) Log Message: ----------- opensips, new package, disabled by default Modified Paths: -------------- branches/1.0/astlinux-ast11.config branches/1.0/astlinux18.config branches/1.0/initrd.config branches/1.0/package/Config.in branches/1.0/package/unixodbc/unixodbc.init branches/1.0/runnix-uclibc.config branches/1.0/runnix.config Added Paths: ----------- branches/1.0/package/opensips/ branches/1.0/package/opensips/Config.in branches/1.0/package/opensips/opensips.cfg branches/1.0/package/opensips/opensips.init branches/1.0/package/opensips/opensips.mk Modified: branches/1.0/astlinux-ast11.config =================================================================== --- branches/1.0/astlinux-ast11.config 2014-08-20 20:39:37 UTC (rev 6649) +++ branches/1.0/astlinux-ast11.config 2014-08-22 15:53:18 UTC (rev 6650) @@ -1,7 +1,7 @@ # # Automatically generated make config: don't edit -# Buildroot 2011.08-svn6635-dirty Configuration -# Sun Aug 17 21:48:38 2014 +# Buildroot 2011.08-svn6649-dirty Configuration +# Fri Aug 22 10:50:22 2014 # BR2_HAVE_DOT_CONFIG=y # BR2_arm is not set @@ -180,6 +180,7 @@ # BR2_PACKAGE_FONULATOR is not set # BR2_PACKAGE_FREESWITCH is not set BR2_PACKAGE_CLIX=y +# BR2_PACKAGE_OPENSIPS is not set BR2_PACKAGE_PROSODY=y BR2_PACKAGE_RHINO=y BR2_PACKAGE_WANPIPE=y Modified: branches/1.0/astlinux18.config =================================================================== --- branches/1.0/astlinux18.config 2014-08-20 20:39:37 UTC (rev 6649) +++ branches/1.0/astlinux18.config 2014-08-22 15:53:18 UTC (rev 6650) @@ -1,7 +1,7 @@ # # Automatically generated make config: don't edit -# Buildroot 2011.08-svn6635-dirty Configuration -# Sun Aug 17 21:48:34 2014 +# Buildroot 2011.08-svn6649-dirty Configuration +# Fri Aug 22 10:50:20 2014 # BR2_HAVE_DOT_CONFIG=y # BR2_arm is not set @@ -180,6 +180,7 @@ # BR2_PACKAGE_FONULATOR is not set # BR2_PACKAGE_FREESWITCH is not set BR2_PACKAGE_CLIX=y +# BR2_PACKAGE_OPENSIPS is not set BR2_PACKAGE_PROSODY=y BR2_PACKAGE_RHINO=y BR2_PACKAGE_WANPIPE=y Modified: branches/1.0/initrd.config =================================================================== --- branches/1.0/initrd.config 2014-08-20 20:39:37 UTC (rev 6649) +++ branches/1.0/initrd.config 2014-08-22 15:53:18 UTC (rev 6650) @@ -1,7 +1,7 @@ # # Automatically generated make config: don't edit -# Buildroot 2011.08-svn6635-dirty Configuration -# Sun Aug 17 21:49:01 2014 +# Buildroot 2011.08-svn6649-dirty Configuration +# Fri Aug 22 10:50:26 2014 # BR2_HAVE_DOT_CONFIG=y # BR2_arm is not set @@ -161,6 +161,7 @@ # BR2_PACKAGE_FONULATOR is not set # BR2_PACKAGE_FREESWITCH is not set # BR2_PACKAGE_CLIX is not set +# BR2_PACKAGE_OPENSIPS is not set # BR2_PACKAGE_PROSODY is not set # Modified: branches/1.0/package/Config.in =================================================================== --- branches/1.0/package/Config.in 2014-08-20 20:39:37 UTC (rev 6649) +++ branches/1.0/package/Config.in 2014-08-22 15:53:18 UTC (rev 6650) @@ -16,6 +16,7 @@ source "package/fbflash/Config.in" source "package/freeswitch/Config.in" source "package/clix/Config.in" +source "package/opensips/Config.in" source "package/prosody/Config.in" source "package/rhino/Config.in" source "package/wanpipe/Config.in" Added: branches/1.0/package/opensips/Config.in =================================================================== --- branches/1.0/package/opensips/Config.in (rev 0) +++ branches/1.0/package/opensips/Config.in 2014-08-22 15:53:18 UTC (rev 6650) @@ -0,0 +1,9 @@ +config BR2_PACKAGE_OPENSIPS + bool "opensips" + default n + select BR2_PACKAGE_OPENSSL + help + OpenSIPS is a mature and flexible open source SIP server (RFC3261). + + http://www.opensips.org + Added: branches/1.0/package/opensips/opensips.cfg =================================================================== --- branches/1.0/package/opensips/opensips.cfg (rev 0) +++ branches/1.0/package/opensips/opensips.cfg 2014-08-22 15:53:18 UTC (rev 6650) @@ -0,0 +1,288 @@ +# +# OpenSIPS residential configuration script +# by OpenSIPS Solutions <te...@op...> +# +# This script was generated via "make menuconfig", from +# the "Residential" scenario. +# You can enable / disable more features / functionalities by +# re-generating the scenario with different options.# +# +# Please refer to the Core CookBook at: +# http://www.opensips.org/Resources/DocsCookbooks +# for a explanation of possible statements, functions and parameters. +# + + +####### Global Parameters ######### + +debug=3 +log_stderror=no +log_facility=LOG_LOCAL0 + +fork=yes +children=4 + +/* uncomment the following lines to enable debugging */ +#debug=6 +#fork=no +#log_stderror=yes + +/* uncomment the next line to enable the auto temporary blacklisting of + not available destinations (default disabled) */ +#disable_dns_blacklist=no + +/* uncomment the next line to enable IPv6 lookup after IPv4 dns + lookup failures (default disabled) */ +#dns_try_ipv6=yes + +/* comment the next line to enable the auto discovery of local aliases + based on revers DNS on IPs */ +auto_aliases=no + + +listen=udp:127.0.0.1:5065 # CUSTOMIZE ME + + +disable_tcp=yes + +disable_tls=yes + + +####### Modules Section ######## + +#set module path +mpath="/usr/lib/opensips/modules/" + +#### SIGNALING module +loadmodule "signaling.so" + +#### StateLess module +loadmodule "sl.so" + +#### Transaction Module +loadmodule "tm.so" +modparam("tm", "fr_timeout", 5) +modparam("tm", "fr_inv_timeout", 30) +modparam("tm", "restart_fr_on_each_reply", 0) +modparam("tm", "onreply_avp_mode", 1) + +#### Record Route Module +loadmodule "rr.so" +/* do not append from tag to the RR (no need for this script) */ +modparam("rr", "append_fromtag", 0) + +#### MAX ForWarD module +loadmodule "maxfwd.so" + +#### SIP MSG OPerationS module +loadmodule "sipmsgops.so" + +#### FIFO Management Interface +loadmodule "mi_fifo.so" +modparam("mi_fifo", "fifo_name", "/tmp/opensips_fifo") +modparam("mi_fifo", "fifo_mode", 0666) + + +#### URI module +loadmodule "uri.so" +modparam("uri", "use_uri_table", 0) + +#### USeR LOCation module +loadmodule "usrloc.so" +modparam("usrloc", "nat_bflag", "NAT") +modparam("usrloc", "db_mode", 0) + +#### REGISTRAR module +loadmodule "registrar.so" +modparam("registrar", "tcp_persistent_flag", "TCP_PERSISTENT") + +/* uncomment the next line not to allow more than 10 contacts per AOR */ +#modparam("registrar", "max_contacts", 10) + +#### ACCounting module +loadmodule "acc.so" +/* what special events should be accounted ? */ +modparam("acc", "early_media", 0) +modparam("acc", "report_cancels", 0) +/* by default we do not adjust the direct of the sequential requests. + if you enable this parameter, be sure the enable "append_fromtag" + in "rr" module */ +modparam("acc", "detect_direction", 0) +modparam("acc", "failed_transaction_flag", "ACC_FAILED") +/* account triggers (flags) */ +modparam("acc", "log_flag", "ACC_DO") +modparam("acc", "log_missed_flag", "ACC_MISSED") + + +####### Routing Logic ######## + +# main request routing logic + +route{ + if (!mf_process_maxfwd_header("10")) { + sl_send_reply("483","Too Many Hops"); + exit; + } + + if (has_totag()) { + # sequential requests within a dialog should + # take the path determined by record-routing + if (loose_route()) { + + if (is_method("BYE")) { + setflag(ACC_DO); # do accounting ... + setflag(ACC_FAILED); # ... even if the transaction fails + } else if (is_method("INVITE")) { + # even if in most of the cases is useless, do RR for + # re-INVITEs alos, as some buggy clients do change route set + # during the dialog. + record_route(); + } + + # route it out to whatever destination was set by loose_route() + # in $du (destination URI). + route(relay); + } else { + + if ( is_method("ACK") ) { + if ( t_check_trans() ) { + # non loose-route, but stateful ACK; must be an ACK after + # a 487 or e.g. 404 from upstream server + t_relay(); + exit; + } else { + # ACK without matching transaction -> + # ignore and discard + exit; + } + } + sl_send_reply("404","Not here"); + } + exit; + } + + # CANCEL processing + if (is_method("CANCEL")) + { + if (t_check_trans()) + t_relay(); + exit; + } + + t_check_trans(); + + if ( !(is_method("REGISTER") ) ) { + if (from_uri==myself) + { + } else { + # if caller is not local, then called number must be local + if (!uri==myself) { + send_reply("403","Rely forbidden"); + exit; + } + } + } + + # preloaded route checking + if (loose_route()) { + xlog("L_ERR", + "Attempt to route with preloaded Route's [$fu/$tu/$ru/$ci]"); + if (!is_method("ACK")) + sl_send_reply("403","Preload Route denied"); + exit; + } + + # record routing + if (!is_method("REGISTER|MESSAGE")) + record_route(); + + # account only INVITEs + if (is_method("INVITE")) { + + setflag(ACC_DO); # do accounting + } + + if (!uri==myself) { + append_hf("P-hint: outbound\r\n"); + route(relay); + } + + # requests for my domain + if (is_method("PUBLISH|SUBSCRIBE")) + { + sl_send_reply("503", "Service Unavailable"); + exit; + } + + if (is_method("REGISTER")) + { + if ( 0 ) setflag(TCP_PERSISTENT); + if (!save("location")) + sl_reply_error(); + + exit; + } + + if ($rU==NULL) { + # request with no Username in RURI + sl_send_reply("484","Address Incomplete"); + exit; + } + + # do lookup with method filtering + if (!lookup("location","m")) { + t_newtran(); + t_reply("404", "Not Found"); + exit; + } + + # when routing via usrloc, log the missed calls also + setflag(ACC_MISSED); + route(relay); +} + + +route[relay] { + # for INVITEs enable some additional helper routes + if (is_method("INVITE")) { + t_on_branch("per_branch_ops"); + t_on_reply("handle_nat"); + t_on_failure("missed_call"); + } + + if (!t_relay()) { + send_reply("500","Internal Error"); + }; + exit; +} + + + + +branch_route[per_branch_ops] { + xlog("new branch at $ru\n"); +} + + +onreply_route[handle_nat] { + + xlog("incoming reply\n"); +} + + +failure_route[missed_call] { + if (t_was_cancelled()) { + exit; + } + + # uncomment the following lines if you want to block client + # redirect based on 3xx replies. + ##if (t_check_status("3[0-9][0-9]")) { + ##t_reply("404","Not found"); + ## exit; + ##} + +} + + + Added: branches/1.0/package/opensips/opensips.init =================================================================== --- branches/1.0/package/opensips/opensips.init (rev 0) +++ branches/1.0/package/opensips/opensips.init 2014-08-22 15:53:18 UTC (rev 6650) @@ -0,0 +1,60 @@ +#!/bin/sh + +. /etc/rc.conf + +init () { + + if [ -d /mnt/kd/opensips ]; then + ln -snf /mnt/kd/opensips /tmp/etc/opensips + else + if [ -L /tmp/etc/opensips ]; then + rm -f /tmp/etc/opensips + fi + exit + fi +} + +start () { + + if [ -f /etc/opensips/opensips.cfg ]; then + echo "Starting opensips..." + opensips -u nobody -g nobody -P /var/run/opensips.pid + fi +} + +stop () { + + if [ -f /var/run/opensips.pid ]; then + echo "Stopping opensips..." + kill $(cat /var/run/opensips.pid) + rm -f /var/run/opensips.pid + fi +} + +case $1 in + +init) + init + start + ;; + +start) + start + ;; + +stop) + stop + ;; + +restart) + stop + sleep 2 + start + ;; + +*) + echo "Usage: start|stop|restart" + ;; + +esac + Property changes on: branches/1.0/package/opensips/opensips.init ___________________________________________________________________ Added: svn:executable ## -0,0 +1 ## +* \ No newline at end of property Added: branches/1.0/package/opensips/opensips.mk =================================================================== --- branches/1.0/package/opensips/opensips.mk (rev 0) +++ branches/1.0/package/opensips/opensips.mk 2014-08-22 15:53:18 UTC (rev 6650) @@ -0,0 +1,81 @@ +############################################################# +# +# opensips +# +############################################################## + +OPENSIPS_VERSION = 1.11.2 +OPENSIPS_SOURCE = opensips-$(OPENSIPS_VERSION)_src.tar.gz +OPENSIPS_SITE = http://www.opensips.org/pub/opensips/$(OPENSIPS_VERSION)/src +OPENSIPS_DEPENDENCIES = openssl + +OPENSIPS_INCLUDE_MODULES = + +ifeq ($(strip $(BR2_PACKAGE_UNIXODBC)),y) +OPENSIPS_DEPENDENCIES += unixodbc +OPENSIPS_INCLUDE_MODULES += db_unixodbc +endif + +OPENSIPS_EXCLUDE_MODULES = siptrace sipcapture cachedb_couchbase cachedb_memcached cachedb_cassandra cachedb_redis \ + cachedb_mongodb db_berkeley db_oracle db_perlvdb db_unixodbc event_rabbitmq identity jabber json ldap lua mi_xmlrpc osp \ + perl perlvdb python h350 snmpstats sngtc aaa_radius carrierroute db_http db_mysql db_postgres mmgeoip httpd \ + b2b_logic cpl-c xmpp rls xcap_client presence presence_xml presence_mwi presence_dialoginfo \ + pua pua_bla pua_mi pua_usrloc pua_xmpp pua_dialoginfo regex dialplan mi_http pi_http cachedb_sql \ + mi_json presence_callinfo presence_xcapdiff + +define OPENSIPS_BUILD_CMDS + $(TARGET_CONFIGURE_OPTS) \ + LOCALBASE="$(STAGING_DIR)/usr" \ + SYSBASE="$(STAGING_DIR)/usr" \ + CROSS_COMPILE=true \ + TLS=1 \ + CFLAGS='$(TARGET_CFLAGS)' \ + LDFLAGS='$(TARGET_LDFLAGS)' \ + $(MAKE) -C $(@D) \ + prefix="" \ + bin-prefix=/usr/ \ + cfg-prefix=/ \ + ARCH="i386" \ + OS="linux" \ + include_modules="$(OPENSIPS_INCLUDE_MODULES)" \ + exclude_modules="$(OPENSIPS_EXCLUDE_MODULES)" \ + all +endef + +define OPENSIPS_INSTALL_TARGET_CMDS + $(INSTALL) -s -D -m 0755 $(@D)/opensips $(TARGET_DIR)/usr/sbin/opensips + # Install modules + (for i in `find $(@D)/modules -name \*.so`; \ + do $(INSTALL) -s -D -m 0755 "$$i" $(TARGET_DIR)/usr/lib/opensips/modules/`basename "$$i"`; done) + # Install opensipsctl + $(INSTALL) -D -m 0640 $(@D)/scripts/opensipsctl.base $(TARGET_DIR)/usr/lib/opensips/opensipsctl/opensipsctl.base + $(SED) 's:/usr/local/etc/opensips:/etc/opensips:g' \ + $(TARGET_DIR)/usr/lib/opensips/opensipsctl/opensipsctl.base + $(INSTALL) -D -m 0640 $(@D)/scripts/opensipsctl.base $(TARGET_DIR)/usr/lib/opensips/opensipsctl/opensipsctl.ctlbase + $(INSTALL) -D -m 0640 $(@D)/scripts/opensipsctl.base $(TARGET_DIR)/usr/lib/opensips/opensipsctl/opensipsctl.fifo + $(INSTALL) -D -m 0755 $(@D)/scripts/opensipsctl $(TARGET_DIR)/usr/sbin/opensipsctl + $(SED) 's:/bin/sh:/bin/bash:' \ + -e 's:/usr/local/etc/opensips:/etc/opensips:g' \ + -e 's:/usr/local/lib/opensips:/usr/lib/opensips:g' \ + $(TARGET_DIR)/usr/sbin/opensipsctl + $(INSTALL) -D -m 0640 $(@D)/scripts/opensipsctlrc $(TARGET_DIR)/stat/etc/opensips/opensipsctlrc + $(INSTALL) -D -m 0640 package/opensips/opensips.cfg $(TARGET_DIR)/stat/etc/opensips/opensips.cfg + $(INSTALL) -D -m 0755 package/opensips/opensips.init $(TARGET_DIR)/etc/init.d/opensips + ln -snf /tmp/etc/opensips $(TARGET_DIR)/etc/opensips + ln -sf ../../init.d/opensips $(TARGET_DIR)/etc/runlevels/default/S58opensips + ln -sf ../../init.d/opensips $(TARGET_DIR)/etc/runlevels/default/K02opensips +endef + +define OPENSIPS_UNINSTALL_TARGET_CMDS + rm -f $(TARGET_DIR)/usr/sbin/opensips + rm -rf $(TARGET_DIR)/usr/lib/opensips + rm -f $(TARGET_DIR)/usr/sbin/opensipsctl.base + rm -f $(TARGET_DIR)/usr/sbin/opensipsctl + rm -rf $(TARGET_DIR)/stat/etc/opensips + rm -f $(TARGET_DIR)/etc/init.d/opensips + rm -f $(TARGET_DIR)/etc/opensips + rm -f $(TARGET_DIR)/etc/runlevels/default/S58opensips + rm -f $(TARGET_DIR)/etc/runlevels/default/K02opensips +endef + +$(eval $(call GENTARGETS,package,opensips)) Modified: branches/1.0/package/unixodbc/unixodbc.init =================================================================== --- branches/1.0/package/unixodbc/unixodbc.init 2014-08-20 20:39:37 UTC (rev 6649) +++ branches/1.0/package/unixodbc/unixodbc.init 2014-08-22 15:53:18 UTC (rev 6650) @@ -102,6 +102,16 @@ Timeout=2000 " install_odbc_dsn "asterisk-cdr" "$DATA" + + if [ -x /usr/sbin/opensips ]; then + DATA=" +Description=OpenSIPS database +Driver=SQLite3 +Database=/mnt/kd/opensips-odbc.sqlite3 +Timeout=2000 +" + install_odbc_dsn "opensips" "$DATA" + fi } stop () { @@ -112,6 +122,9 @@ # Remove DSN's remove_odbc_dsn "asterisk" remove_odbc_dsn "asterisk-cdr" + if [ -x /usr/sbin/opensips ]; then + remove_odbc_dsn "opensips" + fi } case $1 in Modified: branches/1.0/runnix-uclibc.config =================================================================== --- branches/1.0/runnix-uclibc.config 2014-08-20 20:39:37 UTC (rev 6649) +++ branches/1.0/runnix-uclibc.config 2014-08-22 15:53:18 UTC (rev 6650) @@ -1,7 +1,7 @@ # # Automatically generated make config: don't edit -# Buildroot 2011.08-svn6635-dirty Configuration -# Sun Aug 17 21:48:54 2014 +# Buildroot 2011.08-svn6649-dirty Configuration +# Fri Aug 22 10:50:24 2014 # BR2_HAVE_DOT_CONFIG=y # BR2_arm is not set @@ -221,6 +221,7 @@ # BR2_PACKAGE_FONULATOR is not set # BR2_PACKAGE_FREESWITCH is not set # BR2_PACKAGE_CLIX is not set +# BR2_PACKAGE_OPENSIPS is not set # BR2_PACKAGE_PROSODY is not set # BR2_PACKAGE_RHINO is not set # BR2_PACKAGE_WANPIPE is not set Modified: branches/1.0/runnix.config =================================================================== --- branches/1.0/runnix.config 2014-08-20 20:39:37 UTC (rev 6649) +++ branches/1.0/runnix.config 2014-08-22 15:53:18 UTC (rev 6650) @@ -1,7 +1,7 @@ # # Automatically generated make config: don't edit -# Buildroot 2011.08-svn6635-dirty Configuration -# Sun Aug 17 21:48:46 2014 +# Buildroot 2011.08-svn6649-dirty Configuration +# Fri Aug 22 10:50:23 2014 # BR2_HAVE_DOT_CONFIG=y # BR2_arm is not set @@ -163,6 +163,7 @@ # BR2_PACKAGE_FONULATOR is not set # BR2_PACKAGE_FREESWITCH is not set # BR2_PACKAGE_CLIX is not set +# BR2_PACKAGE_OPENSIPS is not set # BR2_PACKAGE_PROSODY is not set # BR2_PACKAGE_RHINO is not set # BR2_PACKAGE_WANPIPE is not set This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |