How to record a voicemail if a number is not picked up on Twilio Studio? - api

I am currently using Twilio Studio to build a customer service process that allows clients to make calls to a Twilio number, which redirects to representatives.
How can I allow clients to send a voice message (voicemail) if the call is not picked up or if the call is not within working hours. Thanks!

Twilio developer evangelist here.
With the Connect Call To widget you can connect further widgets after either the call ending or the caller hanging up. In your case, you need to decide whether the call ended successfully or because the call wasn't picked up. You can do this by adding a Split Based On widget after the Connected Call Ended transition and testing on the DialCallStatus.
DialCallStatus can be any of completed, answered, busy, no-answer, failed, or canceled. In your case you are looking for "no-answer". You can use the Split widget to direct the flow onto the Record Voicemail widget when that happens.
As for calls not within working hours, that is a bit more complicated. To get the current time and compare to working hours will require you to run some code. You can do this with a Twilio Function, for example. There is an example application in the Twilio Code Exchange that implements this functionality but you would need to adjust it to use within your Studio Flow.

Related

Simple time-based chest push notification setup

Hello I am trying to create a simple push-notification system similar to this common use case:
1. The user gets a chest and can either watch an ad to skip the wait time or wait one hours for the chest to open. The app sends an upstream request which sets up a downstream push notification that shall be delivered in one hour to let the user know the chest is ready.
2a. The user then waits an hour, gets a push notification (outside of the app) to open their chest and they do!
or
2b. They wait 20 minutes then decide to watch the ad. The app sends an upstream request which cancels the pending push notification which would have otherwise been delivered in 40 minutes.
Okay awesome so that is the problem and I am having a hard time understanding how to do this. I have looked over the documentation for each of these programs but they seem designed for downstream push notifications. It just seems odd there is no built-in support for this use case. It seems like such a common use case.
I so far found 3 solutions that will integrate into my cross-platform Unity setup and provide services for free or super-cheap:
Amazon Simple Notification Service (SNS)
Google Firebase Cloud Messaging (FCM)
OneSignal
Amazon seems to group clients into "Topics" so I guess I would be setting up a one-device-topic and essentially. I can subscribe and unsubscribe from them but it doesn't seem to support a topic with a 60 minute delay.
2a. Create a topic: https://docs.aws.amazon.com/sns/latest/dg/sns-tutorial-create-topic.html (it would just include the current device)
2b. Subscribe to it
2c. Send a message to it https://docs.aws.amazon.com/sns/latest/dg/sns-tutorial-publish-message-with-attributes.html
So basically I can add attributes to my message but it would seem I need to implement the server-side code to read a delay attribute then somehow queue a message for delay. Maybe I am missing something?
For Firebase I pretty much see the same thing as Amazon. There are topics https://firebase.google.com/docs/cloud-messaging/android/topic-messaging and a means to send upstream messages https://firebase.google.com/docs/cloud-messaging/android/send-with-console but with the messages I don't see anyway here to get the time delay https://firebase.google.com/docs/cloud-messaging/unity/topic-messaging I see conditions towards the bottom of that article but I don't know if it is meant for this use case.
OneSignal has the easiest to scroll-through API. I'll refer to some strings that you can CTRL-F by using the format ("Create Notif") because everything is on this one page: https://documentation.onesignal.com/reference
So basically I can ("Send to Specific Devices") which I guess would be the sending device, then I can ("Schedule notification for future delivery.") using the send_after parameter. And finally, if need be, I can ("Cancel notification"). So this appears to be everything I need. I'm currently looking at this option and trying to figure out how to actually get this working.
So there is my progress over the last few hours researching each of these options. I am hoping you can help me better understand how I may be misunderstanding the above options as this seems to me a very common use-case. Perhaps I am just not googling the question correctly. Any help appreciated.
Whenever there's a likelihood that you'll need to cancel a significant percent of the notifications you send, you should use local notifications. That way you can easily schedule and cancel them locally without making any network requests. Also, this solution works for offline devices which is great for games (played on planes, etc...)

How to make asterisk dial a POTS number triggered by notification?

