tags:

views:

54

answers:

1

I've inherited some code that implements and talks to the MSTAPI interface. I am curious where the request ID's are initialized (or if they are). By request ID, I mean, for example, the parameter idRequest to the LINE_REPLY Message.

The reason I'm curious is that when I have the TSP and the client display request IDs, I see the following as a typical sequence and both sides agree on the numbers:

66304
66303
66286
66269
66252
66235
...

The first value translates to 0x00010300 (which doesn't mean anything to me, but is a round number), and then the request IDs decrease from there. (Unless the request ID is internally being treated as a signed 2-byte integer, which I suppose is possible.)

I suspect that one side or the other side is supposed to be initializing something, and isn't or is initializing it to something inappropriate.

Does anyone know how the request ID is supposed to work? Is it an opaque number generated internally by MSTAPI and provided to both the TSP and client? Can anyone point at references that explain this?

Thanks.

+1  A: 

Request IDs are generated internally by TAPI for all asynchronous operations. When your program calls asynchronous TAPI function like lineMakeCall, TAPI returns a request ID for this operation. The same request ID is provided to TSP in TSPI_lineMakeCall. When TSP completes MakeCall operation, TSP calls CompletionProc callback with this request ID, telling TAPI that this operation is finished. After that TAPI sends LINE_REPLY message to your application with the same request ID, so you know that your lineMakeCall operation has been completed.

Michael Rakita - Traysoft