Skype Logo Take a deep breath™.
Buy Skype Credit · Help ·
  • Download
  • Use Skype
  • Business
  • Shop
  • Account
Don Kennedy

Using In Band DTMF Processing with the Skype API and PSTN Calls

By My status Don Kennedy on August 22, 2007 in Developer Blog.

I will explain, in general terms, how it can be done, what to be careful about, and also show you this working example done with MyToGo For Skype which is free, so that you can see that this can in fact be done.

MyToGo For Skype


MyToGo For Skype was created using the Skype4COM library interface, however the same programming logic could have been used by using the Raw Skype API interface as well. MyToGo for Skype can be run as a stand alone program or as an Extra for Skype.


The Audio API for Skype has been present since release 2.6 of the Skype client for Windows release. There are 2 methods to gain access to Skype Audio via the API, you can use the .wav file or port access methods. In our case we need to use the audio being fed by the Skype API to a port not a file. Here is why......

First you will need to process Skype audio using the Skype API port interface

You cannot use the Skype API file interface for audio for processing real-time in band DTMF which is provided by the Skype API because the Skype API opens the .wav file exclusively while it is writing audio data, so processing the audio via file using the Skype API file interface cannot be done currently in real-time since the file would remain opened by the Skype API until closed to process the file content.

You will need to decode the DTMF digits using your application

Since the Skype API does not provide any in band DTMF decoding ("Which is Good actually, the CPU overhead is high, and should NOT be used when not needed, this is why in band DTMF decoding is normally done using a separate CPU or processor, like a modem for example"), this means you will need to do this asynchronously while receiving Skype audio data via a local port and do the other things your program is doing at the same time.

You should use a buffer size of at least 8,192 bytes when processing the data from the port asynchronously because you can receive as much as 32,768 bytes a second of Audio data. This will mean that you will only need to do a maximum of 4 reads a second to keep up with any audio data, worse case, which will allow you to do whatever other processing your application may need to do.

Is This My DTMF Tone or Yours? or "Look My Garage Door Opener Opens my Neighbors Garage Door Too!"

Imagine if mutiple applications for Skype are processing the same DTMF input.

How does one determine that the tones are for it or that they are not?

Can you predict the outcome of what can/could/would/will happen when two or more applications for Skype process the same DTMF digit?

What would happen if you conference called together two automated PBX systems who are both waiting for DTMF digits from your phone? do you really want that mess?

When you call a PBX, or an IVR system, you don't have this issue because there is only one system ready to process your DTMF input, with Skype because of the API interface, you now can have MULTIPLE applications all waiting for DTMF input, and different digits could mean different things. As is the case for MyToGo For Skype Where a # means end of Skype Speed-Dial number and to call the Skype contact or PSTN number assigned to that Skype Speed-Dial number or that the digits prior to the # are a telephone number and to call that telephone number. Now what happens to the application where the # means to do something else?

A giant mess can be created when or if a Skype user is running two applications processing the same DTMF tones. We never see this in other cases because NOBODY has the rich API interface that Skype has.

PBX or IVR systems never need to worry about "What if there is another application listening for DTMF digits?"), they simply say "If you want to do this or that enter this or that now" this is NOT this case when designing applications using the Skype API.

Do you have error logic that says, if call in progress then....or just then.....? ;)

Can more than one copy of your program be started? ;)

So, please be careful if you think that ONLY your application is going to be using DTMF and plan for proper error logic, if and when your application ends up along side of other applications who may or may not be processing the same DTMF tones you are.

View blog reactions

Comment on this post

(If you haven't left a comment here before, you may need to be approved by the site owner before your comment will appear. Until then, it won't appear on the entry. Thanks for waiting.)

Back to index

Subscribe to this blog
What? Tell me more…

using RSS Subscribe
via Bloglines Subscribe in Bloglines
using Newsgator Subscribe in NewsGator Online
with MyYahoo
with Google Add to Google
with My AOL Add to My AOL
with Anothr.com Subscribe by Anothr
with netvibes Add to Netvibes
with email Get email updates
Skype Developer Newsletter

Sign up now for all the latest news, tips and tricks on using Skype Public API.

Developer Zone

  • Home
  • Docs
  • Tutorials
  • Download
  • Support
  • Certification
  • Blog
  • Community
  • Help
  • Find...
Skype Blogs
  • Share Skype Blog
  • About Skype
  • Heartbeat
  • Developer Zone
  • Business
  • Jobs
  • Skype Prime
  • Skype Gear
  • Security
  • Garage
  • Mac
  • Linux
  • Eesti keeles
  • Töökuulutuste leht
  • 日本語
  • Česky
  • Deutsch
  • Français
  • Italiano
  • Brasil
  • United Kingdom
  • Svenska
  • Polski
  • United States

Recent posts

  • New Skype Certified product in June -- Trend Micro WTP for Skype
  • Developer Zone version 3 is out there
  • Developer Zone down for maintenance
  • Skype for Business Showcase in Stockholm, Sweden
  • Skype sponsors Python Developer Conference (sold out)
  • Support updates and fixes in EM 2.0
  • New Skype Certified products in April
  • Update from Eion Robb and Brandon Holland
  • Long time partners... SDP, what's going on?
  • Time to Join Skype at the eBay DevCon

Archives

  • June 2008
  • May 2008
  • April 2008
  • March 2008
  • February 2008
  • January 2008
  • December 2007
  • November 2007
  • October 2007
  • September 2007
  • August 2007
  • July 2007
  • June 2007
  • May 2007
  • April 2007
  • March 2007
  • February 2007
  • January 2007
  • December 2006
  • November 2006
  • October 2006
  • September 2006
  • August 2006
  • July 2006
  • June 2006
  • May 2006
  • April 2006
  • March 2006
  • February 2006
  • January 2006
  • December 2005
  • November 2005
  • October 2005
  • September 2005
  • August 2005
  • July 2005
About us · Partners · Jobs · Prices · Security
Privacy policy · Legal · © 2008 Skype Limited