<p dir="ltr">Thanks Luis.</p>
<p dir="ltr">If it's been like it for all this time then perhaps some other change recently has exasperated the issue, since it only became noticeable for us after upgrading to 4.3. It had been fine - or at least not noticeable - for several years prior to that, with the same setup everywhere (db mode 2).</p>
<p dir="ltr">Anyway, thanks for fixing!</p>
<p dir="ltr">Cheers,<br>
Charles </p>
<div class="gmail_quote">On 18 Dec 2015 12:47 am, "Luis Azedo" <<a href="mailto:luis@2600hz.com">luis@2600hz.com</a>> wrote:<br type="attribution"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">




<div>
<div style="direction:ltr;font-family:Tahoma;color:#000000;font-size:10pt">Hi Charles,
<div><br>
</div>
<div>i'm not entirely sure but it seems that its been like this for a long time time (2008 with little changes in 2012). i <span style="font-size:13.3333px">usually</span><span style="font-size:13.3333px"> make </span><span style="font-size:10pt">use
 of notifier workers (db mode = 3) where this was no issue.</span></div>
<div><br>
</div>
<div>i received a report about the versioning, identified the code path (it was db_mode = 2  even tho the notifier_processes were 5) which was different , identified the issue and corrected it. sorry for the false start on the correction, i was fooled by travis
 and misread the return type which lead to crashing.</div>
