Module: sip-router
Branch: master
Commit: a538cf860139e2f72c2ab8f444908965125a9ec4
URL:
http://git.sip-router.org/cgi-bin/gitweb.cgi/sip-router/?a=commit;h=a538cf8…
Author: Richard Good <richard.good(a)smilecoms.com>
Committer: Richard Good <richard.good(a)smilecoms.com>
Date: Thu Nov 20 13:31:55 2014 +0200
ims_registrar_scscf: Added params to partial notifies - previously only done in full
---
modules/ims_registrar_scscf/registrar_notify.c | 27 +++++++++++++++++++++++-
1 files changed, 26 insertions(+), 1 deletions(-)
diff --git a/modules/ims_registrar_scscf/registrar_notify.c
b/modules/ims_registrar_scscf/registrar_notify.c
index cebc889..7cc2677 100644
--- a/modules/ims_registrar_scscf/registrar_notify.c
+++ b/modules/ims_registrar_scscf/registrar_notify.c
@@ -1637,7 +1637,8 @@ str get_reginfo_partial(impurecord_t *r, ucontact_t *c, int
event_type) {
int terminate_impu = 1;
ucontact_t *c_tmp;
str state, event;
-
+ param_t *param;
+
buf.s = bufc;
buf.len = 0;
pad.s = padc;
@@ -1716,6 +1717,30 @@ str get_reginfo_partial(impurecord_t *r, ucontact_t *c, int
event_type) {
STR_APPEND(buf, uri_s);
STR_APPEND(buf, (c->c));
STR_APPEND(buf, uri_e);
+
+ param = c->params;
+ while (param && supported_param(¶m->name) == 0) {
+
+ if(param->body.len > 0) {
+ LM_DBG("This contact has params name: [%.*s] body [%.*s]\n",
param->name.len, param->name.s, param->body.len, param->body.s);
+ if (param->body.s[0] == '<' &&
param->body.s[param->body.len -1] == '>') {
+ LM_DBG("This param body starts with '<' and ends with '>'
we will clean these for the NOTIFY XML with < and >\n");
+ sprintf(pad.s, contact_s_params_with_body_fix.s, param->name.len, param->name.s,
param->body.len - 2, param->body.s + 1);
+ } else {
+ sprintf(pad.s, contact_s_params_with_body.s, param->name.len, param->name.s,
param->body.len, param->body.s);
+ }
+
+ pad.len = strlen(pad.s);
+ STR_APPEND(buf, pad);
+ } else {
+ LM_DBG("This contact has params name: [%.*s] \n", param->name.len,
param->name.s);
+ sprintf(pad.s, contact_s_params_no_body.s, param->name.len, param->name.s);
+ pad.len = strlen(pad.s);
+ STR_APPEND(buf, pad);
+ }
+ param = param->next;
+ }
+
STR_APPEND(buf, contact_e);
STR_APPEND(buf, registration_e);
}