Skip to content

Conversation

@mitre-mgarber
Copy link

This PR adds support for RFC3842, which allows for a client to send a SUBSCRIBE message to a server in order to be sent NOTIFY messages when someone has left a message for a user, which the server will do for the period specified.

This is a requirement for Video Relay Services Interoperability, which is primarily aimed at supporting the deaf/blind community - though it should be applicable outside of this context as well.

We did this with a very basic subscribe module, which is not as detailed as PR 711 - if it's preferred, I could talk to that author about incorporating some of the specifics in there.

@ikq
Copy link

ikq commented Aug 20, 2021

Hi !

I noticed that you mentioned my PR 711, so I checked how it can be used for RFC 3842.
Seems without changes, you just have to develop a parser for the NOTIFY body.

I tried to modify my test:
https://github.com/ikq/subscribe_notify_test

to send SUBSCRIBE according RFC3842

SUBSCRIBE sip:alice@vmail.example.com SIP/2.0
      To: <sip:alice@example.com>;tag=4442
      From: <sip:alice@example.com>;tag=78923
      Date: Mon, 10 Jul 2000 15:55:06 GMT
      Call-Id: 1349882@alice-phone.example.com
      CSeq: 8 SUBSCRIBE
      Contact: <sip:alice@alice-phone.example.com>
      Event: message-summary
      Expires: 86400
      Accept: application/simple-message-summary
      Content-Length: 0

Result:

   SUBSCRIBE sip:user3@example.com SIP/2.0
  Via: SIP/2.0/WSS qngoceuqd83q.invalid;branch=z9hG4bK4170069  
  Max-Forwards: 69
  To: <sip:user3@example.com>
  From: "user2" <sip:user2@example.com>;tag=g7ac7k0a9r
  Call-ID: ql9cn510ur3dlh4sarqb
  CSeq: 3675 SUBSCRIBE
  Event: message-summary
  Expires: 86400
  Accept: application/simple-message-summary
  Contact: <sip:user2@v19oh3q8o209.invalid;transport=ws>;+sip.instance=" 
 <urn:uuid:c51e38d8-ff7f-475b-bec7-db6158392d6f>"
  Allow: INVITE,ACK,CANCEL,BYE,UPDATE,MESSAGE,OPTIONS,REFER,INFO,NOTIFY,SUBSCRIBE
  Supported: outbound
  User-Agent: JsSIP 3.8.0
  Content-Length: 0

Note: user names and domain was changed to user??? and example.com

Code:

    let user = 'user3';
    let eventName = 'message-summary';
    let expires = 86400;
    let accept = 'application/simple-message-summary';
    let target = user; 
    let params = null;

    try {
        subscriber = jssipUA.subscribe(
            target,
            eventName,
            accept, {
            expires,
            params
        });
    } catch (e) {
        console.log('Error: cannot create subscriber', e);
    }

  subscriber.on('notify', (isFinal, notify, body, contentType) => {
     /* Please parse notify body, e.g.
 
         Messages-Waiting: yes
         Message-Account: sip:alice@vmail.example.com
         Voice-Message: 4/8 (1/2)
    */
    console.log(body);         
  });

Copy link
Member

@ibc ibc left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't see anything related to dialogs generated by the SUBSCRIBE request. I mean: a SUBSCRIBE generates a dialog so NOTIFY messages received from the remote endpoint should match such a dialog (there could be many subscription dialogs active at the same time). Do I miss something?

@jmillan your thoughts?

@jmillan
Copy link
Member

jmillan commented Aug 23, 2021

As @ikq, indicates, once his PR is accepted the addition for SUBSCRIBE packages will be doable, externally if not inside JsSIP. But this PR does not comply with dialog usage as @ibc says and other considerations.

I'm closing this PR.

@jmillan jmillan closed this Aug 23, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

4 participants