Discussion:
TSPI_LineGetID - what should it return for "wave/out" ?
(too old to reply)
Way2caller
2007-07-01 11:14:02 UTC
Permalink
Hi all,

I have encountered the following problem with my TSP under Win XP:

My TSP tries to support both "wave" & "wave/out" classes for lineGetID.
It reports them in lineGetDevCaps & lineGetAddressCaps.
I noticed this:
When an application (e.g. TAPI browser 2.0) calls lineGetID with the class
set to "wave" - all works ok.
When the app calls lineGetID with the class set to "wave/out" - it fails
returning LINEERR_OPERATIONFAILED.

This happens AFTER the call gets into my TSP, and I validated my TSP returns
the same content in the VARSTRING buffer for the two classes.

One thing I noticed is for some reason the MS TAPI layer resizes the
VARSTRING buffer (only for classes "wave/out" & "wave/in") ad adds 0x100
bytes to it.

Could that be related ?

Is there anything else the TSP should return in the VARSTRING buffer for
"wave/out" ?

Thanks in advance
Matthias Moetje [MVP]
2007-07-02 14:31:57 UTC
Permalink
Hi,

1. there is no commonly used device class named "wave". Useful device
classes are "wave/in", "wave/out" and "wave/in/out" for full-duplex devices

2. You don't set the ID as string. You need to specify STRINGFORMAT_BINARY
for the dwStringFormat parameter of the VARSTRING structure. dwStringSize
must be sizeof(DWORD) and you need to add sizeof(DWORD) to dwUsedSize.
Then you set the first DWORD after sizeof(VARSTRING) to the device ID.


Best regards,

Matthias Moetje
-------------------------------------
TERASENS GmbH
Augustenstraße 24
80333 Munich, GERMANY
-------------------------------------
Fon: +49 89 143370-0
Fax: +49 89 143370-22
e-mail: moetje at terasens dot com
www: www.terasens.com
-------------------------------------
Post by Way2caller
Hi all,
My TSP tries to support both "wave" & "wave/out" classes for lineGetID.
It reports them in lineGetDevCaps & lineGetAddressCaps.
When an application (e.g. TAPI browser 2.0) calls lineGetID with the class
set to "wave" - all works ok.
When the app calls lineGetID with the class set to "wave/out" - it fails
returning LINEERR_OPERATIONFAILED.
This happens AFTER the call gets into my TSP, and I validated my TSP returns
the same content in the VARSTRING buffer for the two classes.
One thing I noticed is for some reason the MS TAPI layer resizes the
VARSTRING buffer (only for classes "wave/out" & "wave/in") ad adds 0x100
bytes to it.
Could that be related ?
Is there anything else the TSP should return in the VARSTRING buffer for
"wave/out" ?
Thanks in advance
Way2caller
2007-07-02 15:46:15 UTC
Permalink
Thanks.

Problem is - I do just that:
dwStringFormat=STRINGFORMAT_BINARY
dwStringSize = sizeof(DWORD)
dwUsedSize=sizeof(VARSTRING)+sizeof(DWORD)
dwNeededSize=sizeof(VARSTRING)+sizeof(DWORD)

But still I get LINEERR_OPERATIONFAILED.

Strange thing is - when I use either TB20 or my own application to call
lineGetID -
if I call it for "tapi/line" or "tapi/phone" I get no error, and the
dwTotalSize field showing within the TSP is the same as the one I set in TB20
or my app.

BUT - when I use the same dwTotalSize (either from TB20 or my app) for the
classes "wave/out" or "wave/in" - the dwTotalSize arriving inside the TSP is
LARGER !
The MS TAPI layer seems to enlarge the VARSTRING, and add to the dwTotalSize
0x00000100 !!!
Why is that ?!?!

I dump in my TSP the contents of the VARSTRING buffer I am returning - it is
just as it should be. I return 0, but still the lineGetID returns
LINEERR_OPERATIONFAILED.

One more thing (maybe will give you a clue) - when I play with it in TB20 I
found out that if the buffer size I am using is < 0x24 - the call returns
OPERATIONFAILED, if I use a buffer larger than that ( >= 0x24) - the call
returns ok, but the value read is NOT the one I am returning (!!!).
In any case the value of dwTotalSize as it i seen within the TSP is enlarged
by the TAPI layer, and it is added a 0x0100.

Why the limit ? 0x23 should be enough for a "normal" VARSTRING (with a DWORD
value)...

Mistery...

** Anyone with a voice device can try this and let me know what TB20 is
returning for him/her ?

Thanks !
Post by Matthias Moetje [MVP]
Hi,
1. there is no commonly used device class named "wave". Useful device
classes are "wave/in", "wave/out" and "wave/in/out" for full-duplex devices
2. You don't set the ID as string. You need to specify STRINGFORMAT_BINARY
for the dwStringFormat parameter of the VARSTRING structure. dwStringSize
must be sizeof(DWORD) and you need to add sizeof(DWORD) to dwUsedSize.
Then you set the first DWORD after sizeof(VARSTRING) to the device ID.
Best regards,
Matthias Moetje
-------------------------------------
TERASENS GmbH
Augustenstraße 24
80333 Munich, GERMANY
-------------------------------------
Fon: +49 89 143370-0
Fax: +49 89 143370-22
e-mail: moetje at terasens dot com
www: www.terasens.com
-------------------------------------
Post by Way2caller
Hi all,
My TSP tries to support both "wave" & "wave/out" classes for lineGetID.
It reports them in lineGetDevCaps & lineGetAddressCaps.
When an application (e.g. TAPI browser 2.0) calls lineGetID with the class
set to "wave" - all works ok.
When the app calls lineGetID with the class set to "wave/out" - it fails
returning LINEERR_OPERATIONFAILED.
This happens AFTER the call gets into my TSP, and I validated my TSP returns
the same content in the VARSTRING buffer for the two classes.
One thing I noticed is for some reason the MS TAPI layer resizes the
VARSTRING buffer (only for classes "wave/out" & "wave/in") ad adds 0x100
bytes to it.
Could that be related ?
Is there anything else the TSP should return in the VARSTRING buffer for
"wave/out" ?
Thanks in advance
Matthias Moetje [MVP]
2007-07-02 21:06:42 UTC
Permalink
Hi,

please try to do the following:

YourLineGetIDfunction(LPVARSTRING lpDeviceID)
{

lpDeviceID->dwNeededSize += sizeof(DWORD)
lpDeviceID->dwStringSize = sizeof(DWORD)
lpDeviceID->dwUsedSize += sizeof(DWORD)
lpDeviceID->dwStringFormat=STRINGFORMAT_BINARY

LPDWORD lpdwDeviceID = (LPDWORD)(((LPBYTE)lpDeviceID) + sizeof(VARSTRING));

*lpdwDeviceID = dwYourID;

}

Best regards,

Matthias Moetje
-------------------------------------
TERASENS GmbH
Augustenstraße 24
80333 Munich, GERMANY
-------------------------------------
Fon: +49 89 143370-0
Fax: +49 89 143370-22
e-mail: moetje at terasens dot com
www: www.terasens.com
-------------------------------------
Way2caller
2007-07-02 22:22:00 UTC
Permalink
Hi,

Did it.
Same results.

When entering TSPI_lineGetID, I have:
lpDeviceID->dwTotalSize=0x124 (which is +0x100 from the value in TB20)
lpDeviceID->dwNeededSize=0x18
lpDeviceID->dwUsedSize=0x18


Just before the app returns:
lpDeviceID->dwTotalSize=0x124 (which is +0x100 from the value in TB20)
lpDeviceID->dwNeededSize=0x1c
lpDeviceID->dwUsedSize=0x1c
lpDeviceID->dwStringFormat=4
lpDeviceID->dwStringSize=4
lpDeviceID->dwStringOffset=0x18

and the value is in the right place.

Still the same results...
And why does TAPI increase the dwTotalSize field ?
Post by Matthias Moetje [MVP]
Hi,
YourLineGetIDfunction(LPVARSTRING lpDeviceID)
{
lpDeviceID->dwNeededSize += sizeof(DWORD)
lpDeviceID->dwStringSize = sizeof(DWORD)
lpDeviceID->dwUsedSize += sizeof(DWORD)
lpDeviceID->dwStringFormat=STRINGFORMAT_BINARY
LPDWORD lpdwDeviceID = (LPDWORD)(((LPBYTE)lpDeviceID) + sizeof(VARSTRING));
*lpdwDeviceID = dwYourID;
}
Best regards,
Matthias Moetje
-------------------------------------
TERASENS GmbH
Augustenstraße 24
80333 Munich, GERMANY
-------------------------------------
Fon: +49 89 143370-0
Fax: +49 89 143370-22
e-mail: moetje at terasens dot com
www: www.terasens.com
-------------------------------------
Matthias Moetje [MVP]
2007-07-03 12:59:45 UTC
Permalink
Hi,

the method I posted is exactly the same like Unimodem is doing it.

So if you are doing exactly what I posted, the problem must be
somewhere else...

PS: I don't know why TAPI increases the size of the structure. What
happens if you pass a much larger structure through TB..?


Best regards,

Matthias Moetje
-------------------------------------
TERASENS GmbH
Augustenstraße 24
80333 Munich, GERMANY
-------------------------------------
Fon: +49 89 143370-0
Fax: +49 89 143370-22
e-mail: moetje at terasens dot com
www: www.terasens.com
-------------------------------------
Post by Way2caller
Hi,
Did it.
Same results.
lpDeviceID->dwTotalSize=0x124 (which is +0x100 from the value in TB20)
lpDeviceID->dwNeededSize=0x18
lpDeviceID->dwUsedSize=0x18
lpDeviceID->dwTotalSize=0x124 (which is +0x100 from the value in TB20)
lpDeviceID->dwNeededSize=0x1c
lpDeviceID->dwUsedSize=0x1c
lpDeviceID->dwStringFormat=4
lpDeviceID->dwStringSize=4
lpDeviceID->dwStringOffset=0x18
and the value is in the right place.
Still the same results...
And why does TAPI increase the dwTotalSize field ?
Post by Matthias Moetje [MVP]
Hi,
YourLineGetIDfunction(LPVARSTRING lpDeviceID)
{
lpDeviceID->dwNeededSize += sizeof(DWORD)
lpDeviceID->dwStringSize = sizeof(DWORD)
lpDeviceID->dwUsedSize += sizeof(DWORD)
lpDeviceID->dwStringFormat=STRINGFORMAT_BINARY
LPDWORD lpdwDeviceID = (LPDWORD)(((LPBYTE)lpDeviceID) +
sizeof(VARSTRING));
*lpdwDeviceID = dwYourID;
}
Best regards,
Matthias Moetje
-------------------------------------
TERASENS GmbH
Augustenstraße 24
80333 Munich, GERMANY
-------------------------------------
Fon: +49 89 143370-0
Fax: +49 89 143370-22
e-mail: moetje at terasens dot com
www: www.terasens.com
-------------------------------------
Way2caller
2007-07-03 13:52:02 UTC
Permalink
Hi,

Question is where the problem lies...
Do you have the UNIMODEM source code ?
Do you know if for UNIMODEM the buffer size is enlarged, too ?

It seems TAPI always increases the buffer size - no matter what size
I originally send via TB20 - TAPI always adds 0x100 to it.
(and when the buffer gets back to the app - it is reduced again by 0x100...)

