|
|
Make sure your device is connected to an active telephone
line. Select your TAPI telephony device from the "ComboBoxDevice"
list. Then check the active checkbox to activate your device.
You will see events fire in the "call progress" memo box window
and will see the etLine.DeviceActive property set to true. Enter a
phone number into the "enter a phone number" window and press
the "dial" button. You will see the call progress events
firing such as OnCallBegin, OnDialing and OnProceeding. These events will show
you where to put your code to program your own application that calls
methods, sets and views properties and responds to events.
While on your call, press the DTMF digits (phone
buttons) and watch the log report the event and tell you what button your
pressed. You can use the OnDigitReceived event to create an IVR
or any other application that requires user input.
You can click on the "hangup" button to end the
call and press the "clear log" button to clear the Call Progress
window and try again. There is a "Line Config" button that
will display the device configuration screen for the TSP (terminal service
provider) or driver for your device if it supports this function.
Place an incoming call and watch the log for the "OnOffering"
event showing you a new call is being offered to you. You should also see
the OnRing event to let you see that the phone is ringing and, if
you line supports it, you will see Caller ID information.
There is no button in this sample to answer an incoming call. Try
our etAutoAnswer sample program
for answering incoming calls or read below about TeleScope.
There is one more very important and useful button
on this sample program, the TeleScope button brings up
our extremely powerful diagnostic, prototyping and learning too. You
can see even more information about the progress of your call and try
things that aren't built into the sample such as answering an incoming call.
Just click on the answer button on the call tab in the etLine
window! We can't stress enough the power of using
TeleScope to see exactly where you are and how to get where you want to
go.
Lastly, their is our little info button to call up an
about box that will provide more information, a link to this web page for
help, and ways to contact us.
If you run into any errors, you can usually just
deactivate the device and reactivate it again to continue. If your
device is not listed in the device list, then the TAPI TSP for your device
is not properly installed. Make sure you have the latest drivers and
have installed them properly. If you have any trouble, just give us
a call or send us an email using the form above in the support menu or by
clicking here GET
SUPPORT.
|
|
|
The program uses the controls events and subroutines
listed below. You get your device list simply by using the etLine.Device.List
property and the etLine.Device.ID property. We automatically
find the installed TAPI devices for you and let you select and then
activate the device with the etLine.DeviceActive property.
When you enter a phone number into the phone number field,
we set the etLine.CallPhone.Number property to that value and then
dial that number for you when you press the dial button by executing the etLine.CallDial
method. Most of the other buttons operate just as simply with only
one line of code. The hangup button calls the etLine.CallHangup
method and the TeleScope button sets etLine.TelescopeVisible to
true. The Line Config button calls the etLine.DeviceConfig
function.
All of the logging is done with our many events and
properties and is also incredibly simple when you see the code. When
the number is dialed, the OnProceeding event is usually one of the first
events to fire, depending on the device, followed by the OnCallBegin
event. This lets you track the progress of the call. We just
write a line of text to the screen in each of these event handlers. If
your device supports it, the OnDialTone event will fire when it
detects a dial tone and then the OnDialing event will
display. As the phone is ringing, you will see the OnRingBack
event fire if the device supports it, then the OnCalledID event to
display the name and number of the called party if it is known and then
finally the OnConnected event when the called party answers.
If the line is busy, the OnBusy event will fire.
The process is reversed when you hangup the call.
The etLine.CallHangup method is called, or if the remote party
disconnects, you will see the OnDisconnected event fire. The
OnCallEnd event fires when the call has ended and then the OnIdle
event will fire to let you know the device is ready to make another call.
NOTE: This sample is designed to show you many of the
event handlers that are available to you. You would only need those
that are important to create your application. In a real program, your
code would be even simpler! For example, if you wanted to just
log all this information you would not need all the event handlers, you
would only need one!
Private Sub etLine1_OnLog(ByVal Line As String)
Text2.Text = Text2.Text & etLine1.CallHandle & vbCrLf & _
etLine1.StringLINECALLSTATE(etLine1.CallState) & vbCrLf & _
etLine1.StringLINECALLSTATEMODE(etLine1.CallState,
_
etLine1.CallStateMode)
& vbCrLf
End Sub
or...
Private Sub etLine1_OnCallState(ByVal CallHandle As Long, _
ByVal State As Long, _
ByVal StateMode As Long, _
ByVal Privilege As Long)
Text1.Text = Text1.Text & CallHandle & vbCrLf & _
etLine1.StringLINECALLSTATE(State) & vbCrLf & _
etLine1.StringLINECALLSTATEMODE(State, StateMode) & vbCrLf & _
Privilege
End Sub
Control
|
Description
|
|
CheckBoxActive |
Used to activate the TAPI Line device. |
|
ComboBoxDevice |
Used to select the TAPI line
device. |
|
ButtonTeleScope |
When clicked the TeleScope.Visible
property for the etLine control is set |
|
ButtonDial |
For dialing out bound calls. |
|
EditPhoneNumber |
Holds the phone number to be dialed. |
|
ButtonHangup |
For hanging up all calls. |
|
ButtonClear |
Clears the information in the Memo1
control |
|
ButtonDeviceConfig |
Display the TAPI TSP config dialog for
your hardware |
|
ButtonInfo |
Popup box for getting more information
from ExceleTel |
|
Text1 / Memo1 |
Displays the log information. |
|
etLine1 |
The TeleTools etLine control |
Event Handler Routine
|
Description
|
|
Form_Load /
FormCreate |
Event Handler Routine for: creation of the form. It fills the combo box
with available TAPI line devices and initializes the line device and the
combo box to the first device available..
|
|
Form_Unload
/ FormClose |
Event Handler Routine for: closing of the form.
The line device is closed by setting the etLine1.Device.Active property to
False. |
|
ComboBoxDeviceClick |
Process the device change |
|
CheckBoxActiveClick |
Event Handler Routine for: the CheckBoxActive.OnClick event for the
CheckBoxActive controls. The “Active” checkbox is used to turn the
selected line device on, when checked, or off, when not checked. If the
control is checked, then the line device is activated by setting the
property etLine1.Device.Active = TRUE; if not checked, then the line
device is deactivated by setting the property etLine1.Device.Active =
FALSE.
If there error LINEERR_INVALIDMEDIAMODE is returned when activating the
line device, the device is probably not 100% TAPI-compliant. The
etLine1.Device.MediaModesActive is set to LINEMEDIAMODE_DATAMODEM and
etLine1.Device.Active is once again set to TRUE. We assume that the device
is a modem that does not support the voice features, so we attempt to
activate the modem in data mode.
After successfully activating the line device, the ButtonDial control
is enabled.
|
|
ButtonDialClick |
Event Handler Routine for: the ButtonDial.OnClick event for the
ButtonDial button. The etLine1.Call.PhoneNumber property is set to the
value in the EditPhoneNumber control then the etLine1.Call.Dial method is
then called. If no errors occurred then the ButtonDial and ButtonDialtone
controls are disabled and the ButtonHangup control is enabled. |
|
ButtonClearClick |
Event Handler Routine for: the ButtonClear.OnClick event of the
ButtonClear control. The information in the Memo1 control (the on screen
log) is cleared. |
|
ButtonHangupClick |
Event Handler Routine for: the ButtonHangup.OnClick event for the
ButtonHangup control which executes the etLine1.Call.Hangup method |
|
ButtonTeleScopeClick |
Event Handler Routine for: the
ButtonTeleScope.OnCLick event of the ButtonTeleScope control. This button causes the TeleScope.Visibile
properties to be toggled for the etLine1control. This causes the TeleScope to be displayed or hidden. |
|
etLine1Busy |
Event Handler Routine for: etLine.OnBusy event of the etLine control.
When this occurs, the etLine1.Call.Hangup method is called. |
|
etLine1CallBegin |
Event Handler Routine for: etLine.OnCallBegin event of the etLine
control. This event is appended to the log edit box on-screen. |
|
etLine1CalledID |
Event Handler Routine for: etLine.OnCalledID event of the etLine
control. When the etLine.OnCalledID event fires the
etLine1.Call.CalledID.Name and etLine1.Call.CalledID.Number property
values are appended to the log.. This is the ID of the called party on an
outbound call. |
|
etLine1CallEnd |
Event Handler Routine for: etLine.OnCallEnd event of the etLine
control. This event is appended to the log edit box on-screen. |
|
etLine1CallerID |
Event Handler Routine for: etLine.OnCallerID event of the etLine
control. When the etLine1.OnCallerID event fires, the
etLine1.Call.CallerID.Name and etLine1.Call.CallerID.Number property
values are appended to the log. This displays the ID of the incoming
caller. |
|
etLine1Connected |
Event Handler Routine for: etLine.OnConnected event of the etLine
control. The etLine1.Call.Origin is checked to see if the call is inbound
or outbound. |
|
etLine1ConnectedID |
Event Handler Routine for: etLine.OnConnectedID event of the etLine
control. When the etLine.OnConnectedID event fires, the
etLine1.Call.ConnectedID.Name and etLine1.Call.ConnectedID.Number property
values are appended to the log. |
|
etLine1Dialing |
Event Handler Routine for: etLine.OnDialing event of the etLine
control. This event is appended to the log edit box on-screen. |
|
etLine1Dialtone |
Event Handler Routine for: etLine.OnDialtone event of the etLine
control. It simply indicates in the log that this event has fired and the
device reports dialtone.
|
|
etLine1Disconnected |
Event Handler Routine for: etLine.OnDisconnected event of the etLine
control. If ButtonDialtone had been clicked and this event occurs, then
the etLine1.Call.DisconnectMode property is tested to see if the dial tone
was detected. This may not work with some telephony devices because not
all Telephony Service Providers (TSP) and/or telephony devices are capable
of reporting a disconnect mode.
The etLine1.Call.Hangup method is called to hang up the call.
|
|
etLine1Error |
Event Handler Routine for: etLine.OnError event of the etLine control.
The log is updated to indicate that this event has fired. |
|
etLine1Idle |
Event Handler Routine for: etLine.OnIdle event of the etLine control.
The Dial button is enabled and the Hangup button is disabled |
|
etLine1Offering |
Event Handler Routine for: etLine.OnOffering event of the etLine
control. . |
|
etLine1Ring |
Event Handler Routine for: etLine.OnRing event of the etLine control.
The log edit box is updated with a message. |
|
etLine1RingBack |
Event Handler Routine for: etLine.OnRingBack event of the etLine
control. The log edit box is updated with a message. |
|
etLine1SpecialInfo |
Event Handler Routine for: etLine.OnSpecialInfo event of the etLine
control. This fires if during a call a SIT tone is detected. These
are the "special information tones" provided by the phone
company when you reach a disconnected number or get "all
circuits are busy". The log edit box is updated with a message. |
|
etLineRedirectingID |
Event Handler Routine for: etLine.OnRedirectingID event of the etLine
control. The etLine1.Call.RedirectingID.Name and
etLine1.Call.RedirectingID.Number property values are appended to the log. |
|
etLineRedirectionID |
Event Handler Routine for: etLine.OnRedirectionID event of the etLine
control. The etLine1.Call.RedirectionID.Name and
etLine1.Call.RedirectionID.Number property values are appended to the log. |
Subroutines
|
| WriteLog |
Function to write lines to the log window |
| Form_Resize
(VB Only) |
Function to keep form, buttons, and other
components dynamic during resizing |
|