From a873079714a67c9979ccf943d24ca0c81d15448c Mon Sep 17 00:00:00 2001 From: Vlad Patrascu Date: Sat, 14 May 2022 21:37:18 +0300 Subject: [PATCH] proto_msrp: use full path in To header when sending request --- modules/proto_msrp/msrp_signaling.c | 19 +++++++++++++++++-- 1 file changed, 17 insertions(+), 2 deletions(-) diff --git a/modules/proto_msrp/msrp_signaling.c b/modules/proto_msrp/msrp_signaling.c index 00ed47ca088..d021ba784ea 100644 --- a/modules/proto_msrp/msrp_signaling.c +++ b/modules/proto_msrp/msrp_signaling.c @@ -823,6 +823,7 @@ int msrp_send_request(void *hdl, enum msrp_method method_id, union sockaddr_union su; struct msrp_cell *cell; void **val; + struct msrp_url *url; if (from==NULL || to==NULL || hdrs==NULL) { LM_ERR("missing hdrs: from %p / to %p/ hdrs %p\n", from, to, hdrs); @@ -929,8 +930,16 @@ int msrp_send_request(void *hdl, enum msrp_method method_id, /* headers * headers = To-Path CRLF From-Path CRLF 1*( header CRLF ) */ - len += TO_PATH_PREFIX_LEN + from->len + CRLF_LEN - + FROM_PATH_PREFIX_LEN + to->whole.len + CRLF_LEN; + len += FROM_PATH_PREFIX_LEN + from->len + CRLF_LEN + + TO_PATH_PREFIX_LEN + to->whole.len; + + url = to->next; + while (url) { + len += 1 /* SP */ + url->whole.len; + url = url->next; + } + len += CRLF_LEN; + /* extra hdrs */ for ( i=0 ; iwhole.s, to->whole.len); + to = to->next; + while (to) { + *(p++) = ' '; + append_string( p, to->whole.s, to->whole.len); + to = to->next; + } append_string( p, CRLF, CRLF_LEN); append_string( p, FROM_PATH_PREFIX, FROM_PATH_PREFIX_LEN);