moves the OPTIONS handling from AmSipDispatcher to AmSessionFactory.

patch by Robert Szokovacs.
sayer/1.4-spce2.6
Raphael Coeffic 16 years ago
parent c5ccd21ead
commit 325762d2da

@ -76,6 +76,22 @@ void AmSessionFactory::configureSession(AmSession* sess) {
void AmSessionFactory::onOoDRequest(const AmSipRequest& req)
{
if(req.method == "OPTIONS"){
// Basic OPTIONS support
if (!AmConfig::OptionsSessionLimit ||
(AmSession::getSessionNum() < AmConfig::OptionsSessionLimit)) {
AmSipDialog::reply_error(req, 200, "OK");
} else {
// return error code if near to overload
AmSipDialog::reply_error(req,
AmConfig::OptionsSessionLimitErrCode,
AmConfig::OptionsSessionLimitErrReason);
}
return;
}
ERROR("sorry, we don't support beginning a new session with "
"a '%s' message\n", req.method.c_str());

@ -182,7 +182,7 @@ class AmSessionFactory: public AmPluginFactory
/**
* Method to receive any out-of-dialog request
* other than INVITE, REFER and OPTIONS
* other than INVITE and REFER
*
* Warning:
* This method should not make any expensive

@ -95,21 +95,7 @@ void AmSipDispatcher::handleSipMsg(AmSipRequest &req)
AmSessionContainer::instance()->startSessionUAS(req);
}
else if(req.method == "OPTIONS"){
// Basic OPTIONS support
if (!AmConfig::OptionsSessionLimit ||
(AmSession::getSessionNum() < AmConfig::OptionsSessionLimit)) {
AmSipDialog::reply_error(req, 200, "OK");
} else {
// return error code if near to overload
AmSipDialog::reply_error(req,
AmConfig::OptionsSessionLimitErrCode,
AmConfig::OptionsSessionLimitErrReason);
}
return;
} else if( (req.method == "CANCEL") ||
else if( (req.method == "CANCEL") ||
(req.method == "BYE") ){
// CANCEL/BYE of a (here) non-existing dialog

Loading…
Cancel
Save