Pages Menu
TwitterRssFacebook

Posted by on Jun 1, 2015 in Learn Skype Web SDK | 0 comments

Learn Skype Web SDK Day 23 : Mute, Hold and DTMF Tones

Learn Skype Web SDK Day 23 : Mute, Hold and DTMF Tones

This is one post in a series of more than 30, devoted to helping you get up to speed quickly with the new Skype Web SDK. Each lesson comes with source code (in GitHub) and a working demo page so you can see what it does. Check out the full list of posts on the Skype Web SDK page.


View Demo
So, last time we looked at how to receive incoming audio calls, meaning you can make and receive audio calls using Skype Web SDK in your browser. Whilst that pretty much is the definition of nirvana, there is in fact even more you can do with audio.

Looking to the standard Skype for Business client for a moment, you’ll notice some features that you probably use every day without even thinking about it. Muting your microphone, for example. Or putting the call on hold. Or sending DTMF tones to navigate through IVR systems.

The great news is that the Skype Web SDK supports all three of these scenarios, and that’s the focus of today’s lesson. Why three new features in one lesson? Because they’re super-easy to pick up!

DTMF (Dual-Tone Multi Frequency) is the noise you hear when you press a keypad on a phone whilst in a call, and is used to navigate IVR systems, vote in phone surveys, and even by Skype for Business when dialling in to join a meeting. According to Wikipedia, DTMF is “an in-band telecommunication signaling system using the voice-frequency band over telephone lines between telephone equipment and other communications devices and switching centers. DTMF was first developed in the Bell System in the United States, and became known under the trademark Touch-Tone for use in push-button telephones supplied to telephone customers, starting in 1963.” So, now you know.

Muting

To provide a mute button for your users so they can sound off about their customers in private, simply set the isMuted property of the selfParticipant‘s audio object:

[code language=”javascript”]
conversation.selfParticipant.audio.isMuted.set(!conversation.selfParticipant.audio.isMuted());
[/code]

On Hold

For longer breaks, or to make another call, you can place the current call on hold by setting the onHold property of the selfParticipant‘s audio:

[code language=”javascript”]
conversation.selfParticipant.audio.isOnHold.set(!conversation.selfParticipant.audio.isOnHold());
[/code]

DTMF

To send DTMF tones, there’s a special method, sendDTMF, which takes the number you want to send:

[code language=”javascript”]
conversation.audioService.sendDtmf(“1″);
[/code]

[code language=”javascript”]








[/code]

Demo Online

You can try this code out against your own Skype for Business environment by going to the demo page. From here you can also download the code from GitHub if you want to host it locally, or take it and use it in your next project.

Disclaimer: This is sample code, intended to inform and educate. It is not production-ready and is lacking key components such as error handling. You use it entirely at your own risk. You should fully understand the effects, limitations and risks of the code before executing, and understand the implications of any set-up steps. By using these code examples you are using the Skype Web SDK, so you should read the Skype Software License Terms to which you are agreeing.

Good to Know

Post a Reply

Your email address will not be published. Required fields are marked *

This site uses cookies to help make this website better. By continuing to use this site we’ll assume you’re OK with that (implied consent).