[sr-dev] git:5.2:7829be65: speeddial: fix stripping domain prefix

Daniel-Constantin Mierla miconda at gmail.com
Mon Oct 7 10:48:43 CEST 2019


Module: kamailio
Branch: 5.2
Commit: 7829be6555b1da66a3802b713304cb28a5ff29a3
URL: https://github.com/kamailio/kamailio/commit/7829be6555b1da66a3802b713304cb28a5ff29a3

Author: Daniel-Constantin Mierla <miconda at gmail.com>
Committer: Daniel-Constantin Mierla <miconda at gmail.com>
Date: 2019-10-07T10:42:31+02:00

speeddial: fix stripping domain prefix

- increment the index after the value is adjusted

(cherry picked from commit 6861995e417c40e9ab530d4c0bed97c57de184fd)

---

Modified: src/modules/speeddial/sdlookup.c

---

Diff:  https://github.com/kamailio/kamailio/commit/7829be6555b1da66a3802b713304cb28a5ff29a3.diff
Patch: https://github.com/kamailio/kamailio/commit/7829be6555b1da66a3802b713304cb28a5ff29a3.patch

---

diff --git a/src/modules/speeddial/sdlookup.c b/src/modules/speeddial/sdlookup.c
index d9e52bf3cd..e26bc37bb8 100644
--- a/src/modules/speeddial/sdlookup.c
+++ b/src/modules/speeddial/sdlookup.c
@@ -117,7 +117,6 @@ int sd_lookup_owner(sip_msg_t* _msg, str* stable, str* sowner)
 		db_vals[nr_keys].nul = 0;
 		db_vals[nr_keys].val.str_val.s = puri->host.s;
 		db_vals[nr_keys].val.str_val.len = puri->host.len;
-		nr_keys++;
 
 		if (dstrip_s.s!=NULL && dstrip_s.len>0
 			&& dstrip_s.len<puri->host.len
@@ -126,6 +125,7 @@ int sd_lookup_owner(sip_msg_t* _msg, str* stable, str* sowner)
 			db_vals[nr_keys].val.str_val.s   += dstrip_s.len;
 			db_vals[nr_keys].val.str_val.len -= dstrip_s.len;
 		}
+		nr_keys++;
 	}
 	/* take sd from r-uri */
 	if (parse_sip_msg_uri(_msg) < 0)




More information about the sr-dev mailing list