{"action":"created","issue":{"url":"https://api.github.com/repos/openpeer/ortc/issues/446","repository_url":"https://api.github.com/repos/openpeer/ortc","labels_url":"https://api.github.com/repos/openpeer/ortc/issues/446/labels{/name}","comments_url":"https://api.github.com/repos/openpeer/ortc/issues/446/comments","events_url":"https://api.github.com/repos/openpeer/ortc/issues/446/events","html_url":"https://github.com/openpeer/ortc/issues/446","id":145034163,"number":446,"title":"Reverse RTCRtpSender<->RTCDtmfSender composition","user":{"login":"murillo128","id":1070835,"avatar_url":"https://avatars.githubusercontent.com/u/1070835?v=3","gravatar_id":"","url":"https://api.github.com/users/murillo128","html_url":"https://github.com/murillo128","followers_url":"https://api.github.com/users/murillo128/followers","following_url":"https://api.github.com/users/murillo128/following{/other_user}","gists_url":"https://api.github.com/users/murillo128/gists{/gist_id}","starred_url":"https://api.github.com/users/murillo128/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/murillo128/subscriptions","organizations_url":"https://api.github.com/users/murillo128/orgs","repos_url":"https://api.github.com/users/murillo128/repos","events_url":"https://api.github.com/users/murillo128/events{/privacy}","received_events_url":"https://api.github.com/users/murillo128/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/openpeer/ortc/labels/1.0","name":"1.0","color":"009800"},{"url":"https://api.github.com/repos/openpeer/ortc/labels/1.1","name":"1.1","color":"0052cc"}],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":4,"created_at":"2016-03-31T22:20:22Z","updated_at":"2016-04-08T18:44:40Z","closed_at":null,"body":"Currently we create a new RTCDtmfSender by calling it's constructor and passing the RTCRtpSender as attribute. Then we have to inspect canInsertDTMF to check whether the RTCDtmfSender is capable of sending DTMF.\r\n\r\n```javacript\r\nvar sender = new RTCDtmfSender(sendObject);\r\nif (sender.canInsertDTMF) {\r\n  var duration = 500;\r\n  sender.insertDTMF(\"1234\", duration);\r\n} else {\r\n  trace(\"DTMF function not available\");\r\n}\r\n```\r\n\r\nThis seems weird to me, as canInsertDTMF refers to te ability to of the RTCRtpSender to send or not DTMFs and has nothing to do with the RTCDtmfSender object it self.\r\n\r\nThe natural way of doing that would be by querying the RTCRtpSender for it's RTCDtmfSender object as the sender MUST know if it supports or not dtmfs based on the media type/send codecs (removing then the canInsertDTMF property of RTCDtmfSender)\r\n\r\n```javacript\r\nvar sender = sendObject.getDtmfSender();\r\nif (sender) {\r\n  var duration = 500;\r\n  sender.insertDTMF(\"1234\", duration);\r\n} else {\r\n  trace(\"DTMF function not available\");\r\n}\r\n```\r\n\r\nWe can refine the pattern later in order to remove the telephony-event as a codec."},"comment":{"url":"https://api.github.com/repos/openpeer/ortc/issues/comments/207552231","html_url":"https://github.com/openpeer/ortc/issues/446#issuecomment-207552231","issue_url":"https://api.github.com/repos/openpeer/ortc/issues/446","id":207552231,"user":{"login":"murillo128","id":1070835,"avatar_url":"https://avatars.githubusercontent.com/u/1070835?v=3","gravatar_id":"","url":"https://api.github.com/users/murillo128","html_url":"https://github.com/murillo128","followers_url":"https://api.github.com/users/murillo128/followers","following_url":"https://api.github.com/users/murillo128/following{/other_user}","gists_url":"https://api.github.com/users/murillo128/gists{/gist_id}","starred_url":"https://api.github.com/users/murillo128/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/murillo128/subscriptions","organizations_url":"https://api.github.com/users/murillo128/orgs","repos_url":"https://api.github.com/users/murillo128/repos","events_url":"https://api.github.com/users/murillo128/events{/privacy}","received_events_url":"https://api.github.com/users/murillo128/received_events","type":"User","site_admin":false},"created_at":"2016-04-08T18:44:40Z","updated_at":"2016-04-08T18:44:40Z","body":"No, it would not be relevant.\n\nWe could return always an object and the check the canInsertDTMF\nEl 8/4/2016 20:06, \"Robin Raymond\" <notifications@github.com> escribió:\n\n> Given the above, would returning null still be relevant? i.e. the object\n> can exist if the dtmf codec is present or not but we get an exception upon\n> insert dtmf?\n>\n> —\n> You are receiving this because you authored the thread.\n> Reply to this email directly or view it on GitHub\n> <https://github.com/openpeer/ortc/issues/446#issuecomment-207540524>\n>\n"}}