[sr-dev] git:master:92451536: presence: return on having a full match on states in xml document

Daniel-Constantin Mierla miconda at gmail.com
Mon Feb 12 10:17:33 CET 2018


Module: kamailio
Branch: master
Commit: 92451536a0ef985ff1d16c5531c232cd657532e1
URL: https://github.com/kamailio/kamailio/commit/92451536a0ef985ff1d16c5531c232cd657532e1

Author: Daniel-Constantin Mierla <miconda at gmail.com>
Committer: Daniel-Constantin Mierla <miconda at gmail.com>
Date: 2018-02-12T10:15:47+01:00

presence: return on having a full match on states in xml document

- better handling after previous commit, related to GH #1427

---

Modified: src/modules/presence/presentity.c

---

Diff:  https://github.com/kamailio/kamailio/commit/92451536a0ef985ff1d16c5531c232cd657532e1.diff
Patch: https://github.com/kamailio/kamailio/commit/92451536a0ef985ff1d16c5531c232cd657532e1.patch

---

diff --git a/src/modules/presence/presentity.c b/src/modules/presence/presentity.c
index 5f0eef6368..4674f0ad49 100644
--- a/src/modules/presence/presentity.c
+++ b/src/modules/presence/presentity.c
@@ -338,6 +338,7 @@ int ps_match_dialog_state_from_body(str body, int *is_dialog, char *vstate)
 		if (tmp_state != NULL)
 		{
 			if(strcmp(tmp_state, vstate)!=0) {
+				/* state not matched */
 				xmlFree(tmp_state);
 				rmatch = 0;
 				goto done;
@@ -550,8 +551,8 @@ int ps_match_dialog_state(presentity_t* presentity, char* vstate)
 		rmatch = ps_match_dialog_state_from_body(tmp_db_body,
 				&db_is_dialog, vstate);
 
-		if(rmatch<=0) {
-			/* failure or not a match */
+		if(rmatch==1) {
+			/* having a full match */
 			pa_dbf.free_result(pa_db, result);
 			result = NULL;
 			return rmatch;




More information about the sr-dev mailing list