how to send DTMF tones over sinch javascript web to PSTN calls? - sinch

I have been looking for a long time but cannot find anything regarding this little quest of mine. I have successfully implemented the sinch sdk into my system and its calling perfectly fine. Now I'd like to send DTMF tones if the call is answered by a PABX.

Hi on the call object there is a sendDTMF method DTMF key must be in [0-9, #, *, A-D].
Ios:
[call sendDTMF:#"1"];
https://download.sinch.com/docs/iOS/latest/reference/html/Protocols/SINCall.html#//api/name/sendDTMF:
Android
call.sendDTMF("1");

Related

How to receive a pulse in Javascript Sinch SDK call to PSTN

I can see in the JS reference how to send a dial tone, but how can I process an incoming one in the JS SDK?
In other words, I need the call receiver to be able to press a number in their phone to acknowledge something and trigger an action in JS
DTMF is not for the other end JS client to recieve, its for the rest api to react on, think IVR etc
See #Redaniums (https://stackoverflow.com/users/3339316/redanium) comment above https://www.sinch.com/docs/voice/rest/#PIE

Disallow user to make a call when there are no more credits: Sinch Javascript SDK

My application allows unlimited instant messages for free, but takes credits for calls. I want to be able to disallow user to make a call when he does not have any more credits. How in a ideal scenario is this managed using javascript SDK?
I am coming from a standpoint, that although I am able to control this behavior through some validations in code itself, but what happens when the user is a hacker? He can go to console and call javascript methods of its own such as removeListeners and then callClient.callUser(userId). How do you protect sinchClient in such case? Thanks.
Note: I am open to provide more information if the question is not clear.
Sinch exposes a REST based callback mechanism to control your call flow. You can set a callback URL in the Sinch Portal under Applications >> Voice and Video settings. Each call will then trigger a Incoming Call Event (documented here: https://www.sinch.com/docs/voice/rest/#callbackapi) and you can control whether or not to connect this call via the callback response.

Navigating an IVR with Twilio

I am trying to navigate an known IVR, that ends with the last input forwarding to a real person. When that person picks up, I want to make a call back to the app to play an mp3. Using sendDigits https://www.twilio.com/docs/api/rest/making-calls#post with call creation works for navigating the menu, but the callback to the url parameter happens when the call is answered by the IVR instead of the end user. So in that case, the mp3 is already playing by the time the person the call is forwarded to answers.
The other way I was thinking of trying involved not using sendDigits with call creation, but using a different url callback to grab TwiML and use Play https://www.twilio.com/docs/api/twiml/play to play the DTMF tones needed. In this scenario though, reading though the docs, I don't see a way to send a callback url that would be called when the call is forwarded and the person picks up.
Any suggestions?
Twilio developer evangelist here.
If you want a webhook when your DTMF tones are finished and the call is put through to a human, you could try your second option using <Play> to send DTMF tones and then use a <Redirect> to cause a new webhook to occur. Like this:
<Response>
<Play digits="1234"></Play>
<Redirect>http://example.com/play_mp3</Redirect>
</Response>
If you find that you are still playing the mp3 before a person has actually answered, you can use <Pause> to wait before sending the <Redirect>.
Let me know if that helps at all.

How to retrieve User's phone number from Twilio in Bot Framework?

Have the bot working just fine via SMS. Now looking for the best way to retrieve the User's phone number being used in the SMS conversation.
Seems like it should be pretty straight forward (easy to do in a native Twilio app), but just not finding the example code or way to get at it from within the Bot Framework using the C# libraries.
I played a bit with the ChannelData off of Activity, but it's not there or I'm not using it correctly.
Any pointers to relevant documentation or sample code would be tremendously helpful!
Your bot's Post handler receives a list of Microsoft.Bot.Connector.Activity when end users message the bot. Each Activity has a "From" Channel Account that contains an "Id" and "Name". You can find the Twilio phone number there.

Sending SMS via combination of Sinch and Parse

Me and my colleagues have been at out wits end trying to send an SMS through Parse which in turn should call Sinch and send the SMS.
Ideally speaking there is to be a cloud code at our Parse backend. This cloud code will be invoked by user through our (iOS + Android) app. When invoked this will inturn call the Sinch SMS sendMessage Function.
Is it necessary to buy a number to send an inbound SMS??
Because no matter what we try, nothing is working out.
If anyone knows of any alternative way working it out do please let us know.

Resources