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

Query on anfy function call failure

3 views
Skip to first unread message

Mohit

unread,
Dec 22, 2009, 4:44:01 AM12/22/09
to
Hi friends,

I have a query regarding to failure condition of any function call.

For an example, suppose a TSP is installed in the PC and the intitialization
process of the TSP is completed.

After initialization of TSP, the TAPI knows the number of line and phone
devices supported by the TSP.

Now, TSP detectes a new line device added int eh hardware it supports and
sends LINE_CREATE message to LINEEVENT callback function.

TAPISRV calls TSPI_providerCreateLineDevice() to add the new line device and
assign it a permenet device ID.

Some how, the returns value is found an error code for this functionc all
and TAPI ignores the event.

Now, what my question is, what should be the behavior of TSP in this case?

If I ask specifically for this case, does TSP should again send LINE_CREATE
message to the LINEEVENT callback function or it should terminate the event
and should free the parameter values, for e.g., temporary device ID assigned
to the detected line?

Or the TAPI application will take care of it and recall the
TSPI_providerCreateLineDevice() again with the same parameters to add the
line?

Thanks,
Mohit


Andreas Marschall [exMVP TAPI]

unread,
Dec 22, 2009, 10:01:32 AM12/22/09
to
"Mohit" <Mo...@discussions.microsoft.com> schrieb im Newsbeitrag
news:BC254D52-3DE7-46FC...@microsoft.com...

> Now, TSP detectes a new line device added int eh hardware it supports and
> sends LINE_CREATE message to LINEEVENT callback function.
>
> TAPISRV calls TSPI_providerCreateLineDevice() to add the new line device
> and
> assign it a permenet device ID.
>
> Some how, the returns value is found an error code for this functionc all
> and TAPI ignores the event.

Mohit,
why in this scenario is the TSP returning an error code on
TSPI_providerCreateLineDevice() to TAPISRV ?

> Now, what my question is, what should be the behavior of TSP in this case?
>
> If I ask specifically for this case, does TSP should again send
> LINE_CREATE
> message to the LINEEVENT callback function or it should terminate the
> event
> and should free the parameter values, for e.g., temporary device ID
> assigned
> to the detected line?

MSDN says on TSPI_providerCreateLineDevice() :
If the service provider recognizes the dwTempID and succeeds in setting up
the structures and such that it needs to support the new device, it saves
off the dwDeviceID, and returns SUCCESS. If this function is unsuccessful,
TAPI doesn't add the device, and there are no negative effects (the
LINE_CREATE message is ignored). If this function completes successfully,
TAPI then informs applications of the availability of the new device using
LINE_CREATE or LINE_LINEDEVSTATE (LINEDEVSTATE_REINIT) messages.


> Or the TAPI application will take care of it and recall the
> TSPI_providerCreateLineDevice() again with the same parameters to add the
> line?

A TAPI application *never* calls any TSPI_ functions.

--
Best Regards
Andreas Marschall
Microsoft MVP for TAPI / Windows SDK / Visual C++ 2003-2008
TAPI / TSP Developer and Tester
My TAPI and TSPI FAQ:
http://www.I-B-A-M.de/Andreas_Marschall's_TAPI_and_TSPI_FAQ.htm
My Toto� Tools (a collection of free, mostly TAPI related tools):
http://www.i-b-a-m.de/Andreas_Marschall's_Toto_Tools.htm
TAPI development around the world (Frappr! map):
http://www.frappr.com/TAPIaroundTheWorld
* Please post all messages and replies to the newsgroup so all may
* benefit from the discussion. Private mail is usually not replied to.
* This posting is provided "AS IS" with no warranties, and confers no
rights.

Mohit

unread,
Dec 22, 2009, 11:27:01 PM12/22/09
to
Thanks Andreas for your reply,

"Andreas Marschall [exMVP TAPI]" wrote:

