Call Soft ActiveX Control
Previous  Top  Next

If you are a software developer and wish to create an application that can interface with Call Soft then your in the right place.
We assume that you're working with Visual Basic. If you're not, you should have very little trouble translating this documentation.

Call Soft is not an ActiveX control by itself. Instead it's an automation server and this control simple acts as a liaison between your application and Call Soft. This, of course, provides you with the ease and flexibility of using an ActiveX control instead of having to manually load the control and it's impossible to get events to work in VB unless your dealing with an Active X control..

Installation:
The Call Soft ActiveX control, callsoftx.ocx, was installed when you installed Call Soft. You should check our developers page (www.toscingl.com/callsoft/developers.html) periodically for updates.  
Create a new VB standard EXE project. From the Project menu select Components. Click CallSoftX Library in the list and then OK. You should see a blue icon appear on your component pallet. Drag and drop the icon onto your form.  
 
Make sure you have the option "Allow Call Soft to be an Active X server" ON. You will find this option on the System tab in Call :Soft's setup.

This document includes:
·Properties  
·Methods  
·Events  



Properties

AnswerOnRing Property

Description
Set the ring to answer on.  
 
Remarks
To never answer set this value to 0. If you want to answer as soon as caller ID information is received set this value to 1. If an incoming call is found in the phone book Call Soft might change this value if a specific answer on ring is set in the phone book record. If Call Soft does modify this value it will happen just before notifying you via the OnCallerID event. So you might want to check this value then if you are looking for complete control.  
 
Access
Read-Write  
 
Data Type
Long  
 
 
CallInCount Property
Description
The number of call in the incoming call history.  
 
Remarks
Use this property before you use CallInGet so your not out of bounds  
 
Access
Read  
 
Data Type
Long  
 
Example
Dim Count As Long  
Count = CallSoft1.CallInCount  
Dim CallItem As InCallItem  
For Index = 0 To Count - 1 Step 1  
CallItem = CallSoft1.CallInGet(Index)
CallList.AddItem (CallItem.Name + " " + CallItem.Number)
Next  
 
 
CallOutCount Property

Description
The number of call in the list of calls to be dialed i.e. on the outgoing call tab.  
 
Remarks
Use this property before you use CallOutGet so your not out of bounds  
 
Access
Read  
 
Data Type
Long  
 
Example
Dim Count As Long  
Count = CallSoft1.CallOutCount  
Dim Calltem As OutCallItem  
For Index = 0 To Count - 1 Step 1  
CallItem = CallSoft1.CallOutGet(Index)
CallList.AddItem (CallItem.Name)
Next  
 
 
COMConnected Property

Description
Connects the control to Call Soft.  
 
Remarks
The control does not automatically connect to Call Soft, you need to do this manually. Set this value to true before you make any calls into the control. Set the value to false before your application closes.  
 
Access
Read-Write  
 
Data Type
Long  
 
 
ConnectedToModem Property

Description
Connects or disconnects the modem.  
 
Remarks
Read this value to determine if Call Soft is connected to the modem. To connect to the modem set this value to true. To disconnect from the modem set this value to false.  
 
Access
Read-Write  
 
Data Type
Long  
 
 
CallConnected Property

Description
Determine if a call is connected or not.  
 
Remarks
Read this value to determine if a call is connected. If true then it's safe to speak text or play wave files. The call becomes connected on the OnCallConnected event and stays that way until OnCallDisconnected.  
 
Access
Read  
 
Data Type
Long  
 
 
Enabled Property

Description
Enables the control.  
 
Remarks
This property currently does nothing.  
 
Access
Read-Write  
 
Data Type
Boolean  
 
 
GotCallerID Property

Description
Indicates if Call Soft has received caller id for the current call.  
 
Remarks
This value will become true after receiving caller ID or Call Soft will force the caller ID to be "Unknown" if by the second ring no caller ID has been received. This value will remain true until the call ends.  
Access
Read  
 
Data Type
Long  


Greeting Property

Description
Get or set the greeting.  
 
