|
|
|
date: Wed, 28 May 2008 10:53:17 +0200,
group: microsoft.public.win32.programmer.tapi
back
Line doesn't Close after LineDrop
So here is my problem. I started my own TSP using Atsp32 from the Microsoft
SDK, I compile with Visual Studio 2003, and I use Outlook 2003 on Win XP to
test my TSP.
I've had many problems since the start, and most of them have been managed
by all the answers I found on the internet. But now, although I can make a
call and stop it using the two buttons in Outlook, the message displayed
stays in the state 'hang up'. My log shows that the TSP has a call to the
function LineDrop, but it doesn't go further. My only solution is to close
Outlook, and then I have LineDrop again, LineCloseCall, LineClose, and
ProviderShutdown.
Here is my log from the moment I click on 'end call'
TSPI_lineDrop: enter
lpsUserUserInfo=(null)
dwSize=0
callstate: 100
hangUp: enter
hangUp: returning
Disconnect: enter
Disconnect: returning
DropActiveCall: enter
DropActiveCall: returning
SetCallState: enter
SetCallState: returning
TSPI_lineDrop: returning 66201
lpsUserUserInfo=(null)
dwSize=0
--------------------------
and that's when I close Outlook
TSPI_lineDrop: enter
lpsUserUserInfo=(null)
dwSize=0
callstate: 1
DropActiveCall: enter
DropActiveCall: returning
SetCallState: enter
SetCallState: returning
TSPI_lineDrop: returning 66184
lpsUserUserInfo=(null)
dwSize=0
--------------------------
TSPI_lineCloseCall
TSPI_lineCloseCall: returning 0
--------------------------
TSPI_lineClose: enter
TSPI_lineClose: returning 0
--------------------------
TSPI_providerShutdown
TSPI_providerShutdown: returning 0
and here is my function LineDrop
LONG
TSPIAPI
TSPI_lineDrop(
DRV_REQUESTID dwRequestID,
HDRVCALL hdCall,
LPCSTR lpsUserUserInfo,
DWORD dwSize
)
{
PDRVLINE pLine = (PDRVLINE) hdCall;
writeLog("TSPI_lineDrop: enter");
writeLog("\nlpsUserUserInfo=");
writeLogLPCSTR(lpsUserUserInfo);
writeLog("\ndwSize=");
writeLogDWORD(dwSize);
#if DBG
FUNC_PARAM params[] =
{
{ gszdwRequestID, dwRequestID },
{ gszhdCall, hdCall },
{ "lpsUserUserInfo", lpsUserUserInfo },
{ gszdwSize, dwSize }
};
FUNC_INFO info =
{
"TSPI_lineDrop",
4,
params
};
#endif
writeLog("\ncallstate: ");
writeLogDWORD(pLine->dwCallState);
if(pLine->dwCallState == LINECALLSTATE_CONNECTED) hangUp();
if(connected == 1) disconnect();
Prolog (&info);
DropActiveCall (pLine);
SetCallState (pLine, LINECALLSTATE_IDLE, 0);
(*gpfnCompletionProc)(dwRequestID, 0);
//dealloc();
//TSPI_lineCloseCall(hdCall);
//TSPI_lineClose((HDRVLINE)line);
//TSPI_providerShutdown(version, providerID);
writeLog("\nTSPI_lineDrop: returning ");
writeLogLONG(Epilog (&info, dwRequestID));
writeLog("\nlpsUserUserInfo=");
writeLogLPCSTR(lpsUserUserInfo);
writeLog("\ndwSize=");
writeLogDWORD(dwSize);
writeLog("\n--------------------------\n");
return (Epilog (&info, dwRequestID));
//return 0;
}
as you can see, I've tried things bu it doesn't work either. Do you have a
hint ?
--
Adrien HAVAS
Student at ECE, School of Engineering Paris - Information Systems &
Networking
date: Wed, 28 May 2008 10:53:17 +0200
author: Adrien HAVAS
Re: Line doesn't Close after LineDrop
"Adrien HAVAS" schrieb im Newsbeitrag
news:OA3UIBKwIHA.4772@TK2MSFTNGP03.phx.gbl...
> So here is my problem. I started my own TSP using Atsp32 from the Microsoft
> SDK, I compile with Visual Studio 2003, and I use Outlook 2003 on Win XP to
> test my TSP.
> I've had many problems since the start, and most of them have been managed
> by all the answers I found on the internet. But now, although I can make a
> call and stop it using the two buttons in Outlook, the message displayed
> stays in the state 'hang up'. My log shows that the TSP has a call to the
> function LineDrop, but it doesn't go further. My only solution is to close
> Outlook, and then I have LineDrop again, LineCloseCall, LineClose, and
> ProviderShutdown.
>
>
> Here is my log from the moment I click on 'end call'
> TSPI_lineDrop: enter
> and that's when I close Outlook
> TSPI_lineDrop: enter
> TSPI_lineCloseCall
> TSPI_lineDrop(
> SetCallState (pLine, LINECALLSTATE_IDLE, 0);
Adrien,
it seems that for some reason Outlook on 'end call' isn't calling
lineDeallocateCall(), which leads to TSPI_lineCloseCall().
From your code it seems that you send a LINECALLSTATE_IDLE,
but you may want to check this with MS TB20 and/or JulMar Phone.exe:
http://www.julmar.com/tapi/
Please post a TB20.log and enable Options/LogParameters and /ShowTimeStamps in
TB20.
See my TAPI and TSPI FAQ:
Q: Where can I download TAPI Browser ?
http://www.i-b-a-m.de/Andreas_Marschall's_TAPI_and_TSPI_FAQ.htm#_Q:_Where_can
Q: Is there a user guide available for TAPI Browser TB20 ?
http://www.i-b-a-m.de/Andreas_Marschall's_TAPI_and_TSPI_FAQ.htm#_Q:_Is_there_1
--
Best Regards
Andreas Marschall
Microsoft MVP for TAPI / Windows SDK
TAPI / TSP Developer and Tester
My TAPI and TSPI FAQ:
http://www.I-B-A-M.de/Andreas_Marschall's_TAPI_and_TSPI_FAQ.htm
My Toto® Tools (a collection of free, mostly TAPI related tools):
http://www.i-b-a-m.de/Andreas_Marschall's_Toto_Tools.htm
TAPI development around the world (Frappr! map):
http://www.frappr.com/TAPIaroundTheWorld
* 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.
date: Wed, 28 May 2008 15:02:54 +0200
author: Andreas Marschall [MVP TAPI]
Re: Line doesn't Close after LineDrop
All right, I tried TB20, but I got an error when adding a line :
9:36.11.125 : Calling lineInitialize
lphLineApp=x2627b0
hInstance=x1000000
lpfnCallback=x10158df
lpszAppName=x6f444
lpdwNumDevs=x6f554
9:36.11.125 : lineInitialize returned SUCCESS
num line devs = 6
9:36.12.312 : Calling lineOpen
hLineApp=x800003ee
dwDeviceID=x0
lphLine=x2682b0
APIVersion=x20000
dwExtVersion=x0
dwCallbackInstance=x0
dwPrivileges=x1
dwMediaModes=x10
lpCallParams=x0
9:36.12.312 : lineOpen returned LINEERR_INCOMPATIBLEAPIVERSION
I changed the default value to 10003, and now I have this:
10:4.58.546 : Calling lineInitialize
lphLineApp=x2627b0
hInstance=x1000000
lpfnCallback=x10158df
lpszAppName=x6f444
lpdwNumDevs=x6f554
10:4.58.546 : lineInitialize returned SUCCESS
num line devs = 7
10:4.59.609 : Calling lineOpen
hLineApp=x80000399
dwDeviceID=x0
lphLine=x2652c0
APIVersion=x10003
dwExtVersion=x0
dwCallbackInstance=x0
dwPrivileges=x1
dwMediaModes=x10
lpCallParams=x0
10:4.59.609 : lineOpen returned SUCCESS
10:5.0.953 : Calling lineMakeCall
hLine=x100f0
lphCall=x266a60
lpszDestAddress=x6f444
dwCountryCode=x0
lpCallParams=x0
10:5.0.953 : lineMakeCall returned x100de
10:5.0.953 : received LINE_REPLY
device=x0
cbInst=x0
param1=x100de,
param2=x80000019,
param3=x0,
LINEERR_INVALCALLPARAMS
Here is from TB3:
ITTAPI.CreateInstance ITTAPI_1
returned hr = 0x00000000
ITTAPI_1.Initialize returned hr = 0x00000000
ITTAPI_1.AdviseEventNotification returned hr = 0x00000000
cookie 990
ITTAPI_1.EnumerateAddresses returned hr = 0x00000000
IEnumAddress_1
IEnumAddress_1.Next ITAddress2_1
returned hr = 0x00000000
ITTAPI_1.put_EventFilter
long plFilterMask : 67108863 (0x03ffffff)
returned hr = 0x00000000
ITTAPI_1.RegisterCallNotifications
ITAddress* pAddress : ITAddress2_1
VARIANT_BOOL fMonitor : 1
VARIANT_BOOL fOwner : 1
long lMediaTypes : 8 (0x00000008)
long lCallbackInstance : 0 (0x00000000)
returned hr = 0x80070057
E_INVALIDARG ($80070057) source (null) description (null)
ITTAPI_1.Shutdown returned hr = 0x00000000
IEnumAddress_1.Release
ITAddress2_1.Release
ITTAPI_1.Shutdown returned hr = 0x00000001
ITTAPI_1.Release
In Julmar Phone, at first I couldn't use it because I didn't have any
'Address'. I had to add one in my source code lpLineDevCaps->dwNumAddresses
= 1;)
TSPI_lineDrop: enter
lpsUserUserInfo=(null)
dwSize=0
callstate: 100
hangUp: returning
Disconnect: enter
Disconnect: returning
DropActiveCall: enter
DropActiveCall: returning
SetCallState: enter
SetCallState: returning
TSPI_lineDrop: returning 66235
lpsUserUserInfo=(null)
dwSize=0
--------------------------
'Hang Up' button is still active
and there, I quit the program
TSPI_lineDrop: enter
lpsUserUserInfo=(null)
dwSize=0
callstate: 1
DropActiveCall: enter
DropActiveCall: returning
SetCallState: enter
SetCallState: returning
TSPI_lineDrop: returning 66218
lpsUserUserInfo=(null)
dwSize=0
--------------------------
TSPI_lineGetLineDevStatus
TSPI_lineCloseCall
TSPI_lineCloseCall: returning 0
--------------------------
TSPI_lineClose: enter
TSPI_lineClose: returning 0
--------------------------
TSPI_providerShutdown
TSPI_providerShutdown: returning 0
--------------------------
so basically I don't have any changes.
Where can I see in TB2 or TB3 what TSP it is using ?
Are there parameters important ? I mean that there are parameters in the
sample code that I didn't change because I thought I wouldn't use them ;
here are some from TSPI_lineGetDevCaps
lpLineDevCaps->dwStringFormat = STRINGFORMAT_ASCII;
lpLineDevCaps->dwAddressModes = LINEADDRESSMODE_ADDRESSID;
lpLineDevCaps->dwNumAddresses = 1;
lpLineDevCaps->dwBearerModes = LINEBEARERMODE_VOICE;
lpLineDevCaps->dwMaxRate = 9600;
lpLineDevCaps->dwMediaModes = LINEMEDIAMODE_INTERACTIVEVOICE |
LINEMEDIAMODE_DATAMODEM;
//
// Specify LINEDEVCAPFLAGS_MSP so tapi knows to call lineMSPIdentify for
// the MSP CLSID. Note: version must be 3.0 or higher
//
lpLineDevCaps->dwDevCapFlags = LINEDEVCAPFLAGS_CLOSEDROP |
LINEDEVCAPFLAGS_DIALBILLING |
LINEDEVCAPFLAGS_DIALQUIET |
LINEDEVCAPFLAGS_DIALDIALTONE;
lpLineDevCaps->dwAddressTypes = LINEADDRESSTYPE_PHONENUMBER;
lpLineDevCaps->dwMaxNumActiveCalls = 1;
lpLineDevCaps->dwRingModes = 1;
lpLineDevCaps->dwLineFeatures = LINEFEATURE_MAKECALL;
My TSP is for using Centrex phones, via sending XML commands to the server.
To this end, to detect if the remote party has terminated the call, I have a
thread that listen on a socket, but I end the thread on the LineDrop.
I thought about something else, from EnumDevices :
*lpdwNumLines = 1;
*lpdwNumPhones = 0;
Do I need to have NumPhones to 1 ? Maybe to say when the phone has been
hanged up after a disconnection.
Looking forward for any other suggestions.
Thanks, Adrien.
date: Thu, 29 May 2008 11:00:27 +0200
author: Adrien HAVAS
Re: Line doesn't Close after LineDrop
Adrien,
as Andreas already hinted: You need to send LINECALLSTATE_DISCONNECTED
first, then .._IDLE (you can send these two callstate messages immediately
after each
other).
Best regards,
Matthias Moetje
-------------------------------------
TAPI WIKI: http://www.tapi.info
-------------------------------------
TERASENS GmbH
Augustenstraße 24
80333 Munich, GERMANY
-------------------------------------
e-mail: moetje at terasens dot com
www: www.terasens.com
-------------------------------------
"Adrien HAVAS" wrote in message
news:OA3UIBKwIHA.4772@TK2MSFTNGP03.phx.gbl...
> So here is my problem. I started my own TSP using Atsp32 from the
> Microsoft SDK, I compile with Visual Studio 2003, and I use Outlook 2003
> on Win XP to test my TSP.
> I've had many problems since the start, and most of them have been managed
> by all the answers I found on the internet. But now, although I can make a
> call and stop it using the two buttons in Outlook, the message displayed
> stays in the state 'hang up'. My log shows that the TSP has a call to the
> function LineDrop, but it doesn't go further. My only solution is to close
> Outlook, and then I have LineDrop again, LineCloseCall, LineClose, and
> ProviderShutdown.
>
>
> Here is my log from the moment I click on 'end call'
>
> TSPI_lineDrop: enter
> lpsUserUserInfo=(null)
> dwSize=0
> callstate: 100
> hangUp: enter
> hangUp: returning
> Disconnect: enter
> Disconnect: returning
> DropActiveCall: enter
> DropActiveCall: returning
> SetCallState: enter
> SetCallState: returning
> TSPI_lineDrop: returning 66201
> lpsUserUserInfo=(null)
> dwSize=0
> --------------------------
>
> and that's when I close Outlook
>
> TSPI_lineDrop: enter
> lpsUserUserInfo=(null)
> dwSize=0
> callstate: 1
> DropActiveCall: enter
> DropActiveCall: returning
> SetCallState: enter
> SetCallState: returning
> TSPI_lineDrop: returning 66184
> lpsUserUserInfo=(null)
> dwSize=0
> --------------------------
> TSPI_lineCloseCall
> TSPI_lineCloseCall: returning 0
> --------------------------
> TSPI_lineClose: enter
> TSPI_lineClose: returning 0
> --------------------------
> TSPI_providerShutdown
> TSPI_providerShutdown: returning 0
>
>
> and here is my function LineDrop
> LONG
> TSPIAPI
> TSPI_lineDrop(
> DRV_REQUESTID dwRequestID,
> HDRVCALL hdCall,
> LPCSTR lpsUserUserInfo,
> DWORD dwSize
> )
> {
> PDRVLINE pLine = (PDRVLINE) hdCall;
> writeLog("TSPI_lineDrop: enter");
> writeLog("\nlpsUserUserInfo=");
> writeLogLPCSTR(lpsUserUserInfo);
> writeLog("\ndwSize=");
> writeLogDWORD(dwSize);
> #if DBG
> FUNC_PARAM params[] =
> {
> { gszdwRequestID, dwRequestID },
> { gszhdCall, hdCall },
> { "lpsUserUserInfo", lpsUserUserInfo },
> { gszdwSize, dwSize }
> };
> FUNC_INFO info =
> {
> "TSPI_lineDrop",
> 4,
> params
> };
> #endif
> writeLog("\ncallstate: ");
> writeLogDWORD(pLine->dwCallState);
> if(pLine->dwCallState == LINECALLSTATE_CONNECTED) hangUp();
> if(connected == 1) disconnect();
> Prolog (&info);
> DropActiveCall (pLine);
> SetCallState (pLine, LINECALLSTATE_IDLE, 0);
> (*gpfnCompletionProc)(dwRequestID, 0);
> //dealloc();
> //TSPI_lineCloseCall(hdCall);
> //TSPI_lineClose((HDRVLINE)line);
> //TSPI_providerShutdown(version, providerID);
> writeLog("\nTSPI_lineDrop: returning ");
> writeLogLONG(Epilog (&info, dwRequestID));
> writeLog("\nlpsUserUserInfo=");
> writeLogLPCSTR(lpsUserUserInfo);
> writeLog("\ndwSize=");
> writeLogDWORD(dwSize);
> writeLog("\n--------------------------\n");
> return (Epilog (&info, dwRequestID));
> //return 0;
> }
>
>
>
> as you can see, I've tried things bu it doesn't work either. Do you have a
> hint ?
>
>
> --
> Adrien HAVAS
> Student at ECE, School of Engineering Paris - Information Systems &
> Networking
>
>
date: Thu, 29 May 2008 23:16:59 +0200
author: Matthias Moetje [MVP]
Re: Line doesn't Close after LineDrop
I enabled traces on tapi and tapisrv, and I found errors, it seems that the
call hasn't any ID. I can't find in the Atsp32 where an ID is assigned to a
call. Could it be the reason of my problem ?
[2956] 11:35:23:953: [INFO ] LMakeCall: pCallParamsApp 00C67250.
[2956] 11:35:23:953: [TRACE] CreatetCallAndClient: enter,
ptLineClient=00C67078
[2956] 11:35:23:953: [TRACE] CreatetCall: enter, ptLine=00C67160
[2956] 11:35:23:953: [INFO ] CreatetCall: calling NewObject ptCall 00C674C0
[2956] 11:35:23:953: [TRACE] CreatetCall: NewObject returned 0x10311
[2956] 11:35:23:953: [TRACE] CreatetCall: exit, new ptCall=00C674C0
[2956] 11:35:23:953: [TRACE] CreatetCallClient: enter, ptCall=00C674C0,
[2956] 11:35:23:953: [INFO ] CreatetCallClient: calling NewObject,
ptCallClient = [00C6753C]
[2956] 11:35:23:953: [TRACE] CreatetCallClient: exit, new
ptCallClient=00C6753C
[2956] 11:35:23:953: [TRACE] LMakeCall: calling CallSP7
[2956] 11:35:23:953: [TRACE] LineEventProcSP - enter
[2956] 11:35:23:953: [INFO ] HTapiLine=00C67160, HTapiCall=00000000, msg=2,
P1=x10, P2=x0, P3=x0
[3760] 11:35:23:953: [INFO ] Got an spevent
[3760] 11:35:23:953: [TRACE] LineEventProc
[3760] 11:35:23:953: [EVENT] LineEventProc: LINE_CALLSTATE event x10
[3760] 11:35:23:953: [ERROR] LINECALLSTATE: Failed call access for call=
x00000000
[3760] 11:35:23:953: [INFO ] Line=xc67160 p1=x10 p2=x0 p3=x0
[2956] 11:35:24:296: [TRACE] LineEventProcSP - enter
[2956] 11:35:24:296: [INFO ] HTapiLine=00C67160, HTapiCall=00000000, msg=2,
P1=x100, P2=x0, P3=x0
[3760] 11:35:24:296: [INFO ] Got an spevent
[3760] 11:35:24:296: [TRACE] LineEventProc
[3760] 11:35:24:296: [EVENT] LineEventProc: LINE_CALLSTATE event x100
[3760] 11:35:24:296: [ERROR] LINECALLSTATE: Failed call access for call=
x00000000
[3760] 11:35:24:296: [INFO ] Line=xc67160 p1=x100 p2=x0 p3=x0
[2956] 11:35:24:296: [TRACE] CompletionProcSP: enter, dwReqID=x10322,
lResult=x0
[3760] 11:35:24:296: [INFO ] Got an spevent
[3760] 11:35:24:296: [TRACE] CompletionProc: enter, dwReqID=x10322,
lResult=x0
[3760] 11:35:24:296: [TRACE] WriteEventBuffer - enter
[3760] 11:35:24:296: [TRACE] WriteEventBuffer: SetEvent 00000118 for local
client
[2956] 11:35:24:296: [ERROR] LMakeCall: CallSP7 returnded 10322
[2956] 11:35:24:296: [TRACE] LMakeCall: calling LINEEPILOGASYNC
[2956] 11:35:24:296: [TRACE] LineEpilogAsyc: exit, result=x10322
[2956] 11:35:24:296: [TRACE] LMakeCall: LINEEPILOGASYNC returned
date: Fri, 30 May 2008 11:56:22 +0200
author: Adrien HAVAS
Re: Line doesn't Close after LineDrop
"Adrien HAVAS" schrieb im Newsbeitrag
news:eoxL0pWwIHA.1772@TK2MSFTNGP03.phx.gbl...
> Where can I see in TB2 or TB3 what TSP it is using ?
Adrien,
in TAPI2 by dwDeviceID at lineOpen(),
in TAPI3 by ITAddress at ITTAPI::RegisterCallNotifications()
> Are there parameters important ? I mean that there are parameters in the
> sample code that I didn't change because I thought I wouldn't use them ;
> here are some from TSPI_lineGetDevCaps
>
> lpLineDevCaps->dwStringFormat = STRINGFORMAT_ASCII;
> lpLineDevCaps->dwAddressModes = LINEADDRESSMODE_ADDRESSID;
> lpLineDevCaps->dwNumAddresses = 1;
> lpLineDevCaps->dwBearerModes = LINEBEARERMODE_VOICE;
> lpLineDevCaps->dwMaxRate = 9600;
dwMaxRate is only relevanmt for LINEMEDIAMODE_DATAMODEM.
> lpLineDevCaps->dwMediaModes = LINEMEDIAMODE_INTERACTIVEVOICE |
> LINEMEDIAMODE_DATAMODEM;
Since you don't do data you don't need LINEMEDIAMODE_DATAMODEM.
> // Specify LINEDEVCAPFLAGS_MSP so tapi knows to call lineMSPIdentify for
> // the MSP CLSID. Note: version must be 3.0 or higher
> //
> lpLineDevCaps->dwDevCapFlags = LINEDEVCAPFLAGS_CLOSEDROP |
Is you TSP automatically dropping a call on TSPI_lineCLose() ?
If not the remove this flag.
> LINEDEVCAPFLAGS_DIALBILLING |
> LINEDEVCAPFLAGS_DIALQUIET |
> LINEDEVCAPFLAGS_DIALDIALTONE;
> lpLineDevCaps->dwAddressTypes = LINEADDRESSTYPE_PHONENUMBER;
> lpLineDevCaps->dwMaxNumActiveCalls = 1;
> lpLineDevCaps->dwRingModes = 1;
> lpLineDevCaps->dwLineFeatures = LINEFEATURE_MAKECALL;
>
>
> My TSP is for using Centrex phones, via sending XML commands to the server.
> To this end, to detect if the remote party has terminated the call, I have a
> thread that listen on a socket, but I end the thread on the LineDrop.
>
> I thought about something else, from EnumDevices :
> *lpdwNumLines = 1;
> *lpdwNumPhones = 0;
>
> Do I need to have NumPhones to 1 ? Maybe to say when the phone has been
> hanged up after a disconnection.
No, you don't need to support the phone device stuff to get a TSP operate with
outlook.
--
Best Regards
Andreas Marschall
Microsoft MVP for TAPI / Windows SDK
TAPI / TSP Developer and Tester
My TAPI and TSPI FAQ:
http://www.I-B-A-M.de/Andreas_Marschall's_TAPI_and_TSPI_FAQ.htm
My Toto® Tools (a collection of free, mostly TAPI related tools):
http://www.i-b-a-m.de/Andreas_Marschall's_Toto_Tools.htm
TAPI development around the world (Frappr! map):
http://www.frappr.com/TAPIaroundTheWorld
* 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.
date: Mon, 2 Jun 2008 16:53:34 +0200
author: Andreas Marschall [MVP TAPI]
|
|