Module: kamailio Branch: master Commit: 26fddd6d6eb604113a2ea9288c48d78a53dbed55 URL: https://github.com/kamailio/kamailio/commit/26fddd6d6eb604113a2ea9288c48d78a...
Author: Daniel-Constantin Mierla miconda@gmail.com Committer: Daniel-Constantin Mierla miconda@gmail.com Date: 2016-01-04T19:07:43+01:00
Merge pull request #460 from kamailio/lazedo/presence_xml_fix_dummy
presence_xml: fix pres_agg_nbody_empty
---
Modified: modules/presence_xml/notify_body.c
---
Diff: https://github.com/kamailio/kamailio/commit/26fddd6d6eb604113a2ea9288c48d78a... Patch: https://github.com/kamailio/kamailio/commit/26fddd6d6eb604113a2ea9288c48d78a...
---
diff --git a/modules/presence_xml/notify_body.c b/modules/presence_xml/notify_body.c index 2730038..f10305c 100644 --- a/modules/presence_xml/notify_body.c +++ b/modules/presence_xml/notify_body.c @@ -58,15 +58,20 @@ void free_xml_body(char* body) body= NULL; }
-#define PRESENCE_EMPTY_BODY_SIZE 512 +#define PRESENCE_EMPTY_BODY_SIZE 1024
-#define PRESENCE_EMPTY_BODY "<presence> \ -<tuple id="615293b33c62dec073e05d9421e9f48b">\ +#define PRESENCE_EMPTY_BODY "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\ +<presence xmlns="urn:ietf:params:xml:ns:pidf" xmlns:dm="urn:ietf:params:xml:ns:pidf:data-model" xmlns:rpid="urn:ietf:params:xml:ns:pidf:rpid" xmlns:c="urn:ietf:params:xml:ns:pidf:cipid" entity="%.*s"> \ +<tuple xmlns="urn:ietf:params:xml:ns:pidf" id="615293b33c62dec073e05d9421e9f48b">\ <status>\ <basic>open</basic>\ </status>\ </tuple>\ <note xmlns="urn:ietf:params:xml:ns:pidf">Available</note>\ +<dm:person xmlns:dm="urn:ietf:params:xml:ns:pidf:data-model" xmlns:rpid="urn:ietf:params:xml:ns:pidf:rpid" id="1">\ +rpid:activities/\ +dm:noteAvailable</dm:note>\ +</dm:person>\ </presence>"
str* pres_agg_nbody_empty(str* pres_user, str* pres_domain) @@ -78,7 +83,7 @@ str* pres_agg_nbody_empty(str* pres_user, str* pres_domain)
str* body_array = (str*)pkg_malloc(sizeof(str)); char* body = (char*)pkg_malloc(PRESENCE_EMPTY_BODY_SIZE); - sprintf(body, PRESENCE_EMPTY_BODY); + sprintf(body, PRESENCE_EMPTY_BODY, pres_user->len, pres_user->s); body_array->s = body; body_array->len = strlen(body);