Skip to content

Commit

Permalink
feat(WEBRTC-119): Documented new ringback property and updated exampl…
Browse files Browse the repository at this point in the history
…es. (#26)

* updated readme file to support ringbackfile prop

* added a warning when using ringbackFile
  • Loading branch information
DeividVeloso authored Jul 14, 2020
1 parent a44d97b commit 92311fb
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 3 deletions.
11 changes: 9 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -41,15 +41,22 @@ import { TelnyxRTC } from '@telnyx/webrtc';

To initialize the JavaScript SDK, you'll need to authenticate using a Telnyx Connection. You can access the Connection credentials in the [Telnyx Portal](https://portal.telnyx.com/#/app/connections).

To use the `ringbackFile`, make sure the "Generate Ringback Tone" option is **disabled** in your [Telnyx Portal connection](https://portaldev.telnyx.com/#/app/connections) configuration (Inbound tab.)

```js
// Initialize the client
const client = new TelnyxRTC({
// Required credentials
login: username,
password: password,
// Other options
// This file can be a wav/mp3 in your local public folder or you can host it in a CDN and pass just the URL, such as https://cdn.company.com/sounds/call.mp3
/*
ringtoneFile - This file can be a wav/mp3 in your local public folder or you can host it in a CDN and pass just the URL, such as https://cdn.company.com/sounds/call.mp3
*/
ringtoneFile: './sounds/incoming_call.mp3',
/*
ringbackFile - Used when you disable Generate Ringback Tone to provide your own ringback sound.
*/
ringbackFile: './sounds/ringback_tone.mp3',
});

// Create a variable to track the current call
Expand Down
2 changes: 1 addition & 1 deletion examples/react/stories/2-WebDialer.stories.js
Original file line number Diff line number Diff line change
Expand Up @@ -271,7 +271,7 @@ const WebDialer = ({
login: username,
password: password,
ringtoneFile: './sounds/incoming_call.mp3',
// Used when the Generate Ringback Tone option is disabled
// Used when the "Generate Ringback Tone" option is disabled
ringbackFile: './sounds/ringback_tone.mp3',
});
session.on('telnyx.socket.open', (call) => {
Expand Down
1 change: 1 addition & 0 deletions examples/vanilla/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -221,6 +221,7 @@ <h5>Remote Video</h5>
login: document.getElementById('username').value,
password: document.getElementById('password').value,
ringtoneFile: './sounds/incoming_call.mp3',
// ringbackFile: './sounds/ringback_tone.mp3',
});

client.remoteElement = 'remoteVideo';
Expand Down
Binary file added examples/vanilla/sounds/ringback_tone.mp3
Binary file not shown.

0 comments on commit 92311fb

Please sign in to comment.