Module: sems
Branch: master
Commit: 4b2547bf3717495943a072691df3d111c4f68433
URL:    
http://git.sip-router.org/cgi-bin/gitweb.cgi/sems/?a=commit;h=4b2547bf3717495943a072691df3d111c4f68433

Author: Juha Heinanen <[email protected]>
Committer: Juha Heinanen <[email protected]>
Date:   Sun Feb 10 07:03:35 2013 +0200

apps/sbc: fixed looping over sst config params

- sizeof(_sst_cfg_params) does not tell the number of sst config params

---

 apps/sbc/SBCCallProfile.cpp |    5 ++++-
 1 files changed, 4 insertions(+), 1 deletions(-)

diff --git a/apps/sbc/SBCCallProfile.cpp b/apps/sbc/SBCCallProfile.cpp
index ab831e1..eb0a723 100644
--- a/apps/sbc/SBCCallProfile.cpp
+++ b/apps/sbc/SBCCallProfile.cpp
@@ -688,6 +688,9 @@ void SBCCallProfile::eval_sst_config(ParamReplacerCtx& ctx,
                                     const AmSipRequest& req,
                                     AmConfigReader& sst_cfg)
 {
+
+#define SST_CFG_PARAM_COUNT 5  // Change if you add/remove params in below
+  
   static const char* _sst_cfg_params[] = {
     "session_expires",
     "minimum_timer",
@@ -696,7 +699,7 @@ void SBCCallProfile::eval_sst_config(ParamReplacerCtx& ctx,
     "accept_501_reply",
   };
 
-  for(unsigned int i=0; i<sizeof(_sst_cfg_params); i++) {
+  for(unsigned int i=0; i<SST_CFG_PARAM_COUNT; i++) {
     if (sst_cfg.hasParameter(_sst_cfg_params[i])) {
       string newval = 
        ctx.replaceParameters(sst_cfg.getParameter(_sst_cfg_params[i]),

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

Reply via email to