How to install the TAPI Service Provider(TSP) using Setup.exe. Using Setup,
I am able to copy my TSP to the System32 folder.
But I want my TSP to be installed during the Setup(Added in the Providers
list of "Phone and Modem Options" > "Advanced" without adding it manually)
How Can I do this in VC++ 2008? Any Help will be greately appreciable.
Regards,
Akil
Akil,
you need to call lineAddProvider() from TAPI32.LIB/DLL.
Please see MSDN for details.
--
Best Regards
Andreas Marschall
Microsoft MVP for TAPI / Windows SDK / Visual C++ 2003-2008
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.
Is there any sample code(Sample TSP with setup) calling lineAddProvider()
from Setup.exe?
Regards,
Akil
"Andreas Marschall [exMVP TAPI]" <Andreas....@I-B-A-M.de> wrote in
message news:OJkodibb...@TK2MSFTNGP06.phx.gbl...
Akil,
sorry, no public sample that I'm aware of.
Basically you can do this by dynamically loading TAPI32.DLL via
LoadLibrary(),
retieving the function pointer for lineAddProvider() via GetProcAddress(),
and finally call lineAddProvider() via that function pointer.
#include
<windows.h>#include
<stdio.h>typedef
LONG (WINAPI *PLAP)(LPCSTR , HWND, LPDWORD);VOID main(VOID)
{
HINSTANCE hinstLib;
PLAP pLAP;
BOOL fFreeResult, fRunTimeLinkSuccess = FALSE;
// Get a handle to the DLL module.hinstLib = LoadLibrary(TEXT(
"TAPI32.DLL")); // If the handle is valid, try to get the function address. if (hinstLib != NULL){
pLAP = (PLAP)GetProcAddress(hinstLib,
"lineAddProvider"); // If the function address is valid, call the function. if (NULL != pLAP){
fRunTimeLinkSuccess = TRUE;
LPCSTR lpszUIDLLName =
"C:\\WINDOWS\\system32\\telesc5.tsp";LONG lResult = (pLAP)(lpszUIDLLName, NULL, NULL);
}
// Free the DLL module.fFreeResult = FreeLibrary(hinstLib);
}
// If unable to call the DLL function, use an alternative. if (! fRunTimeLinkSuccess)printf(
"Message printed from executable\n");}
"Akil Dsouza" <d.a...@teles.com> schrieb im Newsbeitrag news:OFcZJamb...@TK2MSFTNGP05.phx.gbl...
#include <windows.h>#include <stdio.h>typedef LONG (WINAPI *PLAP)(LPCSTR , HWND, LPDWORD);VOID main(VOID){HINSTANCE hinstLib;PLAP pLAP;BOOL fFreeResult, fRunTimeLinkSuccess = FALSE;// Get a handle to the DLL module.hinstLib = LoadLibrary(TEXT("TAPI32.DLL"));// If the handle is valid, try to get the function address.if (hinstLib != NULL){pLAP = (PLAP)GetProcAddress(hinstLib, "lineAddProvider");// If the function address is valid, call the function.if (NULL != pLAP){fRunTimeLinkSuccess = TRUE;LPCSTR lpszUIDLLName = "C:\\WINDOWS\\system32\\telesc5.tsp";LONG lResult = (pLAP)(lpszUIDLLName, NULL, NULL);}// Free the DLL module.fFreeResult = FreeLibrary(hinstLib);}// If unable to call the DLL function, use an alternative.if (! fRunTimeLinkSuccess)printf("Message printed from executable\n");}But I am getting lResult = LINEERR_INVALPOINTER. May I know what is going wrong in my code?
I am able to add my TSP in the Providers list of "Phone and Modem Options"
> "Advanced" using lineAddProvider
Now I want to open the Configuration dialog box of my TSP with
lineConfigProvider. But the dialog box is not opening at all.
The code block for lineAddProvider() and lineConfigProvider() as follows
hinstLib = LoadLibrary(TEXT("TAPI32.DLL"));
if (hinstLib != NULL)
{
pLAP = (PLAP)GetProcAddress(hinstLib, "lineAddProvider");
// If the function address is valid, call the function.
if (NULL != pLAP)
{
DWORD dwPermanentProviderID;
LPCSTR lpszUIDLLName = "C:\\WINDOWS\\system32\\telesc5.tsp";
lResult = (pLAP)(lpszUIDLLName, NULL, &dwPermanentProviderID);
if(lResult == 0)
{
pLCP = (PLCP)GetProcAddress(hinstLib, "lineConfigProvider");
if(NULL != pLCP)
{
lResult = (pLCP)(NULL, dwPermanentProviderID);
}
}
}
// Free the DLL module.
fFreeResult = FreeLibrary(hinstLib);
}
Any suggestions? Pleses help
Regards,
Akil
"Andreas Marschall [exMVP TAPI]" <Andreas....@I-B-A-M.de> wrote in
message news:uNACn2bb...@TK2MSFTNGP06.phx.gbl...
> DWORD dwPermanentProviderID;
> LPCSTR lpszUIDLLName = "C:\\WINDOWS\\system32\\telesc5.tsp";
> lResult = (pLAP)(lpszUIDLLName, NULL, &dwPermanentProviderID);
> if(lResult == 0)
> {
> pLCP = (PLCP)GetProcAddress(hinstLib, "lineConfigProvider");
> if(NULL != pLCP)
> {
> lResult = (pLCP)(NULL, dwPermanentProviderID);
Akil,
what lResult do you get from lineConfigProvider() ?
After adding your TSP, is the "Configure..." button enabled in
PhoneAndModemOptions?
If so, what happens when you click it?
Does your TSP-UI show up correctly?
Did you implement ?:
- TSPI_providerUIIdentify()
- TSPI_providerConfig(), needs just to return 0; nothing else to do
- TUISPI_providerConfig()
Did you export these function from your TSP / UI.DLL ?
what lResult do you get from lineConfigProvider() ?
> 0(Zero)
After adding your TSP, is the "Configure..." button enabled in
PhoneAndModemOptions?
>Yes
If so, what happens when you click it?
>It opens a dialog box where I can configure my TSP.
Does your TSP-UI show up correctly?
> Yes
Did you implement ?:
- TSPI_providerUIIdentify()
>Yes
- TSPI_providerConfig(), needs just to return 0; nothing else to do
>Yes, just returns 0.
- TUISPI_providerConfig()
>Yes
Did you export these function from your TSP / UI.DLL ?
>Yes, exported from my TSP
When I open it manually(Phone and Modem Options>Advanced>Configure), It is
working absolutely fine.
But When I try to open the Cofiguration dialog box using
lineConfigProvider(NULL, dwPermanentProviderID) as shoiw in the code block,
it is not opening at all.
Regards,
Akil
"Andreas Marschall [exMVP TAPI]" <Andreas....@I-B-A-M.de> wrote in
message news:%23jOMLHo...@TK2MSFTNGP04.phx.gbl...
> When I open it manually(Phone and Modem Options>Advanced>Configure), It is
> working absolutely fine.
> But When I try to open the Cofiguration dialog box using
> lineConfigProvider(NULL, dwPermanentProviderID) as shoiw in the code
> block, it is not opening at all.
Akil,
can you reproduce the issue with MS TAPI Browser TB20 ?
You need to check the "Params" checkbox within TB20 to alter the function
params for lineAddProvider().
lineAddProvider is returning SUCESS,
But how to see the value of dwPermanentProviderID which needs to be used in
the lineConfigProvider ?(because default is giving LINEERR_OPERATIONUNAVAIL
for lineConfigProvider)
Regards,
Akil
"Andreas Marschall [exMVP TAPI]" <Andreas....@I-B-A-M.de> wrote in
message news:uW8ImDqb...@TK2MSFTNGP04.phx.gbl...
hinstLib = LoadLibrary(TEXT(
"TAPI32.DLL"));{
pLAP = (PLAP)GetProcAddress(hinstLib,
{
DWORD dwPermanentProviderID;
LPCSTR lpszUIDLLName =
"C:\\WINDOWS\\system32\\telesc5.tsp";lAddResult = (pLAP)(lpszUIDLLName, NULL, &dwPermanentProviderID);
if(lAddResult == 0){
pLCP = (PLCP)GetProcAddress(hinstLib,
"lineConfigProvider"); if(NULL != pLCP){
lConfigResult = (pLCP)(NULL, dwPermanentProviderID);
}
}
}
fFreeResult = FreeLibrary(hinstLib);
"Akil Dsouza" <d.a...@teles.com> wrote in message news:OILi2iyb...@TK2MSFTNGP04.phx.gbl...
"Akil Dsouza" <d.a...@teles.com> schrieb im Newsbeitrag news:OILi2iyb...@TK2MSFTNGP04.phx.gbl...
Hello Andreas,Logs from TB20:= = = = = = = = =11:35.6.36 : Calling lineAddProvider
lpszProviderFilename=x6ac10
hwndOwner=x0
lpdwPermanentProviderID=x6ac74 [ Here I set the value in the Buffer byte editor as 00000001 ]
11:35.6.67 : lineAddProvider returned SUCCESS
11:35.25.145 : Calling lineConfigProvider
hwndOwner=x0
dwPermanentProviderID=x1
11:35.55.661 : lineConfigProvider returned SUCCESSWhen I run lineConfigProvider from TB20, I get "Phone and Modem Options" window invoked instead configuration dialog box of my TSPWhat could be the problem?
Akil,
please try lineGetProviderList().
See my TAPI and TSPI FAQ:
Q: How do I get the dwPermanentProviderID of the TSP for a given line device
?
http://www.i-b-a-m.de/Andreas_Marschall's_TAPI_and_TSPI_FAQ.htm#_Q:_How_do_14
"Akil Dsouza" <d.a...@teles.com> schrieb im Newsbeitrag news:uC2aZQ0b...@TK2MSFTNGP04.phx.gbl...
In some way, I found the value of dwPermamentProviderID of my TSP, and copied that value into thelineConfigProvider(NULL, dwPermanentProviderID) of TB20 and this time the UI dialog box of my TSP get displayed.But I am still not getting it from the Setup.exe
DWORD dwPermanentProviderID;LPCSTR lpszUIDLLName = "C:\\WINDOWS\\system32\\telesc5.tsp";lAddResult = (pLAP)(lpszUIDLLName, NULL, &dwPermanentProviderID);
"lineConfigProvider");pLCP = (PLCP)GetProcAddress(hinstLib,
lConfigResult = (pLCP)(NULL, dwPermanentProviderID);
"Andreas Marschall [exMVP TAPI]" <Andreas....@I-B-A-M.de> wrote in message news:eGpia73...@TK2MSFTNGP02.phx.gbl...
"Akil Dsouza" <d.a...@teles.com> schrieb im Newsbeitrag news:uSOKmAYc...@TK2MSFTNGP05.phx.gbl...
LINEPROVIDERENTRY[8]
dwPermanentProviderID=x16b
dwProviderFilenameSize=x23
dwProviderFilenameOffset=x156
xxxx3a43 xxxxxxxx xxxxxxxx xxxxxxxx C:
49575c5c 574f444e 735c5c53 65747379 \\WINDOWS\\syste
5c32336d 6c65745c 35637365 7073742e m32\\telesc5.tsp
xxxxxx00 xxxxxxxx xxxxxxxx xxxxxxxx .
Is the problem related with path(c:\\WINDOWS\\system32\\telesc5.tsp) ?Because for other TSPs it is not showing c:\\WINDOWS\\system32 path.
"Andreas Marschall [exMVP TAPI]" <Andreas....@I-B-A-M.de> wrote in message news:uhEZZ$ZcKH...@TK2MSFTNGP02.phx.gbl...
"Akil Dsouza" <d.a...@teles.com> wrote in message news:e1n20fac...@TK2MSFTNGP06.phx.gbl...
Akil,
did you actually test removing the path from registry?
Did it lineConfigProvider theny work from code?
> In TB20, If I call lineConfigProvider() with proper dwPermanentProviderID
> then it displays the dialog box of my TSP, and when I close the dialog box
> lineConfigProvider() returns SUCCESS(value 0)
> Whereas from Install.exe, If I call lineConfigProvider() with proper
> dwPermanentProviderID, it immediately returns SUCCESS(value 0), but no
> dialog box get displayed.
Do you always lineAddProvider() before lineConfigProvider() from code?
Does it work if you only do lineConfigProvider() from code?
Akil,
MSDN says on lineConfigProvider(): "This is basically a straight
pass-through to TSPI_providerConfig"
and on TSPI_providerConfig(): "The TSPI_providerConfig function is
obsolete. TAPI version 1.4 or earlier service providers can implement this
TSPI function. TAPI version 2.0 or later TSPs implement
TUISPI_providerConfig."
Again, are you sure that you both implemented and exported (e.g. by means of
.DEF file) both TSPI_providerConfig() and TUISPI_providerConfig() ?
Do you have a separate TSP file and UI.DLL file? If so, where did you
implement/export TSPI_providerConfig() and TUISPI_providerConfig() ?
In general it is recommended to implement and export *all* TSPI_ and TUISPI_
function, at least tracing function entry, params and return value.
If you don't want/need to implement any active code then just do the tracing
and appropriately return 0 or PHONEERR_/LINEERR_OPERATIONUNAVAIL
Regarding H323.TSP: with MS VS Dependency Walker I can see the function
entry points for the following _provider functions:
TSPI_providerConfig
TSPI_providerCreateLineDevice
TSPI_providerEnumDevices
TSPI_providerGenericDialogData
TSPI_providerInit
TSPI_providerInstall
TSPI_providerRemove
TSPI_providerShutdown
TSPI_providerUIIdentify
TUISPI_providerConfig
TUISPI_providerInstall
TUISPI_providerRemove
LIBRARY telesc5
EXPORTS
TSPI_providerInit
TSPI_providerShutdown
TSPI_lineNegotiateTSPIVersion
TSPI_providerEnumDevices
TSPI_lineGetDevCaps
TSPI_lineGetAddressCaps
TSPI_lineOpen
TSPI_lineMakeCall
TSPI_lineDrop
TSPI_lineCloseCall
TSPI_lineGetLineDevStatus
TSPI_lineGetAdressStatus
TSPI_lineGetCallStatus
TSPI_lineGetCallInfo
TSPI_lineGetCallAddressID
TUISPI_providerInstall
TUISPI_providerConfig
TUISPI_providerRemove
TSPI_providerRemove
TUISPI_providerUIIdentify
TSPI_lineAccept
TSPI_lineAddToConference
TSPI_lineAnswer
TSPI_lineBlindTransfer
TSPI_lineClose
TSPI_lineCompleteCall
TSPI_lineCompleteTransfer
TSPI_lineConditionalMediaDetection
TSPI_lineDevSpecific
TSPI_lineDevSpecificFeature
TSPI_lineDial
TSPI_lineDropOnClose
TSPI_lineDropNoOwner
TSPI_lineForward
TSPI_lineGatherDigits
TSPI_lineGenerateDigits
TSPI_lineGenerateTone
TSPI_lineGetAddressCaps
TSPI_lineGetAddressID
TSPI_lineGetAddressStatus
TSPI_lineGetCallInfo
TSPI_lineGetDevConfig
TSPI_lineGetExtensionID
TSPI_lineGetIcon
TSPI_lineGetID
TSPI_lineGetNumAddressIDs
TSPI_lineHold
TSPI_lineMonitorDigits
TSPI_lineMonitorMedia
TSPI_lineMonitorTones
TSPI_lineNegotiateExtVersion
TSPI_linePark
TSPI_linePickup
TSPI_linePrepareAddToConference
TSPI_lineRedirect
TSPI_lineReleaseUserUserInfo
TSPI_lineRemoveFromConference
TSPI_lineSecureCall
TSPI_lineSelectExtVersion
TSPI_lineSendUserUserInfo
TSPI_lineSetAppSpecific
TSPI_lineSetCallData
TSPI_lineSetCallParams
TSPI_lineSetCallQualityOfService
TSPI_lineSetCallTreatment
TSPI_lineSetCurrentLocation
TSPI_lineSetDefaultMediaDetection
TSPI_lineSetDevConfig
TSPI_lineSetLineDevStatus
TSPI_lineSetMediaControl
TSPI_lineSetMediaMode
TSPI_lineSetStatusMessages
TSPI_lineSetTerminal
TSPI_lineSetupConference
TSPI_lineSetupTransfer
TSPI_lineSwapHold
TSPI_lineUncompleteCall
TSPI_lineUnhold
TSPI_lineUnpark
TSPI_phoneClose
TSPI_phoneDevSpecific
TSPI_phoneGetButtonInfo
TSPI_phoneGetData
TSPI_phoneGetDevCaps
TSPI_phoneGetDisplay
TSPI_phoneGetExtensionID
TSPI_phoneGetGain
TSPI_phoneGetHookSwitch
TSPI_phoneGetIcon
TSPI_phoneGetID
TSPI_phoneGetLamp
TSPI_phoneGetRing
TSPI_phoneGetStatus
TSPI_phoneGetVolume
TSPI_phoneNegotiateExtVersion
TSPI_phoneNegotiateTSPIVersion
TSPI_phoneOpen
TSPI_phoneSelectExtVersion
TSPI_phoneSetButtonInfo
TSPI_phoneSetData
TSPI_phoneSetDisplay
TSPI_phoneSetGain
TSPI_phoneSetHookSwitch
TSPI_phoneSetLamp
TSPI_phoneSetRing
TSPI_phoneSetStatusMessages
TSPI_phoneSetVolume
TSPI_providerConfig
TSPI_providerCreateLineDevice
TSPI_providerCreatePhoneDevice
TSPI_providerFreeDialogInstance
TSPI_providerGenericDialogData
TSPI_providerInstall
TSPI_providerShutdown
TSPI_providerUIIdentify
TUISPI_lineConfigDialog
TUISPI_lineConfigDialogEdit
TUISPI_phoneConfigDialog
TUISPI_providerGenericDialog
TUISPI_providerGenericDialogData
"Akil Dsouza" <d.a...@teles.com> schrieb im Newsbeitrag news:exH5IDcc...@TK2MSFTNGP05.phx.gbl...
All functions are implemented(Atleast have Log entry + Return value)The telesc5.DEF file contains following details:
LIBRARY telesc5
EXPORTS
TSPI_providerInit
TSPI_providerShutdown
TSPI_providerEnumDevices
TUISPI_providerInstall
TUISPI_providerConfig
TUISPI_providerRemove
TSPI_providerRemove
TUISPI_providerUIIdentify
TSPI_providerConfig
TSPI_providerCreateLineDevice
TSPI_providerCreatePhoneDevice
TSPI_providerFreeDialogInstance
TSPI_providerGenericDialogData
TSPI_providerInstall
TSPI_providerShutdown
TSPI_providerUIIdentify
TUISPI_providerGenericDialog
TUISPI_providerGenericDialogData
"Andreas Marschall [exMVP TAPI]" <Andreas....@I-B-A-M.de> wrote in message news:emQ7Urc...@TK2MSFTNGP05.phx.gbl...
"Andreas Marschall [exMVP TAPI]" <Andreas....@I-B-A-M.de> wrote in message news:emQ7Urc...@TK2MSFTNGP05.phx.gbl...
"Akil Dsouza" <d.a...@teles.com> schrieb im Newsbeitrag news:Ou$fS6ncK...@TK2MSFTNGP02.phx.gbl...
Hello Andreas,I just checked your _provider functions exports:- TUISPI_providerUIIdentify is not a TUISPI function>>>No, I didn't get your point here. I have both the functions defined in my TSP and>>>TSPI_providerUIIdentify has the implementation and TUISPI_providerUIIdentify simply returns 0.- TSPI_providerShutdown duplicate occurance>>>Removing the duplicate entry doesn't solve the problemIs you TSPI_providerUIIdentify() implementatio correct (because of the misspelling as TUISPI_providerUIIdentify)?>>>I think Implementation must be correct, as it it is working with TB20 and direct TSP configure from telephon.cplWhat logs do you get from your TSP when calling lineAddProvier() ?>>> Please Check the Log file attached(TelesC5Tsp.log)