The lineMakeCall function is one of many functions that operate asynchronously. If an application manages only one line, it can use one state record, a struct containing all the information needed to track one outstanding asynchronous request. State records contain information such as the request identifier, the type of request, and pointers to allocated data that may need to be freed later.
But some applications have to manage more than one line—for example, to manage more than one outgoing call at the same time. To do so, they need to track the different asynchronous requests possible on each of those lines, and must therefore create an array of state records, one for each of the outstanding asynchronous operations (such as multiple invocations of lineMakeCall).
When a reply arrives that shows an asynchronous function has completed, the application matches the incoming request identifier with a request identifier in the array, and does whatever that specific call needs at that point. You can design one function to handle the reply that indicates completion of the outstanding asynchronous lineMakeCall request. The success or failure of the asynchronous request is recorded in the requestResult field of the state struct.