What should be the best way to recognize that a number is connected to a fax without actually sending faxes around ?
I suppose that a short phone call can be made: the goal is to determine if a number that is declared as a fax line is really a fax line, working and available.
If you can make a phone call, many faxes create a "Fax Identification tone".
This signal may be sent by the Terminating FAX machine anywhere between 1.8 to 2.5 seconds AFTER answering the call. The CED signal consists of a 2100 Hz tone that is from 2.6 to 4 seconds in duration. The CED tone is useful for disabling any echo cancellers on the line.
The CED also incorporates a "silent" interval following the 2100 Hz tone. This interval lasts from 55 to 95 (75 +/- 20) mS. Following this interval, the Terminating FAX machine will initiate the Pre-Message Identification procedures by transmitting a 300 BPS "Line Turn-around" preamble.
Some older faxes do not support that though, no idea how they can be triggered (i.e. by you sending a tone first, but that could be really annoying if you have a phone instead of a fax number)
I understand your question as that you have a list of fax-numbers in your customer database and want to verify that those numbers still are valid.
Then you could use TAPI to programatically call those numbers and check if its a fax that answering, no need to actually send any fax, just connect and ask the device (fax) what capabilities it has.
Here are Microsofts information about their TAPI
An easier way could be to have a fax modem on the com-port and using ATI-commands to call the device and send ATX3D and see if the device answers with ATA. (Or something similar, it was ages ago I programmed modems..)
It's essentially impossible.
They make line-sharing switch devices. For example, visit http://www.faxswitch.com/ to see their offerings.
The line appears like a voice line until you send a fax recognition tone. Then the line switches to a fax machine, if one exists.
So, a single number can be voice and fax.
A quick and dirty way of testing if a number is a fax number would be to google (using some API) for "Fax [number]".
e.g.
http://www.google.co.uk/search?q="Fax+01422+329262"
Not in New Zealand at least.
Here, Fax-Numbers do not differ from normal numbers in terms of namespacing.
A fax number may be only 1 digit ( the rightmost ) different from their normal line, or even a company may not have distinct FAX/Phone lines, and they just share a line and use tone detection to initiate fax protocol instead.
Also, you don't need to register with anybody to have fax services work on your phone line, so there's no index you can look up to see if its a fax or not. The only way to know is initiate a call, and see if you get a fax response, and even then, if the Fax happens to be turned off, you'll get a false negative.
I think your question may turn out to result in hunting for phantoms.
Oh, and for additional fun, you may have desktops with their dialup modem plugged into the wall merely emulating a fax device :). If you don't want to include these as "fax machines". you will be most likely out-of-luck.
First, there isn't anything inherent in the number that identifies it as a fax line. Even the phone company doesn't know - it's just a device attached to the wall jack, by the customer.
At some point you just have to trust the user. However, try the following ideas as well:
On each fax, publish a number (preferably toll-free) where the recipient can call to cancel. In some localities this might be a requirement anyway - "unsolicited" faxes are considered abusive in much the same way as spam since they can entail both material and bandwidth costs for the recipient. This will protect you in the eventuality that someone subscribes a number that doesn't belong to them.
Add some kind of error threshold to your software that will halt fax attempts once n attempts fail, and flag the number as inoperative. If you have some other way to contact the user, you could notify them of this event. The same principle works for e-mail addresses - I've received snail-mail notifications from companies when I changed e-mail addresses and forgot to notify them; once the e-mail had bounced a few times, they sent a courtesy letter to remind me to update it.
Many old fax lines are set to automatically pick up even on a voice call, so you could just call and check. On the other hand, it won't work on a lot of new ones, so while you could tell that one is a fax line, you couldn't tell it wasn't.
I'm sure a fax is a modem, so if you connected to it - using AT codes maybe (how 1990's!), you could determine from the response codes that there was a fax there - but you still have to make the call, make the negotiation etc - just dont send a page.
Related
Sorry if this isn't the proper channel for this question; it's hard to tell where else to put it.
Primary Question
Given a phone number (in my case: US or +1), I want to know whether that phone number is designated for use with mobile or landline phones (exclusive or). (Optionally: can I determine whether they were ported?)
I know that the ability to port numbers implies that no data on this is 100% accurate. I'm only looking to be about as accurate as existing services like Vonage's Number Insight API, or PhoneValidator.com, without giving them my customer's phone numbers directly. I'd preferably like to know how they acquire their information so I can replicate it.
I do know that NANPA publishes Central Office Code Assignment Records, which is enough to get me the company who 'owns' a block of numbers, but that doesn't necessarily tell me whether they're mobile or landline blocks.
Reading the TYPE from Google's libphonenumber gives the rather unhelpful FIXED_LINE_OR_MOBILE response, whereas I'm looking for which device type specifically.
Secondary question:
Given that NANPA hands out phone numbers in blocks of 1000, am I safe to presume that a random number within that block is representative of the whole block? In other words: does 222-222-2000 being a mobile number imply that 2000 through 2999 is?
Thank you!
So I get spoofed calls and they're annoying; however from a little reading it seems like all the spoofing is only done in the Caller ID field, but that there are additionally 2-3 ANI fields that generally are used for carrier billing that are much more difficult to spoof. I also have both legitimate friends and spam calls that use blocked numbers, and again it seems it's just Caller ID being left blank and ANI still being submitted. (please correct if this assumption is wrong/there's a better value to use instead)
My end goal is to set up a "public" number that I give out to people, and that "public" number would read the ANI data, "fix" the caller ID, then forward the call to my actual number/send me a text/notification with the real number. My understanding is this is possible if I internally forwarded the call to an 800 number I own first (then forward the number back to a non-800 number to avoid charges) but I haven't seen this mentioned in any Twilio/Bandwidth.com/etc APIs - they mention a 'from' field but not how that field is determined. I've seen products that do this like Trapcall so I know it's possible somehow, but would prefer not to forward all my calls to a number I don't control.
How do I do this? If I forward a call with a fake/blocked caller ID to an 800 number on Twilio/Bandwidth will the from number of that forwarded call be automatically corrected/unblocked? (And would I be able to compare the from of the original call to the from of the 800 call, where a mismatch would mean a spoofed number?) Or is there some specific way the 800 number has to be setup for this/the 800 numbers off of Twilio don't work at all/etc?
I also read that ANI is not very reliable on VOIP calls, and VOIP calls are more or less anonymous. Is there any way to find out whether an incoming call is being made from a VOIP service or from an actual landline/mobile? I know there's the Caller ID lookup, but if we assume that data is unreliable can we find out just from data made available during the call itself?
Figured it out, it does work from toll free #'s, it's just twilio specifically didn't work with it. worked with other providers.
TL;DR Twilio calls keep failing-- I think i've been filtered/blacklisted by carrier. What is limit I'm hitting up against and/or best practice around this.
Further description
I'm trying to automate leaving voicemail in an outbound sales effort.
After a handful of calls, any further calls for a given number return 'Failed', with description 'Invalid Phone Number' 13224.
I'm assuming I'm being throttled by the carriers for suspicious/annoying robo-dialing.
Are there rules of thumb for avoiding this blacklisting?
Twilio developer evangelist here.
Error 13224 does suggest you have invalid numbers rather than are being blocked. The full message is:
Dial: Twilio does not support calling this number or the number is invalid
This error occurs when the provided number is not in E.164 format; for example using local dialing pattern 01234567890 instead of the full E.164 address +441234567890. This can also occur when calls are attempted to non-existent country codes, area codes, or exchanges. For example, there is no +693 country code, no +1238 US area code, and no 555 US exchange.
This can also occur with properly-formatted, valid destinations if none of Twilio’s carrier partners are able to deliver the call; for example a telecom network outage in the phone number’s local area.
Have you ensured the numbers you are dialling are in fact in full E.164 format?
We are leaving a voice message (using an MP3) using Twilio's answering machine detection. We are seeing in our logs the correct calls to/from the API (answered by answering machine, post of our recorded message)...no error.
But the persons were are testing on, only 1/4 are actually getting a voicemail. The rest receive no voicemail, even though the logs show the correct API calls...? What is happening here?
Here is the code to call the twiml.
if (Request.Form["AnsweredBy"] != null)
{
switch (Request.Form["AnsweredBy"])
{
case "machine_end_beep":
case "machine_end_silence":
case "machine_end_other":
SaveTwilioMessage(transaction.Campaign.Id.ToString());
//var machineResponse = new VoiceResponse();
if (!string.IsNullOrWhiteSpace(transaction.Campaign.VoicemailMessageUrl))
{
response.Play(transaction.Campaign.VoicemailMessageUrl);
}
else
{
response.Say(transaction.Campaign.VoicemailMessage, voice: _voice);
}
return new TwiMLResult(response);
case "human":
case "fax":
case "unknown":
default:
break;
}
And here is the call that generates this:
var call = await CallResource.CreateAsync(url: callbackUrl, to: new PhoneNumber(phoneNumber), from: new PhoneNumber(fromPhone),machineDetection: "DetectMessageEnd");
var result = new TelephonicResource(call.Sid);
return result;
Any thoughts?
Twilio developer evangelist here.
When using Twilio's answering machine detection you have two options for detecting a machine. You set answering machine detection to on by supplying a MachineDetection parameter to the REST API request to make a call.
The MachineDetection parameter can be either Enable or DetectMessageEnd. If you want to leave a message after the answering machine message is complete you need to use DetectMessageEnd.
Then, when you get the webhook callback for the start of the call you get an extra parameter, AnsweredBy, which is either machine_end_beep, machine_end_silence, machine_end_other, human, fax or unknown.
If you get machine_end_beep, machine_end_silence or machine_end_other then you should be able to leave your message then. For other results you can handle them as you would a normal call.
If you just use MachineDetection=Enable then Twilio will attempt to connect you to the call with the result as soon as it has figured out if it is human or machine. If you want to leave a message, I would not choose this option.
Let me know if this helps at all.
Answering my own question here. Finally got some support from Twilio after pushing up through sales - after ticket remained open and unworked for days.
Basically, if you want to pull off AMD successfully, you need to be able to respond within 150ms. On our calls, the voice mails were starting, detecting no sound, and saying "we're sorry, but you're not talking...then our message would start". The correction was to do less DB lookups in our API calls by changing programming practice, and moving our MP3 to somewhere on the East coast (AWS preferred).
We investigated this...and found that while our API response was taking ~1 second, the AMD was sometimes waiting 15+ seconds after the beep to play the message. Still confused.
We are using Twilio AMD to broadcast phone appointment reminders, and have similar difficulty with leaving voicemail messages. Having tested this on about 50 calls, we see cases where the AMD detects a 'machine_end_silence' well before the 'beep' that should trigger the PLAY. So when you listen to the recorded call, the PLAY is occurring at the same time as the "your call has been forwarded to an automated voice messaging service...please leave a message...". So the API calls all look correct, but the user doesn't receive a voicemail (as the play message wav file ends just before the beep).
We saw other cases where the AMD doesn't hear the beep - and instead waits for the machineDetectionTimeout before playing the wav - leaving a long gap of dead air on the receivers voicemail. Even within my small development team we saw differences in behavior. For instance, we made test calls to a few iphones that all had the same default voicemail setup (the setup you get when you haven't recorded a custom greeting) on the same Verizon service plan. So the AMD should be hearing the exact same answer. Yet, AMD would detect the 'beep' on some of our phones, but not all of them.
Given all these challenges, we found that it's a good idea to leave a 'longer' version of the message (repeating the critical information a few times). Assuming your message is longer than the machineDetectinTimeout - you at least get some of your message saved on the voicemail.
Working on a fun element for a big company event.
I would like to find a way to call 200 UK cell/mobile numbers as simultaneously as possible and deliver the same recorded message to each of them. All of the target devices belong to people attending the event.
Anybody managed to do something similar?
I think I could do this with Twilio's APIs, but a more packaged solution is preferred.
Any risk of overwhelming the local cells by trying to start a call with so many devices in the same area at once?
Twilio Evangelist here.
This is totally possible with Twilio and some simple programming logic. With the numbers you have, you can loop through them and create phone calls like so (in Python):
for num in number:
# Create a phone call
client.calls.create(
to=num,
from_='MY_TWILIO_NUMBER',
url='http://mywebsite.com/instructions.xml'
)
The url here (final line) will provide some basic TwiML to play an MP3 file.
There are solutions for this available, but it is likely you'll be able to build this in software faster than you will be able to get the solution running, especially if this is for a one-time event and you have some software people handy.
If you need any help, let me know!