From: wbe@bbn.com (Winston Edmond) Newsgroups: comp.dcom.modems Subject: ZyXEL Voice Mode Summary (updated) Date: 6 Dec 92 04:33:00 Message-ID: Organization: Bolt Beranek and Newman, Inc., Cambridge, MA Lines: 748 My ZyXEL modem has just been upgraded from version 4.12c to 5.04A, so I spent some time playing with the nifty new voice mode features and checked to see if a bug I cared about had been fixed (it has). Bug fixed: &N0 (multi-auto detect mode) with FAX detection enabled (S38.4=0) no longer gets "stuck" in FAX mode. How to evoke bug: pick up a phone and dial the modem; stay silent; the modem will answer in data mode, then try FAX mode, and eventually hang up. BUG: the modem would answer all subsequent calls in FAX mode ONLY. Back last August, someone very kindly posted a long description of how to use the new voice mode commands. It was quite helpful, but not always as clear as I might have liked, so I've done the obvious thing -- edited it to make it better. The result is below. Enjoy. -WBE General notes on voice mode support. ------------------------------------ The modem supports half-duplex digitized voice transmission and reception. You may transmit or receive ADPCM (or CELP if you have a "+" model) encoded voice data, but you cannot simultaneously transmit and receive voice data. With suitable software, saved voice files, and disk space, the modem may be used as a combination data/FAX modem and voice answering machine. [Since voice transmission (AT+VTX) accepts all characters from the DTE until the terminating DLE ETX as voice data, and voice reception (AT+VRX) is stopped on receipt of any character other than XON and XOFF from the DTE, it is impossible to even specify full-duplex voice operation.] Voice mode commands have the same general format as the Class 2 FAX commands, except that they begin with "+V" instead of "+F": AT+vfoo? prints the current value of foo; AT+vfoo=? prints the permitted values of foo; and AT+vfoo=value sets foo to the specified value. The modem has some special commands for DTMF (dual-tone multi-frequency a.k.a. touch-tone) tones. It can send the tones for 0-9, #, *, and A-D; in receive mode, it recognizes 0-9, #, and * and sends a special sequence indicating what it heard. Receive mode also recognizes the T.30 (G3 FAX) calling tone, BUSY, and silence. It has two ways to report silence: one indicating that there's been nothing but silence since voice reception began, and another indicating a silence after non-silence. You can set the "silence" threshold and the length of time the silence must last before being recognized and reported. (Typical use: an answering machine that stops recording after 7 seconds of silence, and wants to leave no message if no one spoke.) ZyXEL generalized the send-DTMF function to permit ANY one or two tones in the 200-3300 Hz range to be sent. The implementation is good enough that one gets proper beat-frequency oscillation when you specify two tones of slightly different frequencies. (E.g., at+vts=[800,820,10] produces 800 Hz and 820 Hz tones for 10 * .1 seconds.) Either tone can be silenced by specifying 0 as the frequency. I think it's possible to play simple melodies and harmonies using this feature. Unfortunately, when sending a sequence of tones, there is a noise/click at the transition between tones that indicates ZyXEL does not (yet) terminate the tones at zero-crossing points. This is aesthetically annoying, but shouldn't cause any problem for data, FAX, or answering machine applications. As a work-around, insert short silences. The command that makes a combined data/FAX/voice answering system possible is "ATA" -- innocuously described as "force answer mode". This command might better be called "Re-answer the phone according to current mode". In the Examples of Operation section (later), the algorithm used is (roughly): AT+FCLASS=8 (enable voice mode) (wait for incoming call) (play outgoing message) If FAX tones heard during outgoing message, AT+FCLASS=2 A (switch to FAX mode and reanswer the call) If DTMF tones heard during outgoing message, AT+FCLASS=0 A (switch to data mode and reanswer the call) AT+VRX (listen for response) If silence, AT+FCLASS=0 A (switch to data mode and reanswer the call) else it's a voice message to record. The trick with this method if you want to accept data calls is that either: (1) the outgoing message must be short enough so that it, plus the listen for silence timeout, plus the change mode and reanswer sequence, doesn't take so long that the caller hangs up; yet the listen for silence timeout must be long enough that voice callers won't get mistaken for data calls if they take a while to speak up; or (2) the caller must volunteer a DTMF tone (e.g., "5") a little while after the phone is answered, and voice callers must avoid pushing that button. :-) I think it's inherently hard to distinguish the silence from a modem awaiting answer tones from the silence of a person who happens not be speaking yet. [I'd love to see a universal "calling equipment identifier", consisting of a number carried on T.30 or similar tones, for ALL non-voice equipment, so that the receiving machine could answer, listen briefly for the ID tones, and know instantly what kind of machine called, or that it's a voice call because there were no tones.] Support Commands for voice mode operation ------------------------------------------ AT+FCLASS= This command selects a DCE mode as follows: = 0 (Default), Data mode. = 2, Fax mode. = 6, ZFax mode. (-WBE) = 8, Voice mode. DCE Result codes: OK : if DCE accepts the command. ERROR: if is not permitted. AT+FCLASS? DCE will return current mode setting, followed by the OK result code. AT+FCLASS=? DCE will return permitted modes. The response is: 0,2,8 (yes, 6 isn't in the list. -WBE) OK with between each line. ATA (with AT+FCLASS=8) This command causes DCE to answer the phone. DCE will return VCON result code immediately. (ATA answers according to +FCLASS. For example, "AT +FCLASS=0 A" with &N0 will cause the modem to begin Multi-Auto negotiations. -WBE) ATD (with AT+FCLASS=8) This command causes the DCE to dial a phone number. Result codes: VCON: The DCE issues this result code when the DCE has determined that the remote station is off hook. NO ANSWER: The DCE issues this result code when the DCE has continuously detected Ringbacks for the S7 specified amount of time. ATH (with AT+FCLASS=8) This command causes the DCE to hang up the phone with the following considerations for a hang up while in Voice mode: - Force the command AT+FCLASS=0, but will not destroy any of the Voice parameters. - Force voice I/O device to Telco line. AT+VNH= This command causes the DCE to disable or enable automatic hang-ups to a varying degree in the DATA and FAX modes. = 0 (Default), the DCE shall not disable automatic hang-ups. = 1, the DCE shall disable automatic hang-ups. This behavior shall persist until the DTE issues ATH, ATZ, or AT+VIP command, or DTR drop. The DCE shall perform on hook on a ATH command. = 2, the DCE shall disable automatic hang-ups. This behavior shall persist until the DTE issues ATH, ATZ, or AT+VIP command, or DTR drop. The DCE shall not perform on hook on a ATH command. AT+VNH? DCE will return current hang up setting, followed by the OK result code. AT+VNH=? DCE will return permitted hang-up modes. The response is: 0-2 OK with between each line. ATZ This command causes the DCE to enter DATA MODE (AT+FCLASS=0) and set all of the voice related parameters to their default values. Voice mode commands (alphabetically) ------------------------------------ AT+VBT= This command causes the DCE to set the default DTMF/tone generation duration used in conjunction with the AT+VTS command. (Note that AT+VTS also allows you to specify the duration explicitly when you prefer. -WBE) The range of is 1-255. The units are 0.1 seconds. DCE Result codes: OK : if DCE accepts this command. ERROR: if parameter is out of range. AT+VBT? DCE will return current beep duration setting, followed by the OK result code. AT+VBT=? DCE will return permitted values of beep duration. The response is: 1-255 OK with between each line. AT+VIP This command causes the DCE to initialize all the Voice parameters to the default settings as follows: Compression method: 2-bit ADPCM Silent threshold : 15 (16 -WBE) Activity Timer : 7 sec. Silence interval : 7 sec. Ringback gone away timer : 7 sec. Ringback never appear timer : 5.7 sec. Default beep tone duration : 1 sec. DCE Result codes: OK : if DCE accepts this command. ERROR: if the DCE is not connected to at least one Voice I/O device. AT+VLS= This command causes the DCE to select a voice I/O device. The permitted values of are: 0: disconnect all I/O devices (can cause modem to go On-Hook -WBE) 2: Telco line (causes modem to go Off-Hook -WBE) 8: External Mic. (connect a microphone to dial-up line RJ-11 jack) (on models without the leased line jack, 8 same as 2. -WBE) 16: Internal Speaker DCE Result codes: OK : if DCE accepts this command. ERROR: if is not permitted. AT+VLS? DCE will return current I/O device followed by the OK result code. AT+VLS=? DCE will return permitted I/O devices. The response is: 0,2,8,16 OK with between each line. AT+VRA= This command sets the amount of time the DCE shall wait between Ringbacks before the DCE can assume that the remote station has gone off hook. The default value is 70 (7 seconds). The range of the is from 0 to 255. The units are 0.1 second. A value of zero forces the DCE to return VCON immediately after the ATD command is received. DCE Result codes: OK : if DCE accepts this command. ERROR: if is out of range. AT+VRA? DCE will return current Ringback Goes Away Timer, followed by the OK result code. AT+VRA=? DCE will return the permitted values of the Ringback Goes Away Timer. The response is: 0-255 OK with between each line. AT+VRN= This command sets the amount of time the DCE will wait looking for Ringback. If the DCE does not detect a Ringback in this time period, the DCE shall assume that the remote station has gone off hook. The range of the is from 0 to 255. The units are 0.1 second. A value of zero forces the DCE to return VCON immediately after the ATD command is received. DCE Result codes: OK : if DCE accepts this command. ERROR: if is out of range. AT+VRN? DCE will return current Ringback Never Appeared Timer, followed by the OK result code. AT+VRN=? DCE will return the permitted interval of Ringback Never Appeared Timer. The response is: 0-255 OK with between each line. AT+VRX This command causes the DCE to start the voice reception process. The DCE begins the voice receive mode by returning the CONNECT result code to the DTE. After this report, the DCE sends shielded Voice data to the DTE. The DTE stops the voice receive state by sending a character other than and . On termination of the voice receive state, the DCE will append a character pair, followed by the VCON result code. AT+VSD=, This command causes the DCE to set the silence detection sensitivity, and the required period of silence before the DCE can report silence detected at the end of a voice receive either with the QUIET or SILENCE shielded code. See the description of the shielded codes for the difference between SILENCE and QUIET report. The range of the sensitivity is from 0 to 31. Larger values of this parameter imply that the DCE should treat noisier conditions as silence. A value of zero disables the DCE silence detection; the DCE shall not report QUIET or SILENCE shielded codes. The range of the interval is 0-255 in units of 0.1 seconds. DCE Result codes: OK : if DCE accept this command. ERROR: if or is out of range. AT+VSD? This command causes the DCE to report the current and settings. The form of the response is: , OK with between each line. AT+VSD=? This command causes the DCE to report the permitted ranges of and . The response is: (0-31),(0,255) OK with between each line. AT+VSM= This command causes the DCE to select a compression method as follows [only the E-Plus model supports CELP mode]: = 1, 9.6 KBps CELP (Code Excited Linear Prediction) = 2, 19.2 KBps 2-bit ADPCM (Default) = 3, 28.8 KBps 3-bit ADPCM AT+VSM? This command causes the DCE to report the current compression setting in the following form: ;; OK with between each line. Where: : compression method label. : silence compression sensitivity. : voice sampling rate. AT+VSM=? This command causes the DCE to report the compression methods supported. The response is as follows: 1;CELP;1;0;(9600) <----- (only on E+ models) 2;ADPCM;2;0;(9600) 3;ADPCM;3;0;(9600) OK with between each line. AT+VTS= This command causes the DCE to produce DTMF and other tones. The tone generation string consists of elements in a list with each element separated by commas. Each element can be: 1) A single ASCII character in the set 0-9, A-D, #, and *. The DCE interprets the ASCII character as a DTMF digit with a duration as specified by the AT+VBT command. 2) Three numbers separated by commas and enclosed in square brackets. The DCE interprets the first and the second numbers as the frequencies of the dual tones, and the third one as the duration of the tone(s). The frequency range is from 200 Hz to 3300 Hz; a frequency of zero means silence. The range of the duration is 0-255 with units of 0.1 seconds. 3) A single ASCII character and a number, separated by commas and enclosed in curly braces. The DCE will interpret the ASCII chracter as a DTMF digit, and the number as the duration of the tone. (Type 1 elements appear to work just as well when not separated by commas; e.g., AT+vts=5551212 versus AT+vts=5,5,5,1,2,1,2. -WBE) AT+VTS=? This command causes the DCE to report the allowable tone string elements. The response is as follows: (0,200-3300),(0,200-3300),0-9,A-D,*,# OK with between each line. AT+VTX This command causes the DCE to start the voice transmission process. The DCE begins the voice transmit mode by returning the CONNECT result code to the DTE. After this report, the DCE accepts shielded Voice data from the DTE. The DTE stops the voice transmit state by sending a character pair to the DCE. On termination of the voice transmit state, the DCE will send the VCON result code. shielded codes ---------------------- In both voice transmit and receive modes, BISYNC protocol should be applied to the data stream to/from the DCE. During this period, commands and responses will be in shielded form. The supported shielded codes are as follows (all shield codes are case sensitive): commands (DTE->DCE): : terminate transmission process. responses (DCE->DTE): 0: DTMF '0' received 1: DTMF '1' received 2: DTMF '2' received 3: DTMF '3' received 4: DTMF '4' received 5: DTMF '5' received 6: DTMF '6' received 7: DTMF '7' received 8: DTMF '8' received 9: DTMF '9' received #: DTMF '#' received *: DTMF '*' received c: T.30 calling tone received b: Busy tone received q: Quiet detected. The DCE has determined that there was voice energy present at the the beginning of the voice recording session followed by a period of silence greater than the amount of time selected by AT+VSD command. s: Silence detected. The DCE has determined that there was no voice energy present at the the beginning of the voice recording session followed by a period of silence greater than the amount of time selected by AT+VSD command. (As best I can tell from the examples below, the DLE responses can be received in +VTX mode as well as in +VRX mode. -WBE) Examples of voice mode operation --------------------------------- 1. Greeting message recording (Put a microphone into dial-up line RJ-11 jack.) (If your modem doesn't have a leased line jack, unplug the phone line from the modem and plug your phone into the LINE jack. -WBE) DTE DCE comments ------------- ----------- --------------------- AT+FCLASS=8 ---> Switch to VOICE MODE <--- OK AT+VSM=? ---> (optional -WBE) 1;CELP;1;0;(9600) <--- [E+ only -WBE] 2;ADPCM;2;0;(9600) 3;ADPCM;3;0;(9600) <--- OK AT+VSM=1 ---> select CELP compression method <--- OK AT+VLS=8 ---> Activate internal Mic. (or LINE) <--- VCON AT+VRX ---> Start to record <--- CONNECT <--- ---> Stop recording <--- <--- <--- VCON return to command state AT+VLS=0 ----> Deactivate Mic./LINE <--- OK AT+FCLASS=0 Return to Data Mode <--- OK ** XON and XOFF flow control characters do not terminate recording 2. Voice file playing via internal speaker DTE DCE comments ----------- ----------------- ------------------- AT+FCLASS=8 ---> Switch to VOICE MODE <--- OK AT+VSM=? ---> (optional -WBE) 1;CELP;1;0;(9600) <--- [E+ only -WBE] 2;ADPCM;2;0;(9600) 3;ADPCM;3;0;(9600) <--- OK AT+VSM=1 ---> select CELP compression <--- OK AT+VLS=16 ---> Activate internal speaker <--- VCON AT+VTX ---> Start to Play <--- CONNECT ---> ---> <--- VCON return to command state AT+VLS=0 ---> Deactivate internal speaker <--- OK AT+FCLASS=0 Return to Data Mode <--- OK 3. Voice file playing via line DTE DCE comments AT+FCLASS=8 ---> Switch to VOICE MODE <--- OK AT+VSM=? ---> (optional -WBE) 1;CELP;1;0;(9600) <--- [E+ only -WBE] 2;ADPCM;2;0;(9600) 3;ADPCM;3;0;(9600) <--- OK AT+VSM=1 ---> select CELP compression method <--- OK AT+VLS=2 ---> connect to line <--- VCON AT+VTX ---> Start to Play <--- CONNECT ---> ---> <--- VCON return to command state AT+VLS=0 ---> Disconnect from line <--- OK AT+FCLASS=0 Return to Data Mode <--- OK 4. Basic Answering Machine (Voice call) DTE DCE comments AT+FCLASS=8 ---> Switch to VOICE MODE <--- OK AT+VSM=? ---> (optional -WBE) 1;CELP;1;0;(9600) <--- [E+ only -WBE] 2;ADPCM;2;0;(9600) 3;ADPCM;3;0;(9600) <--- OK AT+VSM=1 ---> select CELP compression method <--- OK Wait for incoming call. When DCE picks up, it sends: <--- VCON AT+VLS=2 ---> connect to line <--- VCON AT+VTX ---> Start to Play greeting message <--- CONNECT ---> ---> <--- VCON return to command state AT+VTS=[933,0,12] ---> DTE anotates the greeting message with a 1.2 second beep <--- OK AT+VRX ---> Start to record <--- CONNECT <--- <--- b DCE detect busy tone or or q long period of quiet ----> Stop recording <--- DCE deliver remaining data <--- <--- VCON return to command state AT+VLS=0 ---> Disconnect from line <--- OK AT+FCLASS=0 Return to Data Mode <--- OK [Application saves the received voice data somewhere for later playback.] ** XON and XOFF flow control characters do not terminate recording 5. Voice/FAX Answering machine (receiving a FAX call) DTE DCE comments AT+FCLASS=8 ---> Switch to VOICE MODE <--- OK AT+VSM=? ---> (optional -WBE) 1;CELP;1;0;(9600) <--- [E+ only -WBE] 2;ADPCM;2;0;(9600) 3;ADPCM;3;0;(9600) <--- OK AT+VSM=1 ---> select CELP compression method <--- OK Wait for incoming call. When DCE picks up, it sends: <--- VCON AT+VLS=2 ---> connect to line <--- VCON AT+VTX ---> Start to Play greeting message <--- CONNECT ---> <--- c T.30 calling tone detected or or 5 DTMF digit '5' detected ---> ---> <--- VCON return to command state AT+FCLASS=2 ---> Switch to FAX mode <--- OK ATA ---> Try to handshake in FAX mode [Receive FAX] (This is the example that indicates that the DLE result codes can be sent by the DCE when in voice transmit mode. -WBE) 6. Voice/Data answering machine (receiving a data call) DTE DCE comments AT+FCLASS=8 ---> Switch to VOICE MODE <--- OK AT+VSM=? ---> (optional -WBE) 1;CELP;1;0;(9600) <--- [E+ only -WBE] 2;ADPCM;2;0;(9600) 3;ADPCM;3;0;(9600) <--- OK AT+VSM=1 ---> select CELP compression method <--- OK Wait for incoming call. When DCE picks up, it sends: <--- VCON AT+VLS=2 ---> connect to line <--- VCON AT+VTX ---> Start to Play greeting message <--- CONNECT ---> ---> ---> <--- VCON return to command state AT+VRX ---> Start to record <--- CONNECT <--- <--- s DCE detect silence ----> Stop recording <--- DCE delivers remaining data <--- <--- VCON return to command state AT+FCLASS=0 ---> Switch to data mode <--- OK ATA ---> Try to handshake in data mode [Handle incoming data call. DTE should delete the voice/silence file.] ** XON and XOFF flow control characters do not terminate recording (Combining examples 4, 5, and 6 in order to be able to handle data, FAX, and voice is left as an exercise for the reader. -WBE) [END]