EXPORTED FUNCTIONS DETAIL
This document describes functions supported by VaxSIPUserAgent SDK Components:
- Initialize()
- UnInitialize()
- RegisterToProxy()
- UnRegisterToProxy()
- OpenLine()
- CloseLine()
- SetLicenceKey()
- GetVaxObjectError()
- Disconnect()
- Connect()
- GetAudioInDevTotal()
- GetAudioOutDevTotal()
- GetAudioOutDevName()
- GetAudioInDevName()
- AcceptCall()
- RejectCall()
- TransferCall()
- GetMyIP()
- DigitDTMF()
- HoldLine()
- UnHoldLine()
- IsLineOpen()
- IsLineHold()
- IsLineBusy()
- EnableKeepAlive()
- DisableKeepAlive()
- DeselectAllVoiceCodec()
- SelectAllVoiceCodec()
- GetOutboundCodec()
- GetInboundCodec()
- SelectVoiceCodec()
- DeselectVoiceCodec()
- EnableEchoNoiseCancellation()
- DisableEchoNoiseCancellation()
- EnableAGC()
- DisableAGC()
- IsRecording()
- StartRecording()
- StopRecording()
- ResetRecording()
- SaveRecordingToWaveFile()
- IsWaveFilePlaying()
- PlayWaveOpen()
- PlayWaveSkipTo()
- PlayWaveTotalTime()
- PlayWavePause()
- PlayWaveStart()
- PlayWaveStop()
- PlayWavePosition()
- MuteMic()
- MuteSpk()
- EnableMicBoost()
- DisableMicBoost()
- IsMicBoostEnable()
- GetMicVolume()
- SetMicVolume()
- GetSpkVolume()
- SetSpkVolume()
- EnableDonotDisturb()
- DisableDonotDisturb()
- SetTOS()
- GetTOS()
- GetMicSoundLevel()
- GetSpkSoundLevel()
Initialize()
To initialize the VaxVoIP component. After initializing, user will be able to dial and receive phone calls. 
Parameters:
- Bind to Listen IP (0 or 1)
- Listen IP
- Listening Port No (default SIP port 5060)
- From SIP URI (Please see the sample source code)
- SIP OutBound Proxy (SIP outbound proxy IP or FQDN provided by IP-Telephony service provider)
- SIP Proxy  (SIP Proxy IP or FQDN provided by IP-Telephony service provider.)
- Login Id     (Provided by the IP-Telephony service provider.)
- Login Pwd  (Provided by the IP-Telephony service provider.)
- Use Sound Device (To enable or disable the sound devices.)
- Total Line (To initialize the VaxSIP component with specific number of lines)
Return Value:
Non-zero on success, otherwise 0, and a appropriate error code can be retrieved by calling GetVaxObjectError() method.
Remarks:
From URI can be constructed in the format: PROXY-LOGIN<sip:PROXY-LOGIN@MY-IP>
GetMyIP() exported method can be used in order to get your machine IP. Please see the Sample 
Source Code or SIP RFC 3261 for more details.
In some cases, ITSP (IP-Telephony service provider) support outbound proxy. Outbound proxy is the only way to let the NAT/firewall user make and receive phone calls.
If the NAT/firewall router does not support SIP pass-through, you need to consult your ITSP if they support SIP outbound proxy. Since different NAT router vendor implement NAT differently.
Typically ITSP may provide SIP outbound proxy to resolve NAT pass-through issues.
UnInitialize()
To uninitialize the VaxVoIP control, this method can be used.
RegisterToProxy()
To register with the SIP proxy server.
Parameters:
  - Registration Interval (See the SIP registration process or SIP RFC 3261 for more details.)
