Discussion:
TAPI disconnection problems
(too old to reply)
Craig
2004-07-07 03:56:22 UTC
Permalink
Hi, I'm using TAPI 3.x.

I've got an application that listens to a phone line and when a call comes
in I register the call notification (pop up a window saying new call) and
when the info state changes I get the Caller ID information and place that
in the form...i.e. 555-2425 is calling.

When I register the call notifications I set monitor to false and owner to
true. I tried monitor true and owner false but the events didn't fire at
all.

Now the trouble is I don't want to answer this call via the modem. I pick
up the phone and answer it that way.

Problems that are occuring...

1. After the initial call any new calls that occur do not fire the call
notification event (probably something wrong with my releasing).
2. Sometimes the line is dead for a while until the modem sorts itself out
(I suppose).
3. When I don't answer a call it takes a while for the call state event to
fire to say call disconnected (about 10 seconds).

So my basic question is how do I handle the releasing of call in TAPI so
that its ready to access a new call? Do I have to Shutdown TAPI and then
restart it up again reconnecting the notifications? At the moment all I do
is call ReleaseUserUserInfo() on the call.

Thanks,

Craig
Andreas Marschall [MVP TAPI]
2004-07-07 07:35:20 UTC
Permalink
Craig, please see inline comments.
Post by Craig
Hi, I'm using TAPI 3.x.
I've got an application that listens to a phone line and when a call comes
in I register the call notification (pop up a window saying new call) and
when the info state changes I get the Caller ID information and place that
in the form...i.e. 555-2425 is calling.
When I register the call notifications I set monitor to false and owner to
true. I tried monitor true and owner false but the events didn't fire at
all.
You are using a modem, aren't you?
This is a well known feature of UniModem.TSP: if the line is only opened with
monitor privilege then the COM port to the modem is not opened - therefore no
events.

You may want to try to open the line with monitor and owner privs.
Post by Craig
Now the trouble is I don't want to answer this call via the modem. I pick
up the phone and answer it that way.
Problems that are occuring...
1. After the initial call any new calls that occur do not fire the call
notification event (probably something wrong with my releasing).
Yes, most likely not all resources regarding the old call are released
correctly (s.b.).
Post by Craig
2. Sometimes the line is dead for a while until the modem sorts itself out
(I suppose).
What do you mean exactly by "the line is dead" ?
Post by Craig
3. When I don't answer a call it takes a while for the call state event to
fire to say call disconnected (about 10 seconds).
I could repro this with my internal voice modems on XP/SP1 and W2kS/SP4.
Seems to be some time out.
It was 12 seconds on both of my test systems.
TB20.log:
9:28.28.768 : received LINE_CALLSTATE
device=x103aa
cbInst=x0
param1=x2, OFFERING
param2=x0,
param3=x0,
9:28.40.775 : received LINE_CALLSTATE
device=x103aa
cbInst=x0
param1=x1, IDLE
param2=x0,
param3=x0,
Post by Craig
So my basic question is how do I handle the releasing of call in TAPI so
that its ready to access a new call? Do I have to Shutdown TAPI and then
restart it up again reconnecting the notifications? At the moment all I do
is call ReleaseUserUserInfo() on the call.
No need to shutdown TAPI and restart.
Just release all(!) resources regarding the old call.
ITCallInfo::ReleaseUserUserInfo() isn't required for this unless there is
actually UUI present (which isn't in most cases).
You need e.g. release the ITCallInfo object instead (and ITBasicCallControl
etc.).
--
Best Regards
Andreas Marschall
Microsoft MVP for TAPI / Windows SDK
TAPI / TSP Developer and Tester
http://www.I-B-A-M.de/Andreas_Marschall's_TAPI_and_TSPI_FAQ.htm
* Please post all messages and replies to the newsgroup so all may
* benefit from the discussion. Private mail is usually not replied to.
* This posting is provided "AS IS" with no warranties, and confers no rights.
Craig
2004-07-08 03:20:03 UTC
Permalink
Cheers Andreas,

Releasing all the objects worked. The trouble I was having was that I
interfaced to TAPI through C# so I forgot that you need to do a
Marshal.ReleaseComObject(...) to release the object in the COM. C# does
these things automatically.

I also realised that it was the Event objects that I was not releasing so I
placed a finally clause after my event capture to remove the event objects.

All works fantastically well now :)

