|
@@ -2320,6 +2320,8 @@ char *generate_res_buf_from_sip_res(
|
|
unsigned offset, s_offset, via_offset;
|
|
unsigned offset, s_offset, via_offset;
|
|
char *buf;
|
|
char *buf;
|
|
unsigned int len;
|
|
unsigned int len;
|
|
|
|
+ str xparams;
|
|
|
|
+ sr_lump_t *anchor;
|
|
|
|
|
|
buf = msg->buf;
|
|
buf = msg->buf;
|
|
len = msg->len;
|
|
len = msg->len;
|
|
@@ -2339,6 +2341,23 @@ char *generate_res_buf_from_sip_res(
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+ /* test and add xavp via reply params */
|
|
|
|
+ if(msg && msg->via2 && (msg->msg_flags & FL_ADD_XAVP_VIA_REPLY_PARAMS)
|
|
|
|
+ && _ksr_xavp_via_reply_params.len > 0) {
|
|
|
|
+ xparams.s = pv_get_buffer();
|
|
|
|
+ xparams.len = xavp_serialize_fields(
|
|
|
|
+ &_ksr_xavp_via_reply_params, xparams.s, pv_get_buffer_size());
|
|
|
|
+ if(xparams.len > 0) {
|
|
|
|
+ anchor = anchor_lump(msg, msg->via2->params.s
|
|
|
|
+ + msg->via2->params.len - msg->buf, 0, 0);
|
|
|
|
+ if(anchor != NULL) {
|
|
|
|
+ if(insert_new_lump_after(anchor, xparams.s, xparams.len, 0) == 0) {
|
|
|
|
+ LM_ERR("unable to add via reply xavp params\n");
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+
|
|
/* Calculate message body difference and adjust
|
|
/* Calculate message body difference and adjust
|
|
* Content-Length
|
|
* Content-Length
|
|
*/
|
|
*/
|
|
@@ -2458,7 +2477,7 @@ char *build_res_buf_from_sip_req(unsigned int code, str *text, str *new_tag,
|
|
len -= msg->via1->rport->size + 1; /* include ';' */
|
|
len -= msg->via1->rport->size + 1; /* include ';' */
|
|
}
|
|
}
|
|
|
|
|
|
- /* test and add xavpvia params */
|
|
|
|
|
|
+ /* test and add xavp via reply params */
|
|
if(msg && (msg->msg_flags & FL_ADD_XAVP_VIA_REPLY_PARAMS)
|
|
if(msg && (msg->msg_flags & FL_ADD_XAVP_VIA_REPLY_PARAMS)
|
|
&& _ksr_xavp_via_reply_params.len > 0) {
|
|
&& _ksr_xavp_via_reply_params.len > 0) {
|
|
xparams.s = pv_get_buffer();
|
|
xparams.s = pv_get_buffer();
|