Module: sip-router
Branch: 4.0
Commit: b7e890b309331a13eb92c5080d276036be5833ae
URL:
http://git.sip-router.org/cgi-bin/gitweb.cgi/sip-router/?a=commit;h=b7e890b…
Author: Daniel-Constantin Mierla <miconda(a)gmail.com>
Committer: Daniel-Constantin Mierla <miconda(a)gmail.com>
Date: Wed Jul 17 00:04:06 2013 +0200
presence_dialoginfo: add schema to entity
- patch by Pawel Sternal, FS#324
(cherry picked from commit 716ffd2787a68734a21a1374c3dc6dd4783844bd)
---
modules/presence_dialoginfo/notify_body.c | 11 ++++++-----
1 files changed, 6 insertions(+), 5 deletions(-)
diff --git a/modules/presence_dialoginfo/notify_body.c
b/modules/presence_dialoginfo/notify_body.c
index 6a63d3e..cc65efb 100644
--- a/modules/presence_dialoginfo/notify_body.c
+++ b/modules/presence_dialoginfo/notify_body.c
@@ -147,14 +147,15 @@ str* agregate_xmls(str* pres_user, str* pres_domain, str**
body_array, int n)
/* LM_DBG("number of bodies in total [n]=%d, number of useful bodies
[j]=%d\n", n, j ); */
/* create the new NOTIFY body */
- if ( (pres_user->len + pres_domain->len + 1) > MAX_URI_SIZE) {
+ if ( (pres_user->len + pres_domain->len + 1 + 4 + 1) >= MAX_URI_SIZE) {
LM_ERR("entity URI too long, maximum=%d\n", MAX_URI_SIZE);
return NULL;
}
- memcpy(buf, pres_user->s, pres_user->len);
- buf[pres_user->len] = '@';
- memcpy(buf + pres_user->len + 1, pres_domain->s, pres_domain->len);
- buf[pres_user->len + 1 + pres_domain->len]= '\0';
+ memcpy(buf, "sip:", 4);
+ memcpy(buf+4, pres_user->s, pres_user->len);
+ buf[pres_user->len+4] = '@';
+ memcpy(buf + pres_user->len + 5, pres_domain->s, pres_domain->len);
+ buf[pres_user->len + 5 + pres_domain->len]= '\0';
doc = xmlNewDoc(BAD_CAST "1.0");
if(doc==0)