PCRABLE@eecs.nwu.edu (VAX WIZZ) (10/04/89)
Hi out there in telephone land...
I'm hoping one of you telephone experts can help me with this problem.
I am dealing with a string of numbers returned by a PBX with Call Data
Reporting. What I need to do is divide the string into three separate
numbers: area_code, exchange and extension. I can parse the digits
fine for calls to the US, Canada, and Mexico. The problem comes with
international calls. I know to look for the country code after the
011 international access code. (The access code is 011 in New York,
right?) How can I tell whether to take the next two or the next three
digits as the country code ?
Any suggestions are welcome...
==============================================================================
Phil Crable PPPPPPP BBBBBBB SSSSSS
Public Broadcasting Service (PBS) P P B B S S
Computer Services Dept. P P B B S
1320 Braddock Place PPPPPPP BBBBBBB SSSSSS
Alexandria, VA 22314 P B B S
P B B S S
(703) 739-5052 P BBBBBBB SSSSSS
...!uunet!vrdxhq!pbs!pcrable
==============================================================================
Don't believe anything you hear and only half of what you see...jjd@necis.nec.com (Jeff DeSantis) (10/20/89)
In article <telecom-v09i0429m04@vector.dallas.tx.us> vrdxhq!pbs!PCRABLE@eecs. nwu.edu (VAX WIZZ) writes: > How can I tell whether to take the next two or the next three >digits as the country code ? It depends on the first two digits. If the first two digits are a valid country code, then you do not have to look at the third digit. For example, if the first two digits are 44, you know you have a call to the United Kingdom. Another approach would be to consider all country codes to consist of three digits. In this case all 44X (440-449) country codes would be calls to the United Kingdom. Either approach requires maintaining a list of country codes against which you can verify the call's country code.
tanner@ki4pv.uucp (Dr. T. Andrews) (10/22/89)
)> How can I tell whether to take the next two or the next three
)> digits as the country code ?
) It depends on the first two digits.
) If the first two digits are a valid country code, then you do not have
) to look at the third digit.
Sorry, this doesn't work. Some country codes (mainly for toy
countries) are special cases of others. Consider "countries" like the
Vatican (looks like a particular exchange in Rome Italy) or San
Marino. You have to examine rather a lot of digits to decide whether
the call is to Rome Italy or the Vatican.
I believe that the list of country codes posted here some time ago
also listed several French-speaking island countries as having country
codes which started with the French 2 digits and were followed by
another digit or two to specify the country.
...!bikini.cis.ufl.edu!ki4pv!tanner ...!bpa!cdin-1!ki4pv!tanner
or... {allegra attctc gatech!uflorida uunet!cdin-1}!ki4pv!tanner