< Previous by Date Date Index Next by Date >
< Previous in Thread Thread Index  

Re: [reSIProcate-users] Fwd: Implementing DUM UAS for SessionRecording Protocol RFC 7866 with resiprocate


Hello Scott,

Thank you very much for your help!

Andriy

From: Scott Godin
Sent: ‎28/‎06/‎2018 20:44
To: Andriy Brozgol
Cc: resiprocate-users@xxxxxxxxxxxxxxx
Subject: Re: [reSIProcate-users] Fwd: Implementing DUM UAS for SessionRecording Protocol RFC 7866 with resiprocate

I don't think that will work, since the static registration with the contents factory won't work correctly.  There is nothing stopping you from sharing common code between the 2 classes though, ie:  a helper class or a common base class.

Scott

On Thu, Jun 28, 2018 at 12:48 PM Andriy Brozgol <andrebroz@xxxxxxxxx> wrote:
Hello Scott,

Thank you very much for your help!

I implemented the first approach, it works.

I have a question please. If there are two similar contents types, application/rs-metadata and application/rs-metadata+xml, is it possible to register them with the same class, RsMetadataContents. I found myself duplicating the whole class and ended up with 2 classes:  RsMetadataContents and  RsMetadataXmlContents

Thank you very much in advance,

Andriy

On Thu, Jun 28, 2018 at 5:13 PM Scott Godin <sgodin@xxxxxxxxxxxxxxx> wrote:
Hi Andriy,

It's odd, that I haven't seen any of your previous posts on this topic.  My apologies.

I'm not familiar with that RFC, and don't really have the time to read through it, but perhaps these pointers will help for the message body stuff.
You have two options for the message body:
1.  Create your own custom message body class, modeling after the existing classes should help you understand how to implement it (perhaps look at GenericPidfContents).  
2.  Use the OctetContents class and provide message body assembly and parsing outside of the class.  For example:

OctetContents* buildYourCustomBody(const Data& txt)
{
    try
    {
        Mime type(YourCustomMimeType, YourCustomMimeSubType);
        OctetContents* contents = new OctetContents(txt, type);
        if(contents)
        {
            contents->header(h_ContentDisposition).value() = CSTAContentDisposition;
            contents->header(h_ContentDisposition).param( p_handling ) = CSTAContentDispositionHandling;
        }
        else
        {
            ErrLog(<< "Error creating body");
        }
        return contents;
    }
    catch(...)
    {
        ErrLog(<< "buildCSTAContents: Error creating body - exception");
    }
}

Parsing example (unrecognized mime-types get created in resip as OctetContents):
void
MyUserAgent::onOffer(InviteSessionHandle h, const SipMessage& msg, const Contents& offer)
{         
    OctetContents* contents = dynamic_cast<OctetContents*>((Contents*)&offer);
    if(!contents)
    {
        h->reject(415 /* Unsupported Media Type */);
        return;
    }

    Data body = contents->getBodyData();
    ParseBuffer pb(body);
    XMLCursor xml(pb);  // Assuming body has XML data - but use whatever parsing makes sense for you from here on....


Scott

On Thu, Jun 28, 2018 at 8:31 AM Andriy Brozgol <andrebroz@xxxxxxxxx> wrote:
Hello All,

Additionally I found the following:

// adds support for the message body
uasMasterProfile->addSupportedMimeType(INVITE, MultipartMixedContents::getStaticType());
uasMasterProfile->addSupportedMimeType(UPDATE, MultipartMixedContents::getStaticType());
uasMasterProfile->addSupportedMimeType(INVITE, RsMetadataContents::getStaticType());
uasMasterProfile->addSupportedMimeType(UPDATE, RsMetadataContents::getStaticType());

I haven't yet figured out how to extract the content from the message. If anybody can give me a clue I would be very grateful.

Thanks,

Andriy

---------- Forwarded message ---------
From: Andriy Brozgol <andrebroz@xxxxxxxxx>
Date: Tue, Jun 12, 2018 at 4:21 PM
Subject: Re: Implementing DUM UAS for Session Recording Protocol RFC 7866 with resiprocate
To: <resiprocate-users@xxxxxxxxxxxxxxx>


Hello All,

So far I found the following:
// adds option tag in Supported header
uasMasterProfile->addSupportedOptionTag(Token("siprec"));
// adds feature tag in Contact header
static const ExtensionParameter p_srs("+sip.srs");
NameAddr capabilities;
capabilities.param(p_srs);
uasMasterProfile-> setUserAgentCapabilities(capabilities);

As far as I understand I need to create RsMetadataContents class which would register with the contents factory (similar to OctetContents for example)

I hope this will help somebody.

Thanks,

Andriy


On Mon, Jun 11, 2018 at 7:00 PM, <resiprocate-users-request@xxxxxxxxxxxxxxx> wrote:
Send resiprocate-users mailing list submissions to
        resiprocate-users@xxxxxxxxxxxxxxx

To subscribe or unsubscribe via the World Wide Web, visit
        https://list.resiprocate.org/mailman/listinfo/resiprocate-users
or, via email, send a message with subject or body 'help' to
        resiprocate-users-request@xxxxxxxxxxxxxxx

You can reach the person managing the list at
        resiprocate-users-owner@xxxxxxxxxxxxxxx

When replying, please edit your Subject line so it is more specific
than "Re: Contents of resiprocate-users digest..."

[please change the subject line when replying]

Today's Topics:

   1. Implementing DUM UAS for Session Recording Protocol RFC 7866
      with resiprocate (Andriy Brozgol)


---------- Forwarded message ----------
From: Andriy Brozgol <andrebroz@xxxxxxxxx>
To: resiprocate-users@xxxxxxxxxxxxxxx
Cc: 
Bcc: 
Date: Mon, 11 Jun 2018 14:47:28 +0300
Subject: [reSIProcate-users] Implementing DUM UAS for Session Recording Protocol RFC 7866 with resiprocate
Hello All,

I am trying to use resiprocate DUM for implementing UAS of recording server.

I have not much experience with resiprocate. If someone could help me in suggesting how to implement or at least pointing to some examples the following:

+sip.src feature tag in Contact header field
siprec option tag in Require header
multipart/mixed  content with application/rs-metadata content type and recording-session content disposition

I also ran into difficulty of accessing the API Docs for resiprocate. The link https://svn.resiprocate.org/dox/ seems broken.

Thank you very much in advance,

Andriy



_______________________________________________
resiprocate-users mailing list
resiprocate-users@xxxxxxxxxxxxxxx
https://list.resiprocate.org/mailman/listinfo/resiprocate-users


_______________________________________________
resiprocate-users mailing list
resiprocate-users@xxxxxxxxxxxxxxx
List Archive: http://list.resiprocate.org/archive/resiprocate-users/