


6.6. Demo State Machine
The application waits for a GCEV_UNBLOCKED event in the GATE_INIT state. Upon receiving this event, the application calls ag_getxmitslot( ) for an analog PSTN board or dt_getxmitslot( ) for a digital PSTN board to get the transmit time slot (Xmitslot) for the PSTN device and saves it in the session.PSTNParams structure. The application then calls gc_GetXmitSlot(VoiceH) to get the transmit time slot (Xmitslot) for the IP device and saves it in the session.IPParams structure.
The application then calls gc_WaitCall( ) to set the conditions for processing an inbound call.
If the application receives GCEV_TASKFAIL, GCEV_BLOCKED, or GCEV_OPENEX_FAIL, it calls endApplication( ) to gracefully shut down the application.
If the application receives GCEV_OPENEX, it does nothing to avoid causing an error.
The state transitions to GATE_NULL.
6.6.1. Call Establishment from IP
This section describes what happens when a call is initiated from the IP network.
Figure 5. Call Establishment from IP
- In GATE_NULL, the application receives GCEV_OFFERED from the IP side.
The application checks if there is a conflict with PSTN side. If there is no conflict, the application calls gc_Extension( ) to get coder and telephone number information from the IP side.
The state transitions to IP_OFFERED.
- In IP_OFFERED, the application waits for GCEV_EXTENSION which contains the coder and telephone number information.
The application then calls gc_SetUserInfo( ) and gc_AnswerCall( ).
When the application receives GCEV_ANSWERED from the IP side, the application calls gc_Listen( ), to tell the IP line device to listen to the PSTN time slot. The application calls gc_MakeCall( ) for the PSTN side to set up the call on the PSTN side.
The state transitions to IP_CONNECTED.
- In IP_CONNECTED, when the application receives GCEV_CONNECTED from the PSTN side, the application calls pstnListen( ), which in turn calls ag_Listen( ) or dt_Listen( ) (ag for analog; dt for digital) to tell the PSTN line device to listen to the IP time slot
The state transitions to GATE_CONNECTED
6.6.2. Call Establishment from PSTN
This section describes what happens when a call is initiated from the PSTN network.
Figure 6. Call Establishment from PSTN
- In GATE_NULL, when the application receives GCEV_OFFERED from the PSTN side, the application calls gc_AcceptCall( ) for the PSTN and gc_MakeCall( ) for the IP side.
The state transitions to PSTN_OFFERED
- In PSTN_OFFERED the application waits for GCEV_CONNECTED from the IP side.
When the application receives GCEV_CONNECTED it calls:
- gc_Extension( ) to get the call information from the IP side
- gc_Listen( ) to tell the IP line device to listen to the PSTN time slot
- pstnListen( ) which calls ag_Listen( ) or dt_Listen( ) (ag for analog; dt for digital) to tell the PSTN line device to listen to the IP time slot
- gc_AnswerCall( ) to answer the call on the PSTN
The state transitions to IP_CONNECTED.
- In IP_CONNECTED, when the application receives GCEV_ANSWERED from the PSTN the state transitions to GATE_CONNECTED.
6.6.3. Call Teardown
- When either side (PSTN or IP) sends a GCEV_DISCONNECTED event in any state except for IP_OFFERED, the application calls gc_Unlisten( ) for the IP side and ag_Unlisten( ) or dt_Unlisten( ) for the PSTN side. The application also calls gc_DropCall( ) for both sides of the call to disconnect the call.
The state transitions to GATE_DROP.
- When the application receives GCEV_DROPCALL from both sides the application calls gc_Extension( ) to get RTCP information for the call.
When the application receives GCEV_EXTENSION with the RTCP information it calls gc_ReleaseCall( ) to release the call.
The state then transitions to GATE_RELEASE.
- When the application receives a GCEV_RELEASECALL event it sends IPTResetSession( ) and the call state transitions to GATE_NULL.
If a GCEV_DISCONNECTED event is received from the IP side when the state is IP_OFFERED:
- The application calls gc_DropCall( ) for the IP side and the state transitions to IP_DROP.
- When the application receives GCEV_DROPCALL from the IP side, it calls gc_Extension( ) to get the RTCP information.
When the application receives GCEV_EXTENSION the application calls gc_ReleaseCall( )and the state transitions to GATE_NULL.
6.6.4. Glare Conditions
Glare conditions occur when a call is being initiated from both sides at the same time. If such a condition is discovered, the state transitions directly to GATE_DROP and proceeds with call teardown.





Click here to contact Telecom Support Resources
Copyright 2002, Intel Corporation
All rights reserved
This page generated October, 2002