Howto:Troubleshooting the TAPI service provider

From innovaphone wiki
Jump to navigation Jump to search

The innovaphone TAPI service provider (like all TSPs) is actually a DLL loaded by a the system on behalf of a TAPI applications TAPI request. This causes some problems, here is how to deal with it.

Applies To

This information applies to all TSP versions.

More Information

Generally, read the respective reference article for the TSP version you are using first:

What exactly is a TSP?

The innovaphone TAPI Service Provider is a DLL which is loaded by the system under certain conditions. In previous Windows versions, it was loaded by a dedicated system service (TapiSrv.exe). In newer Versions (Windows 2000 and up), the TapiSrv itself is actually a DLL loaded by a generic service host process (svchost.exe).

When is the TSP loaded?

The TSP will be loaded by the telephony service as soon as a TAPI application is performing any TAPI request, regardless of the TAPI line it actually uses. In the system standard configuration, some service using TAPI are started upon boot, so the telephony service und hence the TSP will get loaded on system boot.

When is the TSP unloaded?

The conditions when a TSP is unloaded are not defined. In the system standard configuration, the TSP is loaded at system boot and is never unloaded. Clearly, the TSP will be unloaded when the windows telephony service is terminated. To make sure the TSP is unloaded, you need to restart the telephony service thus (see below).

When is the TSP configuration evaluated?

The TSP reads its configuration once when it is loaded. Thus for a configuration change to take effect, you need to reload the TSP.

How can I reload/restart the TSP?

When the TSP is re-configured, the new configuration is not effective until the TSP is re-loaded. If a machine re-boot is undesirable, the Windows Telephony Service must be restarted. Unfortunately, while this can be done using the Service tab in the Window’s System Control Panel, stopping the telephony service often hangs when it tries to stop other services depending on the telephony service. Most often, the RAS service causes this problem.

If you don’t need RAS on the machine the TSP is installed on, then you can safely deactivate the RAS service in the service control panel. After a reboot the RAS service will not be started and you should be able to stop and restart the telephony service without problems.

How can I verify the TSP?

When the TSP is installed, the first thing you should do is to start the phone.exe test program installed by the TSP’s installation routine. In the Device drop down list, you should see – amongst others – all innovaphone PBX lines you defined to be controlled by TAPI. Depending on the number of TSPs you have additionally installed, you will see various other lines.

If you don’t see the lines you intend to use with TAPI, then most likely your TAPI configuration is wrong. The TSP actually sees all PBX objects which are member of groups where the PBX objects configured as PBX Access Username is an active member of. Each such PBX object is presented as a TAPI line to TAPI applications.

If you see the line you want to work with, then click the Start Session button, type in a number into the Phone # field and click Make Call. Provided the object is a normal user object and a telephone is registered, the telephone should now perform an outgoing call. If the Make Call button stays grey, the line is monitored but not controlled by TAPI. This is either cause there is no registration or you selected the wrong Control mode in the TAPI configuration. In a 3rd party configuration, you should select Control and monitor all users so you can control all visible lines. In a 1st party configuration, you may want to use Control selected user, monitor all users. However, in this case you will indications for each call on any visible line but you can control only the line selected as PBX Access Username.

If you change the configuration, make sure you restart the TSP (see above).

How can I debug the TSP?

