# mediasoup 3.6.0 is out with DataChannel termination in Node.js

**URL:** <https://mediasoup.discourse.group/t/mediasoup-3-6-0-is-out-with-datachannel-termination-in-node-js/1118>\
**Category:** Announcements\
**Created:** [May 29, 2020, 3:13pm UTC](https://mediasoup.discourse.group/t/mediasoup-3-6-0-is-out-with-datachannel-termination-in-node-js/1118 "2020-05-29T15:13:14Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![ibc](https://yyz2.discourse-cdn.com/free1/user_avatar/mediasoup.discourse.group/ibc/32/1540_2.png) [@ibc](https://mediasoup.discourse.group/u/ibc)\
**Post date:** [May 29, 2020, 3:13pm UTC](https://mediasoup.discourse.group/t/mediasoup-3-6-0-is-out-with-datachannel-termination-in-node-js/1118/1 "2020-05-29T15:13:14Z")

</div>

mediasoup 3.6.0 is out. It comes with a new `DirectTransport` to send/receive data messages directly from/to Node.js to the mediasoup C++ `Router`, so those messages can be sent/received by remote WebRTC endpoints.

### References

- [Code changes](https://github.com/versatica/mediasoup/pull/409)
- [Guidelines for DataChannel termination in Node.js](https://mediasoup.org/documentation/v3/communication-between-client-and-server/#guidelines-for-datachannel-termination-in-node)
- [mediasoup-demo: Refactor the message Bot with new DataChannel termination in mediasoup](https://github.com/versatica/mediasoup-demo/pull/99)

### New API

- [`router.createDirectTransport()`](https://mediasoup.org/documentation/v3/mediasoup/api/#router-createDirectTransport)
- [`dataProducer.send()`](https://mediasoup.org/documentation/v3/mediasoup/api/#dataProducer-send)
- [`dataConsumer.on('message')`](https://mediasoup.org/documentation/v3/mediasoup/api/#dataConsumer-on-message)

### Feature overview

- Allow the Node application to directly send text/binary messages to `mediasoup-worker` C++ process so others can consume them using `DataConsumers`.

- And vice-versa: allow the Node application to directly consume in Node messages send by `DataProducers`.

### Implementation

- New `DirectTransport` (created via `router.createDirectTransport()`) that uses the new `PayloadChannel` (UnixSocket pair between Node and C++) to send payload messages in both directions.

- Extend `DataProducer` and `DataConsumer` classes to not just work with SCTP capable transports (`WebRtcTransport`, `PlainTransport`, `PipeTransport`) but also with the new `DirectTransport`.

- `sctpStreamParameters` are now optional in `DataProducerOptions` (just valid for `directTransport.produceData()`).

- Added `dataProducer/Consumer.type` getter, that can be ‘sctp’ or ‘direct’.

- `transport.consumeData()` (when in an SCTP capable transport) now accepts optional SCTP related parameters in `DataConsumerOptions` to tell mediasoup how to deliver messages to the remote SCTP endpoint (see [DataConsumerOptions](https://mediasoup.org/documentation/v3/mediasoup/api/#DataConsumerOptions) definition):

- `Worker`: Added a new `message` log tag.

---

<div class="post-metadata">

**Author:** ![peakyDicers](https://avatars.discourse-cdn.com/v4/letter/p/fbc32d/32.png) [@peakyDicers](https://mediasoup.discourse.group/u/peakyDicers)\
**Post date:** [May 30, 2020, 4:21am UTC](https://mediasoup.discourse.group/t/mediasoup-3-6-0-is-out-with-datachannel-termination-in-node-js/1118/2 "2020-05-30T04:21:27Z")

</div>

Wow!

I installed media soup for the first time yesterday, and was trying to figure out why mediasoup couldn’t find the createDirectTransport method. This is great, will be upgrading now. Thanks!

---

<div class="post-metadata">

**Author:** ![ibc](https://yyz2.discourse-cdn.com/free1/user_avatar/mediasoup.discourse.group/ibc/32/1540_2.png) [@ibc](https://mediasoup.discourse.group/u/ibc)\
**Post date:** [May 31, 2020, 3:13pm UTC](https://mediasoup.discourse.group/t/mediasoup-3-6-0-is-out-with-datachannel-termination-in-node-js/1118/3 "2020-05-31T15:13:15Z")

</div>

This topic was automatically closed after 2 days. New replies are no longer allowed.
