Announcement

Collapse
No announcement yet.

Phone interfacing

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Phone interfacing

    What I want to do is dial a phone number via an external modem,
    play a .wav when the phone is answered and then recieve an
    affirmation via telephone tones (ie number 1 pressed).
    Hopefully someone can help me as I have no idea where to start.

    ------------------

  • #2
    Hi Alan,

    Dialing a modem with PowerBASIC is dead easy, and goes something like this:
    Code:
    'Pseudocode
    OPEN "COM1:8,n,1" FOR OUTPUT AS #1
    PRINT #1, "ATZ" ' reset the modem and wait for 2 seconds.
    DELAY 2
    PRINT #1, "ATDT5551234;"
    DELAY 30 ' wait for 30 seconds and then hang up
    PRINT #1, "ATH"
    DELAY 1
    PRINT #1, "ATZ"
    CLOSE #1
    However, playing a WAV file down the line will be governed by the modem's command set - such functionality is not part of the 'standard' Hayes AT command set.

    Your modem manufacturer should be able to provide the information necessary to do this.

    The alternative is to write your application in Windows. The TAPI interface (Telephone App Programming Interface) provides API functions for playing WAV files through a voice-modem. However, this is probably not a simple programming task, whether you do it from Windows or DOS.

    Good luck!

    ------------------
    Lance
    PowerBASIC Support
    mailto:[email protected][email protected]</A>
    Lance
    mailto:[email protected]

    Comment


    • #3
      Check this out http://www.talkingcallerid.com
      It not only allows setting different messages
      for different callers it talks to you telling
      you who is calling.


      ------------------
      How long is an idea? Write it down.

      Comment


      • #4
        I'm very interested in modifying the code above by Lance to recognize if the modem extention is on/off hook as well has handing the call over to the same extention after dialing. Can anyone please offer some additional code? Can't seem to find this info anywhere.

        Thanx

        ------------------

        Comment


        • #5
          Well, you could try using the DT option in the OPEN "COM1:.." statement to leave the modem off-hook when you close the port, but in general, when the telephone picks up the call, you'll want the modem to go on-hook, so for a "dialer" app, that approach is not optimum. The DT option is generally used when another app is going to open the port to take control of the existing connection.

          However, most common "dialer" apps tend to go into a "wait" mode after dialing the number, while displaying a message like "Press a key to hang up the modem" and when you have manually lifted the phone, you press a key, and the modem port is closed, and the modem goes on-hook.

          Since at that time the telephone is off-hook and is holding the line open, the call remains connected. Obviously, this approach would be intended for a parallel line connection (both the telephone and the modem are plugged into the wall socket, rather than using the loop-through telephone socket that some modems offer). In NZ, we never use the loop-through connection, since the modems use "US" connectors, and telehones come with "NZ" connectors which are a different size and wiring configuration... maybe some has another suggestion for loop-through connections?

          Does this help? If not, can you describe the situation in mode detail, and we may be able to help.



          ------------------
          Lance
          PowerBASIC Support
          mailto:[email protected][email protected]</A>
          Lance
          mailto:[email protected]

          Comment


          • #6
            To dial a number and not wait you append a ";" to the end of the ATDT command.

            Many of the modems out have wave device built in to them, along with software that allows you to have voice mailboxes. You would need to contact your modem vendor to see how and if that functionality is included in your modem.

            I know my USRobotics has all those bells and whistles and there was a slew of software to allow it sense DTMF signals and act upon it.

            ------------------
            George W. Bleck
            Lead Computer Systems Engineer
            KeySpan Corporation
            <b>George W. Bleck</b>
            <img src='http://www.blecktech.com/myemail.gif'>

            Comment


            • #7
              With modems in New Zealand, the semicolon stops the modem from attempting to negotiate a data connection after dialing. The modem stays in command-mode.

              If you close the port, even with the ";" at the end of the dialing string, the modem hangs up.

              It's a pretty simple arrangement...

              I was not aware that modems in the US work any differently in that regard?

              ------------------
              Lance
              PowerBASIC Support
              mailto:[email protected][email protected]</A>
              Lance
              mailto:[email protected]

              Comment


              • #8
                Lance,

                My bad, should have clarified it further

                From numerous websites I find the same description...
                The semicolon instructs the modem to return to the command mode after dialing the number.
                This is useful if you need to do things diffently then a standard "dial-out"

                Code:
                Examples:  
                     Originate in answer mode
                     Send additional DTMF tones to negotiate a touch-tone service
                     etc.

                ------------------
                George W. Bleck
                Lead Computer Systems Engineer
                KeySpan Corporation

                [This message has been edited by George Bleck (edited May 26, 2002).]
                <b>George W. Bleck</b>
                <img src='http://www.blecktech.com/myemail.gif'>

                Comment


                • #9
                  Rochelle Communications ani-232 adapters are very hard to find.
                  Need to find another solution for obtaining caller id.
                  Use for automatically accessing a database when the phone rings.
                  Could use a dial-up modem, but looking for an easier way.


                  ------------------
                  How long is an idea? Write it down.

                  Comment

                  Working...
                  X