dot

packages and services management
Log | Files | Refs | README

commit db80e95bafd33071c70a7848b9c036a2cb42eaa0
parent af7975f79fdc6770401c3d223f80a373f1b984b3
Author: Josuah Demangeon <mail@josuah.net>
Date:   Sat, 15 Dec 2018 17:12:34 +0100

generate the configuration file back from the setup script

Diffstat:
Ms6/kamailio/x/conf/route/route/WITHINDLG | 8++++----
Ms6/kamailio/x/setup | 74++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
2 files changed, 78 insertions(+), 4 deletions(-)

diff --git a/s6/kamailio/x/conf/route/route/WITHINDLG b/s6/kamailio/x/conf/route/route/WITHINDLG @@ -9,10 +9,10 @@ if (loose_route()) { if (is_method("BYE")) { setflag(FLT_ACC); # do accounting ... setflag(FLT_ACCFAILED); # ... even if the transaction fails - } else if ( is_method("ACK") ) { + } else if (is_method("ACK")) { # ACK is forwarded statelessly route(NATMANAGE); - } else if ( is_method("NOTIFY") ) { + } else if (is_method("NOTIFY")) { # Add Record-Route for in-dialog NOTIFY as per RFC 6665. record_route(); } @@ -25,8 +25,8 @@ if (is_method("SUBSCRIBE") && uri == myself) { route(PRESENCE); exit; } -if ( is_method("ACK") ) { - if ( t_check_trans() ) { +if (is_method("ACK")) { + if (t_check_trans()) { # no loose-route, but stateful ACK; # must be an ACK after a 487 # or e.g. 404 from upstream server diff --git a/s6/kamailio/x/setup b/s6/kamailio/x/setup @@ -1,3 +1,77 @@ #!/usr/bin/env execlineb +redirfd -w 1 data/conf +cd conf + +if { echo "# Kamailio configuration generated by ./setup" } + +if { + cd define + + if { echo } + + forbacktickx -n -o 0 x { ls } + importas define x + redirfd -r 0 ${define} withstdinas -n x + importas value x + + if { echo "#!define ${define} ${value}" } +} + +if { + cd variable + + if { echo } + + forbacktickx -n -o 0 x { ls } + importas variable x + redirfd -r 0 ${variable} withstdinas -n x + importas value x + + if { echo "${variable}=${value}" } +} + +if { + cd module + + if { echo } + + forbacktickx -n -o 0 x { ls } + importas module x + + if { echo "module ${module}" } +} + +if { + cd modparam + + if { echo } + + forbacktickx -n -o 0 x { ls } + importas module x + + cd ${module} + forbacktickx -n -o 0 x { ls } + importas param x + redirfd -r 0 ${param} withstdinas -n x + importas value x + + if { echo "modparam(\"${module}\", \"${param}\", ${value})" } +} + +if { + cd route + + forbacktickx -n -o 0 x { ls } + importas type x + + cd ${type} + forbacktickx -n -o 0 x { ls } + importas route x + + if { echo } + if { echo "${type}[\"${route}\"] {" } + if { sed "s/^/\t/" ${route} } + if { echo "}" } +}