From 2921deabe0ea3ee38fe813eddf06936fc3756a95 Mon Sep 17 00:00:00 2001 From: Andrew Pogrebennyk Date: Mon, 18 Feb 2013 15:32:37 +0100 Subject: [PATCH] send initial NOTIFY with non-empty body NOTIFYs are accepted by Cisco SPA504g phones now. --- .../presence_dialoginfo_notify.patch | 57 +++++++++++++++++++ 1 file changed, 57 insertions(+) create mode 100644 sipwise_patches/presence_dialoginfo_notify.patch diff --git a/sipwise_patches/presence_dialoginfo_notify.patch b/sipwise_patches/presence_dialoginfo_notify.patch new file mode 100644 index 000000000..b6013d2be --- /dev/null +++ b/sipwise_patches/presence_dialoginfo_notify.patch @@ -0,0 +1,57 @@ +diff --git a/modules_k/presence_dialoginfo/notify_body.c b/modules_k/presence_dialoginfo/notify_body.c +index 6a63d3e..4f49998 100644 +--- a/modules_k/presence_dialoginfo/notify_body.c ++++ b/modules_k/presence_dialoginfo/notify_body.c +@@ -66,8 +66,10 @@ str* dlginfo_agg_nbody(str* pres_user, str* pres_domain, str** body_array, int n + LM_DBG("[pres_user]=%.*s [pres_domain]= %.*s, [n]=%d\n", + pres_user->len, pres_user->s, pres_domain->len, pres_domain->s, n); + +- if(body_array== NULL) +- return NULL; ++ if(body_array== NULL) { ++ n = 0; /* just to be safe */ ++ /* return NULL; */ ++ } + + n_body= agregate_xmls(pres_user, pres_domain, body_array, n); + LM_DBG("[n_body]=%p\n", n_body); +@@ -106,13 +108,17 @@ str* agregate_xmls(str* pres_user, str* pres_domain, str** body_array, int n) + LM_DBG("[pres_user]=%.*s [pres_domain]= %.*s, [n]=%d\n", + pres_user->len, pres_user->s, pres_domain->len, pres_domain->s, n); + +- xml_array = (xmlDocPtr*)pkg_malloc( n*sizeof(xmlDocPtr)); +- if(xml_array== NULL) ++ if (n > 0) + { +- LM_ERR("while allocating memory"); +- return NULL; ++ xml_array = (xmlDocPtr*)pkg_malloc( n*sizeof(xmlDocPtr)); ++ if(xml_array== NULL) ++ { ++ LM_ERR("while allocating memory"); ++ return NULL; ++ } ++ memset(xml_array, 0, n*sizeof(xmlDocPtr)) ; + } +- memset(xml_array, 0, n*sizeof(xmlDocPtr)) ; ++ else xml_array = NULL; + + /* parse all the XML documents */ + for(i=0; i