{"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":5,"created_at":"2016-03-31T22:20:22Z","updated_at":"2016-04-09T13:51:31Z","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/207793276","html_url":"https://github.com/openpeer/ortc/issues/446#issuecomment-207793276","issue_url":"https://api.github.com/repos/openpeer/ortc/issues/446","id":207793276,"user":{"login":"robin-raymond","id":2962646,"avatar_url":"https://avatars.githubusercontent.com/u/2962646?v=3","gravatar_id":"","url":"https://api.github.com/users/robin-raymond","html_url":"https://github.com/robin-raymond","followers_url":"https://api.github.com/users/robin-raymond/followers","following_url":"https://api.github.com/users/robin-raymond/following{/other_user}","gists_url":"https://api.github.com/users/robin-raymond/gists{/gist_id}","starred_url":"https://api.github.com/users/robin-raymond/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/robin-raymond/subscriptions","organizations_url":"https://api.github.com/users/robin-raymond/orgs","repos_url":"https://api.github.com/users/robin-raymond/repos","events_url":"https://api.github.com/users/robin-raymond/events{/privacy}","received_events_url":"https://api.github.com/users/robin-raymond/received_events","type":"User","site_admin":false},"created_at":"2016-04-09T13:51:31Z","updated_at":"2016-04-09T13:51:31Z","body":"Then is it better to have a getter for the object since it cannot be null vs a constructor? The CG had a meeting and I argue in favour of factories but others argued in favour of constructors. I lost that argument...\r\n\r\nSo if we made a getter \"factory\" that would fit less the pattern than constructors. Given it can't be null, I'm not sure we need to/should change it or not.\r\n\r\nAlso, what happens if someone attempts to create this on a video media sender? I would say that should cause an invalid state exception.\r\n"}}