4.11 Packet Exchanges for ACD proxy requests and responses

ACD proxy request and response exchange

Figure 13: ACD proxy request and response exchange

The agent application can send proxy requests and receive proxy responses by following these steps:

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

  2. The client sends a CreateAgent packet to server to create an agent. The return value is a positive number that is the request identifier, or a negative number in case of error.

  3. The server creates a packet LINE_PROXYREQUEST with structure based on the client requested packet type. For CreateAgent packet, LINE_PROXYREQUEST packet is created with structure of type LINEPROXYREQUEST_CREATEAGENT.

  4. The server sends the LINE_PROXYREQUEST packet to registered proxy function handler.

  5. After completing the request, proxy application sends the response by calling lineProxyResponse function which results in generation of LINE_REPLY packet.

  6. The server calls the RemoteSPEventProc method of the client with the LINE_REPLY packet, which matches the request identifier previously returned for the proxy request packet. A return value of 0 indicates that the operation was carried out successfully, or a negative number is returned on error.