Remarks
You should set this value during or after the OnCallerID event. Call Soft will set this value during the caller ID event but before OnCallerID is posted to your application.  
 
Access
Read-Write  
 
Data Type
String  
 
 
Handle Property

Description
Get Call Soft main window handle.  
 
Remarks
You can use this handle for calls into the Windows API that require them, for example ShowWindow(CallSoft1.Handle,SW_HIDE)  
 
Access
Read  
 
Data Type
Long  
 

LastCallersName Property

Description
Indicates the name of the last caller.  
 
Remarks
 
Access
Read  
 
Data Type
String  
 

LastCallersNumber Property

Description
Indicates the number of the last caller.  
 
Remarks
 
Access
Read  
 
Data Type
String  
 

MailBoxCount Property

Description
Indicates the number of mailboxes.  
 
Remarks
 
Access
Read  
 
Data Type
Long  


Modem Property

Description
Get or set the modem to use.  
 
Remarks
Read modem to get the name of the modem Call Soft will use. Set this value prior to calling ConnectedToModem to use a specific modem. By default Call Soft will use the modem defined on the "General" tab in setup.  
 
Access
Read-Write  
 
Data Type
String  
 

ModemCount Property

Description
Returns the number of TAPI (modem) devices attached to the system.  
 
Remarks
Read this value to enumerate modems.  
 
Access
Read-Write  
 
Data Type
Boolean  
 
 
RingNumber Property

Description
Indicates the number of times the current call rung.  
 
Remarks
 
Access
Read  
 
Data Type
Long  


SpeakerPhoneOn Property

Description
Turn the speakerphone on or off.  
 
Remarks
Assuming your modem is speakerphone capable set this property to turn it on or off.  
 
Access
Read-Write  
 
Data Type
Long  
 

Status Property

Description
Get the status string shown on Call Soft's main window.  
 
Remarks
Read this property to get the exact status string shown on Call Soft's main window. For example "Listening for calls on some modem"  
 
Access
Read  
 
Data Type
String  


RemoteMachineName Property

Description
The Call Soft instance running on a remote computer you want to connect to.  
 
Remarks
If you want to connect to an instance of Call Soft running on a remote computer set this value to that computers name. The name should be entered just like it appears when you browse the network using Windows explorer. Keep in mind you must also have rights to access that computer.  
 
Access
Read-Write  
 
Data Type
String  

Visible Property

Description
Use the Visible property to control the visibility of the control at run time.  
 
Remarks
This value should be set to true when designing your forms and set it to false upon loading your forms i.e. during the Form_Load() event.  
 
Access
Read-Write  
 
Data Type
Boolean  
 
 




Methods

Answer(Long How) Method

Description
Answers an incoming call.  
 
Remarks
If the phone is ringing it's safe to call this method.  
Set How to AnswerJustAnswer to simply answer the phone. You can then use SpeakText or PlayWave.  
Set How to AnswerTakeMessage have Call Soft answer the phone and take a message. If you want to use a specific greeting see the Greeting property.  

Long CallInDelete(Long Index) Method

Description
Delete a call from Call Softs incoming call history.  
 
Remarks
Calling CallInDelete with a value of 0 to CallInCount-1 will remove the call from Call Soft incoming call history.  
Method returns the number of calls remaining.  

Long CallInDelete(Long Index) Method

Description
Delete a call from Call Softs incoming call history.  
 
Remarks
Calling CallInDelete with a value of 0 to CallInCount-1 will remove the call from Call Soft incoming call history.  
 
Method returns the number of calls remaining.  


InCallItem CallInGet(Long Index) Method

Description
Get the information pertaining to the incoming call at Index.  
 
Remarks
Call GetInGet with any number between 0 and CallInCount - 1 to retrieve the InCallItem.  
 
