3.4 Outbound Trunks

(Page 5 of 12 in this chapter)
AG Access can be used to place calls with protocols supporting outbound trunks. After the port's protocol is started via adiStartProtocol, the application is eligible to place calls.

The application places a call by invoking adiPlaceCall which initiates a complex process of dialing and running call progress (also known as call analysis). Call progress involves the detection of several events (e.g., signaling, tones, voice) received from the network and the remote party. These events indicate the call's progression through the network.

Once adiPlaceCall is acknowledged, dialing and call progress are initiated and the application is guaranteed to receive either a call connected event or a call disconnected event.

The application chooses the criteria by which AG Access generates the connected and disconnected events. For example, the ADIPLACECALL parameter structure contains a connectmask parameter and disconnectmask parameter that dictate when the connected and disconnected events are generated, thus terminating call progress. Each bit in these masks corresponds to network or remote party events.

Note: If a condition is specified in both masks, connectmask takes precedence. These events are discussed in Section 3.4.3, Events Used by Call Control

The following outlines the general procedure for establishing an outbound connection:

Figure 5 is a protocol timing diagram depicting the command and event interchange for placing an outbound call. Informational events are shown with a dashed line.



: Place Call Timing Diagram

Figure 6 is a state diagram for placing outbound calls. This diagram can be correlated with the timing diagram in Figure 5 to gain a comprehensive understanding of outbound trunk states and events which are described in the next section.



: Place Call State Diagram

Note: The transition from Idle to Disconnect is an artifact of the loop-start protocol if dial tone is not received. See Appendix C of the AG Access Function Reference Manual for more information on the loop-start protocol.

3.4.1 Outbound Trunk Events

This section describes the network events which are generated when establishing outbound connections, as shown in Figure 5 and Figure 6 above:

ADIEVN_PLACING_CALL - This event is generated after AG Access has seized an outgoing line in response to the application invoking adiPlaceCall. The placing call event confirms that the line is seized and glare (a race with an incoming call) is resolved.

Note: For suspected glare conditions on loop-start trunks, the application can program the protocol to abandon placing a call (ADIEVN_DISCONNECTED) or offer an inbound call (ADIEVN_INCOMING_CALL) (see Section 3.10.1, Loop- Start Parameters). For glare conditions on wink-start trunks, the ADIEVN_INCOMING_CALL event may arrive instead of the placing call event. In this case, the place call function is terminated.

ADIEVN_CALL_PROCEEDING - This informational event is generated after the destination address is delivered to the network switch (digits dialed).

ADIEVN_REMOTE_ALERTING - This informational event is generated when ring tone is received from the network.

ADIEVN_REMOTE_ANSWERED - This informational event is generated on the first positive indication that the call is network connected. For positive indication, one of the following conditions must be met:

ADIEVN_CALL_CONNECTED - This event changes the port into the call connected state and terminates the place call function. Multiple conditions as programmed by the application can generate the call connected event. By default, the call connected event is generated when any of the following occur:

These defaults can be overridden by assigning the disconnectmask to disconnect upon occurrence of the event. Other events can also be added to the connectmask.

ADIEVN_CALL_DISCONNECTED - This event is generated if call placement fails at any time for any reason. The following conditions generate the call disconnected event after receiving ADIEVN_PLACING_CALL:

The following conditions generate the call disconnected event before receiving ADIEVN_PLACING_CALL:

Other events may cause call disconnect if added to the disconnectmask.

Note: AG Access may be programmed to connect on SIT via the connectmask.

ADIEVN_CALL_RELEASED - After the application invokes adiReleaseCall, AG Access generates the call released event when its internal state is reset to idle.

3.4.2 Call Control Mask Parameters

This section summarizes the ADIPLACECALL mask parameters. These parameters instruct AG Access when to generate connected and disconnected events. Each bit in these masks corresponds to events received from the network or the called party. Details regarding these events are discussed in Section 3.4.3, Events Used by Call Control. The ADIPLACECALL parameter structure is passed to AG Access when the protocol is started via the adiPlaceCall function.

Connectmask

The ADIPLACECALL connectmask parameter dictates which call progress event causes AG Access to change the placed call into the connected state.

Each of the following bits occupies a position in the connectmask parameter. If the bit is enabled (set) and the condition described occurs, the ADIEVN_CALL_CONNECTED event is generated.

ADI_CON_ON_xxx bit

Condition

RING_QUIT

Ring tone stopped; no other events detected (see Section 3.4.4, Network Tone Parameters).

SIGNAL

Out-of-band signaling indicates network connection established.

CED

Modem tone detected from remote station.

VOICE_BEGIN