I have a few other questions and issues but I'll raise these on a new
thread.

Thanks,

Craig
Post by Andreas Marschall [MVP TAPI]
Craig, please see inline comments.
Post by Craig
Hi, I'm using TAPI 3.x.
I've got an application that listens to a phone line and when a call comes
in I register the call notification (pop up a window saying new call) and
when the info state changes I get the Caller ID information and place that
in the form...i.e. 555-2425 is calling.
When I register the call notifications I set monitor to false and owner to
true. I tried monitor true and owner false but the events didn't fire at
all.
You are using a modem, aren't you?
This is a well known feature of UniModem.TSP: if the line is only opened with
monitor privilege then the COM port to the modem is not opened - therefore no
events.
You may want to try to open the line with monitor and owner privs.
Post by Craig
Now the trouble is I don't want to answer this call via the modem. I pick
up the phone and answer it that way.
Problems that are occuring...
1. After the initial call any new calls that occur do not fire the call
notification event (probably something wrong with my releasing).
Yes, most likely not all resources regarding the old call are released
correctly (s.b.).
Post by Craig
2. Sometimes the line is dead for a while until the modem sorts itself out
(I suppose).
What do you mean exactly by "the line is dead" ?
Post by Craig
3. When I don't answer a call it takes a while for the call state event to
fire to say call disconnected (about 10 seconds).
I could repro this with my internal voice modems on XP/SP1 and W2kS/SP4.
Seems to be some time out.
It was 12 seconds on both of my test systems.
9:28.28.768 : received LINE_CALLSTATE
device=x103aa
cbInst=x0
param1=x2, OFFERING
param2=x0,
param3=x0,
9:28.40.775 : received LINE_CALLSTATE
device=x103aa
cbInst=x0
param1=x1, IDLE
param2=x0,
param3=x0,
Post by Craig
So my basic question is how do I handle the releasing of call in TAPI so
that its ready to access a new call? Do I have to Shutdown TAPI and then
restart it up again reconnecting the notifications? At the moment all I do
is call ReleaseUserUserInfo() on the call.
No need to shutdown TAPI and restart.
Just release all(!) resources regarding the old call.
ITCallInfo::ReleaseUserUserInfo() isn't required for this unless there is
actually UUI present (which isn't in most cases).
You need e.g. release the ITCallInfo object instead (and
ITBasicCallControl
Post by Andreas Marschall [MVP TAPI]
etc.).
--
Best Regards
Andreas Marschall
Microsoft MVP for TAPI / Windows SDK
TAPI / TSP Developer and Tester
http://www.I-B-A-M.de/Andreas_Marschall's_TAPI_and_TSPI_FAQ.htm
* Please post all messages and replies to the newsgroup so all may
* benefit from the discussion. Private mail is usually not replied to.
* This posting is provided "AS IS" with no warranties, and confers no rights.
chirag
2014-02-07 12:36:48 UTC
Permalink
Craig wrote on 07/07/2004 23:20 ET
Post by Craig
Cheers Andreas
Releasing all the objects worked. The trouble I was having was that
interfaced to TAPI through C# so I forgot that you need to do
Marshal.ReleaseComObject(...) to release the object in the COM. C# doe
these things automatically
I also realised that it was the Event objects that I was not releasing so
placed a finally clause after my event capture to remove the event objects
I have a few other questions and issues but I'll raise these on a ne
thread
Thanks
Crai
"Andreas Marschall [MVP TAPI]
wrote i
message news:e%23iYoU
Post by Andreas Marschall [MVP TAPI]
Craig, please see inline comments
"Craig" schrieb im Newsbeitra
news:%23C
Post by Craig
Hi, I'm using TAPI 3.x
I've got an application that listens to a phone line and when a cal
come
Post by Andreas Marschall [MVP TAPI]
Post by Craig
in I register the call notification (pop up a window saying new call
an
Post by Andreas Marschall [MVP TAPI]
Post by Craig
when the info state changes I get the Caller ID information and plac
tha
Post by Andreas Marschall [MVP TAPI]
Post by Craig
in the form...i.e. 555-2425 is calling
When I register the call notifications I set monitor to false and owne
t
Post by Andreas Marschall [MVP TAPI]
Post by Craig
true. I tried monitor true and owner false but the events didn't fir
a
Post by Andreas Marschall [MVP TAPI]
Post by Craig
all
You are using a modem, aren't you
This is a well known feature of UniModem.TSP: if the line is only opene
wit
Post by Andreas Marschall [MVP TAPI]
monitor privilege then the COM port to the modem is not opened - therefor
n
Post by Andreas Marschall [MVP TAPI]
events
You may want to try to open the line with monitor and owner privs
Post by Craig
Now the trouble is I don't want to answer this call via the modem.
pic
Post by Andreas Marschall [MVP TAPI]
Post by Craig
up the phone and answer it that way
Problems that are occuring..
1. After the initial call any new calls that occur do not fire the cal
notification event (probably something wrong with my releasing)
Yes, most likely not all resources regarding the old call are release
correctly (s.b.)
Post by Craig
2. Sometimes the line is dead for a while until the modem sorts itsel
ou
Post by Andreas Marschall [MVP TAPI]
Post by Craig
(I suppose)
What do you mean exactly by "the line is dead"
Post by Craig
3. When I don't answer a call it takes a while for the call state even
t
Post by Andreas Marschall [MVP TAPI]
Post by Craig
fire to say call disconnected (about 10 seconds)
I could repro this with my internal voice modems on XP/SP1 and W2kS/SP4
Seems to be some time out
It was 12 seconds on both of my test systems
TB20.log
9:28.28.768 : received LINE_CALLSTAT
device=x103a
cbInst=x
param1=x2, OFFERIN
param2=x0
param3=x0
9:28.40.775 : received LINE_CALLSTAT
device=x103a
cbInst=x
param1=x1, IDL
param2=x0
param3=x0
Post by Craig
So my basic question is how do I handle the releasing of call in TAPI s
that its ready to access a new call? Do I have to Shutdown TAPI an
the
Post by Andreas Marschall [MVP TAPI]
Post by Craig
restart it up again reconnecting the notifications? At the moment all
d
Post by Andreas Marschall [MVP TAPI]
Post by Craig
is call ReleaseUserUserInfo() on the call
No need to shutdown TAPI and restart
Just release all(!) resources regarding the old call
ITCallInfo::ReleaseUserUserInfo() isn't required for this unless there i
actually UUI present (which isn't in most cases)
You need e.g. release the ITCallInfo object instead (an
ITBasicCallContro
Post by Andreas Marschall [MVP TAPI]
etc.)
Best Regard
Andreas Marschal
Microsoft MVP for TAPI / Windows SD
TAPI / TSP Developer and Teste
http://www.I-B-A-M.de/Andreas_Marschall's_TAPI_and_TSPI_FAQ.ht
* Please post all messages and replies to the newsgroup so all ma
* benefit from the discussion. Private mail is usually not replied to
* This posting is provided "AS IS" with no warranties, and confer
n
rights
Hi

Could you please provide C# code for releasing the COM object (e.g
ITCallInfo)
Thanks in advance.
Andreas Marschall [exMVP TAPI]
2014-02-09 06:23:36 UTC
Permalink
Post by Craig
Releasing all the objects worked. The trouble I was having was that I
interfaced to TAPI through C# so I forgot that you need to do a
Marshal.ReleaseComObject(...) to release the object in the COM. C# does
these things automatically.
I also realised that it was the Event objects that I was not releasing so I
placed a finally clause after my event capture to remove the event objects.
Could you please provide C# code for releasing the COM object (e.g.
ITCallInfo)?
Hi,
I guess was referring to:
http://msdn.microsoft.com/EN-US/library/843807e2(d=hv.2,v=vs.110).aspx?cs-save-lang=1&cs-lang=csharp#code-snippet-1
--
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
* Please post all messages and replies to the group / forum 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.
Loading...