Thanks!
Shimon
Post by Matthias Moetje [MVP]
Hi,
the method I posted is exactly the same like Unimodem is doing it.
So if you are doing exactly what I posted, the problem must be
somewhere else...
PS: I don't know why TAPI increases the size of the structure. What
happens if you pass a much larger structure through TB..?
Best regards,
Matthias Moetje
-------------------------------------
TERASENS GmbH
Augustenstraße 24
80333 Munich, GERMANY
-------------------------------------
Fon: +49 89 143370-0
Fax: +49 89 143370-22
e-mail: moetje at terasens dot com
www: www.terasens.com
-------------------------------------
Post by Way2caller
Hi,
Did it.
Same results.
lpDeviceID->dwTotalSize=0x124 (which is +0x100 from the value in TB20)
lpDeviceID->dwNeededSize=0x18
lpDeviceID->dwUsedSize=0x18
lpDeviceID->dwTotalSize=0x124 (which is +0x100 from the value in TB20)
lpDeviceID->dwNeededSize=0x1c
lpDeviceID->dwUsedSize=0x1c
lpDeviceID->dwStringFormat=4
lpDeviceID->dwStringSize=4
lpDeviceID->dwStringOffset=0x18
and the value is in the right place.
Still the same results...
And why does TAPI increase the dwTotalSize field ?
Post by Matthias Moetje [MVP]
Hi,
YourLineGetIDfunction(LPVARSTRING lpDeviceID)
{
lpDeviceID->dwNeededSize += sizeof(DWORD)
lpDeviceID->dwStringSize = sizeof(DWORD)
lpDeviceID->dwUsedSize += sizeof(DWORD)
lpDeviceID->dwStringFormat=STRINGFORMAT_BINARY
LPDWORD lpdwDeviceID = (LPDWORD)(((LPBYTE)lpDeviceID) +
sizeof(VARSTRING));
*lpdwDeviceID = dwYourID;
}
Best regards,
Matthias Moetje
-------------------------------------
TERASENS GmbH
Augustenstraße 24
80333 Munich, GERMANY
-------------------------------------
Fon: +49 89 143370-0
Fax: +49 89 143370-22
e-mail: moetje at terasens dot com
www: www.terasens.com
-------------------------------------
Matthias Moetje [MVP]
2007-07-03 18:47:09 UTC
Permalink
Shimon,
Post by Way2caller
Question is where the problem lies...
Do you have the UNIMODEM source code ?
Yes, I have access to the source code under the MVPSLA.
Post by Way2caller
Do you know if for UNIMODEM the buffer size is enlarged, too ?
I don't know. Unfortunately I have no time to debug this at
the moment. Both of our TSPs come with an MSP and don't
offer any wave devices, so I don't have practical experience
with lineGetID on the TSPI side.
Post by Way2caller
It seems TAPI always increases the buffer size - no matter what size
I originally send via TB20 - TAPI always adds 0x100 to it.
(and when the buffer gets back to the app - it is reduced again by 0x100...)
Maybe this is just a security measure of tapisrv to avoid memory
being overwritten or to be compatible with previous TSPI versions...
I wouldn't concentrate on the increased size but rather on the reason
why TAPI returns an error.

Do you return 0 (zero) for this function?

Does your TSP write to the dwTotalSite member?


Best regards,

Matthias Moetje
-------------------------------------
TERASENS GmbH
Augustenstraße 24
80333 Munich, GERMANY
-------------------------------------
Fon: +49 89 143370-0
Fax: +49 89 143370-22
e-mail: moetje at terasens dot com
www: www.terasens.com
-------------------------------------
Post by Way2caller
Post by Matthias Moetje [MVP]
Hi,
the method I posted is exactly the same like Unimodem is doing it.
So if you are doing exactly what I posted, the problem must be
somewhere else...
PS: I don't know why TAPI increases the size of the structure. What
happens if you pass a much larger structure through TB..?
Best regards,
Matthias Moetje
-------------------------------------
TERASENS GmbH
Augustenstraße 24
80333 Munich, GERMANY
-------------------------------------
Fon: +49 89 143370-0
Fax: +49 89 143370-22
e-mail: moetje at terasens dot com
www: www.terasens.com
-------------------------------------
Post by Way2caller
Hi,
Did it.
Same results.
lpDeviceID->dwTotalSize=0x124 (which is +0x100 from the value in TB20)
lpDeviceID->dwNeededSize=0x18
lpDeviceID->dwUsedSize=0x18
lpDeviceID->dwTotalSize=0x124 (which is +0x100 from the value in TB20)
lpDeviceID->dwNeededSize=0x1c
lpDeviceID->dwUsedSize=0x1c
lpDeviceID->dwStringFormat=4
lpDeviceID->dwStringSize=4
lpDeviceID->dwStringOffset=0x18
and the value is in the right place.
Still the same results...
And why does TAPI increase the dwTotalSize field ?
Post by Matthias Moetje [MVP]
Hi,
YourLineGetIDfunction(LPVARSTRING lpDeviceID)
{
lpDeviceID->dwNeededSize += sizeof(DWORD)
lpDeviceID->dwStringSize = sizeof(DWORD)
lpDeviceID->dwUsedSize += sizeof(DWORD)
lpDeviceID->dwStringFormat=STRINGFORMAT_BINARY
LPDWORD lpdwDeviceID = (LPDWORD)(((LPBYTE)lpDeviceID) +
sizeof(VARSTRING));
*lpdwDeviceID = dwYourID;
}
Best regards,
Matthias Moetje
-------------------------------------
TERASENS GmbH
Augustenstraße 24
80333 Munich, GERMANY
-------------------------------------
Fon: +49 89 143370-0
Fax: +49 89 143370-22
e-mail: moetje at terasens dot com
www: www.terasens.com
-------------------------------------
Way2caller
2007-07-03 19:04:01 UTC
Permalink
Hi,

1. I guess you can not email me the TSPI_lineGetID source code ?

2. I hope I am not pushing it too far, but could you just check what you get
in return to calling lineGetID with "wave/Out" (with the MSP) ?

3. Tried to figure out that, but with no success.
My TSP does return 0, and it does not touch the dwTotalSize field.

Thanks again for sticking with me on this.
Post by Matthias Moetje [MVP]
Shimon,
Post by Way2caller
Question is where the problem lies...
Do you have the UNIMODEM source code ?
Yes, I have access to the source code under the MVPSLA.
Post by Way2caller
Do you know if for UNIMODEM the buffer size is enlarged, too ?
I don't know. Unfortunately I have no time to debug this at
the moment. Both of our TSPs come with an MSP and don't
offer any wave devices, so I don't have practical experience
with lineGetID on the TSPI side.
Post by Way2caller
It seems TAPI always increases the buffer size - no matter what size
I originally send via TB20 - TAPI always adds 0x100 to it.
(and when the buffer gets back to the app - it is reduced again by 0x100...)
Maybe this is just a security measure of tapisrv to avoid memory
being overwritten or to be compatible with previous TSPI versions...
I wouldn't concentrate on the increased size but rather on the reason
why TAPI returns an error.
Do you return 0 (zero) for this function?
Does your TSP write to the dwTotalSite member?
Best regards,
Matthias Moetje
-------------------------------------
TERASENS GmbH
Augustenstraße 24
80333 Munich, GERMANY
-------------------------------------
Fon: +49 89 143370-0
Fax: +49 89 143370-22
e-mail: moetje at terasens dot com
www: www.terasens.com
-------------------------------------
Post by Way2caller
Post by Matthias Moetje [MVP]
Hi,
the method I posted is exactly the same like Unimodem is doing it.
So if you are doing exactly what I posted, the problem must be
somewhere else...
PS: I don't know why TAPI increases the size of the structure. What
happens if you pass a much larger structure through TB..?
Best regards,
Matthias Moetje
-------------------------------------
TERASENS GmbH
Augustenstraße 24
80333 Munich, GERMANY
-------------------------------------
Fon: +49 89 143370-0
Fax: +49 89 143370-22
e-mail: moetje at terasens dot com
www: www.terasens.com
-------------------------------------
Post by Way2caller
Hi,
Did it.
Same results.
lpDeviceID->dwTotalSize=0x124 (which is +0x100 from the value in TB20)
lpDeviceID->dwNeededSize=0x18
lpDeviceID->dwUsedSize=0x18
lpDeviceID->dwTotalSize=0x124 (which is +0x100 from the value in TB20)
lpDeviceID->dwNeededSize=0x1c
lpDeviceID->dwUsedSize=0x1c
lpDeviceID->dwStringFormat=4
lpDeviceID->dwStringSize=4
lpDeviceID->dwStringOffset=0x18
and the value is in the right place.
Still the same results...
And why does TAPI increase the dwTotalSize field ?
Post by Matthias Moetje [MVP]
Hi,
YourLineGetIDfunction(LPVARSTRING lpDeviceID)
{
lpDeviceID->dwNeededSize += sizeof(DWORD)
lpDeviceID->dwStringSize = sizeof(DWORD)
lpDeviceID->dwUsedSize += sizeof(DWORD)
lpDeviceID->dwStringFormat=STRINGFORMAT_BINARY
LPDWORD lpdwDeviceID = (LPDWORD)(((LPBYTE)lpDeviceID) +
sizeof(VARSTRING));
*lpdwDeviceID = dwYourID;
}
Best regards,
Matthias Moetje
-------------------------------------
TERASENS GmbH
Augustenstraße 24
80333 Munich, GERMANY
-------------------------------------
Fon: +49 89 143370-0
Fax: +49 89 143370-22
e-mail: moetje at terasens dot com
www: www.terasens.com
-------------------------------------
Matthias Moetje [MVP]
2007-07-03 21:26:58 UTC
Permalink
Shimon,
Post by Way2caller
1. I guess you can not email me the TSPI_lineGetID source code ?
No, according to the license agreement this is not allowed. I am not
even allowed to make personal copies (just browsing online).
Post by Way2caller
2. I hope I am not pushing it too far, but could you just check what you get
in return to calling lineGetID with "wave/Out" (with the MSP) ?
Our TSP does not offer any wave devices and thus device classes with
wave/... are not supported.
Post by Way2caller
3. Tried to figure out that, but with no success.
My TSP does return 0, and it does not touch the dwTotalSize field.
I don't have any more ideas, as I can't see your source code.

Looking at your display name I wonder: Don't you already have a working
TSP that supports wave devices...?


Best regards,

Matthias Moetje
-------------------------------------
TERASENS GmbH
Augustenstraße 24
80333 Munich, GERMANY
-------------------------------------
Fon: +49 89 143370-0
Fax: +49 89 143370-22
e-mail: moetje at terasens dot com
www: www.terasens.com
-------------------------------------
Post by Way2caller
Thanks again for sticking with me on this.
Post by Matthias Moetje [MVP]
Shimon,
Post by Way2caller
Question is where the problem lies...
Do you have the UNIMODEM source code ?
Yes, I have access to the source code under the MVPSLA.
Post by Way2caller
Do you know if for UNIMODEM the buffer size is enlarged, too ?
I don't know. Unfortunately I have no time to debug this at
the moment. Both of our TSPs come with an MSP and don't
offer any wave devices, so I don't have practical experience
with lineGetID on the TSPI side.
Post by Way2caller
It seems TAPI always increases the buffer size - no matter what size
I originally send via TB20 - TAPI always adds 0x100 to it.
(and when the buffer gets back to the app - it is reduced again by 0x100...)
Maybe this is just a security measure of tapisrv to avoid memory
being overwritten or to be compatible with previous TSPI versions...
I wouldn't concentrate on the increased size but rather on the reason
why TAPI returns an error.
Do you return 0 (zero) for this function?
Does your TSP write to the dwTotalSite member?
Best regards,
Matthias Moetje
-------------------------------------
TERASENS GmbH
Augustenstraße 24
80333 Munich, GERMANY
-------------------------------------
Fon: +49 89 143370-0
Fax: +49 89 143370-22
e-mail: moetje at terasens dot com
www: www.terasens.com
-------------------------------------
Post by Way2caller
Post by Matthias Moetje [MVP]
Hi,
the method I posted is exactly the same like Unimodem is doing it.
So if you are doing exactly what I posted, the problem must be
somewhere else...
PS: I don't know why TAPI increases the size of the structure. What
happens if you pass a much larger structure through TB..?
Best regards,
Matthias Moetje
-------------------------------------
TERASENS GmbH
Augustenstraße 24
80333 Munich, GERMANY
-------------------------------------
Fon: +49 89 143370-0
Fax: +49 89 143370-22
e-mail: moetje at terasens dot com
www: www.terasens.com
-------------------------------------
Post by Way2caller
Hi,
Did it.
Same results.
lpDeviceID->dwTotalSize=0x124 (which is +0x100 from the value in TB20)
lpDeviceID->dwNeededSize=0x18
lpDeviceID->dwUsedSize=0x18
lpDeviceID->dwTotalSize=0x124 (which is +0x100 from the value in TB20)
lpDeviceID->dwNeededSize=0x1c
lpDeviceID->dwUsedSize=0x1c
lpDeviceID->dwStringFormat=4
lpDeviceID->dwStringSize=4
lpDeviceID->dwStringOffset=0x18
and the value is in the right place.
Still the same results...
And why does TAPI increase the dwTotalSize field ?
Post by Matthias Moetje [MVP]
Hi,
YourLineGetIDfunction(LPVARSTRING lpDeviceID)
{
lpDeviceID->dwNeededSize += sizeof(DWORD)
lpDeviceID->dwStringSize = sizeof(DWORD)
lpDeviceID->dwUsedSize += sizeof(DWORD)
lpDeviceID->dwStringFormat=STRINGFORMAT_BINARY
LPDWORD lpdwDeviceID = (LPDWORD)(((LPBYTE)lpDeviceID) +
sizeof(VARSTRING));
*lpdwDeviceID = dwYourID;
}
Best regards,
Matthias Moetje
-------------------------------------
TERASENS GmbH
Augustenstraße 24
80333 Munich, GERMANY
-------------------------------------
Fon: +49 89 143370-0
Fax: +49 89 143370-22
e-mail: moetje at terasens dot com
www: www.terasens.com
-------------------------------------
Way2caller
2007-07-03 21:56:00 UTC
Permalink
Hi,

