adds default application config, which will be executed if no app explicitely selected

git-svn-id: http://svn.berlios.de/svnroot/repos/sems/trunk@463 8eb893ce-cfd4-0310-b710-fb5ebe64c474
sayer/1.4-spce2.6
Stefan Sayer 19 years ago
parent 4ed0c04087
commit 5911a413b0

@ -59,6 +59,7 @@ string AmConfig::Signature = "";
bool AmConfig::SingleCodecInOK = false;
unsigned int AmConfig::DeadRtpTime = DEAD_RTP_TIME;
bool AmConfig::IgnoreRTPXHdrs = false;
string AmConfig::DefaultApplication = "";
vector <string> AmConfig::CodecOrder;
@ -210,6 +211,8 @@ int AmConfig::readConfiguration()
}
}
DefaultApplication = cfg.getParameter("default_application");
// fork
if(cfg.hasParameter("fork")){
if(!setFork(cfg.getParameter("fork"))){

@ -88,6 +88,10 @@ struct AmConfig
/** If 200 OK reply should be limited to preferred codec only */
static bool SingleCodecInOK;
static vector <string> CodecOrder;
/** this application is executed on incoming calls if there is no
* app/P-App-Name header present */
static string DefaultApplication;
/** Time of no RTP after which Session is regarded as dead, 0 for no Timeout */
static unsigned int DeadRtpTime;

@ -322,9 +322,12 @@ AmSession* AmSessionContainer::createSession(AmSipRequest& req,
plugin_name = getHeader(req.hdrs,APPNAME_HDR);
if(plugin_name.empty()) {
string ex = "AmSessionContainer::createSession: missing '" APPNAME_HDR "' header.";
throw ex;
plugin_name = AmConfig::DefaultApplication;
}
if (plugin_name.empty()) {
string ex = "Unknown Application";
throw ex;
}
}
AmSessionFactory* state_factory = AmPlugIn::instance()->getFactory4App(plugin_name);

@ -37,6 +37,14 @@ stderr=no
# (same as -D)
loglevel=2
# optional parameter: default_application
# - this application is executed if the application is
# not explicitely set with P-App-Name header/appname
# parameter of unix command.
#
# example:
# default_application = conference
# optional parameter: socket_name=<filename>
#
# - path and file name of our unix socket

@ -256,6 +256,7 @@ int main(int argc, char* argv[])
" plug-in path: %s\n"
" daemon mode: %i\n"
" local IP: %s\n"
" default application: %s\n"
"\n",
AmConfig::ConfigurationFile.c_str(),
AmConfig::SerSocketName.c_str(),
@ -263,7 +264,9 @@ int main(int argc, char* argv[])
AmConfig::ReplySocketName.c_str(),
AmConfig::PlugInPath.c_str(),
AmConfig::DaemonMode,
AmConfig::LocalIP.c_str()
AmConfig::LocalIP.c_str(),
AmConfig::DefaultApplication.empty()?
"<not set>":AmConfig::DefaultApplication.c_str()
);
if(AmConfig::DaemonMode){

Loading…
Cancel
Save