First detection of remote voice.

VOICE_MEDIUM

Remote voice has lasted longer than the first time threshold (ms). (See Section 3.4.5, Voice Parameters.)

VOICE_LONG

Remote voice has lasted longer than the second time threshold (ms). (See Section 3.4.5, Voice Parameters.)

VOICE_EXTENDED

Remote voice has lasted longer than the third time threshold (ms). (See Section 3.4.5, Voice Parameters.)

DIALTONE

Dial tone was detected after placing the call.

SIT

Special Information Tone was received.

CALL_PROCEEDING

Unconditional - connect immediately after dialing (no call analysis).

Furthermore, the following conditions generate the connected event by default and have no bit position in the connectmask. Each of these conditions can be overridden by setting the corresponding bit within the disconnectmask.

Condition

Description

VOICE_END

Remote party stopped speaking.

TIMEOUT

Call progress exceeded the ADICALLPROG timeout threshold without an event.

When the call is connected, AG Access generates an ADIEVN_CALL_CONNECTED event. The event's value field indicates the reason for the transition to the connected state.

Disconnectmask

The ADIPLACECALL disconnectmask parameter dictates which call progress event causes AG Access to change the placed call into the disconnected state.

Each of the following bits occupies a position in the disconnectmask parameter. If the bit is enabled (set) and the condition described occurs, the ADIEVN_CALL_DISCONNECTED event is generated.

Note: The connectmask takes precedence. If a condition is selected in both the connectmask and disconnectmask, a call will be connected if that condition occurs.

ADI_DIS_ON_xxx bit

Condition

RING_QUIT

Ring tone stopped; no other events detected (see Section 3.4.4, Network Tone Parameters).

CED

FAX or modem tone detected from remote station.

VOICE_BEGIN

First detection of remote voice.

VOICE_MEDIUM

Remote voice has lasted longer than the first threshold (see Section 3.4.5, Voice Parameters).

VOICE_LONG

Remote voice has lasted longer than the second threshold (see Section 3.4.5, Voice Parameters).

VOICE_EXTENDED

Remote voice has lasted longer than the third threshold (see Section 3.4.5, Voice Parameters).

VOICE_END

Remote party stopped speaking (see Section 3.4.5, Voice Parameters).

TIMEOUT

No events occur after the event ADIEVN_CALL_PROCEEDING.

SIT

Special Information Tone (SIT) detected.

The call disconnect event is generated unconditionally for some conditions. However, the application can specify connect on SIT within the connectmask. In this case, the call will be considered connected for the sake of listening to audio, but is not network connected.

The event value field contains the disconnect reason as identified below. Each disconnect reason is prefixed by ADI_DIS_. The call progress parameters affecting these events are discussed in Section 3.4.4, Network Tone Parameters.

ADI_DIS_xxx

Condition

BUSY

Busy signal detected.

REORDER

Reorder signal detected.

NOANSWER

Remote party did not answer.

3.4.3 Events Used by Call Control

This section provides a description of a call's progression, the events generated by the network, and the application of those events to AG Access' call control.

Detected Network/Remote Party Events

When placing calls, the protocol processes the events (as inband audio and out-of- band signaling) received from the network and far end. The following table provides a summary of those events.

Event

Description

Line request granted

Network acknowledges line seizure
Loop-start: dial tone received.
Wink-start: wink received.

Reorder

Reorder (fast busy) detected.

Busy

Busy tone detected.

SIT

Special information tone detected.

Alerting

Ring tone is detected.

Out-of-band Positive Answer

Out-of-band signaling indicates call answered.

CED

Remote station is generating "called party" modem tone (FAX/modem).

Voice Begin

Remote party has begun speaking.

Voice End

Remote party has stopped speaking.

Ring Quit

The ring tone ended without any other call progress events occurring.

Timeout

Call progress has not detected an event for a specified amount of time.

Events As Applied to AG Access Call Control

The AG Access Call Control functions interpret the detected network events listed above and apply them programmatically. The application instructs AG Access to consider the call connected or disconnected upon occurrence of these events by programming the ADIPLACECALL parameters connectmask and disconnectmask. AG Access generates an AIDEVN_CALL_CONNECTED or ADIEVN_CALL_DISCONNECTED event accordingly, and terminates the placing call function. The application of these events by the protocol-independent call control are described below:

Line Request Granted: The first network event processed is Line Request Granted. When AG Access attempts to place a call, it executes a protocol- dependent operation to acquire the line (e.g., loop-start waits for dial tone). If the outgoing line is granted, AG Access generates the ADIEVN_PLACING_CALL event thus confirming to the application that the function has initiated.