Thanks for your support.

Yes - we do have a TSP that supports wave devices.
It even works great with Vista.
It USED to work great on XP, too, but now all of a sadden it stopped working.
I can only guess some XP update changed something in the way TAPI works...

Anyway - I just found something interesting - the enumeration of wave
devices yields a different order when it is done in the TSP space, or in the
APP space.
I guess this is part of what's going wrong.
Post by Matthias Moetje [MVP]
Shimon,
Post by Way2caller
1. I guess you can not email me the TSPI_lineGetID source code ?
No, according to the license agreement this is not allowed. I am not
even allowed to make personal copies (just browsing online).
Post by Way2caller
2. I hope I am not pushing it too far, but could you just check what you get
in return to calling lineGetID with "wave/Out" (with the MSP) ?
Our TSP does not offer any wave devices and thus device classes with
wave/... are not supported.
Post by Way2caller
3. Tried to figure out that, but with no success.
My TSP does return 0, and it does not touch the dwTotalSize field.
I don't have any more ideas, as I can't see your source code.
Looking at your display name I wonder: Don't you already have a working
TSP that supports wave devices...?
Best regards,
Matthias Moetje
-------------------------------------
TERASENS GmbH
Augustenstraße 24
80333 Munich, GERMANY
-------------------------------------
Fon: +49 89 143370-0
Fax: +49 89 143370-22
e-mail: moetje at terasens dot com
www: www.terasens.com
-------------------------------------
Post by Way2caller
Thanks again for sticking with me on this.
Post by Matthias Moetje [MVP]
Shimon,
Post by Way2caller
Question is where the problem lies...
Do you have the UNIMODEM source code ?
Yes, I have access to the source code under the MVPSLA.
Post by Way2caller
Do you know if for UNIMODEM the buffer size is enlarged, too ?
I don't know. Unfortunately I have no time to debug this at
the moment. Both of our TSPs come with an MSP and don't
offer any wave devices, so I don't have practical experience
with lineGetID on the TSPI side.
Post by Way2caller
It seems TAPI always increases the buffer size - no matter what size
I originally send via TB20 - TAPI always adds 0x100 to it.
(and when the buffer gets back to the app - it is reduced again by 0x100...)
Maybe this is just a security measure of tapisrv to avoid memory
being overwritten or to be compatible with previous TSPI versions...
I wouldn't concentrate on the increased size but rather on the reason
why TAPI returns an error.
Do you return 0 (zero) for this function?
Does your TSP write to the dwTotalSite member?
Best regards,
Matthias Moetje
-------------------------------------
TERASENS GmbH
Augustenstraße 24
80333 Munich, GERMANY
-------------------------------------
Fon: +49 89 143370-0
Fax: +49 89 143370-22
e-mail: moetje at terasens dot com
www: www.terasens.com
-------------------------------------
Post by Way2caller
Post by Matthias Moetje [MVP]
Hi,
the method I posted is exactly the same like Unimodem is doing it.
So if you are doing exactly what I posted, the problem must be
somewhere else...
PS: I don't know why TAPI increases the size of the structure. What
happens if you pass a much larger structure through TB..?
Best regards,
Matthias Moetje
-------------------------------------
TERASENS GmbH
Augustenstraße 24
80333 Munich, GERMANY
-------------------------------------
Fon: +49 89 143370-0
Fax: +49 89 143370-22
e-mail: moetje at terasens dot com
www: www.terasens.com
-------------------------------------
Post by Way2caller
Hi,
Did it.
Same results.
lpDeviceID->dwTotalSize=0x124 (which is +0x100 from the value in TB20)
lpDeviceID->dwNeededSize=0x18
lpDeviceID->dwUsedSize=0x18
lpDeviceID->dwTotalSize=0x124 (which is +0x100 from the value in TB20)
lpDeviceID->dwNeededSize=0x1c
lpDeviceID->dwUsedSize=0x1c
lpDeviceID->dwStringFormat=4
lpDeviceID->dwStringSize=4
lpDeviceID->dwStringOffset=0x18
and the value is in the right place.
Still the same results...
And why does TAPI increase the dwTotalSize field ?
Post by Matthias Moetje [MVP]
Hi,
YourLineGetIDfunction(LPVARSTRING lpDeviceID)
{
lpDeviceID->dwNeededSize += sizeof(DWORD)
lpDeviceID->dwStringSize = sizeof(DWORD)
lpDeviceID->dwUsedSize += sizeof(DWORD)
lpDeviceID->dwStringFormat=STRINGFORMAT_BINARY
LPDWORD lpdwDeviceID = (LPDWORD)(((LPBYTE)lpDeviceID) +
sizeof(VARSTRING));
*lpdwDeviceID = dwYourID;
}
Best regards,
Matthias Moetje
-------------------------------------
TERASENS GmbH
Augustenstraße 24
80333 Munich, GERMANY
-------------------------------------
Fon: +49 89 143370-0
Fax: +49 89 143370-22
e-mail: moetje at terasens dot com
www: www.terasens.com
-------------------------------------
Matthias Moetje [MVP]
2007-07-04 11:31:37 UTC
Permalink
Shimon,

maybe this is the same problem I was just facing a few weeks ago,
when I wanted to perform some tests with your device/TSP.
I couldn't get it working but didn't have enough time to look into
it more thoroughly...


How do you enumerate the wave devices?

Here's what Unimodem does:

It uses LoadLibrary to load winmm.dll dynamically.
Then it calls GetProcAddress to get pointer to the functions

waveInGetDevCapsW
waveInGetNumDevs
(or the corresponding out functions)


If first calls n=waveInGetNumDevs() and then loops from 0 to n-1
calling waveInGetDevCaps and compares the wave device names
to find the correct one.


If you say that this is different from what you receive in the application's
context, in which way is this different. Can you show both lists for
comparison?

One problem I know which often interferes with TSPs' audio devices
is the RDP audio mapper which replaces all wave devices once a
remote desktop session is started (with enabled audio mapping). Though,
we have experienced this behaviour with Windows Server 2003, usually.


Best regards,

Matthias Moetje
-------------------------------------
TERASENS GmbH
Augustenstraße 24
80333 Munich, GERMANY
-------------------------------------
Fon: +49 89 143370-0
Fax: +49 89 143370-22
e-mail: moetje at terasens dot com
www: www.terasens.com
-------------------------------------
Post by Way2caller
Hi,
Thanks for your support.
Yes - we do have a TSP that supports wave devices.
It even works great with Vista.
It USED to work great on XP, too, but now all of a sadden it stopped working.
I can only guess some XP update changed something in the way TAPI works...
Anyway - I just found something interesting - the enumeration of wave
devices yields a different order when it is done in the TSP space, or in the
APP space.
I guess this is part of what's going wrong.
Post by Matthias Moetje [MVP]
Shimon,
Post by Way2caller
1. I guess you can not email me the TSPI_lineGetID source code ?
No, according to the license agreement this is not allowed. I am not
even allowed to make personal copies (just browsing online).
Post by Way2caller
2. I hope I am not pushing it too far, but could you just check what
you
get
in return to calling lineGetID with "wave/Out" (with the MSP) ?
Our TSP does not offer any wave devices and thus device classes with
wave/... are not supported.
Post by Way2caller
3. Tried to figure out that, but with no success.
My TSP does return 0, and it does not touch the dwTotalSize field.
I don't have any more ideas, as I can't see your source code.
Looking at your display name I wonder: Don't you already have a working
TSP that supports wave devices...?
Best regards,
Matthias Moetje
-------------------------------------
TERASENS GmbH
Augustenstraße 24
80333 Munich, GERMANY
-------------------------------------
Fon: +49 89 143370-0
Fax: +49 89 143370-22
e-mail: moetje at terasens dot com
www: www.terasens.com
-------------------------------------
Post by Way2caller
Thanks again for sticking with me on this.
Post by Matthias Moetje [MVP]
Shimon,
Post by Way2caller
Question is where the problem lies...
Do you have the UNIMODEM source code ?
Yes, I have access to the source code under the MVPSLA.
Post by Way2caller
Do you know if for UNIMODEM the buffer size is enlarged, too ?
I don't know. Unfortunately I have no time to debug this at
the moment. Both of our TSPs come with an MSP and don't
offer any wave devices, so I don't have practical experience
with lineGetID on the TSPI side.
Post by Way2caller
It seems TAPI always increases the buffer size - no matter what size
I originally send via TB20 - TAPI always adds 0x100 to it.
(and when the buffer gets back to the app - it is reduced again by 0x100...)
Maybe this is just a security measure of tapisrv to avoid memory
being overwritten or to be compatible with previous TSPI versions...
I wouldn't concentrate on the increased size but rather on the reason
why TAPI returns an error.
Do you return 0 (zero) for this function?
Does your TSP write to the dwTotalSite member?
Best regards,
Matthias Moetje
-------------------------------------
TERASENS GmbH
Augustenstraße 24
80333 Munich, GERMANY
-------------------------------------
Fon: +49 89 143370-0
Fax: +49 89 143370-22
e-mail: moetje at terasens dot com
www: www.terasens.com
-------------------------------------
Post by Way2caller
Post by Matthias Moetje [MVP]
Hi,
the method I posted is exactly the same like Unimodem is doing it.
So if you are doing exactly what I posted, the problem must be
somewhere else...
PS: I don't know why TAPI increases the size of the structure. What
happens if you pass a much larger structure through TB..?
Best regards,
Matthias Moetje
-------------------------------------
TERASENS GmbH
Augustenstraße 24
80333 Munich, GERMANY
-------------------------------------
Fon: +49 89 143370-0
Fax: +49 89 143370-22
e-mail: moetje at terasens dot com
www: www.terasens.com
-------------------------------------
Post by Way2caller
Hi,
Did it.
Same results.
lpDeviceID->dwTotalSize=0x124 (which is +0x100 from the value in TB20)
lpDeviceID->dwNeededSize=0x18
lpDeviceID->dwUsedSize=0x18
lpDeviceID->dwTotalSize=0x124 (which is +0x100 from the value in TB20)
lpDeviceID->dwNeededSize=0x1c
lpDeviceID->dwUsedSize=0x1c
lpDeviceID->dwStringFormat=4
lpDeviceID->dwStringSize=4
lpDeviceID->dwStringOffset=0x18
and the value is in the right place.
Still the same results...
And why does TAPI increase the dwTotalSize field ?
Post by Matthias Moetje [MVP]
Hi,
YourLineGetIDfunction(LPVARSTRING lpDeviceID)
{
lpDeviceID->dwNeededSize += sizeof(DWORD)
lpDeviceID->dwStringSize = sizeof(DWORD)
lpDeviceID->dwUsedSize += sizeof(DWORD)
lpDeviceID->dwStringFormat=STRINGFORMAT_BINARY
LPDWORD lpdwDeviceID = (LPDWORD)(((LPBYTE)lpDeviceID) +
sizeof(VARSTRING));
*lpdwDeviceID = dwYourID;
}
Best regards,
Matthias Moetje
-------------------------------------
TERASENS GmbH
Augustenstraße 24
80333 Munich, GERMANY
-------------------------------------
Fon: +49 89 143370-0
Fax: +49 89 143370-22
e-mail: moetje at terasens dot com
www: www.terasens.com
-------------------------------------
Way2caller
2007-07-04 13:58:01 UTC
Permalink
Hi Matthias,

This code seems to work.
I am not totally happy with this, cause I dont like
going with "hunch" solutions - not knowing why
a solution works...

