Twilio Fax API - how to get the failure reason for failed fax send - api

Hi all (especially Twilio evangelists out there)
I've connected my EMR app to Twilio in order to send faxes, and it works reasonably well, however there's one big problem I'm running into. Some faxes fail to send, and I can't find the reason for it. If the line is busy, or if there's no answer, Twilio marks the fax instances accordingly, and I can attempt a retry or whatever. But in some circumstances I do not understand, a sent fax immediately comes back as Failed through the webHook. So it gets "queued", but the first message I receive from the webHook is FAILED - no additional data whatsoever.
I've tried checking the developer tools Debugger, but there nothing there - it's 100% blank (checked last 30 days). I know from my test account that I should find the failure reason there, if there's something wrong with my implementation (e.g., if Twilio can't fetch my PDF, or I don't provide the "from" number, etc). But on production account, it's empty.
Faxes that I send to myself (Toshiba multifunction) work just fine, report busy when busy, etc. But the faxes sent to other companies fail, though I'm quite sure the numbers are OK. I was wondering if anybody can make a list of the possible reasons for a fax to fail? And I was also wondering why Twilio doesn't send more details on Failed faxes, it would be very helpful to know what happened from my logs...
Thanks,
Vic

Here's a trick that works well, at least when you're just figuring it out. Instead of taking the time to set up a statusCallback URL to handle the error, use an invalid url. This will cause an "Error - 11200 HTTP retrieval failure" in the Twilio debugger, which will include the POST request parameters, including any ErrorMessage.

Twilio evangelist here.
The statusCallback parameter makes as request to a URL when the status of the fax changes and includes parameters like Status, ErrorCode and ErrorReason.
curl 'https://fax.twilio.com/v1/Faxes' \
-X POST \
-d 'To=%2B15558675309' \
-d 'From=%2B15017250604' \
-d 'MediaUrl=https://www.twilio.com/docs/documents/25/justthefaxmaam.pdf' \
-d 'StatusCallback=https://example.com/statusUpdates' \
-u ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX:your_auth_token
Twilio Fax is still in beta but I know that adding the ability to display fax logs in the Twilio Console is planned.
Hope that helps.

Related

Sonos API subscription callbacks stopped

I have perl on apache http service that's been working fine for several years to issue sonos cmds and receive callbacks. About two weeks ago, I stopped receiving any callbacks.
I subscribed successfully (response={}) for groupVolume, playbackMetadata, and playback events.
I am successfully getting webhook messages from other services (e.g., Vonage) using https, so it seems the port is open to my server, and apache is successfully processing these requests. I see no trace of any messages from the sonos api in my apache logs.
I have no trouble issuing commands (setMute, getFavorites, getPlaybackMetadata, etc.). Only the callbacks are a problem.
I ran the ssltools checker from digicert but found no issues.
I can't recall making any changes to the home router config.
Does anyone else have a problem like this or know how to diagnose what's happening?
I installed WireShark but am overwhelmed with the functionality and don't know how to narrow down what I should be looking for to see if the messages are being received and blocked somehow.
it may be unlikely, but is it possible that there isn't any usage of your integration that would result in callbacks being sent to your service? For example - if volume isn't being changed, or playback isn't happening, you won't receive events.
If that's not the case, additional information is required to debug this issue. Could you please email developer-feedback#sonos.com with the following information:
The name of your service/application
The date/time your service stopped receiving callback events. You said about two weeks ago, but could you be more specific?
The clientId used by your code. This is the UUID you generated when you initially created the "API Key" on developer.sonos.com. Format is xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx (note - we do not need the secret associated with this key).
With that information we should be able to determine the cause of your missing callbacks.

Heroku Intercepting Some Gmail Incoming Messages