Return Value:
Non-zero on success, otherwise 0, and a specific error code can be retrieved by calling GetVaxObjectError() method.
UnRegisterToProxy()
To un-register from the SIP proxy server.
Return Value:
Non-zero on success, otherwise 0, and a specific error code can be retrieved by calling GetVaxObjectError() method.
OpenLine()
To open a specific line. Line must be open prior to use it.
Parameters:
- Line No (0 to total no of line - 1)
- Bind to RTP IP (0 or 1)
- RTP IP (IP address to receive voice stream)
- RTP Port (Port to receive voice stream)
Return Value:
Non-zero on success, otherwise 0, and a specific error code can be retrieved by calling GetVaxObjectError() method.
CloseLine()
To close a specific line.
Parameters:
- Line No (0 to total no of line - 1)
Return Value:
Non-zero on success, otherwise 0, and a specific error code can be retrieved by calling GetVaxObjectError() method.
IsLineOpen()
To get the OPEN status of a specific line.
Parameters:
- Line No (0 to total no of line - 1)
Return Value:
Non-zero on success, otherwise 0, and a specific error code can be retrieved by calling GetVaxObjectError() method.
SetLicenceKey()
Call this method, to set the License key.
Parameter:
- License Key Provided by VaxVoIP
Return Value:
Non-zero on success, otherwise 0, and a specific error code can be retrieved by calling GetVaxObjectError() method.
Remarks:
You must pay the License fee in order to get the License Key. After getting the License key, you will use it bye using this method and it will remove the evaluation message box & expiry.
GetVaxObjectError()
Call this method, to get the error for the last operation that failed.
Return Value:
- Error Code Number
Remarks:
See ErrorCodes.htm document for more details.
IsLineBusy()
To check rather line is connected or free.
Parameters:
- Line No (0 to total no of line - 1)
Return Value:
Non-zero on success, otherwise 0, and a specific error code can be retrieved by calling GetVaxObjectError() method.
Disconnect()
To hang up the call.
Parameters:
- Line No (0 to total no of line - 1)
Return Value:
Non-zero on success, otherwise 0, and a specific error code can be retrieved by calling GetVaxObjectError() method.
Connect()
It  connects specific line to a specific number or SIP-URI.
Parameters:
- Line No (0 to total no of line - 1)
- ToSIPURI
- InputDeviceId (-1 = auto select)
- OutputDeviceId (-1 = auto select)
Return Value:
Non-zero on success, otherwise 0, and a specific error code can be retrieved by calling GetVaxObjectError() method.
Remarks:
Construct To-SIP-URI according to the format: sip:PhoneNumber@SIP- Proxy-IP or FQDN 
Please see the SIP RFC 3261 or Sample source code for more details.
Value -1 can be provided, if your computer has single sound device OR you want VaxVoIP control to select the first/default sound device capable of recording and playing. 
If your computer has multiple sound devices and you want to choose a specific sound device then GetAudioOutDevName() & GetAudioInDevName() can be used to determine the device-Ids.
Please see the sample code for more details.
GetAudioInDevTotal()
It can be used to get the total number of sound input devices connected to the computer.
GetAudioOutDevTotal()
It can be used to get the total number of sound output devices connected to the computer.
GetAudioInDevName()
Parameter:
- Device Id  (0 to total no input devices - 1)
Return Value:
Device name on success, otherwise empty string.
GetAudioOutDevName()
Parameter:
- Device Id  (0 to total no output devices - 1)
Return Value:
Device name on success, otherwise empty string.
AcceptCall()
To accept the incoming call.
Parameters:
- Line No (0 to total no of line - 1)
- Call-Id (Incoming call-Id, please see OnIncomingCall() event details)
- InputDeviceId (-1 = auto select)
- OutputDeviceId (-1 = auto select)
Return Value:
Non-zero on success, otherwise 0, and a specific error code can be retrieved by calling GetVaxObjectError() method.
Value -1 can be provided, if your computer has single sound device OR you want VaxVoIP control to select the first/default sound device capable of recording and playing. 
If your computer has multiple sound devices and you want to choose a specific sound device then GetAudioOutDevName() & GetAudioInDevName() can be used to determine the device-Ids.
Please see the sample code for more details.
RejectCall()
To cancel the incoming call.
Parameters:
- Call-Id (Incoming call-Id, please see OnIncomingCall() event details)
Return Value:
Non-zero on success, otherwise 0, and a specific error code can be retrieved by calling GetVaxObjectError() method.
TransferCall()
To transfer a call from a specific line to a specific number or sip uri.
Parameters:
- Line No (0 to total no of line - 1)
- ToSIPURI
Return Value:
Construct the To-SIP-URI according to the SIP- URI format: sip:PhoneNumber@SIP- Proxy-IP or FQDN 
Non-zero on success, otherwise 0, and a specific error code can be retrieved by calling GetVaxObjectError() method.
HoldLine()
To put a specific line on hold.
Parameters:
- Line No (0 to total no of line - 1)
Return Value:
Non-zero on success, otherwise 0, and a specific error code can be retrieved by calling GetVaxObjectError() method.
IsLineHold()
To get the HOLD status of a specific line.
Parameters:
- Line No (0 to total no of line - 1)
Return Value:
Non-zero on success, otherwise 0, and a specific error code can be retrieved by calling GetVaxObjectError() method.
UnHoldLine()
To unhold a specific line.
Parameters:
- Line No (0 to total no of line - 1)
Return Value:
Non-zero on success, otherwise 0, and a specific error code can be retrieved by calling GetVaxObjectError() method.
EnableKeepAlive()
It helps to keep the ports open at NAT/firewall end. 
Parameters:
- Time (seconds) to send the keep alive packets repeatedly.
Return Value:
Non-zero on success, otherwise 0, and a specific error code can be retrieved by calling GetVaxObjectError() method.
DisableKeepAlive()  
Call this method to stop sending keep alive packets.
DeselectAllVoiceCodec()
Call to this method, deselects all voice codecs. 
Supported codecs are: GSM 6.10, iLBC, G711 A-Law, G711 U-Law.        
SelectAllVoiceCodec()
To select all voice codecs.
GetOutboundCodec()
To get the outbound codec.
Return Value:
Codec No on success, otherwise -1, and a specific error code can be retrieved by calling GetVaxObjectError() method.
Remarks:
VaxVoIP SIP SDK support the following voice codecs:
          1. GSM 6.10        (Codec No = 0)
          2. iLBC               (Codec No = 1)
          3. G711 A-Law    (Codec No = 2)
          4. G711 U-Law    (Codec No = 3)
