From a2eb922962e38da1639bf1db7eeb1205a8bc94ba Mon Sep 17 00:00:00 2001 From: Stefan Sayer Date: Tue, 19 Feb 2008 11:14:39 +0000 Subject: [PATCH] re-added P-App-Name application selection git-svn-id: http://svn.berlios.de/svnroot/repos/sems/trunk@733 8eb893ce-cfd4-0310-b710-fb5ebe64c474 --- core/AmConfig.cpp | 2 ++ core/AmConfig.h | 1 + core/AmSessionContainer.cpp | 3 +++ core/etc/sems.conf.sample | 3 +++ 4 files changed, 9 insertions(+) diff --git a/core/AmConfig.cpp b/core/AmConfig.cpp index 0afa0796..e48832d0 100644 --- a/core/AmConfig.cpp +++ b/core/AmConfig.cpp @@ -205,6 +205,8 @@ int AmConfig::readConfiguration() AppSelect = App_RURIUSER; } else if (Application == "$(ruri.param)") { AppSelect = App_RURIPARAM; + } else if (Application == "$(apphdr)") { + AppSelect = App_APPHDR; } else if (Application == "$(mapping)") { AppSelect = App_MAPPING; string appcfg_fname = ModConfigPath + "app_mapping.conf"; diff --git a/core/AmConfig.h b/core/AmConfig.h index af6c59b9..c220c8f7 100644 --- a/core/AmConfig.h +++ b/core/AmConfig.h @@ -89,6 +89,7 @@ struct AmConfig enum ApplicationSelector { App_RURIUSER, App_RURIPARAM, + App_APPHDR, App_MAPPING, App_SPECIFIED }; diff --git a/core/AmSessionContainer.cpp b/core/AmSessionContainer.cpp index a46b86a3..d819994c 100644 --- a/core/AmSessionContainer.cpp +++ b/core/AmSessionContainer.cpp @@ -319,6 +319,9 @@ AmSession* AmSessionContainer::createSession(AmSipRequest& req, case AmConfig::App_RURIUSER: req.cmd = req.user; break; + case AmConfig::App_APPHDR: + req.cmd = getHeader(req.hdrs, APPNAME_HDR); + break; case AmConfig::App_RURIPARAM: req.cmd = get_header_param(req.r_uri, "app"); break; diff --git a/core/etc/sems.conf.sample b/core/etc/sems.conf.sample index a333fffb..2870110b 100644 --- a/core/etc/sems.conf.sample +++ b/core/etc/sems.conf.sample @@ -49,6 +49,8 @@ loglevel=2 # e.g. sip:announcement@host # $(ruri.param) - uri parameter "app", e.g. # sip:joe@host.net;app=announcement +# $(apphdr) - the value of the P-App-Name header is used +# # $(mapping) - regex=>application mapping is read from # app_mapping.conf (see app_mapping.conf) # - application name configured here, e.g. @@ -57,6 +59,7 @@ loglevel=2 # examples: # application = conference # application = $(mapping) +# application = $(apphdr) # application = $(ruri.user) # application = $(ruri.param)