handset drop

Oct 15, 2015 at 12:50 PM
Hello!
Is the're any way to simulate a phone's handset drop?
The call's drop() method can be called only if call state is not "Idle" (and "Offering").
Another words - if some of 2 users is drop the handset in conversation progress, than second user will hear a "short rings", and the is no way to make calls by ATAPI from that phone before 2-nd user's handset will be hanged too.
Coordinator
Oct 15, 2015 at 1:49 PM
Hi,

I'm not sure what you mean. The Drop method can be called at any time on most systems. If you are getting an error calling it, then it's coming from your hardware/driver, not TAPI. It's the correct way to "hang up" a call and is equivalent to hitting the hookswitch on a physical phone.

See: https://msdn.microsoft.com/en-us/library/ms735626(v=vs.85).aspx for more information - in particular, the statement:

"The call state of hCall can be any state except idle."
Oct 15, 2015 at 2:42 PM
i mean 2 situations:
1. If i call Drop method while conversation in progress than - it is ok - call go Idle and i can make a new calls with a line's MakeCall method, and i don't need to hit the hookswitch physically.
2. Another situation - when other user hit the hookswitch on a physical phone (while in conversation, before i call Drop method) - call go idle too, but now i can't use Drop method, and i can't make new calls before hit the hookswitch physically.

so the question is - how can i make new calls without hitting the switch in case 2.?
Sorry for bad english, hope you understand me)
Coordinator
Oct 15, 2015 at 2:43 PM
If the call is already Idle, then you can just call Dispose on it to get rid of the call handle.
Oct 15, 2015 at 3:09 PM
tried this, but nothing happens...
Coordinator
Oct 15, 2015 at 6:23 PM
Are you using ITAPI3 or ATAPI?

ITAPI3 has a Disconnect method, not a Drop method..

I was assuming you are using ATAPI and just in the wrong project here; Dispose() will deallocate the call, which should signal that there are no calls present on the line. If you are still unable to make a call after that, then it's likely a bug in the TSP driver. In fact, if you look at the ATAPI source, you will see that the minute the call goes Idle it closes the call handle, so it's quite pre-emptive.

ITAPI3 is different -- It's COM based so you need to physically release the COM objects to get rid of the calls. This is done in the finalizer for TCall, so if you want to force it to go away, you will need to get rid of live references and force a GC to make sure the COM wrapper is released by .NET (and therefore allows another call object to be created).