GetInboundCodec()
To get the inbound codec.
Return Value:
Codec No on success, otherwise -1, and a specific error code can be retrieved by calling GetVaxObjectError() method.
Remarks:
VaxVoIP SIP SDK support the following voice codecs:
          1. GSM 6.10        (Codec No = 0)
          2. iLBC               (Codec No = 1)
          3. G711 A-Law    (Codec No = 2)
          4. G711 U-Law    (Codec No = 3)
SelectVoiceCodec()
To select a voice codec. 
Parameters:
- Codec No
Return Value:
Non-zero on success, otherwise 0, and a specific error code can be retrieved by calling GetVaxObjectError() method.
Remarks:
VaxVoIP SIP SDK support the following voice codecs:
          1. GSM 6.10        (Codec No = 0)
          2. iLBC               (Codec No = 1)
          3. G711 A-Law    (Codec No = 2)
          4. G711 U-Law    (Codec No = 3)
Any codec can be selected by providing its Codec No in this method.
DeselectVoiceCodec()
To deselect a voice codec. 
Parameters:
- Codec No
Return Value:
Non-zero on success, otherwise 0, and a specific error code can be retrieved by calling GetVaxObjectError() method.
Remarks:
VaxVoIP SIP SDK support the following voice codecs:
          1. GSM 6.10        (Codec No = 0)
          2. iLBC               (Codec No = 1)
          3. G711 A-Law    (Codec No = 2)
          4. G711 U-Law    (Codec No = 3)