============================================

if (lpDeviceID->dwTotalSize < sizeof(VARSTRING)+sizeof(DWORD)+0x00000100+100)
{
// Resize buffer:
lpDeviceID->dwNeededSize = sizeof(VARSTRING)+sizeof(DWORD)+0x00000100+100;

return 0;
}

lpDeviceID->dwNeededSize = sizeof(VARSTRING) + sizeof(DWORD)+0x00000100+100;

if (lpDeviceID->dwTotalSize >= sizeof(VARSTRING) + sizeof(DWORD))
{
lpDeviceID->dwStringFormat = STRINGFORMAT_BINARY;
lpDeviceID->dwNeededSize = sizeof(VARSTRING)+sizeof(DWORD);
lpDeviceID->dwUsedSize = sizeof(VARSTRING)+sizeof(DWORD);
lpDeviceID->dwStringOffset = sizeof(VARSTRING);
lpDeviceID->dwStringSize = sizeof(DWORD);

*(DWORD *)((BYTE *)lpDeviceID + sizeof(VARSTRING)) = dwID;
return 0;
}

return 0;

============================================
Post by Matthias Moetje [MVP]
Shimon,
maybe this is the same problem I was just facing a few weeks ago,
when I wanted to perform some tests with your device/TSP.
I couldn't get it working but didn't have enough time to look into
it more thoroughly...
How do you enumerate the wave devices?
It uses LoadLibrary to load winmm.dll dynamically.
Then it calls GetProcAddress to get pointer to the functions
waveInGetDevCapsW
waveInGetNumDevs
(or the corresponding out functions)
If first calls n=waveInGetNumDevs() and then loops from 0 to n-1
calling waveInGetDevCaps and compares the wave device names
to find the correct one.
If you say that this is different from what you receive in the application's
context, in which way is this different. Can you show both lists for
comparison?
One problem I know which often interferes with TSPs' audio devices
is the RDP audio mapper which replaces all wave devices once a
remote desktop session is started (with enabled audio mapping). Though,
we have experienced this behaviour with Windows Server 2003, usually.
Best regards,
Matthias Moetje
-------------------------------------
TERASENS GmbH
Augustenstraße 24
80333 Munich, GERMANY
-------------------------------------
Fon: +49 89 143370-0
Fax: +49 89 143370-22
e-mail: moetje at terasens dot com
www: www.terasens.com
-------------------------------------
Post by Way2caller
Hi,
Thanks for your support.
Yes - we do have a TSP that supports wave devices.
It even works great with Vista.
It USED to work great on XP, too, but now all of a sadden it stopped working.
I can only guess some XP update changed something in the way TAPI works...
Anyway - I just found something interesting - the enumeration of wave
devices yields a different order when it is done in the TSP space, or in the
APP space.
I guess this is part of what's going wrong.
Post by Matthias Moetje [MVP]
Shimon,
Post by Way2caller
1. I guess you can not email me the TSPI_lineGetID source code ?
No, according to the license agreement this is not allowed. I am not
even allowed to make personal copies (just browsing online).
Post by Way2caller
2. I hope I am not pushing it too far, but could you just check what
you
get
in return to calling lineGetID with "wave/Out" (with the MSP) ?
Our TSP does not offer any wave devices and thus device classes with
wave/... are not supported.
Post by Way2caller
3. Tried to figure out that, but with no success.
My TSP does return 0, and it does not touch the dwTotalSize field.
I don't have any more ideas, as I can't see your source code.
Looking at your display name I wonder: Don't you already have a working
TSP that supports wave devices...?
Best regards,
Matthias Moetje
-------------------------------------
TERASENS GmbH
Augustenstraße 24
80333 Munich, GERMANY
-------------------------------------
Fon: +49 89 143370-0
Fax: +49 89 143370-22
e-mail: moetje at terasens dot com
www: www.terasens.com
-------------------------------------
Post by Way2caller
Thanks again for sticking with me on this.
Post by Matthias Moetje [MVP]
Shimon,
Post by Way2caller
Question is where the problem lies...
Do you have the UNIMODEM source code ?
Yes, I have access to the source code under the MVPSLA.
Post by Way2caller
Do you know if for UNIMODEM the buffer size is enlarged, too ?
I don't know. Unfortunately I have no time to debug this at
the moment. Both of our TSPs come with an MSP and don't
offer any wave devices, so I don't have practical experience
with lineGetID on the TSPI side.
Post by Way2caller
It seems TAPI always increases the buffer size - no matter what size
I originally send via TB20 - TAPI always adds 0x100 to it.
(and when the buffer gets back to the app - it is reduced again by
0x100...)
Maybe this is just a security measure of tapisrv to avoid memory
being overwritten or to be compatible with previous TSPI versions...
I wouldn't concentrate on the increased size but rather on the reason
why TAPI returns an error.
Do you return 0 (zero) for this function?
Does your TSP write to the dwTotalSite member?
Best regards,
Matthias Moetje
-------------------------------------
TERASENS GmbH
Augustenstraße 24
80333 Munich, GERMANY
-------------------------------------
Fon: +49 89 143370-0
Fax: +49 89 143370-22
e-mail: moetje at terasens dot com
www: www.terasens.com
-------------------------------------
Post by Way2caller
Post by Matthias Moetje [MVP]
Hi,
the method I posted is exactly the same like Unimodem is doing it.
So if you are doing exactly what I posted, the problem must be
somewhere else...
PS: I don't know why TAPI increases the size of the structure. What
happens if you pass a much larger structure through TB..?
Best regards,
Matthias Moetje
-------------------------------------
TERASENS GmbH
Augustenstraße 24
80333 Munich, GERMANY
-------------------------------------
Fon: +49 89 143370-0
Fax: +49 89 143370-22
e-mail: moetje at terasens dot com
www: www.terasens.com
-------------------------------------
Post by Way2caller
Hi,
Did it.
Same results.
lpDeviceID->dwTotalSize=0x124 (which is +0x100 from the value in
TB20)
lpDeviceID->dwNeededSize=0x18
lpDeviceID->dwUsedSize=0x18
lpDeviceID->dwTotalSize=0x124 (which is +0x100 from the value in
TB20)
lpDeviceID->dwNeededSize=0x1c
lpDeviceID->dwUsedSize=0x1c
lpDeviceID->dwStringFormat=4
lpDeviceID->dwStringSize=4
lpDeviceID->dwStringOffset=0x18
and the value is in the right place.
Still the same results...
And why does TAPI increase the dwTotalSize field ?
Post by Matthias Moetje [MVP]
Hi,
YourLineGetIDfunction(LPVARSTRING lpDeviceID)
{
lpDeviceID->dwNeededSize += sizeof(DWORD)
lpDeviceID->dwStringSize = sizeof(DWORD)
lpDeviceID->dwUsedSize += sizeof(DWORD)
lpDeviceID->dwStringFormat=STRINGFORMAT_BINARY
LPDWORD lpdwDeviceID = (LPDWORD)(((LPBYTE)lpDeviceID) +
sizeof(VARSTRING));
*lpdwDeviceID = dwYourID;
}
Best regards,
Matthias Moetje
-------------------------------------
TERASENS GmbH
Augustenstraße 24
80333 Munich, GERMANY
-------------------------------------
Fon: +49 89 143370-0
Fax: +49 89 143370-22
e-mail: moetje at terasens dot com
www: www.terasens.com
-------------------------------------
Matthias Moetje [MVP]
2007-07-04 15:33:55 UTC
Permalink
Hi Shimon,

that seems really weird...

I don't think that this is the correct solution. Are you sure that this
doesn't
break applications? What if an application is not coded to take care of the
dwNeededSize?

What I think is correct is NOT to return LINEERR_STRUCTURETOOSMALL,
Unimodem doesn't do this either.

Does this work with the Wave MSP (to test this simply start Windows Phone
Dialer
and see if you can make calls with audio)?


Best regards,

Matthias Moetje
-------------------------------------
TERASENS GmbH
Augustenstraße 24
80333 Munich, GERMANY
-------------------------------------
Fon: +49 89 143370-0
Fax: +49 89 143370-22
e-mail: moetje at terasens dot com
www: www.terasens.com
-------------------------------------
Post by Way2caller
Hi Matthias,
This code seems to work.
I am not totally happy with this, cause I dont like
going with "hunch" solutions - not knowing why
a solution works...
============================================
if (lpDeviceID->dwTotalSize <
sizeof(VARSTRING)+sizeof(DWORD)+0x00000100+100)
{
lpDeviceID->dwNeededSize =
sizeof(VARSTRING)+sizeof(DWORD)+0x00000100+100;
return 0;
}
lpDeviceID->dwNeededSize = sizeof(VARSTRING) +
sizeof(DWORD)+0x00000100+100;
if (lpDeviceID->dwTotalSize >= sizeof(VARSTRING) + sizeof(DWORD))
{
lpDeviceID->dwStringFormat = STRINGFORMAT_BINARY;
lpDeviceID->dwNeededSize = sizeof(VARSTRING)+sizeof(DWORD);
lpDeviceID->dwUsedSize = sizeof(VARSTRING)+sizeof(DWORD);
lpDeviceID->dwStringOffset = sizeof(VARSTRING);
lpDeviceID->dwStringSize = sizeof(DWORD);
*(DWORD *)((BYTE *)lpDeviceID + sizeof(VARSTRING)) = dwID;
return 0;
}
return 0;
============================================
Post by Matthias Moetje [MVP]
Shimon,
maybe this is the same problem I was just facing a few weeks ago,
when I wanted to perform some tests with your device/TSP.
I couldn't get it working but didn't have enough time to look into
it more thoroughly...
How do you enumerate the wave devices?
It uses LoadLibrary to load winmm.dll dynamically.
Then it calls GetProcAddress to get pointer to the functions
waveInGetDevCapsW
waveInGetNumDevs
(or the corresponding out functions)
If first calls n=waveInGetNumDevs() and then loops from 0 to n-1
calling waveInGetDevCaps and compares the wave device names
to find the correct one.
If you say that this is different from what you receive in the application's
context, in which way is this different. Can you show both lists for
comparison?
One problem I know which often interferes with TSPs' audio devices
is the RDP audio mapper which replaces all wave devices once a
remote desktop session is started (with enabled audio mapping). Though,
we have experienced this behaviour with Windows Server 2003, usually.
Best regards,
Matthias Moetje
-------------------------------------
TERASENS GmbH
Augustenstraße 24
80333 Munich, GERMANY
-------------------------------------
Fon: +49 89 143370-0
Fax: +49 89 143370-22
e-mail: moetje at terasens dot com
www: www.terasens.com
-------------------------------------
Post by Way2caller
Hi,
Thanks for your support.
Yes - we do have a TSP that supports wave devices.
It even works great with Vista.
It USED to work great on XP, too, but now all of a sadden it stopped working.
I can only guess some XP update changed something in the way TAPI works...
Anyway - I just found something interesting - the enumeration of wave
devices yields a different order when it is done in the TSP space, or
in
the
APP space.
I guess this is part of what's going wrong.
Post by Matthias Moetje [MVP]
Shimon,
Post by Way2caller
1. I guess you can not email me the TSPI_lineGetID source code ?
No, according to the license agreement this is not allowed. I am not
even allowed to make personal copies (just browsing online).
Post by Way2caller
2. I hope I am not pushing it too far, but could you just check what
you
get
in return to calling lineGetID with "wave/Out" (with the MSP) ?
Our TSP does not offer any wave devices and thus device classes with
wave/... are not supported.
Post by Way2caller
3. Tried to figure out that, but with no success.
My TSP does return 0, and it does not touch the dwTotalSize field.
I don't have any more ideas, as I can't see your source code.
Looking at your display name I wonder: Don't you already have a working
TSP that supports wave devices...?
Best regards,
Matthias Moetje
-------------------------------------
TERASENS GmbH
Augustenstraße 24
80333 Munich, GERMANY
-------------------------------------
Fon: +49 89 143370-0
Fax: +49 89 143370-22
e-mail: moetje at terasens dot com
www: www.terasens.com
-------------------------------------
Post by Way2caller
Thanks again for sticking with me on this.
Post by Matthias Moetje [MVP]
Shimon,
Post by Way2caller
Question is where the problem lies...
Do you have the UNIMODEM source code ?
Yes, I have access to the source code under the MVPSLA.
Post by Way2caller
Do you know if for UNIMODEM the buffer size is enlarged, too ?
I don't know. Unfortunately I have no time to debug this at
the moment. Both of our TSPs come with an MSP and don't
offer any wave devices, so I don't have practical experience
with lineGetID on the TSPI side.
Post by Way2caller
It seems TAPI always increases the buffer size - no matter what size
I originally send via TB20 - TAPI always adds 0x100 to it.
(and when the buffer gets back to the app - it is reduced again by
0x100...)
Maybe this is just a security measure of tapisrv to avoid memory
being overwritten or to be compatible with previous TSPI versions...
I wouldn't concentrate on the increased size but rather on the reason
why TAPI returns an error.
Do you return 0 (zero) for this function?
Does your TSP write to the dwTotalSite member?
Best regards,
Matthias Moetje
-------------------------------------
TERASENS GmbH
Augustenstraße 24
80333 Munich, GERMANY
-------------------------------------
Fon: +49 89 143370-0
Fax: +49 89 143370-22
e-mail: moetje at terasens dot com
www: www.terasens.com
-------------------------------------
Post by Way2caller
Post by Matthias Moetje [MVP]
Hi,
the method I posted is exactly the same like Unimodem is doing it.
So if you are doing exactly what I posted, the problem must be
somewhere else...
PS: I don't know why TAPI increases the size of the structure. What
happens if you pass a much larger structure through TB..?
Best regards,
Matthias Moetje
-------------------------------------
TERASENS GmbH
Augustenstraße 24
80333 Munich, GERMANY
-------------------------------------
Fon: +49 89 143370-0
Fax: +49 89 143370-22
e-mail: moetje at terasens dot com
www: www.terasens.com
-------------------------------------
Post by Way2caller
Hi,
Did it.
Same results.
lpDeviceID->dwTotalSize=0x124 (which is +0x100 from the value in
TB20)
lpDeviceID->dwNeededSize=0x18
lpDeviceID->dwUsedSize=0x18
lpDeviceID->dwTotalSize=0x124 (which is +0x100 from the value in
TB20)
lpDeviceID->dwNeededSize=0x1c
lpDeviceID->dwUsedSize=0x1c
lpDeviceID->dwStringFormat=4
lpDeviceID->dwStringSize=4
lpDeviceID->dwStringOffset=0x18
and the value is in the right place.
Still the same results...
And why does TAPI increase the dwTotalSize field ?
Post by Matthias Moetje [MVP]
Hi,
YourLineGetIDfunction(LPVARSTRING lpDeviceID)
{
lpDeviceID->dwNeededSize += sizeof(DWORD)
lpDeviceID->dwStringSize = sizeof(DWORD)
lpDeviceID->dwUsedSize += sizeof(DWORD)
lpDeviceID->dwStringFormat=STRINGFORMAT_BINARY
LPDWORD lpdwDeviceID = (LPDWORD)(((LPBYTE)lpDeviceID) +
sizeof(VARSTRING));
*lpdwDeviceID = dwYourID;
}
Best regards,
Matthias Moetje
-------------------------------------
TERASENS GmbH
Augustenstraße 24
80333 Munich, GERMANY
-------------------------------------
Fon: +49 89 143370-0
Fax: +49 89 143370-22
e-mail: moetje at terasens dot com
www: www.terasens.com
-------------------------------------
Way2caller
2007-07-04 18:46:03 UTC
Permalink
Hi,

