Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

TAPI device order

0 views
Skip to first unread message

Neil P

unread,
Sep 2, 2004, 4:19:20 PM9/2/04
to
Is there a way to change the order of the TAPI devices such that a
particular device shows up first when enumerating through them?

N.P.


Andreas Marschall [MVP TAPI]

unread,
Sep 2, 2004, 5:32:29 PM9/2/04
to
"Neil P" <Ne...@hotmail.com> schrieb im Newsbeitrag
news:%23QOojoS...@TK2MSFTNGP11.phx.gbl...

> Is there a way to change the order of the TAPI devices such that a
> particular device shows up first when enumerating through them?

Neil,
what's the intend of your question?
Are you referring to a specific TSP that you have in source control?
Or only from a TAPI app's perspective?

TAPI apps can't change the device order.

The device order is controlled by TAPISRV and determined by:
1) order of TSP installation
2) each TSP on TSPI_providerEnumDevices() / TSPI_providerInit()
3) dynamic device creation / removal: LINE_CREATE / _REMOVE,
TSPI_providerCreateLineDevice()

--
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.


Neil P

unread,
Sep 3, 2004, 9:39:30 AM9/3/04
to
Andreas,
I noticed that when testing my application on a PC that had numerous
TAPI devices, the modem that I installed was installed last and it was the
last device to get enumerated to make the call. I was contemplating on how
to make a specific TAPI device appear first in the list. Is there a way to
remove all other TAPI devices from the system? Are there any default TAPI
devices that are installed that should not be removed?

N.P

"Andreas Marschall [MVP TAPI]" <Andreas....@I-B-A-M.de> wrote in
message news:%23P%23PbRTk...@TK2MSFTNGP11.phx.gbl...

Andreas Marschall [MVP TAPI]

unread,
Sep 3, 2004, 10:26:55 AM9/3/04
to
"Neil P" <Ne...@hotmail.com> schrieb im Newsbeitrag
news:OJ9oytbk...@TK2MSFTNGP09.phx.gbl...

> Andreas,
> I noticed that when testing my application on a PC that had numerous
> TAPI devices, the modem that I installed was installed last and it was the
> last device to get enumerated to make the call. I was contemplating on how
> to make a specific TAPI device appear first in the list. Is there a way to
> remove all other TAPI devices from the system? Are there any default TAPI
> devices that are installed that should not be removed?

Neil,
As you can see in ControlPanel there are some TSPs that can't be removed or
configured.
So I guess it will be impossible to remove all device (without hacking the
registry and potentially causing instabilies).

I still don't get it why you need a constant dwDeviceID for a given device.
I don't see any reason not use the usual mechanism like
lineNegotiateAPIVersion() / lineNegotiateExtVersion() / lineGetDevCaps() /
lineGetAddressCaps() to search for the device you want.

Neil P

unread,
Sep 3, 2004, 3:47:06 PM9/3/04
to
Andreas,
I don't really need a constant dwDeviceID. What made me of think of it
was the fact that I had my application work fine on my development machine.
The modem installed was the first to appear so everything worked fine. Then
I was configuring another test machine using a deferent modem and the modem
appeared last. There were also 7 other Tapi devices that came before it.
Some legit, and some I am not sure why it is appearing as a device. Anyway,
my enumeration code bombed halfway when it got hold of a TAPI device that
somehow passed the negotiations, dev caps etc but wasn't the modem device.
In fact I think it was the RAS, I am not sure. Anyway, my code proceeded to
dial out to it and of coursed failed.
All this did was made me realize I screwed up on the coding and I was
able to correct it. But a part of me was thinking, what if some site has a
TAPI device that gets through before it reaches the modem. This then led me
to think, what if I can ensure the modem will appear first to eliminate the
possibility of a failure. Anyway, just a lame way for me to get out of
developing the proper way since my deadline is approaching soon. I seem to
have fixed my bug though, even if my TAPI device is dead last.

N.P.


"Andreas Marschall [MVP TAPI]" <Andreas....@I-B-A-M.de> wrote in

message news:eM1yRIck...@TK2MSFTNGP11.phx.gbl...

William DePalo [MVP VC++]

unread,
Sep 3, 2004, 4:10:59 PM9/3/04
to
"Neil P" <Ne...@hotmail.com> wrote in message
news:OjO$M7ekEH...@TK2MSFTNGP09.phx.gbl...

> But a part of me was thinking, what if some site has a
> TAPI device that gets through before it reaches the modem. This then led
> me
> to think, what if I can ensure the modem will appear first to eliminate
> the
> possibility of a failure. Anyway, just a lame way for me to get out of
> developing the proper way since my deadline is approaching soon.

