Author: sayer
Date: 2008-04-30 15:49:42 +0200 (Wed, 30 Apr 2008)
New Revision: 919

Added:
   trunk/core/plug-in/sipctrl/etc/
   trunk/core/plug-in/sipctrl/etc/sipctrl.conf
Modified:
   trunk/core/plug-in/sipctrl/SipCtrlInterface.cpp
   trunk/core/plug-in/sipctrl/SipCtrlInterface.h
   trunk/core/plug-in/sipctrl/trans_layer.cpp
Log:
sipctrl option to accept FR without To-Tag

Modified: trunk/core/plug-in/sipctrl/SipCtrlInterface.cpp
===================================================================
--- trunk/core/plug-in/sipctrl/SipCtrlInterface.cpp     2008-04-30 13:32:21 UTC 
(rev 918)
+++ trunk/core/plug-in/sipctrl/SipCtrlInterface.cpp     2008-04-30 13:49:42 UTC 
(rev 919)
@@ -36,6 +36,7 @@
 
 string SipCtrlInterfaceFactory::outbound_host = "";
 unsigned int SipCtrlInterfaceFactory::outbound_port = 0;
+bool SipCtrlInterfaceFactory::accept_fr_without_totag = false;
 
 AmCtrlInterface* SipCtrlInterfaceFactory::instance()
 {
@@ -67,6 +68,17 @@
        }
     }
 
+    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;
     
 }

Modified: trunk/core/plug-in/sipctrl/SipCtrlInterface.h
===================================================================
--- trunk/core/plug-in/sipctrl/SipCtrlInterface.h       2008-04-30 13:32:21 UTC 
(rev 918)
+++ trunk/core/plug-in/sipctrl/SipCtrlInterface.h       2008-04-30 13:49:42 UTC 
(rev 919)
@@ -31,6 +31,8 @@
     static string         outbound_host;
     static unsigned int   outbound_port;
 
+    static bool           accept_fr_without_totag;
+
     SipCtrlInterfaceFactory(const string& name): AmCtrlInterfaceFactory(name) 
{}
     ~SipCtrlInterfaceFactory() {}
 

Added: trunk/core/plug-in/sipctrl/etc/sipctrl.conf
===================================================================
--- trunk/core/plug-in/sipctrl/etc/sipctrl.conf 2008-04-30 13:32:21 UTC (rev 
918)
+++ trunk/core/plug-in/sipctrl/etc/sipctrl.conf 2008-04-30 13:49:42 UTC (rev 
919)
@@ -0,0 +1,8 @@
+#
+# Some finer grained SIP stack settings.
+#
+
+#
+# Accept final replies without To-tag? [yes|no]
+#
+#accept_fr_without_totag=yes

Modified: trunk/core/plug-in/sipctrl/trans_layer.cpp
===================================================================
--- trunk/core/plug-in/sipctrl/trans_layer.cpp  2008-04-30 13:32:21 UTC (rev 
918)
+++ trunk/core/plug-in/sipctrl/trans_layer.cpp  2008-04-30 13:49:42 UTC (rev 
919)
@@ -857,7 +857,8 @@
     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){

_______________________________________________
Semsdev mailing list
[email protected]
http://lists.iptel.org/mailman/listinfo/semsdev

Reply via email to