Author Topic: Twilio Timeout  (Read 11788 times)

jgiambo

  • Newbie
  • *
  • Posts: 39
    • View Profile
    • Sacramento Search and Rescue
Twilio Timeout
« on: May 10, 2013, 04:06:36 PM »
If a user calls the Twilio number can we have a timeout and hangup option after like 5 minutes.  I have had several users make calls lasting 90-120 minutes.
Joseph Giambo
Sacramento Search and Rescue
Overhead Coordinator.

Radishworks

  • Hero Member
  • *****
  • Posts: 1318
    • View Profile
Re: Twilio Timeout
« Reply #1 on: May 12, 2013, 07:14:59 AM »
A reasonable request, but after messing with it for a bit its a little harder than you might think.  MM hands a lot of the call managing over to Twilio and there is not "easy" way to limit the length of the call.  I'll keep fussing with this a bit, but it might end up on the wish list.

jgiambo

  • Newbie
  • *
  • Posts: 39
    • View Profile
    • Sacramento Search and Rescue
Re: Twilio Timeout
« Reply #2 on: May 14, 2013, 08:32:40 AM »
Maybe setup a loop count. Play recording 5 times then hang up?
Joseph Giambo
Sacramento Search and Rescue
Overhead Coordinator.

Radishworks

  • Hero Member
  • *****
  • Posts: 1318
    • View Profile
Re: Twilio Timeout
« Reply #3 on: May 14, 2013, 10:19:45 AM »
Quote
Maybe setup a loop count. Play recording 5 times then hang up?
Yes, this was one of the ideas I messed with.  Without getting too technical:  because the way the script resets each loop, this would require a lookup table for each inward call.    Very doable, but its not a 5 minute code change.   ;D

SDCART1

  • Jr. Member
  • **
  • Posts: 98
    • View Profile
Re: Twilio Timeout
« Reply #4 on: May 25, 2014, 10:57:03 AM »
Well this issue has come up on my message line.  Over the past three months, phone calls lasting up to 4 hours each (that's a lot of time listening to my 1 minute message!) have sucked $40 out of my wallet.The helpful people at Twilio fraud said: "Oh, you need to limit the number of playbacks" then directed me to a TwiML app.
https://www.twilio.com/docs/api/twiml/play#attributes-loop
I can't figure out if I am supposed to put it in my Twilio account or somewhere in MM, neither of which are obvious.

Very frustrating.

SDCART1

  • Jr. Member
  • **
  • Posts: 98
    • View Profile
Re: Twilio Timeout
« Reply #5 on: May 25, 2014, 12:03:52 PM »
I heard back from Twilio support.  That link is to code that would need to go into MM.  They won't control message line infinite loops on their end.  Why should they.  They make money for every minute.  Here is my back & forth with their tech support, in revers chronological order:

 
James Smith (Twilio)
May 25 11:49 AM
Hello Tony,
You actually need to change your application that you currently have your twilio number pointed to:
http://www.radishworks.com/SearchManager/MsgLine.php?SID=xxxxxxxxxxxxxxxxxx
You need to get with whom ever hosts or wrote this for you and change it there.
Does this make sense?
Regards,
James
Twilio Support

 
Tony Sawyer
May 25 11:46 AM
That still leaves the question of where exactly I would do that. I tried using your second example in Twilio on the application option for my phone number, but it would only let me enter a URL. No additional lines or commands were allowed. Once again, is this something I can do directly in Twilio, or do I have to modify code on the web site that is hosting my message?
Tony V. Sawyer
 
James Smith (Twilio)
May 25 11:34 AM
Hello Tony,
Please see link I provided below:
instead of
<?xml version="1.0" encoding="UTF-8"?>
<Response><Gather numDigits="1"><Play>http://api.twilio.com/2010-04-01/Accounts/xxxxxxxxxxxxxxxxxx/Recordings/xxxxxxxxxxxxxxxxxx</Play></Gather><Redirect/></Response>
You would do something like
<?xml version="1.0" encoding="UTF-8"?>
<Response>
    <Play loop="10">https://api.twilio.com/cowbell.mp3</Play>
</Response>
Regards,
James
Twilio Support

 
Tony Sawyer
May 25 11:12 AM
OK. Is this loop application something I put somewhere in my Twilio settings, or is it something that has to occur outside Twilio on the web site I direct Twilio to? I tried adding then editing an App in Twilio, but all I got were error messages. Now my balance is below zero. Needless to say, I am not anxious to put more money in, just to have it sucked back out.
Thanks.
Tony V. Sawyer,

 
Tony Sawyer
May 25 09:45 AM
Thanks. I will give it a try.
Tony V. Sawyer

 
James Smith (Twilio)
May 25 09:40 AM
Hello Tony,
Thank you for reaching out. You appear to be using a <redirect> which will play the message over and over until the caller disconnects.
This call for example:
https://www.twilio.com/user/account/log/calls/C
It looks like it just redirected over and over.
I would recommend using a loop instead:
https://www.twilio.com/docs/api/twiml/play#attributes-loop
Regards,
James
Twilio Support

 
Tony Sawyer
May 25 09:32 AM
Account Sid:
 
Target Phone Number:
555-555-1212
Abusive phone number:
numerous
Services being affected:
SMS Voice
Type of abuse being experienced:
I use this number for a volunteer disaster response team message line. It is for my team to call and hear info on the current disaster. These messages are usually less than one minute in duration. No message can be left by a caller. In the past three months, I have received a bunch of calls from various numbers lasting from 15 to 240 minutes! How do I truncate incoming calls after a fixed period of time, say 2 minutes?



<Edited by Support to remove API key and phone number>
« Last Edit: May 27, 2014, 07:07:16 AM by Support »

Support

  • Administrator
  • Full Member
  • *****
  • Posts: 180
    • View Profile
Re: Twilio Timeout
« Reply #6 on: May 27, 2014, 09:45:05 PM »
It would be problematic for some teams to have a time limit to their Twilio message length. As you know, outgoing phone calls made by MM through Twilio play once and then hang up. But incoming calls to the message recording line keep looping. Well they used to. They will now loop 10 times and then hang up. That will have to be the compromise as some teams asked for the looping in the past.

SDCART1

  • Jr. Member
  • **
  • Posts: 98
    • View Profile
Re: Twilio Timeout
« Reply #7 on: May 28, 2014, 07:14:19 AM »
Perfect.  Thanks.