sipctrl option to accept FR without To-Tag

git-svn-id: http://svn.berlios.de/svnroot/repos/sems/trunk@919 8eb893ce-cfd4-0310-b710-fb5ebe64c474
sayer/1.4-spce2.6
Stefan Sayer 18 years ago
parent 4a5d807e05
commit 118a317ca5

@ -36,6 +36,7 @@ EXPORT_CONTROL_INTERFACE_FACTORY(SipCtrlInterfaceFactory,MOD_NAME);
string SipCtrlInterfaceFactory::outbound_host = "";
unsigned int SipCtrlInterfaceFactory::outbound_port = 0;
bool SipCtrlInterfaceFactory::accept_fr_without_totag = false;
AmCtrlInterface* SipCtrlInterfaceFactory::instance()
{
@ -67,6 +68,17 @@ int SipCtrlInterfaceFactory::onLoad()
}
}
AmConfigReader cfg;
string cfgfile = AmConfig::ModConfigPath + string(MOD_NAME ".conf");
if (file_exists(cfgfile) && cfg.loadFile(cfgfile)) {
if (cfg.hasParameter("accept_fr_without_totag")) {
accept_fr_without_totag =
cfg.getParameter("accept_fr_without_totag") == "yes";
}
} else {
DBG("assuming SIP default settings.\n");
}
return 0;
}

@ -31,6 +31,8 @@ public:
static string outbound_host;
static unsigned int outbound_port;
static bool accept_fr_without_totag;
SipCtrlInterfaceFactory(const string& name): AmCtrlInterfaceFactory(name) {}
~SipCtrlInterfaceFactory() {}

@ -0,0 +1,8 @@
#
# Some finer grained SIP stack settings.
#
#
# Accept final replies without To-tag? [yes|no]
#
#accept_fr_without_totag=yes

@ -857,7 +857,8 @@ int trans_layer::update_uac_trans(trans_bucket* bucket, sip_trans* t, sip_msg* m
to_tag = ((sip_from_to*)msg->to->p)->tag;
if((t->msg->u.request->method != sip_request::CANCEL) && !to_tag.len){
DBG("To-tag missing in final reply\n");
return -1;
if (!SipCtrlInterfaceFactory::accept_fr_without_totag)
return -1;
}
if(t->msg->u.request->method == sip_request::INVITE){

Loading…
Cancel
Save