> "Mohit" <Mo...@discussions.microsoft.com> schrieb im Newsbeitrag
> news:BC254D52-3DE7-46FC...@microsoft.com...
> > Now, TSP detectes a new line device added int eh hardware it supports and
> > sends LINE_CREATE message to LINEEVENT callback function.
> >
> > TAPISRV calls TSPI_providerCreateLineDevice() to add the new line device
> > and
> > assign it a permenet device ID.
> >
> > Some how, the returns value is found an error code for this functionc all
> > and TAPI ignores the event.
>
> Mohit,
> why in this scenario is the TSP returning an error code on
> TSPI_providerCreateLineDevice() to TAPISRV ?
>

TSP can return the error value LINEERR_BADDEVICEID when the DeviceID
assigend by the TAPI gets conflicts with the already assigned DeviceID of
another line, or it may also return error value LINEERR_NOMEM when encounters
with the memory related issues.

> > Now, what my question is, what should be the behavior of TSP in this case?
> >
> > If I ask specifically for this case, does TSP should again send
> > LINE_CREATE
> > message to the LINEEVENT callback function or it should terminate the
> > event
> > and should free the parameter values, for e.g., temporary device ID
> > assigned
> > to the detected line?
>
> MSDN says on TSPI_providerCreateLineDevice() :
> If the service provider recognizes the dwTempID and succeeds in setting up
> the structures and such that it needs to support the new device, it saves
> off the dwDeviceID, and returns SUCCESS.

>If this function is unsuccessful,
> TAPI doesn't add the device, and there are no negative effects (the
> LINE_CREATE message is ignored).

I want to know about this unsuccessful case. When the return value of
TSPI_providerCreateLineDevice() is an error code then does the TSP should
clear the temporary line device ID assigned to the newly detected line or it
should remain there as it is?
and also, what about the newly detected line device at the TSP side? does
the TSP again send LINE_CREATE message with new TempID for detected line
device or that line device gets ignored?

>If this function completes successfully,
> TAPI then informs applications of the availability of the new device using
> LINE_CREATE or LINE_LINEDEVSTATE (LINEDEVSTATE_REINIT) messages.
>
>
> > Or the TAPI application will take care of it and recall the
> > TSPI_providerCreateLineDevice() again with the same parameters to add the
> > line?
>
> A TAPI application *never* calls any TSPI_ functions.
>

Yes, actually, it was my mistake, what i was trying to say was does TAPI
appication can take care of such scenario and prompt TAPI to call the
TSPI_providerCreateLineDevice() again?

> --
> Best Regards
> Andreas Marschall
> Microsoft MVP for TAPI / Windows SDK / Visual C++ 2003-2008
> TAPI / TSP Developer and Tester
> My TAPI and TSPI FAQ:
> http://www.I-B-A-M.de/Andreas_Marschall's_TAPI_and_TSPI_FAQ.htm
> My Toto® Tools (a collection of free, mostly TAPI related tools):
> http://www.i-b-a-m.de/Andreas_Marschall's_Toto_Tools.htm
> TAPI development around the world (Frappr! map):
> http://www.frappr.com/TAPIaroundTheWorld
> * Please post all messages and replies to the newsgroup so all may
> * benefit from the discussion. Private mail is usually not replied to.
> * This posting is provided "AS IS" with no warranties, and confers no
> rights.
>
>
>

> .
>

Andreas Marschall [exMVP TAPI]

unread,
Dec 23, 2009, 5:09:06 AM12/23/09
to
"Mohit" <Mo...@discussions.microsoft.com> schrieb im Newsbeitrag
news:87C1EFEF-962A-4DAB...@microsoft.com...

> Thanks Andreas for your reply,

Mohit, you are welcome.

> TSP can return the error value LINEERR_BADDEVICEID when the DeviceID
> assigend by the TAPI gets conflicts with the already assigned DeviceID of
> another line, or it may also return error value LINEERR_NOMEM when
> encounters
> with the memory related issues.

