Skip to content

Commit

Permalink
Feature/sdk eventing (twilio#129)
Browse files Browse the repository at this point in the history
* feat: option for event registration; send option over vsp invite

* Update peerconnection.js

* [VBLOCKS-505] feat: sdk eventing; listener and event (twilio#112)

* feat: sdk eventing; listener and event

* fix: rename registerFor

* chore: unit tests

* feat: send message api (twilio#114)

* feat: send message api

* feat: address feedback

* fix: add callsid check

* fix: remove call status check

* VBLOCKS-981 VBLOCKS-1093 | Updating eventing API per latest specs (twilio#116)

* VBLOCKS-981 VBLOCKS-1093 | Updating eventing API per latest specs

* Adding note about the key

* VBLOCKS-1095 | Updating API docs

* Adding docs

* Addressed feedback

* [VBLOCKS-1127] Consume new SDK eventing errors (twilio#120)

* chore: update voice-error dependency

* fix: update voice-errors dep and generate new error classes

* Adding changelog draft (twilio#123)

* Adding changelog draft

* Adding Kumkum's suggestion.

* Syncing lock file version

* 2.2.0-rc1

* 2.2.0-dev

* Adding placeholder links to public docs

* VBLOCKS-1218 Adding 31209 error for max payload size limit (twilio#125)

* Updating gitignore for test webpack

* Fixing release pipeline: removing unused webpack test

* 2.2.0-rc2

* 2.2.0-dev

* Prep for release (twilio#128)

* Using latest errors

* Using latest errors

* Updating docs

* Update changelog

* Update changelog

Co-authored-by: Michael Huynh <mhuynh@twilio.com>
Co-authored-by: Michael Huynh <12516091+mhuynh5757@users.noreply.github.com>
Co-authored-by: twilio-vblocks-ci <svc.vblocks-ci@twilio.com>
  • Loading branch information
4 people authored Dec 2, 2022
1 parent f518b24 commit a48d7c9
Show file tree
Hide file tree
Showing 15 changed files with 1,144 additions and 79 deletions.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -9,3 +9,5 @@ extension/token.js
node_modules
docs
lib/twilio/constants.js
nodemon.json
tests/webpack/package-lock.json
54 changes: 50 additions & 4 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,49 @@
2.2.0 (In Progress)
===================

New Features
------------

### Call Message Events (Beta)

The SDK can now send and receive custom messages to and from Twilio's backend via the following new `Call` APIs.

- [sendMessage](https://twilio.github.io/twilio-voice.js/classes/voice.call.html#sendmessage)
- [messageReceivedEvent](https://twilio.github.io/twilio-voice.js/classes/voice.call.html#messagereceivedevent)
- [messageSentEvent](https://twilio.github.io/twilio-voice.js/classes/voice.call.html#messagesentevent)

Please visit this [page](https://www.twilio.com/docs/voice/sdks/call-message-events) for more details about this feature. Additionally, please see the following for more information on how to send and receive messages on the server.

- [UserDefinedMessage](https://www.twilio.com/docs/voice/api/userdefinedmessage-resource)
- [UserDefinedMessageSubscription](https://www.twilio.com/docs/voice/api/userdefinedmessagesubscription-resource)

**NOTE:** This feature should not be used with [PII](https://www.twilio.com/docs/glossary/what-is-personally-identifiable-information-pii).

**Example**

```js
const device = new Device(token, options);

const setupCallHandlers = call => {
call.on('messageReceived', message => messageReceivedHandler(message));
call.on('messageSent', message => messageSentHandler(message));
};

// For outgoing calls
const call = await device.connect();
setupCallHandlers(call);

// For incoming calls
device.on('incoming', call => setupCallHandlers(call));
await device.register();

// For sending a message
const eventSid = call.sendMessage({
content: { foo: 'foo' },
messageType: Call.MessageType.UserDefinedMessage,
});
```

2.1.2 (October 26, 2022)
========================

Expand All @@ -17,8 +63,8 @@ Bug Fixes
- Use DOMException instead of DOMError, which has been deprecated
- Removed npm util from the package, instead favoring native functions

2.1.0 (December 16, 2021) - Release
===================================
2.1.0 (December 16, 2021)
=========================

New Features
------------
Expand Down Expand Up @@ -140,8 +186,8 @@ This patch increment was necessary because the 2.0.0 pilot artifact was erroneou
now removed from npm so that it is not mistakenly used. The first npm artifact will be 2.0.1.


2.0.0 (July 7, 2021) - Release
==============================
2.0.0 (July 7, 2021)
====================

## Migration from twilio-client.js 1.x
This product, Twilio's JavaScript Voice SDK, is the next version of Twilio's Javascript Client SDK. It is
Expand Down
Loading

0 comments on commit a48d7c9

Please sign in to comment.