Browse Source

presence_dialoginfo: interetate through all 'dialog' nodes of xml document

- PUBLISH request can carry info for many dialogs
- reported and patch by Klaus Feichtinger
Daniel-Constantin Mierla 11 years ago
parent
commit
7a827a612f
1 changed files with 3 additions and 1 deletions
  1. 3 1
      modules/presence_dialoginfo/notify_body.c

+ 3 - 1
modules/presence_dialoginfo/notify_body.c

@@ -111,6 +111,7 @@ str* agregate_xmls(str* pres_user, str* pres_domain, str** body_array, int n)
 	xmlNodePtr confirmed_node = NULL;
 	xmlNodePtr proceed_node = NULL;
 	xmlNodePtr trying_node = NULL;
+	xmlNodePtr next_node = NULL;
 
 
 	char *state = NULL;
@@ -214,7 +215,8 @@ str* agregate_xmls(str* pres_user, str* pres_domain, str** body_array, int n)
 			goto error;
 		}
 		if (p_root->children) {
-			for (node = p_root->children; node; node = node->next) {
+			for (node = p_root->children; node; node = next_node) {
+				next_node = node->next;
 				if (node->type == XML_ELEMENT_NODE) {
 					LM_DBG("node type: Element, name: %s\n", node->name);
 					/* we do not copy the node, but unlink it and then add it ot the new node