added make ser-cfg-install target to install default ser-sems.cfg

git-svn-id: http://svn.berlios.de/svnroot/repos/sems/trunk@280 8eb893ce-cfd4-0310-b710-fb5ebe64c474
sayer/1.4-spce2.6
Stefan Sayer 20 years ago
parent 3b527c2353
commit c07ba6ac52

@ -70,4 +70,10 @@ tar:
.PHONY: doc
doc:
make -C core/ doc
make -C core/ doc
.PHONY: install-ser-cfg
install-ser-cfg:
make -C core/ install-ser-cfg

@ -86,6 +86,9 @@ LOCALBASE ?= /usr/local
prefix = $(PREFIX)
BASEDIR ?=
basedir = $(BASEDIR)
# for install-ser-cfg
SERPREFIX ?= /opt/ser-sems
ser-prefix = $(SERPREFIX)
# Redhat users should use sems.redhat instead of sems
# the file will be to $(bin-prefix)/$(bin-dir)/sems copied.
@ -105,6 +108,8 @@ bin-dir = sbin/
modules-dir = lib/sems/plug-in/
audio-dir = lib/sems/audio/
ser-cfg-dir = etc/ser/
ifeq ($(OS), linux)
doc-dir = share/doc/sems/
man-dir = share/man/
@ -132,6 +137,7 @@ bin-target = $(prefix)/$(bin-dir)
cfg-target = $(prefix)/$(cfg-dir)
modules-target = $(prefix)/$(modules-dir)
audio-target = $(prefix)/$(audio-dir)
ser-cfg-target =$(ser-prefix)/$(ser-cfg-dir)
ifeq ($(OS), solaris)
#use GNU versions

@ -1,14 +1,6 @@
NAME=sems
LIBNAME=sems.so
# version number
VERSION = 2
PATCHLEVEL = 0
SUBLEVEL = 1
EXTRAVERSION = -iptelorg
RELEASE=$(VERSION).$(PATCHLEVEL).$(SUBLEVEL)$(EXTRAVERSION)
PLUGIN_DIR=plug-in
SRCS=$(filter-out $(NAME).cpp, $(wildcard *.cpp))
HDRS=$(SRCS:.cpp=.h)
@ -84,6 +76,17 @@ install-modules: $(PLUGIN_DIR) $(modules-prefix)/$(modules-dir)
install-modules-cfg: $(PLUGIN_DIR) $(modules-prefix)/$(modules-dir)
$(MAKE) -C $(PLUGIN_DIR) install-cfg
install-ser-cfg: etc/ser-sems.cfg
mkdir -p $(ser-cfg-target)
if [ ! -f $(ser-cfg-target)/ser-sems.cfg ]; then \
$(INSTALL-CFG) etc/ser-sems.cfg $(ser-cfg-target) ; \
fi
$(INSTALL-CFG) etc/ser-sems.cfg $(ser-cfg-target)ser-sems.cfg.default
@echo \*\*\* installed ser-sems.cfg at $(ser-cfg-target)ser-sems.cfg
@echo \*\*\* run $(ser-prefix)/sbin/ser -f $(ser-cfg-target)ser-sems.cfg
@echo \*\*\* to start ser for sems.
install-audio: $(audio-prefix)/$(audio-dir)
-@for f in $(AUDIO_FILES) ; do \
if [ -n "wav/$$f" ]; then \

@ -0,0 +1,79 @@
# ser for sems configuration
#
# This is a simple SER configuration for using SER
# as SIP stack for SEMS. It passes every message
# directly to SEMS.
#
# Application and application parameters need to be
# set in P-App-Name/P-App-Param headers of the INVITE.
#
# To install SER 0.9.6 for SEMS in /opt/ser-sems,
# use the following commands:
# wget ftp.iptel.org/pub/sems/ser-0.9.6-sems.tar.gz
# tar xzvf ser-0.9.6-sems.tar.gz; cd ser-0.9.6-sems
# make install PREFIX=/opt/ser-sems
#
# set listen parameter if you want SEMS to be reachable
# from one interface only:
# listen=eth0
#
# listen on this port
port=5070
# connection SER->SEMS
unix_sock="/tmp/ser_sock"
# SEMS sends its own signature
server_signature=0
# we only need sl and tm
loadmodule "/opt/ser-sems/lib/ser/modules/sl.so"
loadmodule "/opt/ser-sems/lib/ser/modules/tm.so"
# we want provisional replies in SEMS
modparam("tm", "pass_provisional_replies", 1)
# passes "P-App-Name" and
# "P-App-Param" headers with the INVITE
modparam("tm", "tw_append",
"app_headers:hdr[P-App-Name];hdr[P-App-Param]")
# for DTMF in SIP INFO we need content-length, -type
# and body
modparam( "tm", "tw_append",
"dtmf_info:hdr[Content-Length];hdr[Content-Type];msg[body]")
# main routing logic
route{
# make transaction
if (!t_newtran()){
sl_send_reply("500","could not create transaction");
break;
}
# actively absorb ACKs
if (method == "ACK") {
t_relay();
break;
}
# pass everything to SEMS
if (method=="INVITE") {
if(!t_write_unix("/tmp/sems_sock","sems/app_headers")){
log("could not contact sems\n");
t_reply("500","could not contact media server");
}
} else if (method=="INFO") {
if(!t_write_unix("/tmp/sems_sock","sems/dtmf_info")){
log("could not contact sems\n");
t_reply("500","could not contact media server");
}
} else { # no need for special appends
if(!t_write_unix("/tmp/sems_sock","sems")){
log("could not contact sems\n");
t_reply("500","could not contact media server");
}
}
}
Loading…
Cancel
Save