drachtio / drachtio-srf

drachtio signaling resource framework
https://drachtio.org
MIT License
169 stars 59 forks source link

UAS Dialog with 183 response to invite #44

Closed sopinon closed 5 years ago

sopinon commented 5 years ago

I've tried to implement following connection flow with UAS dialog: https://tools.ietf.org/html/draft-ietf-mmusic-trickle-ice-sip-15#page-14

After creating UAS dialog, the first response after receiving the INVITE will be 200 ACK. In the example above, the first response should be 183 Session Progress. Would be great if the dialog supports this kind of connection flow. Or is there a better way to implement this (without using UAS dialog)?

davehorton commented 5 years ago

sending a 180/183 as a non-reliable response before the 200 OK is trivial:

srf.invite((req, res) => {
   res.send(183, {body: ...});
   srf.createUAS(..);

to send a 183 as a reliable response, include a RSeq header, and add the two optional callbacks; the first is called when the response is sent (shows the message sent over the wire) and the second is called when we receive a PRACK to the reliable response:

srf.invite((req, res) => {
   let uas;
   res.send(183, {
      headers {
         'RSeq': 988789 // some value you assign
      },
      body: mySdp
   }, 
   (err, sent) => { 
      console.log(`sent response ${sent}`); 
   },
   () => { 
      console.log('received PRACK, now we can send 200 OK');
      uas = srf.createUAS(...);
   });

Does that help? I see that Figure 5 in the doc you cite is sending some additional INFO messages during call setup, is that something you are trying to do? I've not specifically tested that callflow so let me know how you get on.

sopinon commented 5 years ago

Thank you for reply. Just saw, that this kind of connection flow is still marked as a draft. I've now disabled trickle support on the WebRTC client. So there is no need for a 183 Response anymore.