# Description
I want proxy MSRP messages via Kamailio. To get it working for SIP calls (not WebRTC) need alter SDP `m=message` media connection information: 1. set IP address to Kamailio TLS socket; 1. set port to Kamailio TLS socket.
At preset time I cannot find way to do it.
Could you add function like `msrp_manage` (like `rtpengine_manage`) that update SDP (request and answer) to allow proxy MSRP session via Kamailio socket.
IIRC, MSRP relay is like a TURN server for RTP, not like a RTPProxy. So the UA has to use MSRP to connect to the MSRP server (relay), authenticate with it independent of the SIP signaling and set the MSRP server address in the SDP when UA creates the SDP. When I tested long time ago, the UA (iirc Bria) had option to set the MSRP address in its config
Maybe there are new specs that will allow what you suggest, as I haven't really followed the MSRP standardization development, but the RTPProxy approach is not a standard, is just an workaround. If you have pointers for the (new) specs, paste links to them here.
Think I search way to transparently inject kamailio as MSRP proxy into SDP and MSRP messages. Looks as this behavior will be not standard. But I expect this feature will allow inject kamailio as MSRP proxy when I not able to control caller UA.
**SDP update** Could you looks [RFC4976 Section 11. Example SDP with Multiple Hops](https://tools.ietf.org/html/rfc4976#section-11)
Here exist example ``` c=IN IP4 bob.example.com m=message 1234 TCP/TLS/MSRP * a=accept-types: message/cpim text/plain a=path:msrps://relay.example.com:9000/hjdhfha;tcp \ msrps://bob.example.com:1234/fuige;tcp ``` Attribute `a=path` have two `msrps` uri.
I expect add kamailio msrp socket into `a=path` attribute. Like Kamailio receive caller SDP like ``` c=IN IP4 bob.example.com m=message 1234 TCP/TLS/MSRP * a=accept-types: message/cpim text/plain a=path:msrps://bob.example.com:1234/fuige;tcp ``` Then add `msrps://relay.example.com:9000/hjdhfha;tcp ` at top of `a=path` and forwards to FreeSwitch (Asterisk) daemon.
And then make similar SDP update for `183` and '200' responses.
**MSRP messages updates** Caller send ``` MSRP 6aef SEND To-Path: msrps://b.example.net:9000/aeiug;tcp \ msrps://bob.example.net:8145/foo;tcp From-Path: msrps://alice.example.org:7965/bar;tcp Success-Report: yes Byte-Range: 1-*/* Message-ID: 87652 Content-Type: text/plain
Hi Bob, I'm about to send you file.mpeg -------6aef$ ``` Kamailio forward ``` MSRP 6aef SEND To-Path: msrps://bob.example.net:8145/foo;tcp From-Path: msrps://b.example.net:9000/aeiug;tcp \ msrps://alice.example.org:7965/bar;tcp Success-Report: yes Byte-Range: 1-*/* Message-ID: 87652 Content-Type: text/plain
Hi Bob, I'm about to send you file.mpeg -------6aef$ ```
Kamailio msrp module handles the From-Path and To-Path.
For the sdp in the invite, you can try to add new msrp url with subst/replace functions from textops/textops module, or use some embedded scripting like python or lua if you need more complex operations, then there are functions to delete/set the body. Of course, if someone wants to add a function in the C code for it, I am fine to merge an eventual pull request.
Still my quick guess is that it is the job of UA to set all the msrp URLs there, otherwise it may not build correctly the From-Path and To-Path. But again I am fine if there is a use case for inserting additional msrp relays out of UAs control. Given that MSRP relay is more like a TURN server, the specs likely didn't allow interfering with the selected relay path by UAs for security/privacy reasons.
For sure the MSRP relay next to the end-point has to be set by the UA, otherwise the MSRP relay cannot connect to the endpoint via tcp/tls, especially for natted devices.
If there are no further comments that point to specs that say a msrp relay can be inserted by a middle node, then this item is going to be closed soon. A pull request can be made at any time.
Thanks Daniel for suggestion. May be I try create PR. Could you suggest relevant SDP content or INVITE message headers manipulation where I looks example.
P.S. close ticket in short time.
Probably you can try with subst_body():
* https://www.kamailio.org/docs/modules/stable/modules/textops.html#textops.f....
Let's discuss further on sr-users if you need more help in updating the sdp body.
Closed #2186.