8.5 Outbound Call Control
(Page 6 of 12 in this chapter)
Name:
outadi
Purpose:
This program demonstrates:
Placing an outbound call
Simple glare detection
Synchronous programming model for one port in one process
Play and record using callbacks
Usage
:
outadi [options]
where options are:
Option
Description
-b n
Specifies the AG board number <n>. Default=0.
-s n:m
Specifies the MVIP stream and timeslot for the first channel. Default = 0:0.
-p protocol
Specifies the protocol to run. Default = lps0.
-d digits
Specifies the number to dial. Default = 123.
-r tries
Specifies the maximum dial number of dial attempts or retries on failure.
-l
Print low-level call control events.
Highlights
:
adiPlaceCall
adiRejectCall
adiReleaseCall
adiCollectDigits
adiStartPlaying
adiStartRecording
Description
:
As soon as the demo starts, it seizes the line and places a call. For the wink-start protocol, a wink (momentary off-hook) must be received before the digits will be dialed.
When the demo detects answer (off-hook indication) it plays a greeting message, then prompts the called party for one of the following options:
Record a message
Play back the message
Hang up
Procedure:
The following assumes that you are testing on an AG-8 DID with a 2500-type telephone connected to one of the lines.
Change to the directory containing the
outadi
program and voice files, and start the program. Be sure to specify the board, stream and slot that corresponds to our test set-up. Use the
-l
option to see all call-control events.
When you see the message "Placing a call to 'xxx' ...", momentarily lift the handset and replace it, to simulate a wink from the network.
You should see the
ADIEVN_PLACING_CALL
event displayed; AG Access is now dialing the digits. When dialing is complete, the
ADIEVN_CALL_PROCEEDING
event will be displayed. (You must specify the
-l
command line option in order for this event to be sent). Now lift the handset to simulate network answer.
You should hear the greeting message and the menu message. Dial "1" to record a message. Begin speaking after the beep. Recording will cease shortly after you stop speaking, and you will hear the menu message again.
Dial "2" to play back what you recorded.
When you dial "3," the demo hangs up the line and the program exits.
Note:
The
outadi
program demonstrates synchronous programming of a single port. Many of the demo subroutines are coded this way, such that a "start" command is initiated and the demo continuously retrieves events from the AG board until the expected event returns. This simplifies the overall program flow.
(Page 6 of 12 in this chapter)