Wierd indeed. But seems to work...
Tested with several apps. Not sure I understand what you mean by "Phone
dialer with audio", but tested several apps.

Also - using my own test app, tried puting various values in dwTotalSize,
and it seems to work ok - the TAPI service seems to take care of the
dwNeededSize checks...

But - since I suspect all this may be a result of some windows xp update -
it may not work properly on old XP computers who did not update.

I wish I could shed some light on this...

Thanks.
Post by Matthias Moetje [MVP]
Hi Shimon,
that seems really weird...
I don't think that this is the correct solution. Are you sure that this
doesn't
break applications? What if an application is not coded to take care of the
dwNeededSize?
What I think is correct is NOT to return LINEERR_STRUCTURETOOSMALL,
Unimodem doesn't do this either.
Does this work with the Wave MSP (to test this simply start Windows Phone
Dialer
and see if you can make calls with audio)?
Best regards,
Matthias Moetje
-------------------------------------
TERASENS GmbH
Augustenstraße 24
80333 Munich, GERMANY
-------------------------------------
Fon: +49 89 143370-0
Fax: +49 89 143370-22
e-mail: moetje at terasens dot com
www: www.terasens.com
-------------------------------------
Post by Way2caller
Hi Matthias,
This code seems to work.
I am not totally happy with this, cause I dont like
going with "hunch" solutions - not knowing why
a solution works...
============================================
if (lpDeviceID->dwTotalSize <
sizeof(VARSTRING)+sizeof(DWORD)+0x00000100+100)
{
lpDeviceID->dwNeededSize =
sizeof(VARSTRING)+sizeof(DWORD)+0x00000100+100;
return 0;
}
lpDeviceID->dwNeededSize = sizeof(VARSTRING) +
sizeof(DWORD)+0x00000100+100;
if (lpDeviceID->dwTotalSize >= sizeof(VARSTRING) + sizeof(DWORD))
{
lpDeviceID->dwStringFormat = STRINGFORMAT_BINARY;
lpDeviceID->dwNeededSize = sizeof(VARSTRING)+sizeof(DWORD);
lpDeviceID->dwUsedSize = sizeof(VARSTRING)+sizeof(DWORD);
lpDeviceID->dwStringOffset = sizeof(VARSTRING);
lpDeviceID->dwStringSize = sizeof(DWORD);
*(DWORD *)((BYTE *)lpDeviceID + sizeof(VARSTRING)) = dwID;
return 0;
}
return 0;
============================================
Post by Matthias Moetje [MVP]
Shimon,
maybe this is the same problem I was just facing a few weeks ago,
when I wanted to perform some tests with your device/TSP.
I couldn't get it working but didn't have enough time to look into
it more thoroughly...
How do you enumerate the wave devices?
It uses LoadLibrary to load winmm.dll dynamically.
Then it calls GetProcAddress to get pointer to the functions
waveInGetDevCapsW
waveInGetNumDevs
(or the corresponding out functions)
If first calls n=waveInGetNumDevs() and then loops from 0 to n-1
calling waveInGetDevCaps and compares the wave device names
to find the correct one.
If you say that this is different from what you receive in the application's
context, in which way is this different. Can you show both lists for
comparison?
One problem I know which often interferes with TSPs' audio devices
is the RDP audio mapper which replaces all wave devices once a
remote desktop session is started (with enabled audio mapping). Though,
we have experienced this behaviour with Windows Server 2003, usually.
Best regards,
Matthias Moetje
-------------------------------------
TERASENS GmbH
Augustenstraße 24
80333 Munich, GERMANY
-------------------------------------
Fon: +49 89 143370-0
Fax: +49 89 143370-22
e-mail: moetje at terasens dot com
www: www.terasens.com
-------------------------------------
Post by Way2caller
Hi,
Thanks for your support.
Yes - we do have a TSP that supports wave devices.
It even works great with Vista.
It USED to work great on XP, too, but now all of a sadden it stopped working.
I can only guess some XP update changed something in the way TAPI works...
Anyway - I just found something interesting - the enumeration of wave
devices yields a different order when it is done in the TSP space, or
in
the
APP space.
I guess this is part of what's going wrong.
Post by Matthias Moetje [MVP]
Shimon,
Post by Way2caller
1. I guess you can not email me the TSPI_lineGetID source code ?
No, according to the license agreement this is not allowed. I am not
even allowed to make personal copies (just browsing online).
Post by Way2caller
2. I hope I am not pushing it too far, but could you just check what
you
get
in return to calling lineGetID with "wave/Out" (with the MSP) ?
Our TSP does not offer any wave devices and thus device classes with
wave/... are not supported.
Post by Way2caller
3. Tried to figure out that, but with no success.
My TSP does return 0, and it does not touch the dwTotalSize field.
I don't have any more ideas, as I can't see your source code.
Looking at your display name I wonder: Don't you already have a working
TSP that supports wave devices...?
Best regards,
Matthias Moetje
-------------------------------------
TERASENS GmbH
Augustenstraße 24
80333 Munich, GERMANY
-------------------------------------
Fon: +49 89 143370-0
Fax: +49 89 143370-22
e-mail: moetje at terasens dot com
www: www.terasens.com
-------------------------------------
Post by Way2caller
Thanks again for sticking with me on this.
Post by Matthias Moetje [MVP]
Shimon,
Post by Way2caller
Question is where the problem lies...
Do you have the UNIMODEM source code ?
Yes, I have access to the source code under the MVPSLA.
Post by Way2caller
Do you know if for UNIMODEM the buffer size is enlarged, too ?
I don't know. Unfortunately I have no time to debug this at
the moment. Both of our TSPs come with an MSP and don't
offer any wave devices, so I don't have practical experience
with lineGetID on the TSPI side.
Post by Way2caller
It seems TAPI always increases the buffer size - no matter what size
I originally send via TB20 - TAPI always adds 0x100 to it.
(and when the buffer gets back to the app - it is reduced again by
0x100...)
Maybe this is just a security measure of tapisrv to avoid memory
being overwritten or to be compatible with previous TSPI versions...
I wouldn't concentrate on the increased size but rather on the reason
why TAPI returns an error.
Do you return 0 (zero) for this function?
Does your TSP write to the dwTotalSite member?
Best regards,
Matthias Moetje
-------------------------------------
TERASENS GmbH
Augustenstraße 24
80333 Munich, GERMANY
-------------------------------------
Fon: +49 89 143370-0
Fax: +49 89 143370-22
e-mail: moetje at terasens dot com
www: www.terasens.com
-------------------------------------
Post by Way2caller
Post by Matthias Moetje [MVP]
Hi,
the method I posted is exactly the same like Unimodem is doing it.
So if you are doing exactly what I posted, the problem must be
somewhere else...
PS: I don't know why TAPI increases the size of the structure. What
happens if you pass a much larger structure through TB..?
Best regards,
Matthias Moetje
-------------------------------------
TERASENS GmbH
Augustenstraße 24
80333 Munich, GERMANY
-------------------------------------
Fon: +49 89 143370-0
Fax: +49 89 143370-22
e-mail: moetje at terasens dot com
www: www.terasens.com
-------------------------------------
Post by Way2caller
Hi,
Did it.
Same results.
lpDeviceID->dwTotalSize=0x124 (which is +0x100 from the value
in
TB20)
lpDeviceID->dwNeededSize=0x18
lpDeviceID->dwUsedSize=0x18
lpDeviceID->dwTotalSize=0x124 (which is +0x100 from the value
in
TB20)
lpDeviceID->dwNeededSize=0x1c
lpDeviceID->dwUsedSize=0x1c
lpDeviceID->dwStringFormat=4
lpDeviceID->dwStringSize=4
Matthias Moetje [MVP]
2007-07-05 16:14:01 UTC
Permalink
Hi,
Post by Way2caller
Wierd indeed. But seems to work...
Tested with several apps. Not sure I understand what you mean by "Phone
dialer with audio", but tested several apps.
Start >> Run >> Dialer.exe

Edit >> Options: Select your line for phone calls; second tab: Select your
audio device (e.g. sound card mic and speakers)

Create phone call.
See if you hear audio.
Post by Way2caller
Also - using my own test app, tried puting various values in dwTotalSize,
and it seems to work ok - the TAPI service seems to take care of the
dwNeededSize checks...
But - since I suspect all this may be a result of some windows xp update -
it may not work properly on old XP computers who did not update.
Does it work on W2k?


Best regards,