InCallItem  
Name    String The callers name as it appears in the incoming call history.  
RawName   String The name as given to Call Soft by your modem.  
Number    String The callers number including area code  
MessageFile   String If a message or fax was taken this is the path to the file. .Wave for voice message .tif for fax.  
MessageFile1   String not using this just ignore.  
Status   String The status of the call as it appears in the incoming call history i.e. took message, emailed, hung up etc.  
Date      Date The date and time the call started.  
IsFax   Long If true this was a fax call false if it was voice.  
Length   Long If this was a voice call and a message was taken Length is the message time in seconds.  
New      Long If true this message has not been heard.  
 
 
Example
Dim Count As Long  
Count = CallSoft1.ModemCount  
For Index = 0 To Count - 1 Step 1  
ModemList.AddItem (CallSoft1.GetModemName(Index))
Next  

CallOutClear() Method

Description
Delete all calls in the outgoing call list i.e. those calls to be dialed.  
 
Remarks

CallOutDelete(Long Index) Method

Description
Delete a call from the outgoing call list.  
 
Remarks
Calling CallOutDelete with a value of 0 to CallOutCount-1 will remove the call from outgoing call list.  

 
 
Long DialDigits(String Digits) Method

Description
Dials digits.  
 
Remarks
The call must be in a connected state.  
Return true on success or false on failure.  
 
Example
CallSoft1.DialDigits("123")  
 
 
 
Hangup() Method

Description
Hang up the modem  
 
Remarks
If the call is in a connected state call Hangup to end it. It's should be safe to call this method at any time. If Call Soft has trouble hanging up try using the ConnectedToModem property. There are no parameters  
 

MailBoxItem MailBoxGet(long Index) Method

Description
Retrieves the mailbox Index  
 
Remarks
Call MailBoxGet with any number between 0 and MailBoxCount - 1.  
 
MailBoxItem  
Name      String The mailbox name  
GUID      String A unique HEX identifier. Call Soft support mailboxes with the same name, this uniquely identifies the mailbox.  
ToActivate      String The numeric code to access the mailbox.  
Greeting      String The mailboxes greeting.  
DoAfterGreeting   Not used yet  
DelayAfterGreeting   Long The delay after playing the greeting and doing something else.  
 
 
Example
Read  
 
Data Type
String  
 

PlayBeep() Method

Description
Plays a 200 millisecond beep  
 
Remarks
If the call is in a connected state call PlayBeep to play a 200 millisecond beep.  
 
 
Example
if CallSoft1.CallConnected then  
CallSoft1.PlayBeep  
end if  
 
 
PlayWave(String WaveFile) Method

Description
Plays a 8khz 16bit mono wave file.  
 
Remarks
If the call is in a connected state call PlayWave with a fully qualified wave file name. You will be notified when the wave file has completed via the OnWaveDone event.  
 
 
Example
if CallSoft1.CallConnected then  
CallSoft1.PlayWave("c:\temp\test.wav")  
end if  
 
 
Long RecordMessage(String WaveFile, Long MaxTime,Long SilenceDetection)

Description
Record a message to WaveFile for MaxTime  
 
Remarks
Use RecordMessage to begin recording via the modem.  
WaveFile is a fully qualified file name. If you use this method after receiving a call and you want to be able to play the message from Call Soft you have to record the message in Call Soft's message directory c:\program files\call soft\messages.  
MaxTime is the maximum time in seconds to record don't set this value to 0.  
SilenceDetection if true will use silence detection as defined on the greeting tab in Call Soft's setup.  
 
 
Example
if CallSoft1.CallConnected then  
CallSoft1.StopPlayingOrRecording  
Result = CallSoft1.RecordMessage(RecordWaveEdit.Text, 240)  
end if  
 
 
Long ScheduleCall(String Name,String Number, String FileName, String Mailbox, Date Time) Method

Description
Dials a number, at some future time, optionally specify when and .wave or .txt file to use upon call connection.  
 
Remarks
Name is the name that will appear in the outgoing call history.  
Number is the number to dial. Call Soft will not try to interpret it. In other words what you enter here is exactly what will be dialed.  
FileName is the .wave or .txt file you want played or spoken upon call connection.  
Mailbox is the mailbox you want to assign the call to.  
Time is the date and time you want to start the call.  
 
