Module: sip-router Branch: 4.0 Commit: 2593931d4d8879b4d8d8ab8e666dd3b28ef3aa73 URL: http://git.sip-router.org/cgi-bin/gitweb.cgi/sip-router/?a=commit;h=2593931d...
Author: Daniel-Constantin Mierla miconda@gmail.com Committer: Daniel-Constantin Mierla miconda@gmail.com Date: Thu May 8 08:47:30 2014 +0200
presence_dialoginfo: interetate through all 'dialog' nodes of xml document
- PUBLISH request can carry info for many dialogs - reported and patch by Klaus Feichtinger
(adapted from commit cc4a7c67f24d105a119ea492ce53f017369af296)
---
modules/presence_dialoginfo/notify_body.c | 4 +++- 1 files changed, 3 insertions(+), 1 deletions(-)
diff --git a/modules/presence_dialoginfo/notify_body.c b/modules/presence_dialoginfo/notify_body.c index cc65efb..3ea5e2c 100644 --- a/modules/presence_dialoginfo/notify_body.c +++ b/modules/presence_dialoginfo/notify_body.c @@ -102,6 +102,7 @@ str* agregate_xmls(str* pres_user, str* pres_domain, str** body_array, int n) xmlNodePtr winner_dialog_node = NULL ; str *body= NULL; char buf[MAX_URI_SIZE+1]; + xmlNodePtr next_node = NULL;
LM_DBG("[pres_user]=%.*s [pres_domain]= %.*s, [n]=%d\n", pres_user->len, pres_user->s, pres_domain->len, pres_domain->s, n); @@ -195,7 +196,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