Matthias Moetje
-------------------------------------
TERASENS GmbH
Augustenstraße 24
80333 Munich, GERMANY
-------------------------------------
Fon: +49 89 143370-0
Fax: +49 89 143370-22
e-mail: moetje at terasens dot com
www: www.terasens.com
-------------------------------------
Post by Way2caller
Post by Matthias Moetje [MVP]
Hi Shimon,
that seems really weird...
I don't think that this is the correct solution. Are you sure that this
doesn't
break applications? What if an application is not coded to take care of the
dwNeededSize?
What I think is correct is NOT to return LINEERR_STRUCTURETOOSMALL,
Unimodem doesn't do this either.
Does this work with the Wave MSP (to test this simply start Windows Phone
Dialer
and see if you can make calls with audio)?
Best regards,
Matthias Moetje
-------------------------------------
TERASENS GmbH
Augustenstraße 24
80333 Munich, GERMANY
-------------------------------------
Fon: +49 89 143370-0
Fax: +49 89 143370-22
e-mail: moetje at terasens dot com
www: www.terasens.com
-------------------------------------
Post by Way2caller
Hi Matthias,
This code seems to work.
I am not totally happy with this, cause I dont like
going with "hunch" solutions - not knowing why
a solution works...
============================================
if (lpDeviceID->dwTotalSize <
sizeof(VARSTRING)+sizeof(DWORD)+0x00000100+100)
{
lpDeviceID->dwNeededSize =
sizeof(VARSTRING)+sizeof(DWORD)+0x00000100+100;
return 0;
}
lpDeviceID->dwNeededSize = sizeof(VARSTRING) +
sizeof(DWORD)+0x00000100+100;
if (lpDeviceID->dwTotalSize >= sizeof(VARSTRING) + sizeof(DWORD))
{
lpDeviceID->dwStringFormat = STRINGFORMAT_BINARY;
lpDeviceID->dwNeededSize = sizeof(VARSTRING)+sizeof(DWORD);
lpDeviceID->dwUsedSize = sizeof(VARSTRING)+sizeof(DWORD);
lpDeviceID->dwStringOffset = sizeof(VARSTRING);
lpDeviceID->dwStringSize = sizeof(DWORD);
*(DWORD *)((BYTE *)lpDeviceID + sizeof(VARSTRING)) = dwID;
return 0;
}
return 0;
============================================
Post by Matthias Moetje [MVP]
Shimon,
maybe this is the same problem I was just facing a few weeks ago,
when I wanted to perform some tests with your device/TSP.
I couldn't get it working but didn't have enough time to look into
it more thoroughly...
How do you enumerate the wave devices?
It uses LoadLibrary to load winmm.dll dynamically.
Then it calls GetProcAddress to get pointer to the functions
waveInGetDevCapsW
waveInGetNumDevs
(or the corresponding out functions)
If first calls n=waveInGetNumDevs() and then loops from 0 to n-1
calling waveInGetDevCaps and compares the wave device names
to find the correct one.
If you say that this is different from what you receive in the application's
context, in which way is this different. Can you show both lists for
comparison?
One problem I know which often interferes with TSPs' audio devices
is the RDP audio mapper which replaces all wave devices once a
remote desktop session is started (with enabled audio mapping). Though,
we have experienced this behaviour with Windows Server 2003, usually.
Best regards,
Matthias Moetje
-------------------------------------
TERASENS GmbH
Augustenstraße 24
80333 Munich, GERMANY
-------------------------------------
Fon: +49 89 143370-0
Fax: +49 89 143370-22
e-mail: moetje at terasens dot com
www: www.terasens.com
-------------------------------------
Post by Way2caller
Hi,
Thanks for your support.
Yes - we do have a TSP that supports wave devices.
It even works great with Vista.
It USED to work great on XP, too, but now all of a sadden it stopped working.
I can only guess some XP update changed something in the way TAPI works...
Anyway - I just found something interesting - the enumeration of wave
devices yields a different order when it is done in the TSP space, or
in
the
APP space.
I guess this is part of what's going wrong.
Post by Matthias Moetje [MVP]
Shimon,
Post by Way2caller
1. I guess you can not email me the TSPI_lineGetID source code ?
No, according to the license agreement this is not allowed. I am not
even allowed to make personal copies (just browsing online).
Post by Way2caller
2. I hope I am not pushing it too far, but could you just check what
you
get
in return to calling lineGetID with "wave/Out" (with the MSP) ?
Our TSP does not offer any wave devices and thus device classes with
wave/... are not supported.
Post by Way2caller
3. Tried to figure out that, but with no success.
My TSP does return 0, and it does not touch the dwTotalSize field.
I don't have any more ideas, as I can't see your source code.
Looking at your display name I wonder: Don't you already have a working
TSP that supports wave devices...?
Best regards,
Matthias Moetje
-------------------------------------
TERASENS GmbH
Augustenstraße 24
80333 Munich, GERMANY
-------------------------------------
Fon: +49 89 143370-0
Fax: +49 89 143370-22
e-mail: moetje at terasens dot com
www: www.terasens.com
-------------------------------------
Post by Way2caller
Thanks again for sticking with me on this.
Post by Matthias Moetje [MVP]
Shimon,
Post by Way2caller
Question is where the problem lies...
Do you have the UNIMODEM source code ?
Yes, I have access to the source code under the MVPSLA.
Post by Way2caller
Do you know if for UNIMODEM the buffer size is enlarged, too ?
I don't know. Unfortunately I have no time to debug this at
the moment. Both of our TSPs come with an MSP and don't
offer any wave devices, so I don't have practical experience
with lineGetID on the TSPI side.
Post by Way2caller
It seems TAPI always increases the buffer size - no matter
what
size
I originally send via TB20 - TAPI always adds 0x100 to it.
(and when the buffer gets back to the app - it is reduced
again
by
0x100...)
Maybe this is just a security measure of tapisrv to avoid memory
being overwritten or to be compatible with previous TSPI versions...
I wouldn't concentrate on the increased size but rather on the reason
why TAPI returns an error.
Do you return 0 (zero) for this function?
Does your TSP write to the dwTotalSite member?
Best regards,
Matthias Moetje
-------------------------------------
TERASENS GmbH
Augustenstraße 24
80333 Munich, GERMANY
-------------------------------------
Fon: +49 89 143370-0
Fax: +49 89 143370-22
e-mail: moetje at terasens dot com
www: www.terasens.com
-------------------------------------
Post by Way2caller
Post by Matthias Moetje [MVP]
Hi,
the method I posted is exactly the same like Unimodem is
doing
it.
So if you are doing exactly what I posted, the problem must be
somewhere else...
PS: I don't know why TAPI increases the size of the
structure.
What
happens if you pass a much larger structure through TB..?
Best regards,
Matthias Moetje
-------------------------------------
TERASENS GmbH
Augustenstraße 24
80333 Munich, GERMANY
-------------------------------------
Fon: +49 89 143370-0
Fax: +49 89 143370-22
e-mail: moetje at terasens dot com
www: www.terasens.com
-------------------------------------
Post by Way2caller
Hi,
Did it.
Same results.
lpDeviceID->dwTotalSize=0x124 (which is +0x100 from the value
in
TB20)
lpDeviceID->dwNeededSize=0x18
lpDeviceID->dwUsedSize=0x18
lpDeviceID->dwTotalSize=0x124 (which is +0x100 from the value
in
TB20)
lpDeviceID->dwNeededSize=0x1c
lpDeviceID->dwUsedSize=0x1c
lpDeviceID->dwStringFormat=4
lpDeviceID->dwStringSize=4
Way2caller
2007-07-05 17:56:04 UTC
Permalink
Hi,

Seems to be working ok.
The dialer.exe sends a buffer sized over 0x200, so it's ok.

Regarding Win2K - will have to check. Tested on XP & Vista.

Thanks.
Post by Matthias Moetje [MVP]
Hi,
Post by Way2caller
Wierd indeed. But seems to work...
Tested with several apps. Not sure I understand what you mean by "Phone
dialer with audio", but tested several apps.
Start >> Run >> Dialer.exe
Edit >> Options: Select your line for phone calls; second tab: Select your
audio device (e.g. sound card mic and speakers)
Create phone call.
See if you hear audio.
Post by Way2caller
Also - using my own test app, tried puting various values in dwTotalSize,
and it seems to work ok - the TAPI service seems to take care of the
dwNeededSize checks...
But - since I suspect all this may be a result of some windows xp update -
it may not work properly on old XP computers who did not update.
Does it work on W2k?
Best regards,
Matthias Moetje
-------------------------------------
TERASENS GmbH
Augustenstraße 24
80333 Munich, GERMANY
-------------------------------------
Fon: +49 89 143370-0
Fax: +49 89 143370-22
e-mail: moetje at terasens dot com
www: www.terasens.com
-------------------------------------
Post by Way2caller
Post by Matthias Moetje [MVP]
Hi Shimon,
that seems really weird...
I don't think that this is the correct solution. Are you sure that this
doesn't
break applications? What if an application is not coded to take care of the
dwNeededSize?
What I think is correct is NOT to return LINEERR_STRUCTURETOOSMALL,
Unimodem doesn't do this either.
Does this work with the Wave MSP (to test this simply start Windows Phone
Dialer
and see if you can make calls with audio)?
Best regards,
Matthias Moetje
-------------------------------------
TERASENS GmbH
Augustenstraße 24
80333 Munich, GERMANY
-------------------------------------
Fon: +49 89 143370-0
Fax: +49 89 143370-22
e-mail: moetje at terasens dot com
www: www.terasens.com
-------------------------------------
Post by Way2caller
Hi Matthias,
This code seems to work.
I am not totally happy with this, cause I dont like
going with "hunch" solutions - not knowing why
a solution works...
============================================
if (lpDeviceID->dwTotalSize <
sizeof(VARSTRING)+sizeof(DWORD)+0x00000100+100)
{
lpDeviceID->dwNeededSize =
sizeof(VARSTRING)+sizeof(DWORD)+0x00000100+100;
return 0;
}
lpDeviceID->dwNeededSize = sizeof(VARSTRING) +
sizeof(DWORD)+0x00000100+100;
if (lpDeviceID->dwTotalSize >= sizeof(VARSTRING) + sizeof(DWORD))
{
lpDeviceID->dwStringFormat = STRINGFORMAT_BINARY;
lpDeviceID->dwNeededSize = sizeof(VARSTRING)+sizeof(DWORD);
lpDeviceID->dwUsedSize = sizeof(VARSTRING)+sizeof(DWORD);
lpDeviceID->dwStringOffset = sizeof(VARSTRING);
lpDeviceID->dwStringSize = sizeof(DWORD);
*(DWORD *)((BYTE *)lpDeviceID + sizeof(VARSTRING)) = dwID;
return 0;
}
return 0;
============================================
Post by Matthias Moetje [MVP]
Shimon,
maybe this is the same problem I was just facing a few weeks ago,
when I wanted to perform some tests with your device/TSP.
I couldn't get it working but didn't have enough time to look into
it more thoroughly...
How do you enumerate the wave devices?
It uses LoadLibrary to load winmm.dll dynamically.
Then it calls GetProcAddress to get pointer to the functions
waveInGetDevCapsW
waveInGetNumDevs
(or the corresponding out functions)
If first calls n=waveInGetNumDevs() and then loops from 0 to n-1
calling waveInGetDevCaps and compares the wave device names
to find the correct one.
If you say that this is different from what you receive in the application's
context, in which way is this different. Can you show both lists for
comparison?
One problem I know which often interferes with TSPs' audio devices
is the RDP audio mapper which replaces all wave devices once a
remote desktop session is started (with enabled audio mapping). Though,
we have experienced this behaviour with Windows Server 2003, usually.
Best regards,
Matthias Moetje
-------------------------------------
TERASENS GmbH
Augustenstraße 24
80333 Munich, GERMANY
-------------------------------------
Fon: +49 89 143370-0
Fax: +49 89 143370-22
e-mail: moetje at terasens dot com
www: www.terasens.com
-------------------------------------
Post by Way2caller
Hi,
Thanks for your support.
Yes - we do have a TSP that supports wave devices.
It even works great with Vista.
It USED to work great on XP, too, but now all of a sadden it stopped
working.
I can only guess some XP update changed something in the way TAPI works...
Anyway - I just found something interesting - the enumeration of wave
devices yields a different order when it is done in the TSP space, or
in
the
APP space.
I guess this is part of what's going wrong.
Post by Matthias Moetje [MVP]
Shimon,
Post by Way2caller
1. I guess you can not email me the TSPI_lineGetID source code ?
No, according to the license agreement this is not allowed. I am not
even allowed to make personal copies (just browsing online).
Post by Way2caller
2. I hope I am not pushing it too far, but could you just check what
you
get
in return to calling lineGetID with "wave/Out" (with the MSP) ?
Our TSP does not offer any wave devices and thus device classes with
wave/... are not supported.
Post by Way2caller
3. Tried to figure out that, but with no success.
My TSP does return 0, and it does not touch the dwTotalSize field.
I don't have any more ideas, as I can't see your source code.
Looking at your display name I wonder: Don't you already have a working
TSP that supports wave devices...?
Best regards,
Matthias Moetje
-------------------------------------
TERASENS GmbH
Augustenstraße 24
80333 Munich, GERMANY
-------------------------------------
Fon: +49 89 143370-0
Fax: +49 89 143370-22
e-mail: moetje at terasens dot com
www: www.terasens.com
-------------------------------------
Post by Way2caller
Thanks again for sticking with me on this.
Post by Matthias Moetje [MVP]
Shimon,
Post by Way2caller
Question is where the problem lies...
Do you have the UNIMODEM source code ?
Yes, I have access to the source code under the MVPSLA.
Post by Way2caller
Do you know if for UNIMODEM the buffer size is enlarged, too ?
I don't know. Unfortunately I have no time to debug this at
the moment. Both of our TSPs come with an MSP and don't
offer any wave devices, so I don't have practical experience
with lineGetID on the TSPI side.
Post by Way2caller
It seems TAPI always increases the buffer size - no matter
what
size
I originally send via TB20 - TAPI always adds 0x100 to it.
(and when the buffer gets back to the app - it is reduced
again
by
0x100...)
Maybe this is just a security measure of tapisrv to avoid memory
being overwritten or to be compatible with previous TSPI
versions...
I wouldn't concentrate on the increased size but rather on the
reason
why TAPI returns an error.
Do you return 0 (zero) for this function?
Does your TSP write to the dwTotalSite member?
Best regards,
Matthias Moetje
-------------------------------------
TERASENS GmbH
Augustenstraße 24
80333 Munich, GERMANY
-------------------------------------
Fon: +49 89 143370-0
Fax: +49 89 143370-22
e-mail: moetje at terasens dot com
www: www.terasens.com
-------------------------------------
Matthias Moetje [MVP]
2007-07-05 19:06:55 UTC
Permalink
Shimon,
Post by Way2caller
Seems to be working ok.
The dialer.exe sends a buffer sized over 0x200, so it's ok.
Regarding Win2K - will have to check. Tested on XP & Vista.
You're welcome! Could you send me a copy when it's packaged?
We are performing some new compatibility tests shortly and the
current TSP does not work here.


