Re: LINEERR_INVALCALLHANDLE
- From: "Andreas Marschall [MVP TAPI]" <Andreas.Marschall@xxxxxxxxxx>
- Date: Thu, 3 Nov 2005 14:55:14 +0100
"Stefan Lechner" <StefanLechner@xxxxxxxxxxxxxxxxxxxxxxxxx> schrieb im
Newsbeitrag news:4DBF98DE-1F33-4515-8286-E6DAC8096BFC@xxxxxxxxxxxxxxxx
> I do not understand why I get an LINEERR_INVALCALLHANDLE error after calling
> lineGetCallInfo using the handle from the callback function (dwMsg =
> LINE_CALLINFO)!
> I found out that I get the error in the case that the LINE_CALLINFO is a
> LINECALLINFOSTATE_NUMMONITORS or a LINECALLINFOSTATE_NUMOWNERDECR after the
> call is already deallocated.
Stefan,
that's it!
After you deallocate a call handle you don't have a handle to that call
anymore.
> The TAPI-Browser logs the following lines after ring off:
>
> received LINE_CALLSTATE
> device=x10224
> cbInst=x0
> param1=x1, IDLE
> param2=x0,
> param3=x0,
> lineGetCallStatus returned SUCCESS
> Call x10224 deallocated on IDLE
> received LINE_CALLINFO
> device=x10224
> cbInst=x0
> param1=x2000, NUMMONITORS
> param2=x0,
> param3=x0,
>
> In my application I get the same order:
> - LINE_CALLSTATE = IDLE => lineDeallocateCall
> - any LINE_CALLINFO => lineGetCallInfo
> - LINEERR_INVALCALLHANDLE (because the handle is already deallocated?)
Yes, because the handle is already deallocated.
> My solution is to query the LINECALLINFO structure only if NOT
> LINECALLINFOSTATE_NUMMONITORS AND NOT LINECALLINFOSTATE_NUMOWNERDECR.
>
> Am I right?
> Are there more LINECALLINFOSTATEs that I have to exclude?
> Why do I get a call handle from TAPI that is not valid at the time my
> callback function is executed?
Well, you invalidated the call handle yourself by calling
lineDeallocateCall()...
LINE_CALLINFO doesn't give you a (new) call handle it only provides a
reference.
Valid call handles are provided by LINE_APPNEWCALL message or lineMakeCall() /
linePrepareAddToConference() / linePickup() / lineSetupConference() /
lineSetupTransfer() / lineUnpark() functions (but only if the corresponding
LINE_REPLY indicates success).
> Is there any function to validate a call handle?
It is suggested to maintain your own list a valid call handles.
In addition you can use lineGetNewCalls() to get call handles that you
currently don't have.
--
Best Regards
Andreas Marschall
Microsoft MVP for TAPI / Windows SDK
TAPI / TSP Developer and Tester
http://www.I-B-A-M.de/Andreas_Marschall's_TAPI_and_TSPI_FAQ.htm
* Please post all messages and replies to the newsgroup so all may
* benefit from the discussion. Private mail is usually not replied to.
* This posting is provided "AS IS" with no warranties, and confers no rights.
.
- Prev by Date: Re: C# TAPI
- Next by Date: Re: Outgoing call and the window problem
- Previous by thread: C# TAPI
- Next by thread: problem with second call
- Index(es):
Relevant Pages
|