For bi-directional lines, the placing call event guarantees that an incoming call event will not be generated on this port until after the call is released. This is called glare resolution.

Call Proceeding: After the line is acquired, AG Access delivers the destination address to the network switch. The call proceeding informational event is generated if the "report proceeding" bit is set in the eventmask parameter. No action is required by the application.

Network Rejected Call: After AG Access delivers the destination address to the network switch, the network may reject the call request. By default, the events listed below cause AG Access to terminate the place call function and generate the call disconnected event. The disconnect reason in the event value field is set according to the event.

Network Event

AG Access Disconnect Reason

Reorder

ADI_DIS_REORDER_DETECTED

Busy

ADI_DIS_BUSY_DETECTED

SIT

ADI_DIS_SIT_DETECTED

Note: The application may connect on SIT by setting the appropriate flag in the connectmask. This allows the application to listen to the SIT message. The application must still release the call via adiReleaseCall.

Alerting: If the call is not rejected by the network, AG Access should receive a ring tone from the network. The remote alerting informational event is generated if specified in the eventmask.

After ring tone is received, one of three possible outcomes can occur:

Descriptions of these three outcomes follow.

Ring Quit: For protocols that do not provide positive answer indication (e.g., loop-start), a loss of ring tone with no following events is indistinguishable from the remote party answering the call and saying nothing. The application specifies in the call control parameters whether to generate a connected event under this condition or to abandon the call and generate a disconnect event as shown below.

Place Call Parameters

Bit Position

connectmask

ADI_CON_ON_RING_QUIT

disconnectmask

ADI_DIS_ON_RING_QUIT

If neither bit is set, AG Access continues to monitor inband energy for events.

No Answer: The second possible outcome after ring tone is detected is that the remote party does not answer the call. In this case, AG Access will indefinitely receive a ring tone. The ADIPLACECALL ringcount parameter defines the maximum number of ring tones for AG Access to detect before abandoning the call.

Network Connected: The third possible outcome after ring tone is detected is that the call becomes network connected. A call is network connected when the called party goes off-hook. The following three events are positive indications that the call is network connected:

The application specifies whether AG Access should connect or disconnect on any of these events. The place call connectmask and disconnectmask parameters dictate the AG Access action when these conditions occur. If the condition is not in either of these masks, no action is taken. The following bit positions correspond to the respective events:

Event

connectmask

disconnectmask

Out-of-band

ADI_CON_ON_SIGNAL

Not applicable.

FAX/Modem Tone

ADI_CON_ON_CED

ADI_DIS_ON_CED

Voice

ADI_CON_ON_VOICE_BEGIN

ADI_DIS_ON_VOICE_BEGIN

Note: The call cannot disconnect on out-of-band signal state change. The only option on this event is to generate a connect event or to ignore it and wait for an inband indication of an answer.

Call Answered: AG Access generates a call answered informational event when the call is network connected if both of the following conditions hold true:

  1. The report answered bit is enabled in the eventmask parameter.

  2. The network event occurring is not in the connectmask or disconnectmask parameters.

AG Access will generate only one call answered event per call.

Voice Detection: If AG Access passes through the network connected phase without resolution (i.e., did not generate a connected or disconnected event), call analysis advances into its final stage -- voice detection.

AG Access detects when the remote party begins and ceases speaking. These are the voice begin and voice end events respectively. The voice begin event is a positive indicator for being network connected.

By default, AG Access generates the connected event on voice begin thus terminating the place call function. The application can override this behavior by clearing the voice begin bit in the connectmask.

AG Access supports three voice duration time thresholds -- medium, long, and extended. The duration for these three thresholds is specified in the ADICALLPROG parameter structure (a substructure of ADIPLACECALL). The application can program the connectmask and disconnectmask to force call resolution on any of these voice thresholds, as well as the voice end event.

For example, suppose the application is only interested in connecting if the call is answered with a short salutation (e.g., "Hello"). The "disconnect on voice medium event" (ADI_DIS_ON_VOICE_MEDIUM) bit in the disconnectmask should be set, and the voice medium time threshold should be set accordingly (see Section 3.4.5, Voice Parameters). This would generate a disconnected event if an answering machine were reached.

Timeout: To ensure call placement is resolved within a certain time period, AG Access provides a timeout parameter. The ADIPLACECALL timeout parameter specifies the maximum time after the last detected event before AG Access generates a connect or disconnect event. By default, AG Access generates a connect event if this time period elapses. The application can choose to disconnect on timeout via the disconnectmask parameter. The timeout feature can be defeated by setting the ADIPLACECALL timeout to zero.

3.4.4 Network Tone Parameters