Best regards,

Matthias Moetje
-------------------------------------
TERASENS GmbH
Augustenstraße 24
80333 Munich, GERMANY
-------------------------------------
Fon: +49 89 143370-0
Fax: +49 89 143370-22
e-mail: moetje at terasens dot com
www: www.terasens.com
-------------------------------------
Post by Way2caller
Post by Matthias Moetje [MVP]
Hi,
Post by Way2caller
Wierd indeed. But seems to work...
Tested with several apps. Not sure I understand what you mean by "Phone
dialer with audio", but tested several apps.
Start >> Run >> Dialer.exe
Edit >> Options: Select your line for phone calls; second tab: Select your
audio device (e.g. sound card mic and speakers)
Create phone call.
See if you hear audio.
Post by Way2caller
Also - using my own test app, tried puting various values in dwTotalSize,
and it seems to work ok - the TAPI service seems to take care of the
dwNeededSize checks...
But - since I suspect all this may be a result of some windows xp update -
it may not work properly on old XP computers who did not update.
Does it work on W2k?
Best regards,
Matthias Moetje
-------------------------------------
TERASENS GmbH
Augustenstraße 24
80333 Munich, GERMANY
-------------------------------------
Fon: +49 89 143370-0
Fax: +49 89 143370-22
e-mail: moetje at terasens dot com
www: www.terasens.com
-------------------------------------
Post by Way2caller
Post by Matthias Moetje [MVP]
Hi Shimon,
that seems really weird...
I don't think that this is the correct solution. Are you sure that this
doesn't
break applications? What if an application is not coded to take care
of
the
dwNeededSize?
What I think is correct is NOT to return LINEERR_STRUCTURETOOSMALL,
Unimodem doesn't do this either.
Does this work with the Wave MSP (to test this simply start Windows Phone
Dialer
and see if you can make calls with audio)?
Best regards,
Matthias Moetje
-------------------------------------
TERASENS GmbH
Augustenstraße 24
80333 Munich, GERMANY
-------------------------------------
Fon: +49 89 143370-0
Fax: +49 89 143370-22
e-mail: moetje at terasens dot com
www: www.terasens.com
-------------------------------------
Post by Way2caller
Hi Matthias,
This code seems to work.
I am not totally happy with this, cause I dont like
going with "hunch" solutions - not knowing why
a solution works...
============================================
if (lpDeviceID->dwTotalSize <
sizeof(VARSTRING)+sizeof(DWORD)+0x00000100+100)
{
lpDeviceID->dwNeededSize =
sizeof(VARSTRING)+sizeof(DWORD)+0x00000100+100;
return 0;
}
lpDeviceID->dwNeededSize = sizeof(VARSTRING) +
sizeof(DWORD)+0x00000100+100;
if (lpDeviceID->dwTotalSize >= sizeof(VARSTRING) + sizeof(DWORD))
{
lpDeviceID->dwStringFormat = STRINGFORMAT_BINARY;
lpDeviceID->dwNeededSize = sizeof(VARSTRING)+sizeof(DWORD);
lpDeviceID->dwUsedSize = sizeof(VARSTRING)+sizeof(DWORD);
lpDeviceID->dwStringOffset = sizeof(VARSTRING);
lpDeviceID->dwStringSize = sizeof(DWORD);
*(DWORD *)((BYTE *)lpDeviceID + sizeof(VARSTRING)) = dwID;
return 0;
}
return 0;
============================================
Post by Matthias Moetje [MVP]
Shimon,
maybe this is the same problem I was just facing a few weeks ago,
when I wanted to perform some tests with your device/TSP.
I couldn't get it working but didn't have enough time to look into
it more thoroughly...
How do you enumerate the wave devices?
It uses LoadLibrary to load winmm.dll dynamically.
Then it calls GetProcAddress to get pointer to the functions
waveInGetDevCapsW
waveInGetNumDevs
(or the corresponding out functions)
If first calls n=waveInGetNumDevs() and then loops from 0 to n-1
calling waveInGetDevCaps and compares the wave device names
to find the correct one.
If you say that this is different from what you receive in the application's
context, in which way is this different. Can you show both lists for
comparison?
One problem I know which often interferes with TSPs' audio devices
is the RDP audio mapper which replaces all wave devices once a
remote desktop session is started (with enabled audio mapping). Though,
we have experienced this behaviour with Windows Server 2003, usually.
Best regards,
Matthias Moetje
-------------------------------------
TERASENS GmbH
Augustenstraße 24
80333 Munich, GERMANY
-------------------------------------
Fon: +49 89 143370-0
Fax: +49 89 143370-22
e-mail: moetje at terasens dot com
www: www.terasens.com
-------------------------------------
Post by Way2caller
Hi,
Thanks for your support.
Yes - we do have a TSP that supports wave devices.
It even works great with Vista.
It USED to work great on XP, too, but now all of a sadden it stopped
working.
I can only guess some XP update changed something in the way TAPI
works...
Anyway - I just found something interesting - the enumeration of wave
devices yields a different order when it is done in the TSP
space,
or
in
the
APP space.
I guess this is part of what's going wrong.
Post by Matthias Moetje [MVP]
Shimon,
Post by Way2caller
1. I guess you can not email me the TSPI_lineGetID source code ?
No, according to the license agreement this is not allowed. I am not
even allowed to make personal copies (just browsing online).
Post by Way2caller
2. I hope I am not pushing it too far, but could you just
check
what
you
get
in return to calling lineGetID with "wave/Out" (with the MSP) ?
Our TSP does not offer any wave devices and thus device classes with
wave/... are not supported.
Post by Way2caller
3. Tried to figure out that, but with no success.
My TSP does return 0, and it does not touch the dwTotalSize field.
I don't have any more ideas, as I can't see your source code.
Looking at your display name I wonder: Don't you already have a working
TSP that supports wave devices...?
Best regards,
Matthias Moetje
-------------------------------------
TERASENS GmbH
Augustenstraße 24
80333 Munich, GERMANY
-------------------------------------
Fon: +49 89 143370-0
Fax: +49 89 143370-22
e-mail: moetje at terasens dot com
www: www.terasens.com
-------------------------------------
Post by Way2caller
Thanks again for sticking with me on this.
Post by Matthias Moetje [MVP]
Shimon,
Post by Way2caller
Question is where the problem lies...
Do you have the UNIMODEM source code ?
Yes, I have access to the source code under the MVPSLA.
Post by Way2caller
Do you know if for UNIMODEM the buffer size is enlarged,
too ?
I don't know. Unfortunately I have no time to debug this at
the moment. Both of our TSPs come with an MSP and don't
offer any wave devices, so I don't have practical experience
with lineGetID on the TSPI side.
Post by Way2caller
It seems TAPI always increases the buffer size - no matter
what
size
I originally send via TB20 - TAPI always adds 0x100 to it.
(and when the buffer gets back to the app - it is reduced
again
by
0x100...)
Maybe this is just a security measure of tapisrv to avoid memory
being overwritten or to be compatible with previous TSPI
versions...
I wouldn't concentrate on the increased size but rather on the
reason
why TAPI returns an error.
Do you return 0 (zero) for this function?
Does your TSP write to the dwTotalSite member?
Best regards,
Matthias Moetje
-------------------------------------
TERASENS GmbH
Augustenstraße 24
80333 Munich, GERMANY
-------------------------------------
Fon: +49 89 143370-0
Fax: +49 89 143370-22
e-mail: moetje at terasens dot com
www: www.terasens.com
-------------------------------------
Way2caller
2007-07-05 20:14:01 UTC
Permalink
Hi,

Sure - done.

