3.2.3 Incoming calls

An Incoming-Call-Request message is generated by the PAC when an associated telephone line rings. The PAC selects a Call ID and serial number and indicates the call bearer type.  Modems should always indicate analog call type.  ISDN calls should indicate digital when unrestricted digital service or rate adaption is used and analog if digital modems are involved. Dialing number, dialed number, and subaddress may be included in the message if they are available from the telephone network.

Once the PAC sends the Incoming-Call-Request, it waits for a response from the PNS but does not answer the call from the telephone network. The PNS may choose not to accept the call if:

No resources are available to handle more sessions

The dialed, dialing, or subaddress fields are not indicative of an authorized user

The bearer service is not authorized or supported

If the PNS chooses to accept the call, it responds with an Outgoing-Call-Reply which also indicates window sizes (see Appendix B). When the PAC receives the Outgoing-Call-Reply, it attempts to connect the call, assuming the calling party has not hung up. A final call connected message from the PAC to the PNS indicates that the call states for both the PAC and the PNS should enter the established state.

When the dialed-in client hangs up, the call is cleared normally and the PAC sends a Call-Disconnect-Notify message. If the PNS wishes to clear a call, it sends a Call-Clear-Request message and then waits for a Call-Disconnect-Notify.

3.2.3.1 PAC Incoming Call States

       Ring/Send Incoming Call Request          +-----------------+

     +----------------------------------------->|    wait_reply   |

     |                                          +-----------------+

     |           Receive Incoming Call Reply    V  V  V

     |           Not Accepting                  |  |  |   Receive Incoming

     |         +--------------------------------+  |  |   Call Reply Accepting

     |         |    +------------------------------+  |   /Answer call; Send

     |         |    |     Abort/Send Call             |    Call Connected

     ^         V    V     Disconnect Notify           V

   +-----------------+                              +-----------------+

   |      idle       |<-----------------------------|   established   |

   +-----------------+  Receive Clear Call Request  +-----------------+

                        or telco call dropped

                        or local disconnect

                        /Send Call Disconnect Notify

The states associated with the PAC for incoming calls are:

idle

The PAC detects an incoming call on one of its telco interfaces. Typically this means an analog line is ringing or an ISDN TE has detected an incoming Q.931 SETUP message. The PAC sends an Incoming-Call-Request message and moves to the wait_reply state.

wait_reply

The PAC receives an Incoming-Call-Reply message indicating non-willingness to accept the call (general error or don't accept) and moves back into the idle state. If the reply message indicates that the call is accepted, the PAC sends an Incoming-Call-Connected message and enters the established state.

established

Data is exchanged over the tunnel. The call may be cleared following:

An event on the telco connection. The PAC sends a Call-Disconnect-Notify message

Receipt of a Call-Clear-Request. The PAC sends a Call-Disconnect-Notify message

A local reason. The PAC sends a Call-Disconnect-Notify message.

3.2.3.2 PNS Incoming Call States

     Receive Incoming Call Request

     /Send Incoming Call Reply                     +-----------------+

      Not Accepting if Error                       |   Wait-Connect  |

     +-----+                                    +-----------------+

     |     |     Receive Incoming Call Req.     ^  V  V

     |     |     /Send Incoming Call Reply OK   |  |  |   Receive Incoming

     |     |   +--------------------------------+  |  |   Call Connect

     ^     V   ^    V------------------------------+  V

   +-----------------+  Receive Call Disconnect     +-----------------+

   |      Idle       |  Notify                   +- |   Established   |

   +-----------------+                           |  +-----------------+

           ^        ^                            |   V   Local Terminate

           |        +----------------------------+   |   /Send Call Clear

           |            Receive Call Disconnect      |    Request

           |            Notify                       V

           |                                      +-----------------+

           +--------------------------------------| Wait-Disconnect |

                        Receive Call Disconnect   +-----------------+

                        Notify

The states associated with the PNS for incoming calls are:

idle

An Incoming-Call-Request message is received. If the request is not acceptable, an Incoming-Call-Reply is sent back to the PAC and the PNS remains in the idle state.  If the Incoming-Call-Request message is acceptable, an Incoming-Call-Reply is sent indicating accept in the result code. The session moves to the wait_connect state.

wait_connect

If the session is connected on the PAC, the PAC sends an incoming call connect message to the PNS which then moves into established state. The PAC may send a Call-Disconnect-Notify to indicate that the incoming caller could not be connected.  This could happen, for example, if a telephone user accidently places a standard voice call to a PAC resulting in a handshake failure on the called modem.

established

The session is terminated either by receipt of a Call-Disconnect-Notify message from the PAC or by sending a Call-Clear-Request. Once a Call-Clear-Request has been sent, the session enters the wait_disconnect state.

wait_disconnect

Once a Call-Disconnect-Notify is received the session moves back to the idle state.