home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Professional / OS2PRO194.ISO / os2 / wps / com / am4pm / am4pm.txt < prev    next >
Encoding:
Text File  |  1993-05-29  |  10.4 KB  |  353 lines

  1. AM4PM v0.5c (29 May 1993)
  2.  
  3.  
  4.    What is AM4PM?
  5.    
  6.   AM4PM   is   a  simple  answering  machine  program   for
  7.   OS/2  2.x PM and ZyXEL 1496. I wrote it for personal  use
  8.   because  I  could  not find a suitable  program.  When  I
  9.   started to write it I had the following objectives:
  10.   
  11.   - To be able to distinguish between voice/fax/modem.
  12.     
  13.   - I  did not want to write fax or modem software. I  must
  14.     therefore  be  able to use external programs  for  this
  15.     purpose.
  16.     
  17.   - To  be  able  to  listen to recorded  messages  from  a
  18.     remote phone.
  19.     
  20.   - To  make  a  program  that  could  easily  be  modified
  21.     without having to recompile my code.
  22.     
  23.   - To  make  the program give up the COM port  if  another
  24.     program needs it.
  25.     
  26.   Other  things  on  the wish list was:  call  my  personal
  27.   pager  or a special phone number if an important  message
  28.   is  recorded, change greeting message from a remote phone
  29.   or  at  a specified time, use some external program  such
  30.   as ZIP to compress the voice files.
  31.   
  32.   Not all these features have been implemented yet, but  be
  33.   patient;  some  day  they will. I  must  also  admit  the
  34.   documentation might need some further work.
  35.   
  36.   PLEASE  note  that this documentation does  not  describe
  37.   how  the  ZyXEL  modem works. To be able  to  modify  the
  38.   program  a  good  knowledge of the voice AT  commands  is
  39.   required.
  40.   
  41.   AM4PM  is a public domain program. It is free to use  and
  42.   free to distribute as long as unmodified versions of  all
  43.   the  original  programs  and this document  is  included.
  44.   Please report any grammatical or spelling errors in  this
  45.   text  to  me.  How  else can I learn  to  write  accurate
  46.   English?
  47.   
  48.   I  take no responsibility whatsoever for any damage AM4PM
  49.   can  cause.  Neither do I guarantee the functionality  of
  50.   the program.
  51.   
  52.   I  might  not  be  able to fix all bugs  and  answer  all
  53.   questions  about AM4PM, but I would like to  be  informed
  54.   about problems and ideas on further development.
  55.   
  56.   The  program  have  been tested on a  486  clone  with  a
  57.   16550A running OS/2 2.1 march beta and a ZyXEL 1496+  ROM
  58.   v6.00.
  59.   
  60.   Thomas Olsson
  61.   
  62.   Göteborg, Sweden
  63.   email d8olsth@dtek.chalmers.se
  64.  
  65.  
  66.  
  67.    What is included in this version?
  68.    
  69.   Most  of  the functionality is programmed in REXX.  AM4PM
  70.   adds  some functions to the REXX language that  makes  it
  71.   possible  to  control  the modem. The  REXX  script  that
  72.   comes with AM4PM gives the following functionality:
  73.   
  74.   - The  program  can be set to answer after  a  predifined
  75.     number  of  signals.  It  will  then  play  a  greeting
  76.     message.  A  short  beep  indicates  the  end  of   the
  77.     greeting message and the beginning of the recording.
  78.     
  79.   - If  a  voice is heard during recording the message will
  80.     be  saved. The end of the message is determined  either
  81.     by 7 s of silence or after a specific maximum time.
  82.     
  83.   - If  a  fax calling tone  or a DTMF '5' is heard  during
  84.     playback or recording AM4PM will try to see if it is  a
  85.     fax  or a modem. This will also happen if no voice  has
  86.     been heard for the first 7 s of recording.
  87.     
  88.   - If  a  DTMF  '*' is heard during playback or  recording
  89.     AM4PM will enter command mode. A command consists of  a
  90.     DTMF  '*'  and number followed by a DTMF '#'. The  only
  91.     available  command  will make  it  possible  listen  to
  92.     recorded messages from a remote phone.
  93.     
  94.   - The  COM port can be released by starting AM4PMCMD with
  95.     the  command  'r'.  The port can also  be  released  by
  96.     pressing  the 'Release' button in the PM window.  AM4PM
  97.     will try to open the port again every 30 s.
  98.     
  99.  
  100.  
  101.    The functions of the program
  102.    
  103.   The  main  window  presents a list of recorded  messages.
  104.   The  date of the recording is displayed together with the
  105.   length of the message if it was recorded in CELP mode.
  106.   
  107.   If  any  settings  are  changed in  the  settings  window
  108.   restart the program to make sure they take effect.
  109.   
  110.   
  111.   
  112.   Play
  113.       
  114.   By  selecting one or more messages in the list  and  then
  115.   press  Play  the messages will be played  in  the  modems
  116.   internal speaker.
  117.   
  118.   
  119.   
  120.   Delete
  121.       
  122.   By  selecting one or more messages in the list  and  then
  123.   press  Delete the messages will be deleted. If Delete  is
  124.   pressed  during  playback  the messages  will  be  played
  125.   first.
  126.   
  127.   
  128.   
  129.   Abort
  130.       
  131.   By  pressing  Abort the current playback or recording  is
  132.   aborted.  If  a  delete operation is  delayed  due  to  a
  133.   playback the delete operation will also be aborted.
  134.   
  135.   
  136.   
  137.   Release
  138.       
  139.   Pressing  Release will release the COM port for 30s.  The
  140.   program  will  then try to reopen to COM  port  every  30
  141.   second.
  142.   
  143.   This  can  also be accomplished by starting  the  program
  144.   AM4PMCMD with the parameter R.
  145.   
  146.  
  147.  
  148.    The REXX functions
  149.    
  150.   
  151.   
  152.   handle = AMGetHotComm()
  153.       
  154.   AM4PM stops using the COM port until AMReleaseHotComm  is
  155.   called.  The  port is not closed. A file  handle  to  the
  156.   open  port is returned and can be used as a parameter  to
  157.   other programs such as REFAX/2 and OS2YOU.
  158.   
  159.   The  port  settings,  such as speed and  handshaking,  is
  160.   undefined and must be set by the called program.
  161.   
  162.   
  163.   
  164.   CALL AMReleaseHotComm
  165.       
  166.   AM4PM  reinitializes the port and starts listen for input
  167.   again.
  168.   
  169.   
  170.   
  171.   CALL AMDPrint text
  172.       
  173.   Prints text to the debug window. Debugging printouts  are
  174.   enabled  by  starting the debug printout application  and
  175.   then start AM4PM with the switch '-d'.
  176.   
  177.   
  178.   
  179.   filename = AMOpenRecFile(mode)
  180.       
  181.   Creates  a unique file used for storing messages in.  The
  182.   filename is returned. The file is created in the  current
  183.   directory and is called Mnnnn.ZVD where nnnn is a  unique
  184.   number.
  185.   
  186.   The  mode is used for setting the voice mode in the modem
  187.   by  sending  'AT+VSM'. The following modes are  supported
  188.   on a ZyXEL 1496E+ with ROM v6.00:
  189.   
  190.   1.              CELP      9600  baud.  High  compression.
  191.      Fairly good quality.
  192.      
  193.   2.            bit ADPCM    19200 baud. Bad quality.
  194.      
  195.   3.            bit ADPCM    28800 baud. Good quality.
  196.      
  197.   Receiving  of a message is started by calling  AMStartRec
  198.   and ended by calling AMEndRec.
  199.   
  200.   The file must be closed by calling AMCloseRecFile.
  201.  
  202.   
  203.   
  204.   CALL AMCloseRecFile
  205.       
  206.   Close the message file opened by calling AMOpenRecFile.
  207.   
  208.   
  209.   
  210.   dlecode = AMPlayFile(filename)
  211.       
  212.   Play  the  file filename. If a DLE code is returned  from
  213.   the  modem  the  playback  is aborted  and  the  code  is
  214.   returned.  Otherwise  a  blank  is  returned.  At   least
  215.   following codes can be returned:
  216.   
  217.   '0'-'9', '*', '#'   A DTMF code was received.
  218.   
  219.   c          A fax calling tone was received.
  220.   
  221.   b          A busy tone was received.
  222.   
  223.   
  224.   
  225.   CALL AMStartRec
  226.       
  227.   Starts  recording. The message is saved  in  the  current
  228.   message   file  opened  by  calling  AMOpenRecFile.   The
  229.   recording is stopped by calling AMEndRec and the file  is
  230.   closed by calling AmCloseRecFile.
  231.   
  232.   The  function  AMWaitDLECode is normally  called  between
  233.   this  call  and  AMEndRec to see if  any  DLE  codes  are
  234.   heard.
  235.   
  236.   
  237.   
  238.   CALL AMEndRec
  239.       
  240.   Ends  the  recording. The file must be closed by  calling
  241.   AMCloseRecFile.
  242.   
  243.   
  244.   
  245.   CALL AMStartListenDLECode
  246.       
  247.   Start  recording but does not save the message to a file.
  248.   This  is used to listen for DLE codes. The listening must
  249.   be stopped by calling AMEndListenDLECode.
  250.   
  251.   The  function  AMWaitDLECode is normally  called  between
  252.   this  call and AMEndListenDLECode to see if any DLE codes
  253.   are heard.
  254.   
  255.   
  256.   
  257.   CALL AMEndListenDLECode
  258.       
  259.   Ends the listening for DLE codes.
  260.  
  261.  
  262.   
  263.   dlecode = AMWaitDLECode()
  264.       
  265.   Listen  for DLE codes during recording started either  by
  266.   AMStartRec   or  AMStartListenDLECode.   At   least   the
  267.   following codes can be returned
  268.   
  269.   '0'-'9', '*', '#' A DTMF code was received.
  270.                
  271.   c           A fax calling tone was received.
  272.                
  273.   b           A busy tone was received.
  274.                
  275.   q            Quiet detected. Some voice was heard at  the
  276.                beginning, but now there is silence.
  277.                
  278.   s            Silence  was  detected. No  voice  has  been
  279.                heard at all.
  280.                
  281.   
  282.   
  283.   dceresp = AMSendW(text)
  284.       
  285.   Sends  the  text text followed by CR/LF to the modem  and
  286.   then  waits  for  a response. The response  is  returned.
  287.   Note  that  this functions waits for a LF to be  received
  288.   from the modem.
  289.   
  290.   
  291.   
  292.   dceresp = AMGetMoreDCEResp()
  293.       
  294.   If  more then one string is returned from the modem as  a
  295.   response  to  AMSendW this function can the  be  used  to
  296.   retrieve them.
  297.   
  298.   
  299.   
  300.   rc = AMStartProg(command)
  301.       
  302.   Starts  the program found at the beginning of the  string
  303.   command. The program name must be given without path  and
  304.   extension.  The environment variable path  will  be  used
  305.   when  searching  for  the file. All  text  following  the
  306.   program name will be used as a parameter to the program.
  307.   
  308.   The programs return code is returned.
  309.   
  310.   The  program  will be started minimized and  closed  when
  311.   the session ends unless AM4PM is in debug mode.
  312.   
  313.   
  314.   
  315.   CALL AMSetStateText text
  316.       
  317.   The  text  in the AM4PM window under the heading  'State'
  318.   is set to text.
  319.   
  320.   The  text  is reset to 'Waiting for call' when  the  rexx
  321.   program terminates.
  322.   
  323.  
  324.   
  325.   CALL AMSetLastEventText text
  326.       
  327.   The  text  in  the AM4PM window under the  heading  'Last
  328.   event' is set to text.
  329.   
  330.   The text is set to 'Abort' when Abort is pressed.
  331.  
  332.  
  333.  
  334.    Functions I will add some day
  335.    
  336.   -  Make it remember the screen position.
  337.       
  338.   -  Better error handling.
  339.       
  340.   -  Possibility to use an external program such as ZIP  to
  341.       compress/decompress to message files.
  342.       
  343.   -  Use  extended  attributes to store the length  of  the
  344.       message in seconds and the caller id.
  345.       
  346.   -  Keep  track of messages that have never been  listened
  347.       to and mark them in some way in the list.
  348.       
  349.   -  Possibility to use another device, such as a SB  card,
  350.       to  play the messages. This would be easy if I  could
  351.       only find an OS/2 program for playing VOC files.
  352.       
  353.