Shimon
Post by Matthias Moetje [MVP]
Shimon,
Post by Way2caller
Seems to be working ok.
The dialer.exe sends a buffer sized over 0x200, so it's ok.
Regarding Win2K - will have to check. Tested on XP & Vista.
You're welcome! Could you send me a copy when it's packaged?
We are performing some new compatibility tests shortly and the
current TSP does not work here.
Best regards,
Matthias Moetje
-------------------------------------
TERASENS GmbH
Augustenstraße 24
80333 Munich, GERMANY
-------------------------------------
Fon: +49 89 143370-0
Fax: +49 89 143370-22
e-mail: moetje at terasens dot com
www: www.terasens.com
-------------------------------------
Post by Way2caller
Post by Matthias Moetje [MVP]
Hi,
Post by Way2caller
Wierd indeed. But seems to work...
Tested with several apps. Not sure I understand what you mean by "Phone
dialer with audio", but tested several apps.
Start >> Run >> Dialer.exe
Edit >> Options: Select your line for phone calls; second tab: Select your
audio device (e.g. sound card mic and speakers)
Create phone call.
See if you hear audio.
Post by Way2caller
Also - using my own test app, tried puting various values in dwTotalSize,
and it seems to work ok - the TAPI service seems to take care of the
dwNeededSize checks...
But - since I suspect all this may be a result of some windows xp update -
it may not work properly on old XP computers who did not update.
Does it work on W2k?
Best regards,
Matthias Moetje
-------------------------------------
TERASENS GmbH
Augustenstraße 24
80333 Munich, GERMANY
-------------------------------------
Fon: +49 89 143370-0
Fax: +49 89 143370-22
e-mail: moetje at terasens dot com
www: www.terasens.com
-------------------------------------
Post by Way2caller
Post by Matthias Moetje [MVP]
Hi Shimon,
that seems really weird...
I don't think that this is the correct solution. Are you sure that this
doesn't
break applications? What if an application is not coded to take care
of
the
dwNeededSize?
What I think is correct is NOT to return LINEERR_STRUCTURETOOSMALL,
Unimodem doesn't do this either.
Does this work with the Wave MSP (to test this simply start Windows Phone
Dialer
and see if you can make calls with audio)?
Best regards,
Matthias Moetje
-------------------------------------
TERASENS GmbH
Augustenstraße 24
80333 Munich, GERMANY
-------------------------------------
Fon: +49 89 143370-0
Fax: +49 89 143370-22
e-mail: moetje at terasens dot com
www: www.terasens.com
-------------------------------------
Post by Way2caller
Hi Matthias,
This code seems to work.
I am not totally happy with this, cause I dont like
going with "hunch" solutions - not knowing why
a solution works...
============================================
if (lpDeviceID->dwTotalSize <
sizeof(VARSTRING)+sizeof(DWORD)+0x00000100+100)
{
lpDeviceID->dwNeededSize =
sizeof(VARSTRING)+sizeof(DWORD)+0x00000100+100;
return 0;
}
lpDeviceID->dwNeededSize = sizeof(VARSTRING) +
sizeof(DWORD)+0x00000100+100;
if (lpDeviceID->dwTotalSize >= sizeof(VARSTRING) + sizeof(DWORD))
{
lpDeviceID->dwStringFormat = STRINGFORMAT_BINARY;
lpDeviceID->dwNeededSize = sizeof(VARSTRING)+sizeof(DWORD);
lpDeviceID->dwUsedSize = sizeof(VARSTRING)+sizeof(DWORD);
lpDeviceID->dwStringOffset = sizeof(VARSTRING);
lpDeviceID->dwStringSize = sizeof(DWORD);
*(DWORD *)((BYTE *)lpDeviceID + sizeof(VARSTRING)) = dwID;
return 0;
}
return 0;
============================================
Post by Matthias Moetje [MVP]
Shimon,
maybe this is the same problem I was just facing a few weeks ago,
when I wanted to perform some tests with your device/TSP.
I couldn't get it working but didn't have enough time to look into
it more thoroughly...
How do you enumerate the wave devices?
It uses LoadLibrary to load winmm.dll dynamically.
Then it calls GetProcAddress to get pointer to the functions
waveInGetDevCapsW
waveInGetNumDevs
(or the corresponding out functions)
If first calls n=waveInGetNumDevs() and then loops from 0 to n-1
calling waveInGetDevCaps and compares the wave device names
to find the correct one.
If you say that this is different from what you receive in the
application's
context, in which way is this different. Can you show both lists for
comparison?
One problem I know which often interferes with TSPs' audio devices
is the RDP audio mapper which replaces all wave devices once a
remote desktop session is started (with enabled audio mapping). Though,
we have experienced this behaviour with Windows Server 2003, usually.
Best regards,
Matthias Moetje
-------------------------------------
TERASENS GmbH
Augustenstraße 24
80333 Munich, GERMANY
-------------------------------------
Fon: +49 89 143370-0
Fax: +49 89 143370-22
e-mail: moetje at terasens dot com
www: www.terasens.com
-------------------------------------
Post by Way2caller
Hi,
Thanks for your support.
Yes - we do have a TSP that supports wave devices.
It even works great with Vista.
It USED to work great on XP, too, but now all of a sadden it stopped
working.
I can only guess some XP update changed something in the way TAPI
works...
Anyway - I just found something interesting - the enumeration of wave
devices yields a different order when it is done in the TSP
space,
or
in
the
APP space.
I guess this is part of what's going wrong.
Post by Matthias Moetje [MVP]
Shimon,
Post by Way2caller
1. I guess you can not email me the TSPI_lineGetID source code
?
No, according to the license agreement this is not allowed. I am
not
even allowed to make personal copies (just browsing online).
Post by Way2caller
2. I hope I am not pushing it too far, but could you just
check
what
you
get
in return to calling lineGetID with "wave/Out" (with the MSP) ?
Our TSP does not offer any wave devices and thus device classes
with
wave/... are not supported.
Post by Way2caller
3. Tried to figure out that, but with no success.
My TSP does return 0, and it does not touch the dwTotalSize
field.
I don't have any more ideas, as I can't see your source code.
Looking at your display name I wonder: Don't you already have a
working
TSP that supports wave devices...?
Best regards,
Matthias Moetje
-------------------------------------
TERASENS GmbH
Augustenstraße 24
80333 Munich, GERMANY
-------------------------------------
Fon: +49 89 143370-0
Fax: +49 89 143370-22
e-mail: moetje at terasens dot com
www: www.terasens.com
-------------------------------------
Post by Way2caller
Thanks again for sticking with me on this.
Post by Matthias Moetje [MVP]
Shimon,
Post by Way2caller
Question is where the problem lies...
Do you have the UNIMODEM source code ?
Yes, I have access to the source code under the MVPSLA.
Post by Way2caller
Do you know if for UNIMODEM the buffer size is enlarged,
Matthias Moetje [MVP]
2007-07-06 14:01:26 UTC
Permalink
Got it, thanks!


Best regards,

Matthias Moetje
-------------------------------------
TERASENS GmbH
Augustenstraße 24
80333 Munich, GERMANY
-------------------------------------
Fon: +49 89 143370-0
Fax: +49 89 143370-22
e-mail: moetje at terasens dot com
www: www.terasens.com
-------------------------------------
Post by Way2caller
Hi,
Sure - done.
Shimon
Post by Matthias Moetje [MVP]
Shimon,
Post by Way2caller
Seems to be working ok.
The dialer.exe sends a buffer sized over 0x200, so it's ok.
Regarding Win2K - will have to check. Tested on XP & Vista.
You're welcome! Could you send me a copy when it's packaged?
We are performing some new compatibility tests shortly and the
current TSP does not work here.
Best regards,
Matthias Moetje
-------------------------------------
TERASENS GmbH
Augustenstraße 24
80333 Munich, GERMANY
-------------------------------------
Fon: +49 89 143370-0
Fax: +49 89 143370-22
e-mail: moetje at terasens dot com
www: www.terasens.com
-------------------------------------
Post by Way2caller
Post by Matthias Moetje [MVP]
Hi,
Post by Way2caller
Wierd indeed. But seems to work...
Tested with several apps. Not sure I understand what you mean by "Phone
dialer with audio", but tested several apps.
Start >> Run >> Dialer.exe
Edit >> Options: Select your line for phone calls; second tab: Select your
audio device (e.g. sound card mic and speakers)
Create phone call.
See if you hear audio.
Post by Way2caller
Also - using my own test app, tried puting various values in dwTotalSize,
and it seems to work ok - the TAPI service seems to take care of the
dwNeededSize checks...
But - since I suspect all this may be a result of some windows xp update -
it may not work properly on old XP computers who did not update.
Does it work on W2k?
Best regards,
Matthias Moetje
-------------------------------------
TERASENS GmbH
Augustenstraße 24
80333 Munich, GERMANY
-------------------------------------
Fon: +49 89 143370-0
Fax: +49 89 143370-22
e-mail: moetje at terasens dot com
www: www.terasens.com
-------------------------------------
Post by Way2caller
Post by Matthias Moetje [MVP]
Hi Shimon,
that seems really weird...
I don't think that this is the correct solution. Are you sure that this
doesn't
break applications? What if an application is not coded to take care
of
the
dwNeededSize?
What I think is correct is NOT to return LINEERR_STRUCTURETOOSMALL,
Unimodem doesn't do this either.
Does this work with the Wave MSP (to test this simply start Windows Phone
Dialer
and see if you can make calls with audio)?
Best regards,
Matthias Moetje
-------------------------------------
TERASENS GmbH
Augustenstraße 24
80333 Munich, GERMANY
-------------------------------------
Fon: +49 89 143370-0
Fax: +49 89 143370-22
e-mail: moetje at terasens dot com
www: www.terasens.com
-------------------------------------
Post by Way2caller
Hi Matthias,
This code seems to work.
I am not totally happy with this, cause I dont like
going with "hunch" solutions - not knowing why
a solution works...
============================================
if (lpDeviceID->dwTotalSize <
sizeof(VARSTRING)+sizeof(DWORD)+0x00000100+100)
{
lpDeviceID->dwNeededSize =
sizeof(VARSTRING)+sizeof(DWORD)+0x00000100+100;
return 0;
}
lpDeviceID->dwNeededSize = sizeof(VARSTRING) +
sizeof(DWORD)+0x00000100+100;
if (lpDeviceID->dwTotalSize >= sizeof(VARSTRING) + sizeof(DWORD))
{
lpDeviceID->dwStringFormat = STRINGFORMAT_BINARY;
lpDeviceID->dwNeededSize = sizeof(VARSTRING)+sizeof(DWORD);
lpDeviceID->dwUsedSize = sizeof(VARSTRING)+sizeof(DWORD);
lpDeviceID->dwStringOffset = sizeof(VARSTRING);
lpDeviceID->dwStringSize = sizeof(DWORD);
*(DWORD *)((BYTE *)lpDeviceID + sizeof(VARSTRING)) = dwID;
return 0;
}
return 0;
============================================
Post by Matthias Moetje [MVP]
Shimon,
maybe this is the same problem I was just facing a few weeks ago,
when I wanted to perform some tests with your device/TSP.
I couldn't get it working but didn't have enough time to look into
it more thoroughly...
How do you enumerate the wave devices?
It uses LoadLibrary to load winmm.dll dynamically.
Then it calls GetProcAddress to get pointer to the functions
waveInGetDevCapsW
waveInGetNumDevs
(or the corresponding out functions)
If first calls n=waveInGetNumDevs() and then loops from 0 to n-1
calling waveInGetDevCaps and compares the wave device names
to find the correct one.
If you say that this is different from what you receive in the
application's
context, in which way is this different. Can you show both lists for
comparison?
One problem I know which often interferes with TSPs' audio devices
is the RDP audio mapper which replaces all wave devices once a
remote desktop session is started (with enabled audio mapping). Though,
we have experienced this behaviour with Windows Server 2003, usually.
Best regards,
Matthias Moetje
-------------------------------------
TERASENS GmbH
Augustenstraße 24
80333 Munich, GERMANY
-------------------------------------
Fon: +49 89 143370-0
Fax: +49 89 143370-22
e-mail: moetje at terasens dot com
www: www.terasens.com
-------------------------------------
Post by Way2caller
Hi,
Thanks for your support.
Yes - we do have a TSP that supports wave devices.
It even works great with Vista.
It USED to work great on XP, too, but now all of a sadden it
stopped
working.
I can only guess some XP update changed something in the way TAPI
works...
Anyway - I just found something interesting - the enumeration
of
wave
devices yields a different order when it is done in the TSP
space,
or
in
the
APP space.
I guess this is part of what's going wrong.
Post by Matthias Moetje [MVP]
Shimon,
Post by Way2caller
1. I guess you can not email me the TSPI_lineGetID source
code
?
No, according to the license agreement this is not allowed. I am
not
even allowed to make personal copies (just browsing online).
Post by Way2caller
2. I hope I am not pushing it too far, but could you just
check
what
you
get
in return to calling lineGetID with "wave/Out" (with the
MSP)
?
Our TSP does not offer any wave devices and thus device classes
with
wave/... are not supported.
Post by Way2caller
3. Tried to figure out that, but with no success.
My TSP does return 0, and it does not touch the dwTotalSize
field.
I don't have any more ideas, as I can't see your source code.
Looking at your display name I wonder: Don't you already have a
working
TSP that supports wave devices...?
Best regards,
Matthias Moetje
-------------------------------------
TERASENS GmbH
Augustenstraße 24
80333 Munich, GERMANY
-------------------------------------
Fon: +49 89 143370-0
Fax: +49 89 143370-22
e-mail: moetje at terasens dot com
www: www.terasens.com
-------------------------------------
Post by Way2caller
Thanks again for sticking with me on this.
Post by Matthias Moetje [MVP]
Shimon,
Post by Way2caller
Question is where the problem lies...
Do you have the UNIMODEM source code ?
Yes, I have access to the source code under the MVPSLA.
Post by Way2caller
Do you know if for UNIMODEM the buffer size is enlarged,
m***@gmail.com
2014-05-13 05:54:36 UTC
Permalink
Post by Way2caller
Hi all,
My TSP tries to support both "wave" & "wave/out" classes for lineGetID.
It reports them in lineGetDevCaps & lineGetAddressCaps.
When an application (e.g. TAPI browser 2.0) calls lineGetID with the class
set to "wave" - all works ok.
When the app calls lineGetID with the class set to "wave/out" - it fails
returning LINEERR_OPERATIONFAILED.
This happens AFTER the call gets into my TSP, and I validated my TSP returns
the same content in the VARSTRING buffer for the two classes.
One thing I noticed is for some reason the MS TAPI layer resizes the
VARSTRING buffer (only for classes "wave/out" & "wave/in") ad adds 0x100
bytes to it.
Could that be related ?
Is there anything else the TSP should return in the VARSTRING buffer for
"wave/out" ?
Thanks in advance
Loading...