The long return value might be used in later releases so multiple connections to Call Soft can determine if an event really belongs to them.  
 
Example
DateTimeNow = DateValue(Now)  
id = CallSoft1.Dial("My Office", "713-555-1212", "", 0, DateTimeNow)  

Long SendFax(String FaxFile, String RecipientName, String RecipientNumber, String RecipientCompany, String FromName, String FromFaxNumber, String FromVoiceNumber, String CoverPageFile, String Subject, String BannerText, String Comments, Long HiResolution, Date SendTime) Method

Description
Send a file as a fax with an optional cover page.  
 
Remarks
FaxFile    This can be any file ASCII text file or .bmp, .tif, tiff, pcx, or dcx file.  
HiResolution Set this value to 1 to send in hi resolution or 0 for standard resolutiion.  
SendTime   The date and time you want the fax sent. Set to 0 to send now.  
 
The remaining parameters only need to be set if you plan on sending a cover page. To not send a cover page set the CoverPageFile parameter to a null string i.e. "".  
 
CoverPageFile The cover page you want to use. This file must be a Microsoft Fax coverpage format. These files have a cpe extention.  
Comments This text will appear in the comment section of the cover page.  
RecipientName The name of the person your sending the fax to.  
RecipientNumber The fax number your calling.  
RecipientCompany The name of the company your sending the fax to.  
FromName The name of the person sending the fax.  
FromFaxNumber The phone number of the fax machine sending the fax.  
FromVoiceNumber The voice number of the person sending the fax.  
 
Example
DateTimeNow = DateValue(Now)  
CallSoft1.SendFax("c:\temp\test.txt", "To Walter", "713-555-1212", "Wal Mart Inc", "Me", "936-555-1212", "936-555-1213", "My Test Fax", "c:\temp\generic.cpe", "My banner text", "This is my test fax you like it?", 0, DateTimeNow) = 0  

 
StopPlayingOrRecording() Method

Description
Stop playing, speaking or recording a greeting. Also remove any pending hangups.  
 
Remarks
In short call this method prior to any call to SpeakText or PlayWave.  
 
Call StopPlayingOfRecording to stop Call Soft from playing or recording a greeting or abort any in progress calls to SpeakText or PlayWave. Call Soft also que a hangup request, periodically to make sure the line does not get hung, calling this method will remove all hangup requests. For example when a tone is detected Call Soft will que a hangup in 20 seconds. If the caller hits another tone then all hangup requests are removed and another one added to go off in 20 seconds. If the caller enters a proper code i.e. to listen to messages etc all hangup requests are removed and the listen to new messages dialog is invoked. We have to do this because some modems do not detect a caller hanging up so we must cover our butts.  
 
 
Example
if CallSoft1.CallConnected then  
CallSoft.StopPlayingOrRecording  
CallSoft1.PlayWave("c:\temp\test.wav")  
end if  
 
 


SpeakText(String TextToSay) Method

Description
Speak TextToSay over the modem.  
 
Remarks
The call state must be connected so call CallConnected property prior to using SpeakText. When Call Soft is done saying TextToSay your will be notified via the OnSpeakDone event.  
 
Example
if CallSoft1.CallConnected then  
CallSoft1.SpeakText ("Hello world")  
end if  
 

String GetModemName(Long Index) Method

Description
Get the name of the modem at index  
 
Remarks
Call GetModemName with any number between 0 and GetModemCount - 1 to retrieve the name of the modem.  
 
Example
Dim Count As Long  
Count = CallSoft1.ModemCount  
For Index = 0 To Count - 1 Step 1  
ModemList.AddItem (CallSoft1.GetModemName(Index))
Next  



OutCallItem CallOutGet(Long Index) Method

Description
Get the information pertaining to the outgoing call item at Index.  
 
Remarks
Call CallOutGet with any number between 0 and CallOutCount - 1 to retrieve the OutCallItem.  
 