In the 1st case this would be an issue in TAPISRV itself,
the latter case is an issue in the TSP or in system resources.
I guess they are all somewhat unlikely.
Did you actually encounter one of those?


>>If this function is unsuccessful,
>> TAPI doesn't add the device, and there are no negative effects (the
>> LINE_CREATE message is ignored).
>
> I want to know about this unsuccessful case. When the return value of
> TSPI_providerCreateLineDevice() is an error code then does the TSP should
> clear the temporary line device ID assigned to the newly detected line or
> it
> should remain there as it is?

TSP should clear the temporary line device ID because it stopped the
proocess of creating this new device.


> and also, what about the newly detected line device at the TSP side? does
> the TSP again send LINE_CREATE message with new TempID for detected line
> device or that line device gets ignored?

The old LINE_CREATE gets ignored after TSPI_providerCreateLineDevice().
So if the TSP still wants to create the new device it has to resend
LINE_CREATE and then return SUCCESS from he corresponding
TSPI_providerCreateLineDevice().


>> > Or the TAPI application will take care of it and recall the
>> > TSPI_providerCreateLineDevice() again with the same parameters to add
>> > the
>> > line?
>>
>> A TAPI application *never* calls any TSPI_ functions.
>>
>
> Yes, actually, it was my mistake, what i was trying to say was does TAPI
> appication can take care of such scenario and prompt TAPI to call the
> TSPI_providerCreateLineDevice() again?

Even this is impossible because no TAPI does know anything about the new
device yet.
TAPISRV only reports LINE_CREATE to TAPI apps if
TSPI_providerCreateLineDevice() has complete successfully.

Mohit

unread,
Dec 23, 2009, 6:13:01 AM12/23/09
to

"Andreas Marschall [exMVP TAPI]" wrote:

> "Mohit" <Mo...@discussions.microsoft.com> schrieb im Newsbeitrag
> news:87C1EFEF-962A-4DAB...@microsoft.com...
> > Thanks Andreas for your reply,
>
> Mohit, you are welcome.
>
> > TSP can return the error value LINEERR_BADDEVICEID when the DeviceID
> > assigend by the TAPI gets conflicts with the already assigned DeviceID of
> > another line, or it may also return error value LINEERR_NOMEM when
> > encounters
> > with the memory related issues.
>
> In the 1st case this would be an issue in TAPISRV itself,
> the latter case is an issue in the TSP or in system resources.
> I guess they are all somewhat unlikely.
> Did you actually encounter one of those?
>

No, I had not encountered with any, but I had asked it to confirm that do I
need to take care for such case in my TSP or not.


Thanks,
Mohit

Andreas Marschall [exMVP TAPI]

unread,
Dec 23, 2009, 6:55:35 AM12/23/09
to
"Mohit" <Mo...@discussions.microsoft.com> schrieb im Newsbeitrag
news:5275713F-B1F8-4B27...@microsoft.com...

>> > TSP can return the error value LINEERR_BADDEVICEID when the DeviceID
>> > assigend by the TAPI gets conflicts with the already assigned DeviceID
>> > of
>> > another line, or it may also return error value LINEERR_NOMEM when
>> > encounters
>> > with the memory related issues.
>>
>> In the 1st case this would be an issue in TAPISRV itself,
>> the latter case is an issue in the TSP or in system resources.
>> I guess they are all somewhat unlikely.
>> Did you actually encounter one of those?
>>
>
> No, I had not encountered with any, but I had asked it to confirm that do
> I
> need to take care for such case in my TSP or not.

Mohit,
if such severe issues (TAPISRV or TSP bug) occurs then I guess just trying
to re-create the new device won't fix it.
But logging such a issue may be helpful for error analysis.
It is generally recommended to add some kind of logging to a TSP, i.e.not
only DebugOutput but wrint to log file or System EVT.

0 new messages