{"id":248,"date":"2017-02-22T14:43:20","date_gmt":"2017-02-22T14:43:20","guid":{"rendered":"https:\/\/blog.mozilla.org\/webrtc\/?p=248"},"modified":"2018-03-23T20:43:51","modified_gmt":"2018-03-23T20:43:51","slug":"dtmf-now-available-firefox","status":"publish","type":"post","link":"https:\/\/blog.mozilla.org\/webrtc\/dtmf-now-available-firefox\/","title":{"rendered":"DTMF available in Firefox 52"},"content":{"rendered":"<p><a href=\"https:\/\/www.mozilla.org\/en-US\/firefox\/channel\/desktop\/\">Firefox 52<\/a> now supports <a href=\"https:\/\/en.wikipedia.org\/wiki\/Dual-tone_multi-frequency_signaling\">DTMF<\/a>. Try it out now in <a href=\"https:\/\/webrtc.github.io\/samples\/src\/content\/peerconnection\/dtmf\/\">webrtc samples<\/a>! This means you no longer need <a href=\"https:\/\/hacks.mozilla.org\/2015\/11\/webrtc-sending-dtmf-in-firefox\/\">workarounds<\/a> to accomplish this.<\/p>\n<p>The <a href=\"http:\/\/w3c.github.io\/webrtc-pc\/#peer-to-peer-dtmf\">spec JavaScript API<\/a> we&#8217;ve implemented is newer and different from what is in Chrome at the moment. Therefore, we recommend using <a href=\"https:\/\/github.com\/webrtc\/adapter\">adapter.js<\/a> until Chrome updates their API. That way, you only deal with one API that works on all browsers.<\/p>\n<p>In the new API, the <a href=\"https:\/\/developer.mozilla.org\/en-US\/docs\/Web\/API\/RTCRtpSender\/dtmf\"><code>dtmf<\/code><\/a> sender already exists, so you don&#8217;t create it. It hangs off of the <a href=\"http:\/\/w3c.github.io\/webrtc-pc\/#peer-to-peer-dtmf\">RTCRtpSender<\/a> associated with a track. So instead of writing the following <!--more-->Chrome-only code:<\/p>\n<pre>    dtmf <span class=\"pl-k\">=<\/span> <span class=\"pl-smi\">pc<\/span>.<span class=\"pl-en\">createDTMFSender<\/span>(audioTrack);\r\n    dtmf.insertDTMF(\"112233\");<\/pre>\n<p>you now write:<\/p>\n<pre>    sender = pc.getSenders().find(sender =&gt; sender.track == audioTrack);\r\n    sender.dtmf.insertDTMF(\"112233\");<\/pre>\n<p>The latter is the most browser-compatible way to obtain the sender right now. You can also get the sender as the return value of <a href=\"https:\/\/developer.mozilla.org\/en-US\/docs\/Web\/API\/MediaStream\/addTrack\"><code>pc.addTrack()<\/code><\/a>, but only Firefox supports tracks at the moment.<\/p>\n<h3>Signaling side<\/h3>\n<p>On the signaling side, it is more straightforward.\u00a0 An offer indicating support for DTMF contains an additional payload type on the audio line with a corresponding rtpmap for &#8220;telephone-event&#8221;.\u00a0 If Firefox generates the offer, the DTMF payload type is typically 101, whereas Chrome usually uses 126.\u00a0 If the answer supports DTMF, the DTMF payload type will be included with the other audio codecs in the m= line for audio.<\/p>\n<p>The base DTMF RFC (<a href=\"https:\/\/tools.ietf.org\/html\/rfc4733\">RFC 4733<\/a>) allows for sending DTMF events for each of the digits (0-9), &#8216;*&#8217; (asterisk), &#8216;#&#8217; (hash or pound), letters A-D, plus a few other special events that all come from the legacy POTS (Plain Old Telephone Service) days.\u00a0 However, the WebRTC spec (<a href=\"https:\/\/tools.ietf.org\/html\/rfc7874\">RFC 7874<\/a>) says events 0-15 (digits 0-9, A-D, &#8216;*&#8217;, and &#8216;#&#8217;) are required and nothing else is allowed.\u00a0 All that to say, you may or may not see an fmtp line that specifies that events 0-15 are supported.\u00a0 Either way, 0-15 are supported.<\/p>\n<p>Given that the main use of DTMF is to call into &#8220;legacy&#8221; systems, we haven&#8217;t been able to test it extensively. We&#8217;ve tested against WebRTC <a href=\"https:\/\/webrtc.github.io\/samples\/src\/content\/peerconnection\/dtmf\/\">samples<\/a> and written some unit tests, but we could use some help with testing it against real systems. Please try it out and file a <a href=\"https:\/\/bugzilla.mozilla.org\/enter_bug.cgi?product=Core&amp;component=WebRTC\">bug<\/a> if you hit any problems!<\/p>\n<p>(Thanks to Jan-Ivar and Michael for significant contributions this post)<\/p>\n","protected":false},"excerpt":{"rendered":"Firefox 52 now supports DTMF. Try it out now in webrtc samples! This means you no longer need workarounds to accomplish this. The spec JavaScript API we&#8217;ve implemented is newer and different from what is in Chrome at the moment. Therefore, we recommend using adapter.js until Chrome updates their API. That way, you only deal [&hellip;]","protected":false},"author":1396,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[],"coauthors":[301097,301096,301098],"acf":[],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v22.5 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>DTMF available in Firefox 52 - Advancing WebRTC<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/blog.mozilla.org\/webrtc\/dtmf-now-available-firefox\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"DTMF available in Firefox 52 - Advancing WebRTC\" \/>\n<meta property=\"og:description\" content=\"Firefox 52 now supports DTMF. Try it out now in webrtc samples! This means you no longer need workarounds to accomplish this. The spec JavaScript API we&#8217;ve implemented is newer and different from what is in Chrome at the moment. Therefore, we recommend using adapter.js until Chrome updates their API. That way, you only deal [&hellip;]\" \/>\n<meta property=\"og:url\" content=\"https:\/\/blog.mozilla.org\/webrtc\/dtmf-now-available-firefox\/\" \/>\n<meta property=\"og:site_name\" content=\"Advancing WebRTC\" \/>\n<meta property=\"article:published_time\" content=\"2017-02-22T14:43:20+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2018-03-23T20:43:51+00:00\" \/>\n<meta name=\"author\" content=\"dminor@mozilla.com, Michael Froman, Jan-Ivar Bruaroey\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"dminor@mozilla.com, Michael Froman, Jan-Ivar Bruaroey\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"2 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"WebPage\",\"@id\":\"https:\/\/blog.mozilla.org\/webrtc\/dtmf-now-available-firefox\/\",\"url\":\"https:\/\/blog.mozilla.org\/webrtc\/dtmf-now-available-firefox\/\",\"name\":\"DTMF available in Firefox 52 - Advancing WebRTC\",\"isPartOf\":{\"@id\":\"https:\/\/blog.mozilla.org\/webrtc\/#website\"},\"datePublished\":\"2017-02-22T14:43:20+00:00\",\"dateModified\":\"2018-03-23T20:43:51+00:00\",\"author\":{\"@id\":\"https:\/\/blog.mozilla.org\/webrtc\/#\/schema\/person\/b7903b7726087f6999c63c036314b140\"},\"breadcrumb\":{\"@id\":\"https:\/\/blog.mozilla.org\/webrtc\/dtmf-now-available-firefox\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/blog.mozilla.org\/webrtc\/dtmf-now-available-firefox\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/blog.mozilla.org\/webrtc\/dtmf-now-available-firefox\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/blog.mozilla.org\/webrtc\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"DTMF available in Firefox 52\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/blog.mozilla.org\/webrtc\/#website\",\"url\":\"https:\/\/blog.mozilla.org\/webrtc\/\",\"name\":\"Advancing WebRTC\",\"description\":\"Committed to moving Firefox and WebRTC forward\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/blog.mozilla.org\/webrtc\/?s={search_term_string}\"},\"query-input\":\"required name=search_term_string\"}],\"inLanguage\":\"en-US\"},{\"@type\":\"Person\",\"@id\":\"https:\/\/blog.mozilla.org\/webrtc\/#\/schema\/person\/b7903b7726087f6999c63c036314b140\",\"name\":\"dminor@mozilla.com\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/blog.mozilla.org\/webrtc\/#\/schema\/person\/image\/af732858a65119b5fde439df1412fcab\",\"url\":\"https:\/\/secure.gravatar.com\/avatar\/2ac711ca4c5ab8c8545725bcd618c037?s=96&d=mm&r=g\",\"contentUrl\":\"https:\/\/secure.gravatar.com\/avatar\/2ac711ca4c5ab8c8545725bcd618c037?s=96&d=mm&r=g\",\"caption\":\"dminor@mozilla.com\"},\"url\":\"https:\/\/blog.mozilla.org\/webrtc\/author\/dminormozilla-com\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"DTMF available in Firefox 52 - Advancing WebRTC","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/blog.mozilla.org\/webrtc\/dtmf-now-available-firefox\/","og_locale":"en_US","og_type":"article","og_title":"DTMF available in Firefox 52 - Advancing WebRTC","og_description":"Firefox 52 now supports DTMF. Try it out now in webrtc samples! This means you no longer need workarounds to accomplish this. The spec JavaScript API we&#8217;ve implemented is newer and different from what is in Chrome at the moment. Therefore, we recommend using adapter.js until Chrome updates their API. That way, you only deal [&hellip;]","og_url":"https:\/\/blog.mozilla.org\/webrtc\/dtmf-now-available-firefox\/","og_site_name":"Advancing WebRTC","article_published_time":"2017-02-22T14:43:20+00:00","article_modified_time":"2018-03-23T20:43:51+00:00","author":"dminor@mozilla.com, Michael Froman, Jan-Ivar Bruaroey","twitter_card":"summary_large_image","twitter_misc":{"Written by":"dminor@mozilla.com, Michael Froman, Jan-Ivar Bruaroey","Est. reading time":"2 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebPage","@id":"https:\/\/blog.mozilla.org\/webrtc\/dtmf-now-available-firefox\/","url":"https:\/\/blog.mozilla.org\/webrtc\/dtmf-now-available-firefox\/","name":"DTMF available in Firefox 52 - Advancing WebRTC","isPartOf":{"@id":"https:\/\/blog.mozilla.org\/webrtc\/#website"},"datePublished":"2017-02-22T14:43:20+00:00","dateModified":"2018-03-23T20:43:51+00:00","author":{"@id":"https:\/\/blog.mozilla.org\/webrtc\/#\/schema\/person\/b7903b7726087f6999c63c036314b140"},"breadcrumb":{"@id":"https:\/\/blog.mozilla.org\/webrtc\/dtmf-now-available-firefox\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/blog.mozilla.org\/webrtc\/dtmf-now-available-firefox\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/blog.mozilla.org\/webrtc\/dtmf-now-available-firefox\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/blog.mozilla.org\/webrtc\/"},{"@type":"ListItem","position":2,"name":"DTMF available in Firefox 52"}]},{"@type":"WebSite","@id":"https:\/\/blog.mozilla.org\/webrtc\/#website","url":"https:\/\/blog.mozilla.org\/webrtc\/","name":"Advancing WebRTC","description":"Committed to moving Firefox and WebRTC forward","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/blog.mozilla.org\/webrtc\/?s={search_term_string}"},"query-input":"required name=search_term_string"}],"inLanguage":"en-US"},{"@type":"Person","@id":"https:\/\/blog.mozilla.org\/webrtc\/#\/schema\/person\/b7903b7726087f6999c63c036314b140","name":"dminor@mozilla.com","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/blog.mozilla.org\/webrtc\/#\/schema\/person\/image\/af732858a65119b5fde439df1412fcab","url":"https:\/\/secure.gravatar.com\/avatar\/2ac711ca4c5ab8c8545725bcd618c037?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/2ac711ca4c5ab8c8545725bcd618c037?s=96&d=mm&r=g","caption":"dminor@mozilla.com"},"url":"https:\/\/blog.mozilla.org\/webrtc\/author\/dminormozilla-com\/"}]}},"_links":{"self":[{"href":"https:\/\/blog.mozilla.org\/webrtc\/wp-json\/wp\/v2\/posts\/248"}],"collection":[{"href":"https:\/\/blog.mozilla.org\/webrtc\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/blog.mozilla.org\/webrtc\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/blog.mozilla.org\/webrtc\/wp-json\/wp\/v2\/users\/1396"}],"replies":[{"embeddable":true,"href":"https:\/\/blog.mozilla.org\/webrtc\/wp-json\/wp\/v2\/comments?post=248"}],"version-history":[{"count":0,"href":"https:\/\/blog.mozilla.org\/webrtc\/wp-json\/wp\/v2\/posts\/248\/revisions"}],"wp:attachment":[{"href":"https:\/\/blog.mozilla.org\/webrtc\/wp-json\/wp\/v2\/media?parent=248"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/blog.mozilla.org\/webrtc\/wp-json\/wp\/v2\/categories?post=248"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/blog.mozilla.org\/webrtc\/wp-json\/wp\/v2\/tags?post=248"},{"taxonomy":"author","embeddable":true,"href":"https:\/\/blog.mozilla.org\/webrtc\/wp-json\/wp\/v2\/coauthors?post=248"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}