spandsp: ADSI transmission and reception

spandsp 0.0.6

ADSI transmission and reception

# What does it do?

Although ADSI has a specific meaning in some places, the term is used here to indicate any form of Analogue Display Service Interface, which includes caller ID, SMS, and others.

The ADSI module provides for the transmission and reception of ADSI messages in various formats. Currently, the supported formats are:

    - Bellcore/Telcordia GR-30 CORE CLASS (Custom Local Area Signaling Services) standard
      (North America, Australia, China, Taiwan, and Hong Kong).

    - ETSI ETS 300 648, ETS 300 659-1 CLIP (Calling Line Identity Presentation) FSK standard
      (France, Germany, Norway, Italy, Spain, South Africa, Turkey, and the UK).

    - ETSI Caller-ID support for the UK, British Telecom SIN227 and SIN242.

    - ETSI ETS 300 648, ETS 300 659-1 CLIP (Calling Line Identity Presentation) DTMF standard
      variant 1 (Belgium, Brazil, Denmark, Finland, Iceland, India, Netherlands, Saudi Arabia,
      Sweden and Uruguay).

    - ETSI ETS 300 648, ETS 300 659-1 CLIP (Calling Line Identity Presentation) DTMF standard
      variant 2 (Denmark and Holland).

    - ETSI ETS 300 648, ETS 300 659-1 CLIP (Calling Line Identity Presentation) DTMF standard
      variant 3.

    - ETSI ETS 300 648, ETS 300 659-1 CLIP (Calling Line Identity Presentation) DTMF standard
      variant 4. (Taiwan and Kuwait).

    - ETSI Caller-ID support in UK (British Telecom), British Telecomm SIN227, SIN242.

    - Nippon Telegraph & Telephone Corporation JCLIP (Japanese Calling Line Identity
      Presentation) standard.

    - Telecommunications Authority of Singapore ACLIP (Analog Calling Line Identity
      Presentation) standard.

    - TDD (Telecommunications Device for the Deaf).

# How does it work?

# The Bellcore CLASS specification

Most FSK based CLI formats are similar to the US CLASS one, which is as follows:

The alert tone for CLI during a call is at least 100ms of silence, then 2130Hz + 2750Hz for 88ms to 110ms. When CLI is presented at ringing time, this tone is not sent. In the US, CLI is usually sent between the first two rings. This silence period is long in the US, so the message fits easily. In other places, where the standard ring tone has much smaller silences, a line voltage reversal is used to wake up a power saving receiver, then the message is sent, then the phone begins to ring.

The message is sent using a Bell 202 FSK modem. The data rate is 1200 bits per second. The message protocol uses 8-bit data words (bytes), each bounded by a start bit and a stop bit.

Channel Carrier Message Message Data Checksum Seizure Signal Type Length Word(s) Word Signal Word Word

# CHANNEL SEIZURE SIGNAL

The channel seizure is 30 continuous bytes of 55h (01010101), including the start and stop bits (i.e. 300 bits of alternations in total). This provides a detectable alternating function to the CPE (i.e. the modem data pump).

# CARRIER SIGNAL

The carrier signal consists of 180 bits of 1s. This may be reduced to 80 bits of 1s for caller ID on call waiting.

# MESSAGE TYPE WORD

Various message types are defined. The commonest ones for the US CLASS standard are:

    - Type 0x04 (SDMF) - single data message. Simple caller ID (CND)
    - Type 0x80 (MDMF) - multiple data message. A more flexible caller ID,
                         with extra information.

Other messages support message waiting, for voice mail, and other display features.

# MESSAGE LENGTH WORD

The message length word specifies the total number of data words to follow.

# DATA WORDS

The data words contain the actual message.

# CHECKSUM WORD

The Checksum Word contains the twos complement of the modulo 256 sum of the other words in the data message (i.e., message type, message length, and data words). The receiving equipment may calculate the modulo 256 sum of the received words and add this sum to the received checksum word. A result of zero generally indicates that the message was correctly received. Message retransmission is not supported. The sumcheck word should be followed by a minimum of two stop bits.

# The ETSI CLIP specification

The ETSI CLIP specification uses similar messages to the Bellcore specification. They are not, however, identical. First, ETSI use the V.23 modem standard, rather than Bell 202. Second, different fields, and different message types are available.

The wake up indication generally differs from the Bellcore specification, to accomodate differences in European ring cadences.

# The ETSI caller ID by DTMF specification

CLI by DTMF is usually sent in a very simple way. The exchange does not give any prior warning (no reversal, or ring) to wake up the receiver. It just sends a string of DTMF digits. Around the world several variants of this basic scheme are used.

One variant of the digit string is used in Belgium, Brazil, Denmark, Finland, Iceland, India, Netherlands, Saudi Arabia, Sweden and Uruguay:

    - A<caller's phone number>D<redirected number>B<special information>C

Each of these fields may be omitted. The following special information codes are defined

    - "00" indicates the calling party number is not available.
    - "10" indicates that the presentation of the calling party number is restricted.

A second variant of the digit string is one of the following:

    - A<caller's phone number>#
    - D1#     Number not available because the caller has restricted it.
    - D2#     Number not available because the call is international.
    - D3#     Number not available due to technical reasons.

A third variant of the digit string is used in Taiwan and Kuwait:

    - D<caller's phone number>C

A forth variant of the digit string is used in Denmark and Holland:

    - <caller's phone number>#

There is no distinctive start marker in this format.

# The Japanese specification from NTT

The Japanese caller ID specification is considerably different from any of the others. It uses V.23 modem signals, but the message structure is uniqeue. Also, the message is delivered while off hook. This results in a sequence

    - The phone line rings
    - CPE answers and waits for the caller ID message
    - CPE hangs up on receipt of the caller ID message
    - The phone line rings a second time
    - The CPE answers a second time, connecting the called party with the caller.

Timeouts are, obviously, required to ensure this system behaves well when the caller ID message or the second ring are missing.