summaryrefslogtreecommitdiffstats
path: root/testing
diff options
context:
space:
mode:
Diffstat (limited to 'testing')
-rw-r--r--testing/kamailio/APKBUILD12
-rw-r--r--testing/kamailio/kamailio.cfg107
2 files changed, 117 insertions, 2 deletions
diff --git a/testing/kamailio/APKBUILD b/testing/kamailio/APKBUILD
index f226e219f..d414f8e14 100644
--- a/testing/kamailio/APKBUILD
+++ b/testing/kamailio/APKBUILD
@@ -2,7 +2,7 @@
# Maintainer: Natanael Copa <ncopa@alpinelinux.org>
pkgname=kamailio
pkgver=1.5.2
-pkgrel=5
+pkgrel=6
pkgdesc="Open Source SIP Server"
url="http://www.kamailio.org/"
pkgusers="kamailio"
@@ -15,6 +15,7 @@ install=
subpackages="$pkgname-doc $pkgname-mysql $pkgname-postgres $pkgname-pcre
$pkgname-presence"
source="http://www.kamailio.org/pub/kamailio/$pkgver/src/$pkgname-$pkgver-notls_src.tar.gz
+ kamailio.cfg
kamailio.initd
kamailio.pre-install
kamailio.post-install"
@@ -43,7 +44,7 @@ build() {
include_modules=db_postgres \
all || return 1
make prefix=/usr \
- cfg-dir=/etc/kamailio \
+ cfg-dir=/etc/kamailio/ \
MODS_MYSQL=yes \
MODS_PCRE=yes \
MODS_PRESENCE=yes \
@@ -52,6 +53,12 @@ build() {
include_modules=db_postgres \
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
}
@@ -96,6 +103,7 @@ presence() {
}
md5sums="6c6f4ed6fbcb4d008b8ac3de5b99ce99 kamailio-1.5.2-notls_src.tar.gz
+eb665248ee39cf755a247286affc5cbb kamailio.cfg
81100c479890a2a8c2628db22fdd1a0c kamailio.initd
c646af2dd31f5c4289a2f802c873d98f kamailio.pre-install
3fbaf633ff1620d0d526fc4047c7bed9 kamailio.post-install"
diff --git a/testing/kamailio/kamailio.cfg b/testing/kamailio/kamailio.cfg
new file mode 100644
index 000000000..9c101a871
--- /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
+#--------------------------------------------------------
+
+
+
+
+
+
+
+
+
+