I am serving my Rails 3 app on Heroku, my mail through Google, and the domain through Enom. This is for www.challengage.com
This works 95% of the time, however, once in a while, when someone tries to reply to an email I send them, it fails with the below error message because my email, josh#challengage.com, somehow got replaced with josh#herokuapp.challengage.com when they recieved it. I think it has something to do with Mail Delivery Subsystems, but I'm not sure. It also only seems to happen when emailing University professionals.
Error Message:
From: Mail Delivery Subsystem [mailto:MAILER-DAEMON#smtp2.syr.edu]
Sent: Monday, July 15, 2013 2:08 PM
To: David DiMaggio
Subject: Undeliverable: FW: Challengage - Work Team Simulation product for interviewing evaluations
Delivery has failed to these recipients or groups:
paul#challengage.herokuapp.com
The server has tried to deliver this message, without success, and has stopped trying. Please try sending this message again. If the problem continues, contact your helpdesk.
The following organization rejected your message: challengage.herokuapp.com.
Any ideas?
Thanks everyone.
This is almost certainly because you're using a CNAME for your email records.
Although most email servers will reflect the original domain when sending a message, others will replace it with the domain that's at the end of the CNAME.
This means that instead of sending to someone#challengage.com they send to someone#challengage.herokuapp.com instead.
The mail server sees the request to send to someone#challengage.herokuapp.com and decides that it doesn't look after challengage.herokuapp.com and so from it's perspective the message is rejected.
We used to see this issue with CloudMailin customers and started to recommend that they don't use CNAMES where email is involved and just make use of adding MX records direct to the Apex domain.
With Heroku this poses a problem though as you don't have a single IP that you can use to access their servers. We eventually ended up using Route 53 to host our domain, then adding an SSL endpoint (to get load balancer details) and then adding that load balancer to Route 53's Alias command so that it automatically always gave the correct results. Alternatively you can setup some sort of static IP based system on your apex domain to redirect.

IronMQ push queue sending unknown HTTP requests

I setup my push queue endpoint as POST /iron, which works fine. But I'm getting a bunch of other requests too. Are these from Iron.io? What's the point of them? They're just filling up my Apache log. My server is returning 500 errors for all of them (500 instead of 404 in development mode).
POST /webhooks
POST /orders/webhook
POST /api/orders/webhook
Edit: I looked into it using multicast and noticed only my first server was getting these weird requests. They seem to be totally unrelated to iron.io. I guess it's just coincidence they're webhook requests and I just noticed them now. Probably someone put my server as an endpoint for their webhooks. >_<
If you added all those endpoints (subscribers) to your queue it's possible that IronMQ sends multiple requests. Check your queue's subscribers list.
GET /projects/{Project ID}/queues/{Queue Name}
If it contains multiple endpoints and its type is multicast - this is the reason of multiple requests on your side. In this case remove all odd subscribers (or setup new queue).
DELETE /projects/{Project ID}/queues/{Queue Name}/subscribers
In other case contact support ( :
More information at http://dev.iron.io/mq
IronMQ won't send any "unknown" requests. If your endpoint doesn't return a 200, the push queue will keep retrying the message until it either a) receives a 200, or b) fails the "max_retries" number of times.
Also per Featilion's answer, check the multicast/unicast/subscriber setup as well. If you are getting requests to those other endpoints then there's something up with your subscriber setup.
Feel free to jump into live chat if you don't figure out your answer rather quickly.

Strophe gets invalid SID

I'm building a web based client with strophe and jquery and I'm using openfire as server.
Almost everything its working, I can get the roster list, send and receive messages, but when I'm trying to change my presence from avaliable to xa or dnd or any other else the server stops answering and I start to get 404 errors on my POSTs and invalid SID messages like this: "NetworkError: 404 Invalid SID. - http://myurl.com/".
I've been through other topics around and it seems to be a problem with my avaliable credentials, but I don't have any clear evidence of what's wrong.
thanks in advance for any help.
I'm also using Strophe and for me everything works just fine! I don't know what could be you problem, since you didn't share your code with us, so my answer probably won't help you, but here's what I do to update my presence:
connection.send($pres().c('status').t('dnd or any status you want'));

black screen and error 400 bad request

I was trying telnet into a Web server and send a multiline request message. I have to include in the request message the If-modified-since. I made settings for Win7.
For instance when I type telnet edition.cnn.com 80 on my command prompt, it opens a black empty screen, I don't see any thing that I type.
Then I wrote this line on the black screen GET pageName HTTP/1.0, it returned 400 Bad Request Error and says connection closed. What should I do? I used get pagename for an example.
If you want to use e.g. a telnet client to manually get web-pages, you have to remember the format of a HTTP request header:
GET pageName HTTP/1.0
additional header
additional header
Note that the last line is an empty line. You might also need HTTP/1.1 for certain headers to make sense. Please read a HTTP specification for more information and what headers are standard.
The "black screen" is simply the telnet program running in a command window.
400 is an HTTP error code, meaning you did succesfully send a message to the server, it was just invalid HTTP (probably a simple typo)
The black screen and not seeing what you type is 'normal' behavior for telnet (at least I always had that).
If you use a tool like Putty you can see what you type, so it becomes easier to do this sort of thing, and spot your typo.
See the tutorial here: http://www.hellboundhackers.org/articles/571-spoofing-http-requests-with-putty.html
Hope this helps you.
If you need to anything other than basic interaction with the web server I'd suggesting using a tool specifically made for the job, for example cURL. It will allow you set headers etc.
curl -H "If-Modified-Since:04-Nov-2012 11:59:00 GMT" http://host.com/21838937.asp