When establishing outbound calls, AG Access analyzes inband audio to detect the following network signals:

The application assigns the ADIPLACECALL parameter structure to describe how to determine whether energy received is a network tone or voice. These parameters are sent to the AG board via adiPlaceCall function.

When discussing network tone qualifiers, the following terms are used. Figure 7 illustrates these terms.

Pulsewidth - The time during which a tone is active.

Inter-pulse delay - The time between two active tone pulses.

Tone cycle - The time during which a tone is active and then absent.



: Generic Tone

AG Access uses two types of tone detectors -- a precise tone detector and a broadband tone detector. These are described below.

Precise Tone Detection

The precise tone detector quickly analyzes inband audio at specific frequencies to detect the following three events:

The application specifies which of these events should be detected by configuring the precmask in the ADIPLACECALL parameter structure. If the busy tone is not enabled, AG Access takes more time discerning the busy tone via Broadband Tone Detection described below. If SIT and CED are not enabled, these tones cannot be detected.

The precqualtime parameter determines the duration in which the tones are qualified. This parameter applies to all three tones defined above and should be set to the time required to detect the tone of least duration.

In places where you need to guarantee precise dial tone, you can defeat broadband dial tone detection by setting ADILPS dialtonemintime parameter to zero. The precise dial tone detection parameters are located in the ADIPLACECALL parameter structure.

Broadband Tone Detection

The broadband detection method uses simple high and low pass frequency discrimination together with broadband energy measurements over time to qualify network tones. For example, the DSP determines that a ring tone is present if all of the following conditions are met:

There are two signal characteristics used for broadband tone detection: the pulsewidth and cadence, both of which are described below.

Pulsewidth: When defining pulsewidth, the application specifies time limits for excluding each network tone. Figure 8 illustrates the effect these limits have on the tones. The waveforms depicted are in milliseconds and are representative of tones in the USA.



: Network Tone Pulsewidth Limits

The time parameters depicted in Figure 8 are described below and are contained in the ADICALLPROG parameter structure.

Parameter

Description

maxreorder

The upper limit for a network reorder tone pulsewidth (ms). The reorder tone will be excluded from consideration if the pulsewidth is greater than this value.

maxbusy

The upper limit for a network busy tone pulsewidth (ms). The busy tone will be excluded from consideration if the pulsewidth is greater than this value.

maxring

The upper limit for a network ring tone pulsewidth (ms). The ring tone will be excluded from consideration if the pulsewidth is greater than this value.

If the network tone is present for longer than maxring milliseconds, dial tone is being received.

AG Access presumes that maxreorder is less than maxbusy which is less than maxring.

  1. maxreorder < maxbusy < maxring

  2. This relationship defines a time tolerance -- minimum and maximum -- for each of the three tones being detected.

Cadence: The second characteristic used for broadband tone detection is the signal's cadence. The application specifies tone counts in the ADIPLACECALL parameter structure. The signal must satisfy the single tone criteria described in Figure 8 for the respective number of cycles before AG Access concludes the signal is present. The following table defines the cadence for each signal.

Tone

Parameter

Meaning

Busy

busycount

Busy signal received.

Reorder

busycount

Reorder received.

Ring

ringcount

Call not answered.

For example, when busycount reorder tones are counted, AG Access concludes it is receiving a reorder (fast busy) signal.

Figure 9 depicts ring tone termination. After having established that the line is receiving ringtone, the call progress function concludes that the remote trunk has quit ringing if a ringtone is not received in the maxringquit time period. This parameter controls the ring quit event described in the previous section.



: Ring Tone Termination

3.4.5 Voice Parameters

After an outbound call is network-connected, AG Access analyzes inband audio to detect voice. AG Access processes the five voice events defined below. Each event is controlled by parameters in the ADIPLACECALL parameter structure.

Event

Description

Controlling Parameter

Voice Begin

Remote party begins speaking.

None.

Voice Medium

Remote party has spoken for a period longer than the first time threshold.

voicemedium - (ms) first time threshold.

Voice Long

Remote party has spoken for a period longer than the second time threshold.

voicelong - (ms) second time threshold.

Voice Extended

Remote party has spoken for a period longer than the third time threshold.

voicextended - (ms) third and final time threshold.

Voice End

Remote party stopped speaking.

silencetime - (ms) qualification time before concluding voice end.

Voice begin is the first voice event generated when the remote party begins speaking. The voice end event is generated after an absence of voice for silencetime milliseconds. This is illustrated in Figure 10.



: Call Progress Voice Detection


(Page 5 of 12 in this chapter)

Copyright 1996 Natural MicroSystems, Inc. All Rights Reserved.