Shop OBEX P1 Docs P2 Docs Learn Events
Distinctive telephone Ring — Parallax Forums

Distinctive telephone Ring

DonwalkworthDonwalkworth Posts: 1
edited 2008-10-25 13:32 in BASIC Stamp
I have very limited experience with the BS2 and have not been able to figure this out. I would like the BS2 to tell the difference between a regular telephone ring and a distinctive ring (two short rings). If it is a regular ring the BS2 ignores it but if it is a distinctive ring it "answers" waits for a DTMF "password" and if correct produces a #6 DTMF into the phone line. Any help would be coding and additional info would be greatly appreciated

Comments

  • FranklinFranklin Posts: 4,747
    edited 2008-10-25 03:21
    Start with how you plan to answer the phone and transmit the tone before you get into the programming or chip selection.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    - Stephen
  • lenswerkslenswerks Posts: 40
    edited 2008-10-25 13:32
    This is what I use and may be of some help to you. I interface to the telephone line using a XECOM DAA XE0052SIP. The module has an internal 2-4 wire converter to separate transmit and receive signals. Pin 8 on the module is the ring indicator which can be connected to any Stamp to determine if the telephone is ringing. Pin 3 is OH or hookswitch relay control - A high on OH from your Stamp will connect you to the telephone line - Answer phone.

    For decoding tones I use a SSI202P chip, for encoding or dialing out I use the Stamp's DTMFOUT.

    If you can put two short rings on the line, then it would easy to determine two short from a standard ring sequence by testing. The code below will answer the phone before first ring has terminated.

    I use to buy the DAA devices directly from XECOM in 1 to 5 units at a time, but that has been awhile. I recall they were ~20$. If you want to try using the device you can check their WEB site for ordering.

    Once you get something prototyped I'd be glad to help you along.

    Donnie

    · IF RI = 0 THEN······················ ' Active low indicates phone ringing
    ·· HIGH OH····························· ' Take phone off-hook - Pin on DAA - Data Access Arrangement
    · IF DV = 1 THEN····················· ' DV is pin on 202P indicating a valid tone received when high
    ··GOSUB AAAA
    .
    .
    ············································ 'INB are the 4 pins connected to 202P tone decoder
    ············································ 'So I am decoding·0-9 + # and *.·The code for 1, 2 and # sign
    ············································ 'follows.
    AAAA:
    ··· SELECT INB
    ···· CASE 1·········· ' Turn power to camera ON
    ····· cmd=0
    ····· GOSUB Play_Msg
    ····· AUXIO
    ····· XOUT Mpin, Zpin, [noparse][[/noparse]HouseA\Unit2\2, HouseA\UNITON]
    ····· MAINIO
    ····· SEROUT pTX, Baud, [noparse][[/noparse]"!NB0W26:ON", CLS]
    ····· SEROUT pTX, Baud, [noparse][[/noparse]"!NB0W00:", HEX 1, CLS]
    ···· CASE 2·········· ' Turn power to camera OFF
    ····· cmd=0
    ····· GOSUB Play_Msg
    ····· AUXIO
    ····· XOUT Mpin, Zpin, [noparse][[/noparse]HouseA\Unit2\2, HouseA\UNITOFF]
    ····· MAINIO
    ····· SEROUT pTX, Baud, [noparse][[/noparse]"!NB0W26:OFF", CLS]
    ····· SEROUT pTX, Baud, [noparse][[/noparse]"!NB0W00:", HEX 0, CLS]
    .
    .
    .
    ···· CASE 12································· ' A #·which is·decoded as 12·terminates the conversation.
    ····· cmd=1
    ····· GOSUB Play_Msg
    ····· LOW OH································ ' Place phone on-hook - HANG-UP

    A timer is started after each tone is received that allows ~30 seconds to key the next tone before the Stamp will terminate the call.
Sign In or Register to comment.