In FreeSWITCH, would it be possible to capture DTMF without interrupting sound playback? play_and_get_digits app stops playback as soon as the required keypress is obtained.
I am trying to do this via ESL, hence session.stream wouldn't work. Have tried bind_digit_action, but it doesn't work at all while the sound is being played. Lastly, bind_meta_app wouldn't work as it requires a meta keypress like *, which messes up with the requirement.
You should be able to subscribe to events for a specific session and catch the DTMF events while playback or any other application is running.
Related
Is there any way to get a notification in my application when I set a timer (such as "5 minutes") by voice with Google Home?
I wish I could display the countdown time using an ESP microcontroller and a segmented display. Displaying countdown is easy, but I don't know if it is possible to programmatically know when a timer has started.
If you are building a Smart Home Action, you can use the Timer trait, which will enable you to query by voice how much time is left, as long as you set the commandOnlyTimer attribue to false (this allows querying and reporting the device state).
Your execute response can then also include the status of SUCCESS or any ERROR codes that may occur when setting the timer.
I am trying to get Alexa to play an audio sound to a specific speaker group on a button press. I have a doorbell button which is hooked up to my Raspberry Pi. I can detect when the button is physically pressed on the Pi so from here I want to some how issue a command to Alexa to play an mp3 file to a pre-configured speaker group (everywhere). Is this possible?
The Pi has node-red and MQTT installed so REST Requests are no problem!
The simple answer is no. The interaction with Alexa is user initiative most of the time. That means, user starts a conversation and then Alexa speaks or plays an audio. The only times that Alexa wakes up on its own is when there is a reminder or a notification (Proactive Events API). The Proactive Events API allows you to send notifications to users of your skill. When your skill successfully sends a notification to a user’s Alexa device, the user hears a chime sound that indicates a notification has arrived. The user can then say, “Alexa, read my notifications” and hear the details.
So, for your use case, it is not possible to wake Alexa to play the mp3 file as result of pressing a button.
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
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.
I have an audio player that uses BackgroundAudioPlayer together with AudioPlayerAgent. Everything is working fine, except there's one use case I don't know how to handle.
If I play an audio track in my application and then the user switches to another application, the audio track continues to play in the background as it should - but I guess my application has now been swapped to memory and is suspended.
My question is: if the user now starts to play music in another app, I do get the AudioPlayerAgent.UserAction.Stop action as a callback to my AudioAgent. But can I do anything about this now from my app's point of view? I mean, I would like to save the position of the audio playback where the user was in my app, but my app has been suspended, right?
When my app is in the foreground and the audio stops, I do get the BackgroundAudioPlayer.Instance.PlayerState.Stopped event. It's here that I normally save the position of the playback. But if the user switches to another app to play music, I don't get this event.
So I am just wondering how to handle this kind of case. Is there anything I can do to improve the user experience?
The only way is to save that Position to Isolated Storage in the agent code.
See this very useful article of Paul about how to use Background audio agent and the way to communicate between UI and agent side