InCallItem  
Name    String The callers name as it appears in the outgoing call list i.e. on Call Soft outgoing call tab.  
Number    String The callers number including area code  
MessageFile   String If a message or fax was taken this is the path to the file. .Wave for voice message .tif for fax nothing if it's just a call.  
Status   String The status of the call as it appears in the outgoing call list.  
Date      Date The date and time the call started.  
Failed   Long the number of times an attempt to make the call has failed.  
Length   Long the unique number associated with the call.  
 
 
Example
DateTimeNow = DateValue(Now)  
id = CallSoft1.Dial("Remote Dial", "713-555-1212", "", 0, DateTimeNow)



Long PhoneBookAdd(String OriginalName, String DisplayName, String PhoneNumber, String SoundFile, String Greeting, Long Key, Long RingToAnswerOn, Long NumberTimesCalled) Method

Description
Add a new entry to the phone book.  
 
Remarks
OriginalName is the name that Call Soft will use when trying to identify this caller assuming Key=1 . If you use this value be sure it is exactly as it appears on caller ID.  
DisplayName is the name that will appear on the incoming call list when this person calls.  
PhoneNumber is the callers number as it appears on caller ID. You should always include area code.  
SoundFile is the wave or text file you want played when this person calls.  
GreetingFile is the greeting you want to use this file must reside in the greeting directory "c:\program files\call soft\greetings".  
Key is how to identify this caller if 0 the PhoneNumber will be used if 1 OriginalName will be used.  
RingToAnswerOn is the ring to answer on. 0 = use the answer on ring as defined on the message tab  
in Call Soft's setup. 1 = answer on caller ID i.e. as soon as this caller is identified.  
NumberTimesCalled is the number of times this caller has called.  
 
Example
Count = CallSoft1.PhoneBookAdd("XYZ INC", "Mom at work", "713-555-1212", "mom.txt", "momgreeting.txt", 0, 0, 0)  

Long PhoneBookModify
(Long Index, String OriginalName, String DisplayName, String PhoneNumber, String SoundFile, String Greeting, Long Key, Long RingToAnswerOn, Long NumberTimesCalled) Method

Description
Add a new entry to the phone book.  
 
Remarks
Index is the phone book record you want to modify value can be from 0 to PhoneBookCount - 1.  
OriginalName is the name that Call Soft will use when trying to identify this caller assuming Key=1 . If you use this value be sure it is exactly as it appears on caller ID.  
DisplayName is the name that will appear on the incoming call list when this person calls.  
PhoneNumber is the callers number as it appears on caller ID. You should always include area code.  
SoundFile is the wave or text file you want played when this person calls.  
GreetingFile is the greeting you want to use this file must reside in the greeting directory "c:\program files\call soft\greetings".  
Key is how to identify this caller if 0 the PhoneNumber will be used if 1 OriginalName will be used.  
RingToAnswerOn is the ring to answer on. 0 = use the answer on ring as defined on the message tab  
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
in Call Soft's setup. 1 = answer on caller ID i.e. as soon as this caller is identified.  
NumberTimesCalled is the number of times this caller has called.  
 
The method returns the number of phone book entries.  
 
Example
Count = CallSoft1.PhoneBookModify(0,"XYZ INC", "Mom at work", "713-555-1212", "mom.txt", "moms_new_greeting.txt", 0, 0, 0)  



PhoneBookClear Method

Description
Removes all entries in the phonebook..  
 
Remarks
 
Example
CallSoft1.PhoneBookClear  
 
 
 
Long PhoneBookDelete(Long Index) Method

Description
Delete a phone book entry.  
 
Remarks
Index is the phone book record you want to delete value can be from 0 to PhoneBookCount - 1.  
 
The method returns the number of phone book entries.  
 
Example
Dim Count As Long  
Count = CallSoft1.PhoneBookDelete(0)  
 
 
PBookItem PhoneBookGet(Long Index, PBookItem Item) Method

Description
Get a phone book entry.  
 
Remarks
Index is the phone book record you want to modify value can be from 0 to PhoneBookCount - 1.  
 
The method returns a PBookItem it's structure is as follows.  
 
