Twilio Application Failed Message - twilio

I have been trying to build a app that redirect a Twilio number to another phone number when a customer call Twilio number.
When callback URL does not return proper Twilml, it says "Application has failed" message on the call.
However, I do not want my customers hear that message even though there is a error.
Is there a way to turn that message off?
Thank you.

Twilio evangelist here.
There is no way to disable the error message, but you can set a Fallback URL on your phone number that Twilio will request in case the Voice Request URL fails.
You could set the Fallback URL to a simple static XML file hosted somewhere like Amazon or Dropbox, or use a service like twimlbin.com to host some backup TwiML for you.

Related

Twilio Advanced Opt-in not sending

I'm building a text service with Twilio and configured and enabled the Advanced Opt-out / Opt-in settings in my messaging service.
When testing the opt-in with my custom keyword I get this back instead my custom message
Thanks for the message. Configure your number's SMS URL to change this message. Reply HELP for help . Reply STOP to unsubscribe. Msg&Data rates may apply.
The screenshot shows my custom keyword and message. I'm using a toll-free number.
Any ideas as to why its not automatically sending the custom opt-in message?
When you receive opt-in messages to your number the webhook request is still sent to the URL you configure for your number. It looks like you haven't configured that URL for your number yet, as that is the default response for a new number.
Head to the Twilio console to configure your number and update the URL for when a message comes in. You can set it to your own application's URL if you have built that out yet, or if you are still working on that you could use a TwiMLBin with an empty <Response> which doesn't respond if you don't have an application yet.

Twilio Browser client Available or not

I am facing a problem with Twilio to detect the Twilio Browser client Available or not.
If Twilio client is not available then need to send the voicemail otherwise I am using to accept the call.
Twilio.Device.incoming(function (conn);
Thanks.
Sounds like you need agent presence. There are a couple ways to go about this. One (Recommended) is to use Twilio TaskRouter. https://www.twilio.com/taskrouter. This will handle agent presence for you (online, offline, busy, etc..) and much more
Your other option is to use a service like PubNub http://www.pubnub.com/ and bind the clint so you can get state information (online, offline, busy, etc..). This is more wok since you have to handle state yourself.
The following steps can be followed to achieve this
 1. Set a valid url to the action attribute of the Dial verb of the client
  Eg., The TwiMl to dial the client must be
  <Response>
   <Dial action="myapp/statusCallBack">
    <Client>jenny</Client>
   </Dial>
  </Response>
 2. If the client jenny is available, the connection object can be received via
  Twilio.Device.incoming(function (conn){conn.accept();});
 3. If the client jenny is unavailable, Twilio will request to the statusCallBack url with the parameter 'DialCallStatus=no-answer'. Now the following
  twiml can be returned to say Unavailable message.
  <Response>
   <Say>
    Please leave your name and number along with a short message.
   </Say>
   <Record maxLength="3600" action="myapp/recordedUrl">
   </Record>
  </Response>
 4. Now the voicemail url can be stored when the "myapp/recordedUrl" is called once the caller recorded the voicemail. For more info on record verb, visit this site
 Note that the voice mail is recorded on two cases, if the client is unavailable or the client does not accept the call.

Is there a way to see the response to Twilio's request to the SMS URL?

When I set my SMS Url for a given phone number and then send a text to that phone number, the request somehow fails. Is there a way for me to inspect the error response (404/500/403 etc) to see any exception details from my twilio dashboard?
Hi Twilio Customer Support here,
Have you viewed the app monitor?
https://www.twilio.com/user/account/developer-tools/app-monitor
It contains all of the errors that your account has recorded, you can drill down on each error to see the request body etc.

twilio browser to browser incoming message shows +19999999999 instead of client name

I'm following the php quick start guide, and when I try call from one browser client to another browser client, I see the incoming messages shows that the call is coming from "+199999999" instead of the name of the client who is calling. Is anyone else experiencing this?
It appears that this happens when you don't specify a callerId. After adding a twilio number to the callerId variable, the incoming call message now shows the call is my twilio number instead of +19999999. For those who are wondering, you can also change your the callerId to a client name in the format of client:yourdesiredclientname for when you are dialing to a client.

Twilio is sending the Message Fall Back URL text along with actual text

Initially I have been using the TwiML response to send response to my text messages. But since my requirement has changed and I need to send more than 10 messages in response to my text hence I am now using the Twilio API to send the message out. So to fix this now I am trying to send nothing as the TwiML response for my Text Messages and instead using the Twilio API to send the actual messages out. I also have a TwiML bin URL attached to my short code as a Message Fall Back URL in case Twilio is not able to connect to my REST API URL. So now when a Text message is received by Twilio it connects to my REST API and the response is sent. But I am getting the response from the Message FallBack URL first and then the actual response for my text message via the Twilio API. Is there anyway to avoid this? I can remove the Message Fall back URL but then what would happen in the actual case when Twilio is not able to connect to my server?
This is how I have added the code:
var twilioResponse = new Twilio.TwiML.TwilioResponse();
...... have code that uses Twilio API to send out more than 10 messages.
...... Since the messages are going out via Twilio API hence returning NULL to the TwiML response
return Request.CreateResponse(HttpStatusCode.OK, twilioResponse.Element);
More Updates:
As I mentioned earlier I'm using the REST API to send an SMS. When a Text request comes Twilio server calls my URL supplied to the REST call.
Sometimes my server is little slow in responding - in which case twilio gets the fallback URL message and passes on the text message.
How do I increase the timeout ? This timeout is the time the server responding with TWIML.
Please help - any pointers are appreciated.
Twilio evangelist here.
My first suggestion would be to check your accounts App Monitor to see if Twilio is logging any errors. The Fallback URL should not be getting requested unless Twilio fails to get a valid response from the primary URL.
The default timeout for a Twilio request is 15 seconds, so if your server is taking longer than that to respond there may be a bigger issue happening with your server or network.
Hope that helps.

Resources