Just by the way, TAPI has a kind of vendor and device neutral way of looking
at the world. It is as though TAPI collects all of the resources on a box
and puts them all into one big pile. It is left for the application to
inspect the devices in the pile one by one, and use one or reject one based
on its capabilities.

When I need to determine if a device is a modem I make sure that the
dwMediaModes member in the LINEDEVCAPS structure corresponding to the line
in question has the LINEMEDIAMODE_DATAMODEM bit set. Then if I can get from
lineGetID() the multimedia identifiers of the speaker and microphone in the
line and open the devices I know the line device is good to go.

This is different from other vendor-neutral APIs like ODBC where you can
"connect" to a particular vendor's driver and pass credentials so that, for
example, you only see the database provided by Oracle. It would be nice if
you could do the same thing with TAPI - say connect to the UNIMODEM TSP for
access only to modems or the Cisco TSP for access only to its CTI ports and
CIT route points, but sadly, you can't. You need to write the code to
inspect the devices and open only those that you like.

Regards,
Will


Andreas Marschall [MVP TAPI]

unread,
Sep 3, 2004, 6:37:12 PM9/3/04
to
"Neil P" <Ne...@hotmail.com> schrieb im Newsbeitrag
news:OjO$M7ekEH...@TK2MSFTNGP09.phx.gbl...

> Andreas,
> I don't really need a constant dwDeviceID. What made me of think of it
> was the fact that I had my application work fine on my development machine.
> The modem installed was the first to appear so everything worked fine. Then
> I was configuring another test machine using a deferent modem and the modem
> appeared last. There were also 7 other Tapi devices that came before it.
> Some legit, and some I am not sure why it is appearing as a device. Anyway,
> my enumeration code bombed halfway when it got hold of a TAPI device that
> somehow passed the negotiations, dev caps etc but wasn't the modem device.
> In fact I think it was the RAS, I am not sure. Anyway, my code proceeded to
> dial out to it and of coursed failed.
> All this did was made me realize I screwed up on the coding and I was
> able to correct it. But a part of me was thinking, what if some site has a
> TAPI device that gets through before it reaches the modem. This then led me
> to think, what if I can ensure the modem will appear first to eliminate the
> possibility of a failure. Anyway, just a lame way for me to get out of
> developing the proper way since my deadline is approaching soon. I seem to
> have fixed my bug though, even if my TAPI device is dead last.

Neil,
RAS doesn't provide TAPI devices. RAS itself is using TAPI and TAPI devices to
dial out.

If you wrongly identified the device you want then your "filter" wasn't
precise enough.
E.g. if you want only modems hosted by UniModem.TSP then include an evaluation
of the TSP of each device.
See my TAPI and TSPI FAQ:
Q: Which TSP is hosting a given line device ?
http://www.i-b-a-m.de/Andreas_Marschall's_TAPI_and_TSPI_FAQ.htm#_Q:_Which_TSP

Once you've found the device you want to use on a given system you can store
its LINEDEVCAPS.dwPermanentLineID within your app configuration and search for
it the next time your app launches.

Neil P

unread,
Sep 3, 2004, 6:58:55 PM9/3/04
to
Thanks,

I am checking for LINEMEDIAMODE_DATAMODEM bit, but not sure what you mean
about the multimedia identifiers of the speaker and microphone. Is this the
same as calling GetLineId and using a specific device class name, such as
"comm/datamodem"?

N.P.


"William DePalo [MVP VC++]" <willd....@mvps.org> wrote in message
news:OUm2bIf...@tk2msftngp13.phx.gbl...

Andreas Marschall [MVP TAPI]

unread,
Sep 3, 2004, 7:05:25 PM9/3/04
to
"Neil P" <Ne...@hotmail.com> schrieb im Newsbeitrag
news:uYQEZmgk...@TK2MSFTNGP15.phx.gbl...

> I am checking for LINEMEDIAMODE_DATAMODEM bit, but not sure what you mean
> about the multimedia identifiers of the speaker and microphone. Is this the
> same as calling GetLineId and using a specific device class name, such as
> "comm/datamodem"?

Neil,
I guess Will was talking about DeviceClasses "wave/in" and "wave/out".

William DePalo [MVP VC++]

unread,
Sep 3, 2004, 7:17:20 PM9/3/04
to
"Neil P" <Ne...@hotmail.com> wrote in message
news:uYQEZmgk...@TK2MSFTNGP15.phx.gbl...

> I am checking for LINEMEDIAMODE_DATAMODEM bit, but not sure what you mean
> about the multimedia identifiers of the speaker and microphone. Is this
> the
> same as calling GetLineId and using a specific device class name, such as
> "comm/datamodem"?

Sorry, I forgot that you needed to make a data call. Same principle applies,
if the search for the device of the class in question succeeds and if the
datamodem bit is set you should be good to go.

Regards,
Will


0 new messages