Any codec can be de-selected by providing its Codec No in this method.
GetMyIP()
Method is used to get the IP address assigned to the computer. Please see the sample source code for more details. 
DigitDTMF()
Method to send DTMF digit to the remote end. This method can also be used to play DTMF tones.
Parameters:
- Line No (0 to total no of line - 1)
- DTMF Digit (1, 2, 3, 4, 5, ..... 0, *, #)
Return Value:
Non-zero on success, otherwise 0, and a specific error code can be retrieved by calling GetVaxObjectError() method.
EnableEchoNoiseCancellation()
Method can be used to enable the noise & echo cancellation. Default value = Enable.
AEC helps to ensure that no echo is heard at the other end. 
Noise cancellation, that allows significant suppression of any background noise and provides high quality of output speech.
Return Value:
Non-zero on success, otherwise 0, and a specific error code can be retrieved by calling GetVaxObjectError() method.
DisableEchoNoiseCancellation()
Method to disable the noise & echo cancellation feature.
Return Value:
Non-zero on success, otherwise 0, and a specific error code can be retrieved by calling GetVaxObjectError() method.
EnableAGC()
Method can be used to enable the AGC (auto gain controller).
Parameters:
- Volume level (0 to 32767)
Return Value:
Non-zero on success, otherwise 0, and a specific error code can be retrieved by calling GetVaxObjectError() method.
DisableAGC()
Method to disable the disable the AGC (auto gain controller).
Return Value:
Non-zero on success, otherwise 0, and a specific error code can be retrieved by calling GetVaxObjectError() method.
IsRecording()
This method is used to check if recording is enable or not on a specific line.
Parameters:
- Line No (0 to total no of line - 1)
Return Value:
Non-zero on success, otherwise 0, and a specific error code can be retrieved by calling GetVaxObjectError() method.
StartRecording()
This method is used to start the conversation recording.
Parameters:
- Line No (0 to total no of line - 1)
- Record Voice (0=Record outgoing only, 1=Record incoming only, 2=Record both)
- Record compress (0= create uncompressed wave file, 1= create GSM 6.10 compress wave file)
Return Value:
Non-zero on success, otherwise 0, and a specific error code can be retrieved by calling GetVaxObjectError() method.
Remarks:
VaxVoIP component creates recording tmp file for buffering purposes or to store the digital data. When this method is called, VaxVoIP component starts storing data into the tmp file.
StopRecording()
This method is used to stop the conversation recording.
Parameters:
- Line No (0 to total no of line - 1)
Return Value:
Non-zero on success, otherwise 0, and a specific error code can be retrieved by calling GetVaxObjectError() method.
Remarks:
Call to this method stops storing data into recording tmp file.
ResetRecording()
This method can be call to reset/clear the recording buffer.
Parameters:
- Line No (0 to total no of line - 1)
Return Value:
Non-zero on success, otherwise 0, and a specific error code can be retrieved by calling GetVaxObjectError() method.
Remarks:
Call to this method, clears saved digital data from the recording tmp file.
SaveRecordingToWaveFile()
To save the recording tmp file voice data into wave (.wav) file.
Parameter:
- Line No (0 to total no of line - 1)
- File name (.wav)
Return Value:
Non-zero on success, otherwise 0, and a specific error code can be retrieved by calling GetVaxObjectError() method.
Remarks:
Call to this method, saves tmp voice data into wave (.wav) file. 
IsWaveFilePlaying()
This method is used to check if playing wave file is still in progress or not.
Parameters:
- Line No (0 to total no of line - 1)
Return Value:
Non-zero on success, otherwise 0, and a specific error code can be retrieved by calling GetVaxObjectError() method.
PlayWaveOpen()
To set a wave file to play to the remote end.
Parameter:
- Line No (0 to total no of line - 1)
- File name (.wav)  
Return Value:
Non-zero on success, otherwise 0, and a specific error code can be retrieved by calling GetVaxObjectError() method.
PlayWaveStart()
Call to this method, starts playing the wave file on the specific line.
Parameter:
- Line No (0 to total no of line - 1)
- Listen   (0 = Play to remote end, 1 = play to remote end & sound card both)
Return Value:
Non-zero on success, otherwise 0, and a specific error code can be retrieved by calling GetVaxObjectError() method.
Remarks:
1. Open the wave file with PlayWaveOpen() method.
2. Start playing with PlayWaveStart() method.
It starts sending wave file data to the remote end, value listen = 1 starts sending and playing (on sound card) wave file data at the same time.
PlayWaveSkipTo()
To change the playing cursor position to the new position.
Parameter:
- Line No (0 to total no of line - 1)
- New Position (in seconds)  
Return Value:
Non-zero on success, otherwise 0, and a specific error code can be retrieved by calling GetVaxObjectError() method.
Remarks:
Call to this method, changes the playing cursor position and VaxVoIP SIP object starts playing from the new position.
PlayWavePosition()
To get the current position of playing cursor.
Parameter:
- Line No (0 to total no of line - 1)
Return Value:
Non-zero on success, otherwise -1, and a specific error code can be retrieved by calling GetVaxObjectError() method.
PlayWaveTotalTime()
To get the total play time of a wave file.
Parameter:
- Line No (0 to total no of line - 1)
Return Value:
Non-zero on success, otherwise -1, and a specific error code can be retrieved by calling GetVaxObjectError() method.
PlayWavePause()
To pause playing at the current position.
Parameter:
- Line No (0 to total no of line - 1)
Return Value:
Non-zero on success, otherwise 0, and a specific error code can be retrieved by calling GetVaxObjectError() method.
PlayWaveStop()
To stop playing and change the playing cursor position to the beginning.
Parameter:
- Line No (0 to total no of line - 1)
Return Value:
Non-zero on success, otherwise 0, and a specific error code can be retrieved by calling GetVaxObjectError() method.
MuteSpk()
To mute the speaker, this method can be called. Call to MuteSpk() does not affect the Master Mute Control.
Parameter:
- Boolean Value 0 or 1
Return Value:
Non-Zero on success, otherwise 0
MuteMic()
To mute the microphone, this method can be called. Call to MuteMic() does not affect the Master Mute Control. It simply starts sending silence data.
Parameter:
- Boolean Value 0 or 1
Return Value:
Non-Zero on success, otherwise 0
GetSpkVolume()
Call to this method returns the speaker volume value between Range [0 to 255], where (0 = min volume, 255 = max volume)
Return Value:
Speaker Volume value on success, otherwise –1 and a specific error code can be retrieved by calling GetVaxObjectError() method.
SetSpkVolume()
To set the Output volume, this method can be called. the value range should between 0 to 255.
Parameter:
- Volume Value between [0255] Range, where (0 = Min Volume, 255 = Max Volume)
Return Value:
Non-zero on success, otherwise 0, and a specific error code can be retrieved by calling GetVaxObjectError() method.
GetMicVolume()
Call the method to get the Microphone Volume. Volume value is returned, in the range of [0 to 255], where (0 = min volume, 255 = max volume)
Return Value:
Microphone Volume value on success, otherwise –1 and a specific error code can be retrieved by calling GetVaxObjectError() method.
SetMicVolume()
Call the method to set the Microphone Volume, the value range should between 0 to 255, where (0 = min volume, 255 = max volume)
Parameter:
  - Volume Value between [0255] Range
Return Value:
Non-zero on success, otherwise 0, and a specific error code can be retrieved by calling GetVaxObjectError() method.
EnableMicBoost()
Call the method to increase the Microphone sensitivity.
DisableMicBoost()
To disable the Mic Boost.
IsMicBoostEnable()
Call the method to get Mic Boost is enabled or disabled.
EnableDonotDisturb()
To enable the don't disturb status. Please see the sample source code for more details.
DisableDonotDisturb()
To disable the don't disturb status. Please see the sample source code for more details.
SetTOS() (NOT FUNCTIONAL, FOR FUTURE ENHANCEMENTS ONLY)
To set the IP-Header TOS (Type of Service) value.
GetTOS() (NOT FUNCTIONAL, FOR FUTURE ENHANCEMENTS ONLY)
To get the IP-Header TOS (Type of Service) value.
GetMicSoundLevel()
It can be used to add microphone volume level meter. It returns the value between 0 to 100.
GetSpkSoundLevel()
It can be used to add speaker volume level meter. It returns the value between 0 to 100.