4.3 Packet Exchanges to Make an Outgoing Call

Client making an outgoing call

Figure 5: Client making an outgoing call

A client can make an outgoing call by following the steps below:

  1.  The client establishes the session as described in the example in section 4.1.

  2. The client calls the MakeCall packet to the server to make an outgoing call. The return value is a positive number that is the request identifier or a negative number in case of error.

  3. The server calls the RemoteSPEventProc method of the client with the LINE_REPLY packet, which matches the request identifier previously returned for the MakeCall packet. The LINE_REPLY packet that is returned is actually the MakeCall completion packet, and it contains the handle to the newly created call, which is then used in packets requiring HCALL. A return value of zero indicates that the call was made successfully, or a negative number is returned on error.

  4. When done with the call, the client calls ClientRequest with the Drop packet to terminate the call. It uses the HCALL returned by the MakeCall completion packet. The server closes the call and returns 0 if it is successful and a negative error number if an error occurs.

  5. The client calls ClientRequest with the DeallocateCall packet to release any resources on the server. For example, even after terminating the call, the client might want to query information about the terminated call, such as the caller ID. The server closes the call and the handle for this call is no longer valid. The server returns 0 if the DeallocateCall operation is successful and a negative error number if an error occurs.

  6. The client can terminate the session as described in the example in section 4.2.