diff options
Diffstat (limited to 'testing')
-rw-r--r-- | testing/kamailio/APKBUILD | 140 | ||||
-rw-r--r-- | testing/kamailio/kamailio-backslash.patch | 15 | ||||
-rw-r--r-- | testing/kamailio/kamailio.cfg | 107 | ||||
-rw-r--r-- | testing/kamailio/kamailio.initd | 26 | ||||
-rw-r--r-- | testing/kamailio/kamailio.post-install | 5 | ||||
-rw-r--r-- | testing/kamailio/kamailio.pre-install | 5 |
6 files changed, 298 insertions, 0 deletions
diff --git a/testing/kamailio/APKBUILD b/testing/kamailio/APKBUILD new file mode 100644 index 0000000000..ea28b0cafe --- /dev/null +++ b/testing/kamailio/APKBUILD @@ -0,0 +1,140 @@ +# Contributor: Michael Mason <ms13sp@gmail.com> +# Maintainer: Natanael Copa <ncopa@alpinelinux.org> +pkgname=kamailio +pkgver=3.0.0 +pkgrel=0 +pkgdesc="Open Source SIP Server" +url="http://www.kamailio.org/" +pkgusers="kamailio" +pkggroups="kamailio" +license="GPL" +depends= +makedepends="bison flex expat-dev postgresql-dev pcre-dev + libxml2-dev curl-dev unixodbc-dev confuse-dev" +install= +subpackages="$pkgname-doc $pkgname-postgres + $pkgname-mediaproxy $pkgname-unixodbc" +source="http://sip-router.org/tarballs/sr/kamailio_3.0/kamailio-${pkgver}_src_2010-01-12_6d1e9f.tar.gz + kamailio.cfg + kamailio.initd + kamailio.pre-install + kamailio.post-install + " + +_builddir="$srcdir"/$pkgname-$pkgver +prepare() { + cd "$_builddir" +# patch -p1 -i "$srcdir"/kamailio-backslash.patch || return 1 + + sed -i -e 's:^cfg-target.*:cfg-target = $(cfg-dir):' \ + -e 's:^cfg-prefix.*:cfg-prefix = $(basedir):' Makefile.defs \ + || return 1 +# cd scripts +# sed -i -e 's:/var/run/kamailio.pid:/var/run/kamailio/kamailio.pid:g' \ +# kamctl.base kamctlrc || return 1 +# # Set email_address field as not required field (could be null) +# cd dbtext/kamailio +# sed -i -e 's:email_address(string):email_address(string,null):' subscriber \ +# || return 1 +} + +build() { + cd "$_builddir" + make prefix=/usr \ + cfg-dir=/etc/kamailio/ \ + MODS_MYSQL=yes \ + MODS_PCRE=yes \ + MODS_PRESENCE=yes \ + MODS_RADIUS= \ + TLS= \ + include_modules="db_postgres mediaproxy db_unixodbc carrierroute" \ + all || return 1 +} + +package() { + cd "$_builddir" + make prefix=/usr \ + cfg-dir=/etc/kamailio/ \ + MODS_MYSQL=yes \ + MODS_PCRE=yes \ + MODS_PRESENCE=yes \ + MODS_RADIUS= \ + TLS= \ + include_modules="db_postgres mediaproxy db_unixodbc carrierroute" \ + basedir="$pkgdir" install || return 1 + + # move default config to -doc package and use our own default config + + mv "$pkgdir"/etc/kamailio/kamailio.cfg \ + "$pkgdir"/usr/share/doc/kamailio/ + install -m644 -D "$srcdir"/kamailio.cfg \ + "$pkgdir"/etc/kamailio/kamailio.cfg + + install -m755 -D "$srcdir"/$pkgname.initd "$pkgdir"/etc/init.d/$pkgname + install -d -o kamailio "$pkgdir"/var/run/kamailio +} + +_mv_mod() { + local moddir=usr/lib/kamailio/modules i= + mkdir -p "$subpkgdir"/$moddir + for i in $@; do + mv "$pkgdir"/$moddir/$i.so "$subpkgdir"/$moddir/ || return 1 + done +} + +_mv_mod_k() { + local moddir=usr/lib/kamailio/modules_k i= + mkdir -p "$subpkgdir"/$moddir + for i in $@; do + mv "$pkgdir"/$moddir/$i.so "$subpkgdir"/$moddir/ || return 1 + done +} + + +mysql() { + pkgdesc="MySQL support for kamailio" + depends="kamailio mysql-client" + _mv_mod db_mysql + mkdir -p "$subpkgdir"/usr/share/kamailio + mv "$pkgdir"/usr/share/kamailio/mysql \ + "$subpkgdir"/usr/share/kamailio/ +} + +postgres() { + pkgdesc="PostgreSQL support for kamailio" + depends="kamailio postgresql-client" + _mv_mod db_postgres + mkdir -p "$subpkgdir"/usr/share/kamailio + mv "$pkgdir"/usr/share/kamailio/postgres \ + "$subpkgdir"/usr/share/kamailio/ +} + +pcre() { + pkgdesc="Regular expressions support for kamailio" + _mv_mod dialplan lcr regex +} + +presence() { + pkgdesc="Precense support for kamailio" + _mv_mod presence presence_xml presence_mwi pua pua_bla pua_mi \ + pua_usrloc pua_xmpp rls xcap_client presence_dialoginfo \ + pua_dialoginfo +} + +mediaproxy() { + pkgdesc="Mediaproxy support for kamailio" + depends="kamailio" + _mv_mod mediaproxy +} + +unixodbc() { + pkgdesc="UnixODBC support for kamailio" + depends="kamailio" + _mv_mod_k db_unixodbc +} + +md5sums="a043944e195338d56bdfdcd6c86a468b kamailio-3.0.0_src_2010-01-12_6d1e9f.tar.gz +eb665248ee39cf755a247286affc5cbb kamailio.cfg +81100c479890a2a8c2628db22fdd1a0c kamailio.initd +c646af2dd31f5c4289a2f802c873d98f kamailio.pre-install +3fbaf633ff1620d0d526fc4047c7bed9 kamailio.post-install" diff --git a/testing/kamailio/kamailio-backslash.patch b/testing/kamailio/kamailio-backslash.patch new file mode 100644 index 0000000000..cefebcd2c7 --- /dev/null +++ b/testing/kamailio/kamailio-backslash.patch @@ -0,0 +1,15 @@ +--- a/scripts/kamdbctl.base Tue Dec 22 07:01:57 2009 ++++ b/scripts/kamdbctl.base Tue Dec 22 07:02:26 2009 +@@ -32,9 +32,9 @@ + + # Used by dbtext and db_berkeley to define tables to be created, used by + # postgres to do the grants +-STANDARD_TABLES=${STANDARD_TABLES:-version acc dbaliases lcr domain grp +- uri speed_dial gw pdt subscriber location re_grp trusted +- address missed_calls usr_preferences aliases silo dialog ++STANDARD_TABLES=${STANDARD_TABLES:-version acc dbaliases lcr domain grp \ ++ uri speed_dial gw pdt subscriber location re_grp trusted \ ++ address missed_calls usr_preferences aliases silo dialog \ + dispatcher dialplan} + EXTRA_TABLES=${EXTRA_TABLES:-imc_members imc_rooms cpl sip_trace domainpolicy carrierroute + carrier_name domain_name carrierfailureroute userblacklist globalblacklist htable purplemap} diff --git a/testing/kamailio/kamailio.cfg b/testing/kamailio/kamailio.cfg new file mode 100644 index 0000000000..9c101a871f --- /dev/null +++ b/testing/kamailio/kamailio.cfg @@ -0,0 +1,107 @@ +# Demonstration Kamailio Configuration for AlpineLinux + + +#-------------------------------------------------------- +# Section 1: Global Definitions +#-------------------------------------------------------- +debug = 3 +fork = yes +log_stderror = no +listen = 0.0.0.0 +port = 5060 +children = 4 + +dns = no +rev_dns = no + +mpath = "/usr/lib/kamailio/modules/" +#-------------------------------------------------------- +# Section 2: Modules +#-------------------------------------------------------- + +loadmodule "sl.so" +loadmodule "tm.so" +loadmodule "rr.so" +loadmodule "maxfwd.so" +loadmodule "usrloc.so" +loadmodule "registrar.so" +loadmodule "mi_fifo.so" + +#-------------------------------------------------------- +# Section 1: Module Configuration +#-------------------------------------------------------- + +modparam ( "usrloc", "db_mode", 0 ) +modparam ( "rr", "enable_full_lr", 1 ) +modparam ( "mi_fifo", "fifo_name", "/tmp/kamailio_fifo") + +#-------------------------------------------------------- +# Section 1: Main Route Block +#-------------------------------------------------------- + +route + { + if (!mf_process_maxfwd_header("10")) + { + sl_send_reply("483", "Too Many Hops"); + return; + } + + if (msg:len > max_len) + { + sl_send_reply("513", "Message Overflow"); + return; + } + + if (method == "REGISTER" ) + { + route(2); + return; + } + + loose_route(); + + if (!lookup("location")) { + sl_send_reply("404", "User Not Found"); + return; + } + + route(1); + +} +#-------------------------------------------------------- +# Section 1: Secondary Route Blocks +#-------------------------------------------------------- + +# - Default message handler +route[1] { + if (!t_relay()) { + sl_reply_error(); + } +} + +#- Registration Request +route[2] { + if (!save("location")) { + sl_reply_error(); + } +} + +#-------------------------------------------------------- +# Section 1: Reply Route Block +#-------------------------------------------------------- + + +#-------------------------------------------------------- +# Section 1: Failure Route Block +#-------------------------------------------------------- + + + + + + + + + + diff --git a/testing/kamailio/kamailio.initd b/testing/kamailio/kamailio.initd new file mode 100644 index 0000000000..ee4e2ecef1 --- /dev/null +++ b/testing/kamailio/kamailio.initd @@ -0,0 +1,26 @@ +#!/sbin/runscript + +daemon=/usr/sbin/kamailio +pidfile=/var/run/kamailio/kamailio.pid + +depend() { + need net + after firewall +} + +start() { + ebegin "Starting Kamailio" + start-stop-daemon --start --quiet --pidfile $pidfile --exec $daemon \ + -- \ + -u ${KAMAILIO_USER:-kamailio} \ + -g ${KAMAILIO_GROUP:-kamailio} \ + -P $pidfile \ + ${KAMAILIO_OPTS:-} + eend $? +} + +stop() { + ebegin "Stopping Kamailio" + start-stop-daemon --stop --quiet --pidfile $pidfile + eend $? +} diff --git a/testing/kamailio/kamailio.post-install b/testing/kamailio/kamailio.post-install new file mode 100644 index 0000000000..19fc932dd6 --- /dev/null +++ b/testing/kamailio/kamailio.post-install @@ -0,0 +1,5 @@ +#!/bin/sh + +chown -R kamailio:kamailio /var/run/kamailio +chgrp kamailio /etc/kamailio/kamailio.cfg +exit 0 diff --git a/testing/kamailio/kamailio.pre-install b/testing/kamailio/kamailio.pre-install new file mode 100644 index 0000000000..78dfa38bf3 --- /dev/null +++ b/testing/kamailio/kamailio.pre-install @@ -0,0 +1,5 @@ +#!/bin/sh + +adduser -H -h /var/empty -s /bin/false -D kamailio 2>/dev/null + +exit 0 |