OriginalName is the name that Call Soft will use when trying to identify this caller assuming Key=1 . If you use this value be sure it is exactly as it appears on caller ID.  
DisplayName is the name that will appear on the incoming call list when this person calls.  
PhoneNumber is the callers number as it appears on caller ID. You should always include area code.  
SoundFile is the wave or text file you want played when this person calls.  
GreetingFile is the greeting you want to use this file must reside in the greeting directory "c:\program files\call soft\greetings".  
Key is how to identify this caller if 0 the PhoneNumber will be used if 1 OriginalName will be used.  
RingToAnswerOn is the ring to answer on. 0 = use the answer on ring as defined on the message tab  
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
in Call Soft's setup. 1 = answer on caller ID i.e. as soon as this caller is identified.  
NumberTimesCalled is the number of times this caller has called.  
 
Example
Dim Count As Long  
Count = CallSoft1.PhoneBookCount  
 
For Index = 0 To Count - 1 Step 1  
PhoneBookItem = CallSoft1.PhoneBookGet(Index)  
PhoneBookList.AddItem (PhoneBookItem.DisplayName)  
Next  
 
 
 
Events

OnCallerID(String Name,String FriendlyName, String Number) Event

Description
Occurs when caller ID is detected.  
 
Remarks
Name is the raw caller ID name as sent by the telephone company.  
If Name or Number are found in the phone book FriendlyName will be the name assigned to that caller.  
Number is the callers phone number.  
 

OnTone(String Key) Event

Description
Occurs when a caller sends tones over the phone.  
 
Remarks
Key is the tone they hit.  
 
 
 
OnRing(long RingNumber) Event

Description
Occurs when the modem detects a ring.  
 
Remarks
RingNumber is the number of rings.  
 
 
 

OnCallConnected Event

Description
Occurs when the call state changes to connected.  
 
Remarks
This is an important event because it is a signal to you that it's OK to play text or wave data through the modem until OnCallDisconnected() occurs. This event will occur upon answering a call or if you make a call it will occur when the phone begins to ringing.  
 
 
 

OnCallDisconnected Event

Description
Occurs when the call state changes from connected to not connected.  
 
Remarks
This is an important event because it is a signal to you that it's NOT OK to play text or wave data through the modem.  
 
 
 

OnModemConnected Event

Description
Occurs when Call Soft connects to a modem.  
 
Remarks
 
 
 
 
OnModemDisconnected Event

Description
Occurs when Call Soft disconnect from a modem.  
 
Remarks
 
 
 
OnNewMessage(String RealName, String FriendlyName, String PhoneNumber, String MessageFile, String Status) Event

Description
Occurs when the a new caller has been added to the incoming call history.  
 
Remarks
RealName is the raw caller ID name.  
FriendlyName is the name assigned to this caller if they where found in the phone book.  
PhoneNumber is the callers phone number.  
MessageFile, if not empty, is the message they left or the fax received. If the extension is .wav it's a voice message if it's .tif it's a fax.  
 
 
 
 
OnDialError(Long ErrorCode) Event

Description
Occurs when Call Soft is unable to make a call.  
 
Remarks   
Possible error codes are DialErrorBusy and DialErrorNoDialTone.  
 
 
 
OnSpeakDone Event

Description
Occurs when Call Soft is done speaking from a previous call to SpeakText.  
 
Remarks
If you have more to play or say this is a good time to say it.  
 
 
 
OnWaveDone Event

Description
Occurs when Call Soft is done playing a wave file from a previous call to PlayWave..  
 
Remarks
If you have more to play or say this is a good time to say it.  
 
 
 
OnGreetingStart Event

Description
Occurs when Call Soft is about to play a greeting.  
 
Remarks
 
 
 
 
OnGreetingDone Event

Description
Occurs when Call Soft is done playing a greeting.  
 
Remarks
 
 
 
 
OnRecordStart Event

Description
Occurs when Call Soft is about to record a message.  
 
Remarks
 
 
 
 
OnRecordDone Event

Description
Occurs when Call Soft is done recording a message.  
 
Remarks