I'm setting up some higher end security systems for a client. I'm using blue iris (his request) which has alot of great options for alerting you via cell phone or POTS telephone call. Unfortunately the building is 100% VoIP with no POTS and the camera server is in that building. I want it to ring a house number via a Automated VOIP call when an event is triggered in blue Iris then play a pre-recorded message.
We have a couple of Asterisk/Elastix PBXes in the company. I'm not sure how to proceeded:
Blus iris event triggered, it sends message/request/alert to a extension on the PBX
PBX makes the automated call to the group of numbers whenever that extension is dialed/contacted/triggered/etc.
I'd use an external script file (PHP, Ruby, BASH) to generate your call request on the PBX. See my answer at [
Asterisk AGI - Originate a call using php agi
] for more details. However, what you're doing is entirely possible, as I do it myself for a couple of different solution sets.
Essentially, and most easily, you'd generate a call file via script and within it ensure you have a couple of channel variables set that are keys for specific routing. When the call connects at the far end, the near end goes into a dialplan on the ASTPBX where exactly what message is played, after-message behaviour, etc, is managed by the channel variables you've set.

Twilio - how to tell if incoming call while on another call in Client Browser

If a call is incoming when using a Client Browser (twilio.js) and I am already connected to an active call in the Client Browser. Client Browser doesn't ring or given any indication of an incoming call while I'm already on a call with someone else.
Is this a bug? What can be done about it so I can tell if there is an incoming call? I need to be able to answer that 2nd, 3rd, 4th, etc... incoming call should I have multiple people calling my Twilio number at the same time.
Kind of a late reply but you can use the Enqueue verb to place your callers in a queue, and then use the REST API with a javascript setInterval to list the callers in the queue. After that you can dequeue them with a Dial method or via the REST API.
We have crafted call-center functionality in node using a similar method where callers are placed in a queue which triggers a setInterval loop that monitors the queue for its members, and also looks for available agents to call.
For anyone interested I have solved this problem for myself, but in a different way to what #Ding suggests.
I'm not sure if the API has changed since this questions but you are able to access multiple Connections from a single Twilio.Device(). See this question for more details: Twilio call routing/management for small customer service team

Why does the Bloomberg API occasionally hang on certain commands?

I'm subscribing to live data with the Bloomberg API. Occasionally, it hangs on the call to session.Cancel(correlationID)
Anyone know why?
Where can I find documentation on the API?
I assume that you are talking about the .NET or Java API. In either case you should be able to find documentation (pdfs) by running WAPI on a Bloomberg terminal.
The Bloomberg API can be run in two modes - synchronous and asynchronous. So if you've taken some code example using WAPI and it happens to have been synchronous, you will face delays in your application.
The mode differs in the way data is accessed, for e.g.
the COM API in asynchronous mode would first send out the request using one procedure and another procedure is called back to execute when the data is fetched and ready, hence enabling the user to continue interacting with the GUI.
The synchronous mode would handle data requests and fetching in the same function with the same thread causing the app to hang. It won't make a big difference for the single value return types, but some large data sets could cause delays depending on your leased-line or internet bandwidth.
Is your question referring to the Bloomberg's Excel Add-In or its API Library releases to access live dataI? In either case, unless the data is not widely available to the public, and unless you have a special subscription arrangement from Bloomberg or other data feeds that can be sourced through the terminal, you are going to run into limits on the amount of live data that you are able to gather in any single interval.
To answer your second question, you can access Documentation for Bloomberg's Developers API here. And you can find Documentation and Resources for Bloomberg's API Libraries / Releases here.

Alternative to wcf callback.Is there one?

Wondering if there is a better option than a wcf callback.
When processing some data Invoices and printing them and I need to constantly show the user in a winform -"Invoice 1 Printed" invoice 2 printed etc....
I have put together a call back mechanism and all works but wondering if there is a better way of doing this .
Was thinking along the line if 2 services would be better than a callback.
One that loops at server side through the invoices and saves to the database the status ="Printed" and the other the queries it and check if it has printed and return to the user
.
Would that be better than a callback,faster and avoid timeouts etc..?
Just thinking as an alternative as a collegue who used callback extensively said" dont use callback use 2 services".
What would you do if you had to process 2000 invoices and notify the user for each one
Any suggestions?
On one project we have done the following:
All windows clients also host a WCF service
When the windows client starts it registers itself with the server, that this user is loggon with this IP address.
The server stores info on who is logged in where
Then we can send a message to the user whenever we want
When the client recieves the message we fire an event, then whatever part of the UI that is affected can update itself or show a message.