How would we do this with Twilio
We need to add code that allows messages / calls only to be sent from 9 am New York time to 9 pm New York time
message can be sent from 9:00am - 8:45 pm. (this will give a 15 minute buffer to clear out the queue
Message can not be sent from 8:46 pm til 8:59 am New York time
There are past blogs that take advantage of JavaScript libraries to help with routing based on date/time of day. You can also apply this to SMS response behavior.
Using Twilio Functions to Add Custom JavaScript Code in Studio Flows
Related
I'm testing some flows that use outbound SMS via Twilio and have been really pleased and impressed by the magic numbers provided e.g. https://www.twilio.com/docs/iam/test-credentials
However, I'm interested to see how our application responds if there's some issue sending an SMS to a number where it essentially hits a timeout value. I haven't found a magic number such as this or know of a way to recreate the scenario, can anyone help me here?
Even if you were using a real auth credentials and real phone number (instead of magic number), I suspect Twilio just queues the request on their side and responds with a HTTP 201, so you'll always get a very fast response from Twilio, but it doesn't necessarily mean the message has been sent to a carrier and delivered to a device.
If you're using Twilio messaging services, you can subscribe to delivery status callbacks to get the status of a SMS e.g. sending, sent, delivered, failed, etc - see here. Note: I don't know if you'd receive callbacks with magic numbers - I suspect not... either way you can provision a Twilio phone number pretty cheaply to test e.g. in Australia (where I'm from) I can purchase a AU phone number for $6 per month and I can release the phone number when ever I want to stop getting billed for it...
If you just want your app to timeout on invocation of the Twilio API you can do something like the following (in .NET core) to force timeout a request in a specified amount of time (1 second in example below):
using var tokenSource = new CancellationTokenSource(TimeSpan.FromMilliseconds(1000));
response = await twilioHttpClient.PostAsJsonAsync($"2010-04-01/Accounts/{accountSID}/Messages.json", request, jsonSerializerOptions, tokenSource.Token);
If timeout is exceeded, an exception will be thrown that you can handle. Note: there's various networking tools that can be used to block or limit outbound requests, which you can use to test timeout scenarios.
When an API call is made after receiving an SMS via Twilio, I occasionally get the error below -
Error: Total timeout is triggered. Configured tt is 15000ms and we attempted 1 time(s)
The API call occasionally takes longer than 15 seconds to return a response (this is due to having to process the SMS etc.). How can I configure the total timeout to say 25000ms?
It is possible to override the timeout settings for a webhook. However, the maximum total time (tt) for webhooks is 15 seconds and you cannot increase it beyond there.
If you find your service cannot respond within that time, you might want to hand off the processing of the SMS to a job and respond to the webhook quicker. If you then intend to reply to the SMS, you can do so using the REST API message resource instead of TwiML.
I have a metric that sends me information from 8:30am to 12:30pm and from 2pm to 6pm how can I define an alert that makes sure I receive information during this time slot without taking into account the night and weekends because I receive nothing.
I use Grafana alert manager for alerts
my query :
sum(increase(rappellibrary_route_end_count_total{job="callbotRetraite", exitVdn="null"}[5m]))
Any ideas?
We implemented the change notifications subscription for channel messages as per the Microsoft Teams guidelines. We received the messages within 1 minute until 12-July-2021. Now we see a latency of about 2 - 15 minutes for sometimes notably on PST day time.
According to this link (https://learn.microsoft.com/en-us/graph/webhooks#latency) channel messages will be notified within 1 minute.
Could you please let us know what is causing this delay serving the request ?
We would also like to know if there is policy or priority on serving the notifications based on tenant type.
Thanks in advance.
On their documentation they specify that "Users can keep a 30-day message history". I assume this means that after 30 days the messages are deleted,is there anyway of extending this or disabling this feature?
We should change the word history, we store the message for delivery for 30 days. There is not really an inbox with sinch, its a delivery process so every message will be stored for 30 days to be delivered to all the users devices.