Establish MSRP channel

May 14, 2013 at 7:03 PM
Hi,

First wanted to say this project looks awesome - great work!

I'd like to use SIP in order to establish a MSRP channel for chat, file transfer etc.
This is done over an INVITE request as described:
http://tools.ietf.org/html/rfc4975#section-4

An INVITE will look like this:
INVITE sip:bob@biloxi.example.com SIP/2.0
To: sip:bob@biloxi.example.com
From: sip:alice@atlanta.example.com;tag=786
Call-ID: 3413an89KU
Content-Type: application/sdp

c=IN IP4 atlanta.example.com
m=message 7654 TCP/MSRP *
a=accept-types:text/plain
a=path:msrp://atlanta.example.com:7654/jshA7weztas;tcp

Is there a way to add the payload to the INVITE using this project?
It seem there is no sendInvite method that expects additional arguments.

I'd love to get your thoughts and ideas on how this is possible.

Thanks!!!
May 15, 2013 at 11:33 AM
You can create a SIPCallDescriptor with a custom SDP payload as the content, and call SIPClientUserAgent.Call method to create an INVITE transaction.
Check out the SoftPhone application if you haven't done already ;)

SIPclient.cs: https://sipsorcery.codeplex.com/SourceControl/latest#1316982
string sdp = 
    "c=IN IP4 atlanta.example.com" + "\n" +
    "m=message 7654 TCP/MSRP *" + "\n" +
    "a=accept-types:text/plain" + "\n" +
    "a=path:msrp://atlanta.example.com:7654/jshA7weztas;tcp";

SIPCallDescriptor callDescriptor = new SIPCallDescriptor(sipUsername, sipPassword, callURI.ToString(), fromHeader, null, null, null, null, SIPCallDirection.Out, SDP.SDP_MIME_CONTENTTYPE, sdp, null);

var m_uac = new SIPClientUserAgent(m_sipTransport, null, null, null, null);
m_uac.Call(callDescriptor);
Coordinator
May 15, 2013 at 11:54 AM
It should be straight forward to send a custom SDP payload, such as the MSRP one, within an INVITE transaction. The SIP stack in this project largely ignores the body of a the INVITE request (the softphone project is an exception since it needs to parse the SDP to set up the RTP) apart from a few places where NAT handling is invoked to replace private IP addresses.

As tacnayn has pointed out the softphone project is the best starting point for a client that wants to use MSRP. The quickest and dirtiest way would be to rip all the RTP and Audio handling out of the softphone and replace it with the MSRP handling code. The clean way would be to add some logic that checked the protocol specified in the SDP and handle it with the RTP or MSRP logic appropriately.
May 15, 2013 at 4:50 PM
Thanks so much for the information!
I'll try it out and let you guys know how it went.

Thank you!