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

TSP: adding and removing lines dynamically

11 views
Skip to first unread message

Klaus Darilion

unread,
Dec 9, 2009, 1:39:50 PM12/9/09
to
Hi!

I just read about adding (LINE_CREATE) and removing (not supported)
lines dynamically.

I wonder - is there a simpler approach to just re-initialize the TSP?
E.g. is it possible to send a message from the TSP to TAPI which causes
TAPI to reinitialize the TSP, i.e. calling TSPI_providerEnumDevices again?

thanks
Klaus

Andreas Marschall [exMVP TAPI]

unread,
Dec 9, 2009, 8:21:58 PM12/9/09
to
"Klaus Darilion" <klaus.mai...@pernau.at> schrieb im Newsbeitrag
news:u9wm87Pe...@TK2MSFTNGP04.phx.gbl...

> I just read about adding (LINE_CREATE) and removing (not supported) lines
> dynamically.

Klaus,
why do you think that removing lines dynamically is not supported?
Indeed it is: via LINE_REMOVE message.

> I wonder - is there a simpler approach to just re-initialize the TSP? E.g.
> is it possible to send a message from the TSP to TAPI which causes TAPI to
> reinitialize the TSP, i.e. calling TSPI_providerEnumDevices again?

It is only possible to re-init the *whole* TAPI system by sending
LINE_LINEDEVSTATE message with LINEDEVSTATE_REINIT.
But this isn't recommended for your scenario because with _REINIT *all* TAPI
apps need to lineShutdown() / phoneSutdown() all devices and *all* TSPs re
affected.
If only one TAPI app isn't smart enough to handle _REINIT than the whole
TAPI system is "deadlocked", i.e.e waiting on this one TAPI app to shutdown.
I'd regard such an an approch as quick and dirty.
A TAPI compliant solution is the usage of LINE_CREATE / LINE_REMOVE.

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

Klaus Darilion

unread,
Dec 10, 2009, 8:12:43 AM12/10/09
to

Andreas Marschall [exMVP TAPI] schrieb:

> "Klaus Darilion" <klaus.mai...@pernau.at> schrieb im Newsbeitrag
> news:u9wm87Pe...@TK2MSFTNGP04.phx.gbl...
>> I just read about adding (LINE_CREATE) and removing (not supported) lines
>> dynamically.
>
> Klaus,
> why do you think that removing lines dynamically is not supported?
> Indeed it is: via LINE_REMOVE message.

Hi Andreas!

I was confused by this paragraph (from
http://msdn.microsoft.com/en-us/library/ms725223%28VS.85%29.aspx )

...Devices cannot be removed dynamically. If a service provider wants to
remove a line from service, it can send a LINE_LINEDEVSTATE
(LINEDEVSTATE_OUTOFSERVICE) message. It would then refuse (for example,
by returning LINEERR_INVALLINESTATE) to perform any operation with the
device until it returns to service or the provider is shut down and
restarted (in which case the device could not be declared in
TSPI_providerEnumDevices, effectively removing it from the system)....

>> I wonder - is there a simpler approach to just re-initialize the TSP? E.g.
>> is it possible to send a message from the TSP to TAPI which causes TAPI to
>> reinitialize the TSP, i.e. calling TSPI_providerEnumDevices again?
>
> It is only possible to re-init the *whole* TAPI system by sending
> LINE_LINEDEVSTATE message with LINEDEVSTATE_REINIT.
> But this isn't recommended for your scenario because with _REINIT *all* TAPI
> apps need to lineShutdown() / phoneSutdown() all devices and *all* TSPs re
> affected.
> If only one TAPI app isn't smart enough to handle _REINIT than the whole
> TAPI system is "deadlocked", i.e.e waiting on this one TAPI app to shutdown.
> I'd regard such an an approch as quick and dirty.
> A TAPI compliant solution is the usage of LINE_CREATE / LINE_REMOVE.

Ok. Thanks

Klaus

Andreas Marschall [exMVP TAPI]

unread,
Dec 11, 2009, 4:14:33 AM12/11/09
to
"Klaus Darilion" <klaus.mai...@pernau.at> schrieb im Newsbeitrag
news:u06C0pZe...@TK2MSFTNGP02.phx.gbl...

> I was confused by this paragraph (from
> http://msdn.microsoft.com/en-us/library/ms725223%28VS.85%29.aspx )
>
> ...Devices cannot be removed dynamically. If a service provider wants to
> remove a line from service, it can send a LINE_LINEDEVSTATE
> (LINEDEVSTATE_OUTOFSERVICE) message. It would then refuse (for example, by
> returning LINEERR_INVALLINESTATE) to perform any operation with the device
> until it returns to service or the provider is shut down and restarted (in
> which case the device could not be declared in TSPI_providerEnumDevices,
> effectively removing it from the system)....

Klaus,
yes, I agree that this paragrapg is confusing - because it is wrong.
LINE_REMOVE is supported by TAPI.
I've just sent a comment about this with feedback link on the references web
page.

I've built a TSP that uses LINE_CREATE and LINE_REMOVE to dynamically add
and remove line devices.
So this concept definitely works.

> Ok. Thanks

You are welcome.

0 new messages