Module: sems
Branch: kubartv/error_recovery
Commit: deb678f63890c5d5d12dab549f7fe5cc7bcf6d5c
URL:    
http://git.sip-router.org/cgi-bin/gitweb.cgi/sems/?a=commit;h=deb678f63890c5d5d12dab549f7fe5cc7bcf6d5c

Author: Václav Kubart <[email protected]>
Committer: Václav Kubart <[email protected]>
Date:   Thu Mar 13 14:09:55 2014 +0100

sbc: make timer for re-trying upon 491 reply configurable

---

 apps/sbc/SBCCallLeg.h       |    2 ++
 apps/sbc/SBCCallProfile.cpp |    2 ++
 apps/sbc/SBCCallProfile.h   |    7 ++++++-
 3 files changed, 10 insertions(+), 1 deletions(-)

diff --git a/apps/sbc/SBCCallLeg.h b/apps/sbc/SBCCallLeg.h
index 69c3976..80d87aa 100644
--- a/apps/sbc/SBCCallLeg.h
+++ b/apps/sbc/SBCCallLeg.h
@@ -251,6 +251,8 @@ class SBCCallLeg : public CallLeg, public CredentialHolder
 
   bool openLogger(const std::string &path);
   msg_logger *getLogger() { return logger; }
+
+  virtual double get491RetryTime() { return (get_random() % 
call_profile.max_491_retry_time) / 1000.0; }
 };
 
 #endif
diff --git a/apps/sbc/SBCCallProfile.cpp b/apps/sbc/SBCCallProfile.cpp
index ecdc301..75319b4 100644
--- a/apps/sbc/SBCCallProfile.cpp
+++ b/apps/sbc/SBCCallProfile.cpp
@@ -386,6 +386,8 @@ bool SBCCallProfile::readFromConfiguration(const string& 
name,
   min_reg_expires = cfg.getParameterInt("min_reg_expires",0);
   max_ua_expires = cfg.getParameterInt("max_ua_expires",0);
 
+  max_491_retry_time = cfg.getParameterInt("max_491_retry_time", 2000);
+
   md5hash = "<unknown>";
   if (!cfg.getMD5(profile_file_name, md5hash)){
     ERROR("calculating MD5 of file %s\n", profile_file_name.c_str());
diff --git a/apps/sbc/SBCCallProfile.h b/apps/sbc/SBCCallProfile.h
index 95b67e3..1a3169a 100644
--- a/apps/sbc/SBCCallProfile.h
+++ b/apps/sbc/SBCCallProfile.h
@@ -314,6 +314,10 @@ struct SBCCallProfile
       bool evaluate(ParamReplacerCtx& ctx, const AmSipRequest& req);
   } hold_settings;
 
+  // maximum retry time for repeating reINVITE after 491 response (in
+  // milliseconds), according to RFC 3261 should be 2000 ms
+  int max_491_retry_time;
+
  private:
   // message logging feature
   string msg_logger_path;
@@ -352,7 +356,8 @@ struct SBCCallProfile
     patch_ruri_next_hop(false),
     next_hop_1st_req(false),
     next_hop_fixed(false),
-    allow_subless_notify(false)
+    allow_subless_notify(false),
+    max_491_retry_time(2000)
   { }
 
   ~SBCCallProfile()

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

Reply via email to