If the TSP still doesn’t work, you need to have the TSP generate trace files. For performance reasons, the standard TSP installed will not do so. To install the debug version

  • de-install the TSP from system control panel add/remove software (de-install the product, don't just remove the TSP from the TAPI configuration)
  • re-install the same version of the tapi using the special debug version installer (it is in the same download package)

The TSP will now write trace messages to the C:\…\innovaphone\innovaphone® PBX TSP\tsp-xxxx-xx-xx-xx.log trace files (switching on an hourly basis).

The debug version will generate huge debug files and they will grow quickly. As they are written in the install directory and this is in the windows root drive often, this may ultimately crash your system! So watch out and make sure you delete log files before your drive is full (compressing the TSP install directory may help).

Also, the debug version will create substantial CPU load on the system. Depending on the size of the PBX and the processing power of your TSP host, this may result in slow response from the TSP. Also, some situations are more CPU intensive than others, so you may experience intermittent phases of high CPU load. On a multiprocessor system, you may want to change the ProcessorMask registry tweak.

Debugging more recent TSP Versions (Version 8 and up)

Recent TSP versions can write log files in both debug and retail versions. Installing the debug is only useful if the TSP crashes as it produces meaningful crash dump files in this case. The TSP Control utility allows to set the number of log files kept. This can be used to prevent the logs to fill up your disk (see above).

Writing Log Files to a separate Disk

If you for whatever reason need to keep a lot of log files and want to save them on a separate disk, the easiest way is to de-install the TSP package and re-install it to another disk. There is no need to de-install the TSP from the Telephony and Modem control applet (this would make you loose your configuration).

What if the TSP cannot be unloaded because stopping the telephony service hangs?

In some cases, service control panel cannot stop the telephony service although there are no other services that depend on telephony services. In this case, you need to terminate the process hosting the TSP DLL.

As mentioned above, the TSP is loaded by TapiSrv.dll which in turn is loaded by svchost.exe. Unfortunately, for optimization purposes, windows will not only run the telephony service within a single svchost process. Instead, it loads various service DLLs into a single process. The exact conditions for which services run in the same svchost are determined by registry settings.

You can see the services running in the various svchost instances on the system using tlist –s on Windows 2000 or tasklist /svc on Windows XP. The telephony service is called TapiSrv. On Windows XP, you might see something like:

svchost.exe                1292 AudioSrv, Browser, CryptSvc, Dhcp, dmserver, ERSvc, EventSystem,
                           helpsvc,lanmanserver, lanmanworkstation, Netman, Nla, Schedule, TapiSrv,
                           seclogon, SENS, SharedAccess, ShellHWDetection, srservice, Themes, TrkWks,
                           W32Time, winmgmt, wuauserv, WZCSVC

svchost.exe                1352 Dnscache

To be able to terminate a hanging TSP, you need to verify the telephony service is the only service running in its svchost.exe instance. Typically, in server configurations, this is the case anyway. If not, you need to change registry entries. You must only do this if you feel comfortable with changing the registry. Changing the registry may cause the telephony service or the whole system to behave incorrect or may even prevent the system from booting.

To configure the telephony service to run a separate svchost.exe instance, follow these steps:

  • Open the registry editor regedit.exe
  • Locate the key HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\SvcHost
  • Find the MULTI_SZ value that contains TapiSrv (this will usually be the netsvcs value)
  • Open the value and remove the TapiSrv string (be sure not to alter any other part of this string value), Save it
  • Create a new MULTI_SZ value called TapiSrv and add TapiSrv as a single entry, Save it
  • Locate the HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\TapiSrv key
  • Edit the ImagePath EXPAND_SZ value and replace netsvsc by TapiSrv (so it reads something like %SystemRoot%\System32\svchost.exe -k TapiSrv)
  • Quit the registry editor and reboot the system

When the telephony service is started, it will be the only service running in its svchost.exe.

To terminate a hanging TSP, identify the svchost.exe instance running TapiSrv and terminate it using task manager or one of the various kill utilities available. When you have the debug version of the TSP installed, it will write its process ID into the file C:\tsp.txt.

In very rare case, a trace of the Windows TAPI subsystem may be helpful. This can be done using the commands (from the windows command prompt):

> netsh ras set tracing tapi32 enable

> netsh ras set tracing tapisrv enable

This will create log files in the %WINDIR%\tracing log file directory.

The size of the protocol file can configured with the REG_DWORD HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Tracing\tapi**\MaxFileSize

What if the TSP is too slow due to heavy PBX load or slow IP link?

If the status updates shown for telephone lines by the TSP are slow or there is too much load on the PBX, you can

  • reduce the load by removing lines that are of no interest from the group the TAPI user that the TSP is configured for. This will exclude status updates for these lines from the TSP

TSP generates error "Master PBX not accessible"

Check if the Master PBX is reachable from the server where the TSP is installed (e.g. using your browser). If not and you are using HTTPS, check the TLS-Profile on your PBX/RP. Some older Windows Servers may not support the TLS-Cipher-Suites required by the PBX (see the TLS Profile setting in Reference13r2:IP4/General/TLS and Howto:Security_works_with_innovaphone#TLS_6).

Related Articles