(Page 3 of 11 in this chapter)
Using Voice and Fax: faxback
Name
faxback
Purpose
Uses voice and fax functions to receive a call, play a prompt menu and respond to input by sending a fax to the caller. It can receive input from a "live" caller, or from the simulated caller provided by the
caller
demonstration program.
Usage
faxback
[
options
]
options
are:
Option
Description
Default
-b
n
Specifies the AG board number n.
0
-s
n:m
Specifies the stream and timeslot.
0:0
-r
resolution
Specifies the resolution (
low
,
high
,
superhigh
).
low
-e
encoding
Specifies the encoding (
1D
,
2D
,
MMR
).
1D
-c
mode
Specifies conversion mode:
y
= yes (
NFX_OTF_ALWAYS
)
m
= maybe (
NFX_OTF_ONLY_IF_FAIL
)
n
= no (
NFX_OTF_NEVER
)
m
-p
protocol
Specifies the protocol (TCP name).
nocc
-E
Use ECM mode when encoding is 1D or 2D.
None.
-v
Verbosity of event information.
None.
Description
faxback
demonstrates using voice, DTMF detection, and fax functions during a single telephone call> It uses API functions from NaturalFax, CT Access, and the ADI service. This demonstration application plays a fixed prompt menu to the caller, allows the caller to select a document, and faxes the document back to the caller.
The demonstration begins by initializing the CT Access environment, and then opens the ADI service on a CTA context associated with the specified board, stream, and timeslot.
When
faxback
receives a call, it plays a voice menu prompt that requests that the caller enter DTMF tones to select a document.
faxback
initializes a document queue, then uses DTMF detection to determine which document(s) the caller has selected. Then
faxback
enqueues the document(s), sets transmit parameters, and transmits the requested document(s).
faxback
monitors all events until it receives the
NFXEVN_SESSION_DONE
event, and takes appropriate actions if the call is disconnected or if a board error occurs. After the fax is transmitted, the document queue is destroyed, and
faxback
returns to waiting for the next incoming call.
faxback
runs in an infinite loop. Enter
Ctrl+C
to terminate the demonstration program.
This program may be used interactively by calling it from a fax machine, or in conjunction with another NaturalFax demonstration program,
caller
, for automated testing. DTMF tones are used to synchronize
faxback
and
caller
.
faxback
begins by initializing the CT Access environment, and then opens the ADI service on a CTA context associated with the specified board, stream, and timeslot. It places the call, and after detecting the DTMF tone that signals the end of the prompt menu, it generates the DTMF tone that corresponds to a request for a document catalog.
caller
then creates a document queue, enqueues temporary files, sets receive parameters, and receives the document when
faxback
transmits it.
caller
monitors all events until it receives the
NFXEVN_SESSION_DONE
event, and takes appropriate actions if the call is disconnected or if a board error occurs. After the fax has been received, the document queue is destroyed, and
caller
is set to place another call.
caller
runs in an infinite loop. Enter
Ctrl+C
to terminate the demonstration program.
(Page 3 of 11 in this chapter)
tech_support@nmss.com
Copyright © 1998, Natural MicroSystems, Inc. All rights reserved.