Module: kamailio
Branch: master
Commit: 056b98d6717af79eb4f40a5d02cd343bdac8c628
URL:
https://github.com/kamailio/kamailio/commit/056b98d6717af79eb4f40a5d02cd343…
Author: Daniel-Constantin Mierla <miconda(a)gmail.com>
Committer: Daniel-Constantin Mierla <miconda(a)gmail.com>
Date: 2018-08-30T12:18:11+02:00
sipjson: serialize reply status code and reason phrase in default attributes
---
Modified: src/modules/sipjson/sipjson_mod.c
---
Diff:
https://github.com/kamailio/kamailio/commit/056b98d6717af79eb4f40a5d02cd343…
Patch:
https://github.com/kamailio/kamailio/commit/056b98d6717af79eb4f40a5d02cd343…
---
diff --git a/src/modules/sipjson/sipjson_mod.c b/src/modules/sipjson/sipjson_mod.c
index 1dc82eb777..ca6ea8e8bd 100644
--- a/src/modules/sipjson/sipjson_mod.c
+++ b/src/modules/sipjson/sipjson_mod.c
@@ -285,6 +285,9 @@ static int sj_serialize_data(sip_msg_t* msg, srjson_doc_t *jdoc, str*
smode)
srjson_AddStrStrToObject(jdoc, jr, "rU", 2, "", 0);
srjson_AddStrStrToObject(jdoc, jr, "rd", 2, "", 0);
srjson_AddNumberToObject(jdoc, jr, "rp", 0);
+ srjson_AddNumberToObject(jdoc, jr, "rs",
msg->first_line.u.reply.statuscode);
+ srjson_AddStrStrToObject(jdoc, jr, "rr", 2,
+ msg->first_line.u.reply.reason.s, msg->first_line.u.reply.reason.len);
} else {
if(msg->parsed_uri_ok==0 && parse_sip_msg_uri(msg)<0) {
srjson_AddStrStrToObject(jdoc, jr, "rU", 2, "", 0);
@@ -296,6 +299,8 @@ static int sj_serialize_data(sip_msg_t* msg, srjson_doc_t *jdoc, str*
smode)
sj_add_xuri_attr(puri, 2, "rd", 2, jdoc, jr);
sj_add_xuri_attr(puri, 3, "rp", 2, jdoc, jr);
}
+ srjson_AddNumberToObject(jdoc, jr, "rs", 0);
+ srjson_AddStrStrToObject(jdoc, jr, "rr", 2, "", 0);
}
puri = parse_from_uri(msg);