<div><br>
</div>
<div>Best</div>
<div><br>
<div style="font-family:Times New Roman;color:#000000;font-size:16px">
<hr>
<div style="direction:ltr"><font face="Tahoma" size="2" color="#000000"><b>From:</b> sr-dev [<a href="mailto:sr-dev-bounces@lists.sip-router.org" target="_blank">sr-dev-bounces@lists.sip-router.org</a>] on behalf of Charles Chance [<a href="mailto:charles.chance@sipcentric.com" target="_blank">charles.chance@sipcentric.com</a>]<br>
<b>Sent:</b> Thursday, December 17, 2015 4:11 PM<br>
<b>To:</b> sr-dev<br>
<b>Subject:</b> Re: [sr-dev] git:master:b6b7de88: presence_dialoginfo : aux_body should return xmldoc instead of char<br>
</font><br>
</div>
<div></div>
<div>
<div dir="ltr">
<p dir="ltr">Hi Luis,</p>
<p dir="ltr">It would be interesting to understand where the issue with document versioning was first introduced - it was working fine prior to 4.3 as far as I can tell.<br>
</p>
<p dir="ltr">We noticed some weirdness with BLF after upgrading to 4.3.4 on some production machines and soon realised it was due to the version being incorrect - however, these recent patches have only led to other issues/crashes in our offline tests today.</p>
<p>Can you shed any light on when it might have been introduced? I've not had much chance look myself but happy to spend some time over the weekend.</p>
<p dir="ltr">Cheers,<br>
Charles</p>
<p dir="ltr"><br>
</p>
<div class="gmail_quote">On 17 Dec 2015 10:09 pm, "Luis Azedo" <<a href="mailto:luis@2600hz.com" target="_blank">luis@2600hz.com</a>> wrote:<br type="attribution">
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
Module: kamailio<br>
Branch: master<br>
Commit: b6b7de8832e4ab22ef2c00ebb2c1e1b6ced9ff35<br>
URL: <a href="https://github.com/kamailio/kamailio/commit/b6b7de8832e4ab22ef2c00ebb2c1e1b6ced9ff35" rel="noreferrer" target="_blank">
https://github.com/kamailio/kamailio/commit/b6b7de8832e4ab22ef2c00ebb2c1e1b6ced9ff35</a><br>
<br>
Author: Luis Azedo <<a href="mailto:luis@2600hz.com" target="_blank">luis@2600hz.com</a>><br>
Committer: Luis Azedo <<a href="mailto:luis@2600hz.com" target="_blank">luis@2600hz.com</a>><br>
Date: 2015-12-17T21:02:43Z<br>
<br>
presence_dialoginfo : aux_body should return xmldoc instead of char<br>
<br>
---<br>
<br>
Modified: modules/presence/notify.c<br>
Modified: modules/presence_dialoginfo/notify_body.c<br>
<br>
---<br>
<br>
Diff:  <a href="https://github.com/kamailio/kamailio/commit/b6b7de8832e4ab22ef2c00ebb2c1e1b6ced9ff35.diff" rel="noreferrer" target="_blank">
https://github.com/kamailio/kamailio/commit/b6b7de8832e4ab22ef2c00ebb2c1e1b6ced9ff35.diff</a><br>
Patch: <a href="https://github.com/kamailio/kamailio/commit/b6b7de8832e4ab22ef2c00ebb2c1e1b6ced9ff35.patch" rel="noreferrer" target="_blank">
https://github.com/kamailio/kamailio/commit/b6b7de8832e4ab22ef2c00ebb2c1e1b6ced9ff35.patch</a><br>
<br>
---<br>
<br>
diff --git a/modules/presence/notify.c b/modules/presence/notify.c<br>
index efb8a48..f6a0ba9 100644<br>
--- a/modules/presence/notify.c<br>
+++ b/modules/presence/notify.c<br>
@@ -1535,8 +1535,7 @@ int send_notify_request(subs_t* subs, subs_t * watcher_subs,<br>
                                        {<br>
                                                aux_body = subs->event->aux_body_processing(subs, notify_body);<br>
                                                if(aux_body) {<br>
-                                                       xmlFree(notify_body->s);<br>
-                                                       pkg_free(notify_body);<br>
+                                                       free_notify_body(notify_body, subs->event);<br>
                                                        notify_body = aux_body;<br>
                                                }<br>
                                        }<br>
diff --git a/modules/presence_dialoginfo/notify_body.c b/modules/presence_dialoginfo/notify_body.c<br>
index e6dc050..710fe91 100644<br>
--- a/modules/presence_dialoginfo/notify_body.c<br>
+++ b/modules/presence_dialoginfo/notify_body.c<br>
@@ -595,5 +595,18 @@ str *dlginfo_body_setversion(subs_t *subs, str *body) {<br>
        memcpy(version_start, version, version_len);<br>
        memset(version_start + version_len, ' ', 12 - version_len);<br>
<br>
+       xmlDocPtr doc = xmlReadMemory(aux_body->s, aux_body->len, "noname.xml", NULL, 0);<br>
+        if (doc == NULL) {<br>
+               LM_ERR("error allocation xmldoc\n");<br>
+               pkg_free(aux_body->s);<br>
+               pkg_free(aux_body);<br>
+               return NULL;<br>
+       }<br>
+       pkg_free(aux_body->s);<br>
+        xmlDocDumpFormatMemory(doc,(xmlChar**)(void*)&aux_body->s, &aux_body->len, 1);<br>
+<br>
+        xmlCleanupParser();<br>
+        xmlMemoryDump();<br>
+<br>
        return aux_body;<br>
 }<br>
<br>
<br>
_______________________________________________<br>
sr-dev mailing list<br>
<a href="mailto:sr-dev@lists.sip-router.org" target="_blank">sr-dev@lists.sip-router.org</a><br>
<a href="http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-dev" rel="noreferrer" target="_blank">http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-dev</a><br>
</blockquote>
</div>
</div>
<br>
<div><font face="Helvetica, Arial, sans-serif"><font size="2"><b>** We're rebranding! Learn more
<a href="http://www.sipcentric.com/2015/07/were-rebranding/" target="_blank">here</a> **</b></font></font></div>
<div><br>
</div>
<font face="Helvetica, Arial, sans-serif"><font size="2"><span style="font-size:10pt"><a href="http://www.sipcentric.com/" title="blocked::http://www.sipcentric.com/" target="_blank">www.sipcentric.com</a><br>
<br>
Follow us on twitter <a href="http://twitter.com/sipcentric" title="blocked::http://twitter.com/sipcentric" target="_blank">
@sipcentric</a><br>
<br>
<font color="gray">Sipcentric Ltd. Company registered in England & Wales no. 7365592.</font> <font color="gray">Registered office: Faraday Wharf, Innovation Birmingham Campus, Holt Street, Birmingham Science Park, Birmingham B7 4BB.</font></span></font></font></div>
</div>
</div>
</div>
</div>

<br>_______________________________________________<br>
sr-dev mailing list<br>
<a href="mailto:sr-dev@lists.sip-router.org">sr-dev@lists.sip-router.org</a><br>
<a href="http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-dev" rel="noreferrer" target="_blank">http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-dev</a><br>
<br></blockquote></div>

<br>
<div><font face="Helvetica, Arial, sans-serif"><font size="2"><b>** We're rebranding! Learn more <a href="http://www.sipcentric.com/2015/07/were-rebranding/" target="_blank">here</a> **</b></font></font></div><div><br></div><font face="Helvetica, Arial, sans-serif"><font size="2"><span style="font-size:10pt"><a href="http://www.sipcentric.com/" title="blocked::http://www.sipcentric.com/" target="_blank">www.sipcentric.com</a><br>
            <br>
            Follow us on twitter <a href="http://twitter.com/sipcentric" title="blocked::http://twitter.com/sipcentric" target="_blank">@sipcentric</a><br>
            <br>
            <font color="gray">Sipcentric Ltd.
                Company registered in England & Wales no. 7365592.</font> <font color="gray">Registered
                office: Faraday Wharf, Innovation Birmingham Campus, Holt Street, Birmingham Science Park, Birmingham B7 4BB.</font></span></font></font>