IPPhone Component

Properties   Methods   Events   Config Settings   Errors  

The IPPhone component can be used to implement a software-based phone.

Syntax

nsoftware.IPWorksVoIP.Ipphone

Remarks

The IPPhone component can be used to implement a software-based phone utilizing modern Voice over Internet Protocol (VoIP) technology. This softphone is able to perform many different functions of a traditional telephone, such as making and receiving calls, performing blind and attended transfers, placing calls on hold, establishing and joining conferences, and more.

Registration

To begin, the first step is activating, or registering, the component. The Server, Port, User, and Password properties must be set to the appropriate values to register with your SIP server/provider. After these values are set, call Activate. If the component has successfully activated/registered, the Activated event will fire and Active will be set to true. The component will now be able to make/receive phone calls. For example:

component.OnActivated += (o, e) => { Console.WriteLine("Activation Successful"); }; component.User = "sip_user"; component.Password = "sip_password"; component.Server = "sip_server"; component.Port = 5060 // Default, 5061 is typical for SSL/TLS component.Activate(); Additionally, it's important to note that the registration of a SIP client will expire if not refreshed. The expiration time is negotiated with the server when registering. By default, the component will attempt to negotiate a value of 60 seconds. This value can be changed via the RegistrationInterval configuration. Note this is merely a suggestion to the server, and the server can change this accordingly. If the server does change this, after registration is complete, RegistrationInterval will be updated.

To prevent the registration from expiring, the component will refresh the registration within DoEvents, when needed. To ensure this occurs, we recommend calling DoEvents frequently. In a form-based application, we recommend doing so within a timer. For example, this could look something like:

private void timer1_Tick(object sender, EventArgs e) { component.DoEvents(); } private System.Windows.Forms.Timer timer1; timer1.Interval = 1000; timer1.Tick += new System.EventHandler(this.timer1_Tick); timer1.Enabled = true;

Note that in console applications, you must call DoEvents in a loop in order to provide accurate message processing, in addition to this case.

Security

By default, the component operates in plaintext for both SIP signaling and RTP (audio) communication. To enable completely secure communication using the component, both SIPS (Secure SIP) and SRTP (Secure RTP) must be enabled.

Enable SIPS

To enable SIPS (Secure SIP, or SIP over SSL/TLS), the SIPTransportProtocol property must be set to 2 (TLS). The Port property will typically need to be set to 5061 (this may vary). Additionally, the SSLServerAuthentication event must be handled, allowing users to check the server identity and other security attributes related to server authentication. Once this is complete, the component can then be activated. All subsequent SIP signaling will now be secured. For example:

component.OnSSLServerAuthentication += (o, e) => { if (!e.Accept) { if (e.CertSubject == "SIPS_SAMPLE_SUBJECT" && e.CertIssuer == "SIPS_CERT_ISSUER") { e.Accept = true; } } }; // Enable SIPS component.SIPTransportProtocol = 2; // TLS component.User = "sip_user"; component.Password = "sip_password"; component.Server = "sip_server"; component.Port = 5061; // 5061 is typical for SSL/TLS component.Activate();

Information related to the SSL/TLS handshake will be available within the SSLStatus event with the prefix [SIP TLS].

Enable SRTP

While the above process secures SIP signaling, it does not secure RTP (audio) communication. The RTPSecurityMode property can be used to specify the security mode that will be used when transmitting RTP packets. By default, this property is 0 (None), and RTP packets will remain unencrypted during communication with the remote party.

To ensure the audio data is encrypted and SRTP is enabled, the RTPSecurityMode must be set to either of the following modes: 1 (SDES), or 2 (DTLS-SRTP). The selected mode will be used to securely derive a key used to encrypt and decrypt RTP packets, enabling secure audio communication with the remote party. The appropriate mode to use may depend on the service provider and configuration of a particular User. For example:

component.OnSSLServerAuthentication += (o, e) => { if (!e.Accept) { if (e.CertSubject == "SIPS_SAMPLE_SUBJECT" && e.CertIssuer == "SIPS_CERT_ISSUER") { e.Accept = true; } } }; component.RTPSecurityMode = 1; // Enable SRTP (SDES) //component.RTPSecurityMode = 2; // Enable SRTP (DTLS-SRTP) component.SIPTransportProtocol = 2; // TLS component.User = "sip_user"; component.Password = "sip_password"; component.Server = "sip_server"; component.Port = 5061; // 5061 is typical for SSL/TLS component.Activate(); component.Dial("123456789", "", true);

Note it is highly recommended that SIPTransportProtocol is set to TLS when enabling SRTP. Additionally, if SRTP is enabled, the remote party must support the selected mode, otherwise no call will be established.

Audio Setup

While not required to function, you may set the microphone and speaker for the component to use during calls. First, you must call ListMicrophones and ListSpeakers. Doing so will populate the Microphones collection and the Speakers collection. Once this is done, you can set these devices via SetMicrophone and SetSpeaker given their device name. For example:

ipphone1.ListMicrophones(); ipphone1.ListSpeakers(); foreach (Speaker s in ipphone1.Speakers) { Console.WriteLine("Speaker Name: " + s.Name); } foreach (Microphone m in ipphone1.Microphones) { Console.WriteLine("Microphone Name: " + m.Name); } ipphone1.SetSpeaker(ipphone1.Speakers[0].Name); ipphone1.SetMicrophone(ipphone1.Microphones[0].Name);

Managing Calls

All incoming and outgoing calls currently recognized by the component will be stored in the Calls collection. These connections will be initiated or accepted through the interface identified by LocalHost and LocalPort.

Incoming Calls

After successful activation, incoming calls will be detected, and IncomingCall will fire for each call. Within this event, Answer, Decline, or Forward can be used to handle these calls. For example:

ipphone1.OnIncomingCall += (o, e) => { ipphone1.Answer(e.CallId); };

Outgoing Calls

To make an outgoing call, you must use Dial. This method takes three parameters: the user you wish to call, your caller ID (optional), and a boolean that determines whether the method will connect synchronously (True) or asynchronously (False). If set, the second parameter will cause P-Asserted-Identity headers (RFC 3325) to be sent in requests to the server. If left as an empty string, this header will not be sent. Dial will return a call identification string (Call-ID) that is unique to the call. After the method returns successfully, the call will be added to the Calls collection.

Please see the method description for detailed examples on using Dial synchronously and asynchronously.

Transferring Calls

Ongoing calls can be transferred using Transfer. The component supports two types of transfers:

Basic (Blind) Transfers

Basic transfers are very simple to perform. First, the user establishes a call with the number they will be transferring (transferee). After the call is established, the user can transfer the call to the appropriate number (transfer target). The call will then be removed. For example:

string callId = ipphone1.Dial("123456789", "", true); // Establish call with transferee, hold if needed //ipphone1.Hold(callId); ipphone1.Transfer(callId, "number");

Attended Transfers

Typically, attended transfers are used to manually check if the "number" they are transferring to (transfer target) is available for a call, provide extra information about the call, etc., before transferring. In addition to establishing a call with the transferee, the component must also establish a call with the transfer target. Once both calls are active, you may perform an attended transfer by calling Transfer at any moment. Afterwards, a session will be established between both calls, and they will be removed. Note that Transfer must be used with the callId of the call you wish to transfer (transferee) and the number of the call you wish to transfer to (transfer target). For example:

string callId1 = ipphone1.Dial("123456789", "", true); // Establish call with Transferee, hold if needed //ipphone1.Hold(callId1); string callId2 = ipphone1.Dial("number", "", true); // Establish call with Transfer Target, hold if needed //ipphone1.Hold(callId2); ipphone1.Transfer(callId1, "number");

Note in these examples, Hold can be used to place a call on hold before a transfer. This is optional.

Audio Playback

The component supports three methods of playing audio to a call, being PlayFile, PlayText, or PlayBytes. Note for each of these methods, audio transmission will only occur when the call has connected and CallReady has fired. Additionally, only audio data with a sampling rate of 8 kHz and a bit depth of 16 bits per sample can be played (PCM 8 kHz 16-bit format). Also note that these methods are non-blocking, and will return immediately. The component can also handle playing audio to concurrent calls.

PlayFile can be used to play audio from a WAV file to a specific call. PlayText can also be used to play audio, but will do so using Text-to-Speech. Once audio has finished playing, Played will fire.

PlayBytes can be used to play audio, but will do so in an event-based manner. The behavior of PlayBytes is very different from the previous two methods. For a detailed description on how to use this method with the Played event, please see the method and event descriptions.

Recording Audio

Ongoing calls can be recorded using StartRecording. The audio can be recorded directly to a WAV file by specifying the filename parameter. Additionally, if the filename parameter is not specified, the audio will be recorded internally, and made available once the recording is finished. The recorded data will be available within the Record event.

Note in both scenarios, the recording will end either when the call is terminated, or StopRecording is called. The recorded audio will have a sampling rate of 8 kHz and a bit depth of 16 bits per sample (PCM 8 kHz 16-bit format).

Example: Using the 'Record' event

MemoryStream recordStream = new MemoryStream(); phone.StartRecording("callId", ""); phone.OnRecord += (o, e) => { recordStream.Write(e.RecordedDataB, 0, e.RecordedDataB.Length); File.WriteAllBytes(recordFile, recordStream.ToArray()); };

Conferencing

The component also supports conferencing. A call can join a conference using the JoinConference method, passing in the callId of the call and the custom conferenceId. If the conferenceId does not exist, then a new conference will be created given this ID. Other calls can then join the existing conference with this same ID.

To monitor existing conferences, the ListConferences method will return a string containing all ongoing conferences and calls within each conference. This value will have the following format:

ConferenceId_1: CallId_1, CallId_2

...

ConferenceId_n: CallId_3, CallId_4, CallId_5, ...

At any moment, a call can be removed from a conference using LeaveConference. If the user is the last call within the conference, then the conference will be removed.

Call Termination

Ongoing calls are terminated by passing the appropriate Call-ID to Hangup. All ongoing calls can be terminated with HangupAll. When a call has been terminated (by either party), CallTerminated will fire. It's important to note that in the case where an outgoing call is never answered, the component will attempt to leave a voicemail. The voicemail will end once Hangup or HangupAll is called, and CallTerminated will fire.

Property List


The following is the full list of the properties of the component with short descriptions. Click on the links for further details.

ActiveThe current activation status of the component.
CallsA collection of calls.
LocalHostThe name of the local host or user-assigned IP interface through which connections are initiated or accepted.
LocalPortThe UDP port in the local host where UDP binds.
MicrophonesA collection of microphones.
PasswordThe password that is used when connecting to the SIP Server.
PortThe port on the SIP server the component is connecting to.
RTPSecurityModeSpecifies the security mode that will be used when transmitting RTP.
ServerThe address of the SIP Server.
SIPTransportProtocolSpecifies the transport protocol the component will use for SIP signaling.
SpeakersA collection of speakers.
SSLAcceptServerCertInstructs the component to unconditionally accept the server certificate that matches the supplied certificate.
SSLCertThe certificate to be used during SSL negotiation.
UserThe username that is used when connecting to the SIP Server.

Method List


The following is the full list of the methods of the component with short descriptions. Click on the links for further details.

ActivateActivates the component.
AnswerAnswers an incoming phone call.
ConfigSets or retrieves a configuration setting.
DeactivateDeactivates the component.
DeclineDeclines an incoming phone call.
DialUsed to make a call.
DoEventsProcesses events from the internal message queue.
ForwardUsed to forward an incoming call.
HangupUsed to hang up a specific call.
HangupAllUsed to hang up all calls.
HoldPlaces a call on hold.
JoinConferenceAdds a call to a conference call.
LeaveConferenceRemoves a call from a conference call.
ListConferencesLists ongoing conference calls.
ListMicrophonesLists all microphones detected on the system.
ListSpeakersLists all speakers detected on the system.
MuteMicrophoneUsed to mute or unmute the microphone for a specified call.
MuteSpeakerUsed to mute or unmute the speaker for a specified call.
PingUsed to ping the server.
PlayBytesThis method is used to play bytes to a call.
PlayFilePlays audio from a WAV file to a call.
PlayTextPlays audio from a string to a call using Text-to-Speech.
ResetReset the component.
SetMicrophoneSets the microphone used by the component.
SetSpeakerSets the speaker used by the component.
StartRecordingUsed to start recording the audio of a call.
StopPlayingStops audio from playing to a call.
StopRecordingStops recording the audio of a call.
TransferTransfers a call.
TypeDigitUsed to type a digit.
UnholdTakes a call off hold.

Event List


The following is the full list of the events fired by the component with short descriptions. Click on the links for further details.

ActivatedThis event is fired immediately after the component is activated.
CallReadyThis event is fired after a call has been answered, declined, or ignored.
CallStateChangedThis event is fired after a call's state has changed.
CallTerminatedThis event is fired after a call has been terminated.
DeactivatedThis event is fired immediately after the component is deactivated.
DialCompletedThis event is fired after the dial process has finished.
DigitThis event fires every time a digit is pressed using the keypad.
ErrorInformation about errors during data delivery.
IncomingCallThis event is fired when there's an incoming call.
LogThis event is fired once for each log message.
OutgoingCallThis event is fired when an outgoing call has been made.
PlayedThis event is fired after the component finishes playing available audio.
RecordThis event is fired when recorded audio data is available.
SilenceThis event is fired when the component detects silence from incoming audio streams.
SSLServerAuthenticationFired after the server presents its certificate to the client.
SSLStatusShows the progress of the secure connection.

Config Settings


The following is a list of config settings for the component with short descriptions. Click on the links for further details.

AuthUserSpecifies the username to be used during client authentication.
CodecsComma-separated list of codecs the component can use.
DialTimeoutSpecifies the amount of time to wait for a response when making a call.
DomainCan be used to set the address of the SIP domain.
DtmfMethodThe method used for delivering the signals/tones sent when typing a digit.
LogEncodedAudioDataWhether the component will log encoded audio data.
LogLevelThe level of detail that is logged.
LogRTPPacketsWhether the component will log RTP packets.
RecordTypeThe type of recording the component will use.
RedirectLimitThe maximum number of redirects an outgoing call can experience.
RegistrationIntervalSpecifies the interval between subsequent registration messages.
SilenceIntervalSpecifies the interval the component uses to detect periods of silence.
STUNPortThe port of the STUN server.
STUNServerThe address of the STUN Server.
UnregisterOnActivateSpecifies whether the component will unregister from the SIP Server before registration.
VoiceIndexThe voice that will be used when playing text.
VoiceRateThe speaking rate of the voice when playing text.
BuildInfoInformation about the product's build.
GUIAvailableTells the component whether or not a message loop is available for processing events.
LicenseInfoInformation about the current license.
MaskSensitiveWhether sensitive data is masked in log messages.
UseInternalSecurityAPITells the component whether or not to use the system security libraries or an internal implementation.

Active Property (IPPhone Component)

The current activation status of the component.

Syntax

public bool Active { get; }
Public ReadOnly Property Active As Boolean

Default Value

False

Remarks

This property indicates the activation status of the component. Active will be True if the component has been successfully activated (registered) with the SIP Server, and False otherwise. If False, the component is not registered and will not be able to make or receive calls.

The component can be activated via Activate and deactivated through Deactivate.

This property is read-only and not available at design time.

Calls Property (IPPhone Component)

A collection of calls.

Syntax

public CallList Calls { get; }
Public ReadOnly Property Calls As CallList

Remarks

This collection holds data for each incoming and outgoing Call recognized by the component.

This property is read-only and not available at design time.

Please refer to the Call type for a complete list of fields.

LocalHost Property (IPPhone Component)

The name of the local host or user-assigned IP interface through which connections are initiated or accepted.

Syntax

public string LocalHost { get; set; }
Public Property LocalHost As String

Default Value

""

Remarks

The LocalHost property contains the name of the local host as obtained by the gethostname() system call, or if the user has assigned an IP address, the value of that address.

In multi-homed hosts (machines with more than one IP interface) setting LocalHost to the value of an interface will make the component initiate connections (or accept in the case of server components) only through that interface.

If the component is connected, the LocalHost property shows the IP address of the interface through which the connection is made in internet dotted format (aaa.bbb.ccc.ddd). In most cases, this is the address of the local host, except for multi-homed hosts (machines with more than one IP interface).

NOTE: LocalHost is not persistent. You must always set it in code, and never in the property window.

LocalPort Property (IPPhone Component)

The UDP port in the local host where UDP binds.

Syntax

public int LocalPort { get; set; }
Public Property LocalPort As Integer

Default Value

0

Remarks

The LocalPort property must be set before UDP is activated (Active is set to True). It instructs the component to bind to a specific port (or communication endpoint) in the local machine.

Setting it to 0 (default) enables the TCP/IP stack to choose a port at random. The chosen port will be shown by the LocalPort property after the connection is established.

LocalPort cannot be changed once the component is Active. Any attempt to set the LocalPort property when the component is Active will generate an error.

The LocalPort property is useful when trying to connect to services that require a trusted port in the client side.

Microphones Property (IPPhone Component)

A collection of microphones.

Syntax

public MicrophoneList Microphones { get; }
Public ReadOnly Property Microphones As MicrophoneList

Remarks

This collection holds data for each Microphone detected on the system. Calling ListMicrophones will populate this collection.

This property is read-only and not available at design time.

Please refer to the Microphone type for a complete list of fields.

Password Property (IPPhone Component)

The password that is used when connecting to the SIP Server.

Syntax

public string Password { get; set; }
Public Property Password As String

Default Value

""

Remarks

This property contains the password of the client attempting to connect to the SIP Server. This value will be used when activating the component via Activate.

This property is not available at design time.

Port Property (IPPhone Component)

The port on the SIP server the component is connecting to.

Syntax

public int Port { get; set; }
Public Property Port As Integer

Default Value

5060

Remarks

This property specifies the port on the SIP server that the component will connect to. This value will be used when activating the component via Activate.

RTPSecurityMode Property (IPPhone Component)

Specifies the security mode that will be used when transmitting RTP.

Syntax

public IpphoneRTPSecurityModes RTPSecurityMode { get; set; }

enum IpphoneRTPSecurityModes { etNone, etSDES, etDTLS }
Public Property RTPSecurityMode As IpphoneRTPSecurityModes

Enum IpphoneRTPSecurityModes etNone etSDES etDTLS End Enum

Default Value

0

Remarks

This property is used to specify the security mode that will be used when transmitting RTP (audio data). Possible modes are:

0 (None) SRTP is disabled.
1 (SDES) SRTP is enabled, utilizing SDES.
2 (DTLS) SRTP is enabled, utilizing DTLS (DTLS-SRTP).

By default, the security mode will be 0 (None), and RTP packets will remain unencrypted during communication with the remote party. To enable SRTP (Secure RTP), the security mode must be set to either: 1 (SDES), or 2 (DTLS).

When SRTP is enabled, the selected mode will be used to securely derive a key used to encrypt and decrypt RTP packets, enabling secure audio communication with the remote party. The appropriate mode to use may depend on the service provider and configuration of a particular User. Additionally, if SRTP is enabled, the remote party must support the selected mode, otherwise no call will be established.

Note it is highly recommended that SIPTransportProtocol is set to TLS when enabling SRTP.

Server Property (IPPhone Component)

The address of the SIP Server.

Syntax

public string Server { get; set; }
Public Property Server As String

Default Value

""

Remarks

This property contains the address of the SIP Server the component will attempt to connect to. This value will be used when activating the component via Activate.

SIPTransportProtocol Property (IPPhone Component)

Specifies the transport protocol the component will use for SIP signaling.

Syntax

public IpphoneSIPTransportProtocols SIPTransportProtocol { get; set; }

enum IpphoneSIPTransportProtocols { tpUDP, tpTCP, tpTLS }
Public Property SIPTransportProtocol As IpphoneSIPTransportProtocols

Enum IpphoneSIPTransportProtocols tpUDP tpTCP tpTLS End Enum

Default Value

0

Remarks

This property specifies which transport protocol (UDP, TCP, TLS) the component will use for SIP signaling and can be used to enable SIPS (Secure SIP). Note it is important to set the SIPTransportProtocol property before setting any additional properties and configurations.

This value is 0 (UDP) by default. Possible values are:

0 (UDP - Default)Signaling will be performed over UDP (plaintext).
1 (TCP)Signaling will be performed over TCP (plaintext).
2 (TLS)Signaling will be performed using TLS over TCP (SIPS).

Note when TLS is specified, the Port will typically need to be set to 5061.

Speakers Property (IPPhone Component)

A collection of speakers.

Syntax

public SpeakerList Speakers { get; }
Public ReadOnly Property Speakers As SpeakerList

Remarks

This collection holds data for each Speaker detected on the system. Calling ListSpeakers will populate this collection.

This property is read-only and not available at design time.

Please refer to the Speaker type for a complete list of fields.

SSLAcceptServerCert Property (IPPhone Component)

Instructs the component to unconditionally accept the server certificate that matches the supplied certificate.

Syntax

public Certificate SSLAcceptServerCert { get; set; }
Public Property SSLAcceptServerCert As Certificate

Remarks

If it finds any issues with the certificate presented by the server, the component will normally terminate the connection with an error.

You may override this behavior by supplying a value for SSLAcceptServerCert. If the certificate supplied in SSLAcceptServerCert is the same as the certificate presented by the server, then the server certificate is accepted unconditionally, and the connection will continue normally.

Please note that this functionality is provided only for cases where you otherwise know that you are communicating with the right server. If used improperly, this property may create a security breach. Use it at your own risk.

This property is not available at design time.

Please refer to the Certificate type for a complete list of fields.

SSLCert Property (IPPhone Component)

The certificate to be used during SSL negotiation.

Syntax

public Certificate SSLCert { get; set; }
Public Property SSLCert As Certificate

Remarks

The digital certificate that the component will use during SSL negotiation. Set this property to a valid certificate before starting SSL negotiation. To set a certificate, you may set the Encoded field to the encoded certificate. To select a certificate, use the store and subject fields.

This property is not available at design time.

Please refer to the Certificate type for a complete list of fields.

User Property (IPPhone Component)

The username that is used when connecting to the SIP Server.

Syntax

public string User { get; set; }
Public Property User As String

Default Value

""

Remarks

This property contains the username of the client attempting to connect to the SIP Server. This value will be used when activating the component via Activate.

This property is not available at design time.

Activate Method (IPPhone Component)

Activates the component.

Syntax

public void Activate();
Public Sub Activate()

Remarks

This method is used to activate the component by registering to a SIP Server specified in the Server and Port properties. The username and password of the SIP Server must be provided via User and Password properties for authorization, if applicable.

Example: ipphone.User = "MyUsername"; ipphone.Password = "MyPassword"; ipphone.Server = "HostNameOrIP"; ipphone.Port = 5060; ipphone.Activate(); Upon successful activation, the Activated event will fire.

Answer Method (IPPhone Component)

Answers an incoming phone call.

Syntax

public void Answer(string callId);
Public Sub Answer(ByVal callId As String)

Remarks

This method can be used to answer an incoming phone call, specified by callId. This method can be used in conjunction with the IncomingCall event, for example: ipphone.onIncomingCall += (sender, e) => { ipphone.Answer(e.CallId); }; If successful, CallReady will fire.

Config Method (IPPhone Component)

Sets or retrieves a configuration setting.

Syntax

public string Config(string configurationString);
Public Function Config(ByVal ConfigurationString As String) As String

Remarks

Config is a generic method available in every component. It is used to set and retrieve configuration settings for the component.

These settings are similar in functionality to properties, but they are rarely used. In order to avoid "polluting" the property namespace of the component, access to these internal properties is provided through the Config method.

To set a configuration setting named PROPERTY, you must call Config("PROPERTY=VALUE"), where VALUE is the value of the setting expressed as a string. For boolean values, use the strings "True", "False", "0", "1", "Yes", or "No" (case does not matter).

To read (query) the value of a configuration setting, you must call Config("PROPERTY"). The value will be returned as a string.

Deactivate Method (IPPhone Component)

Deactivates the component.

Syntax

public void Deactivate();
Public Sub Deactivate()

Remarks

This method is used to unregister the component from the SIP Server. If deactivation is successful, Deactivated will fire.

Decline Method (IPPhone Component)

Declines an incoming phone call.

Syntax

public void Decline(string callId);
Public Sub Decline(ByVal callId As String)

Remarks

This method can be used to decline an incoming phone call, specified by callId. This method can be used in conjunction with the IncomingCall event, for example: ipphone.onIncomingCall += (sender, e) => { ipphone.Decline(e.CallId); };

Dial Method (IPPhone Component)

Used to make a call.

Syntax

public string Dial(string number, string callerNumber, bool wait);
Public Function Dial(ByVal number As String, ByVal callerNumber As String, ByVal wait As Boolean) As String

Remarks

This method is used to make a call to a particular user, given by number. This method should only be called after the component has been successfully activated via Activate. Initially, the OutgoingCall event will fire after calling this method. DialCompleted may fire when the dial process is complete. If successful, CallReady will fire after the outgoing call has been answered, declined, or ignored. If the call is declined or ignored, the component will be sent to voicemail, which can be ended with Hangup.

The callerNumber parameter specifies the optional caller ID. If given, the P-Asserted-Identity Header, specified in RFC 3325, will be sent in requests to the connected SIP Server. If left as an empty string, this header will not be sent.

The wait parameter specifies whether the component should connect synchronously or asynchronously to the call. If True, the component will connect synchronously, and won't return until the call has been answered, declined, or ignored. If False, the component will connect asynchronously. The call's status can be checked through various events, such as OutgoingCall, CallReady, and CallStateChanged, or found in the call's State field. Exceptions throughout the call process will be reported in DialCompleted, along with other call details.

NOTE: This method will return the CallId field of the call. This returned value may not always reflect the accurate CallId. In the case that wait is true, this method will always return the accurate value. In the case that wait is false, the returned value may not be accurate if the outgoing call is forwarded, or redirected, as the component must change this field. Both the updated and original CallId will be present within the DialCompleted event. Any references to the original CallId must be updated accordingly. Please see DialCompleted for more details. The below examples assume the outgoing call has been answered:

Example: "wait" is true string callId = ""; bool connected = false; ipphone.OnCallReady += (sender, e) => { connected = true; } try { callId = ipphone.Dial("123456789", "", true); } catch (IPWorksVoIPException e) { MessageBox.Show(e.Code + ": " + e.Message); } if (connected) { ipphone.PlayText(callId, "Hello"); } Example: "wait" is false bool connected = false; string callId = ""; ipphone.OnDialCompleted += (sender, e) => { if (e.ErrorCode != 0) { MessageBox.Show(e.ErrorCode + ": " + e.Description); // Handle error } if (e.OriginalCallId != e.CallId) { callId = e.CallId; // Update callId if redirect occurred } } ipphone.OnCallReady += (sender, e) => { connected = true; } string callId = ipphone.Dial("123456789", "", false); ... ... ... // Somewhere else... if (connected) { ipphone.PlayText(callId, "Hello"); }

DoEvents Method (IPPhone Component)

Processes events from the internal message queue.

Syntax

public void DoEvents();
Public Sub DoEvents()

Remarks

When DoEvents is called, the component processes any available events. If no events are available, it waits for a preset period of time, and then returns.

Forward Method (IPPhone Component)

Used to forward an incoming call.

Syntax

public void Forward(string callId, string number);
Public Sub Forward(ByVal callId As String, ByVal number As String)

Remarks

This method can be used to implement call forwarding, allowing incoming calls, given by callId to be forwarded to a particular user specified by number. This method can be used in conjunction with the IncomingCall event, for example: ipphone.onIncomingCall += (sender, e) => { ipphone.Forward(e.CallId, "123456789"); };

Hangup Method (IPPhone Component)

Used to hang up a specific call.

Syntax

public void Hangup(string callId);
Public Sub Hangup(ByVal callId As String)

Remarks

This method is used to terminate a specific call, specified by callId. After the call has been successfully terminated, CallTerminated will fire.

HangupAll Method (IPPhone Component)

Used to hang up all calls.

Syntax

public void HangupAll();
Public Sub HangupAll()

Remarks

This method is used to terminate all calls currently in the Calls collection. CallTerminated will fire for each successfully terminated call.

Hold Method (IPPhone Component)

Places a call on hold.

Syntax

public void Hold(string callId);
Public Sub Hold(ByVal callId As String)

Remarks

This method is used to place a call, specified by callId, on hold.

JoinConference Method (IPPhone Component)

Adds a call to a conference call.

Syntax

public void JoinConference(string callId, string conferenceId);
Public Sub JoinConference(ByVal callId As String, ByVal conferenceId As String)

Remarks

This method is used to add a call, specified by callId, to a conference call.

The conferenceId parameter specifies the unique ID of the conference call. If no conference ID exists, the component will start a new conference call with this ID.

LeaveConference Method (IPPhone Component)

Removes a call from a conference call.

Syntax

public void LeaveConference(string callId);
Public Sub LeaveConference(ByVal callId As String)

Remarks

This method is used to remove a call, specified by callId, from a conference call. If the call is not a part of any conference call, an exception will be thrown.

ListConferences Method (IPPhone Component)

Lists ongoing conference calls.

Syntax

public string ListConferences();
Public Function ListConferences() As String

Remarks

This method is used to list ongoing conferences any of the component's calls are currently a part of. Calling this will return a string with the following format:

ConferenceId_1: CallId_1, CallId_2

...

ConferenceId_n: CallId_3, CallId_4, CallId_5, ...

ListMicrophones Method (IPPhone Component)

Lists all microphones detected on the system.

Syntax

public void ListMicrophones();
Public Sub ListMicrophones()

Remarks

This method lists all microphones detected on the system. Calling this method will populate the Microphones collection.

ListSpeakers Method (IPPhone Component)

Lists all speakers detected on the system.

Syntax

public void ListSpeakers();
Public Sub ListSpeakers()

Remarks

This method lists all speakers detected on the system. Calling this method will populate the Speakers collection.

MuteMicrophone Method (IPPhone Component)

Used to mute or unmute the microphone for a specified call.

Syntax

public void MuteMicrophone(string callId, bool mute);
Public Sub MuteMicrophone(ByVal callId As String, ByVal mute As Boolean)

Remarks

This method can be used to either mute or unmute the microphone for a specified call, given by callId. When mute is true, the microphone will be muted for the call. When false, the microphone will be unmuted.

MuteSpeaker Method (IPPhone Component)

Used to mute or unmute the speaker for a specified call.

Syntax

public void MuteSpeaker(string callId, bool mute);
Public Sub MuteSpeaker(ByVal callId As String, ByVal mute As Boolean)

Remarks

This method can be used to either mute or unmute the speaker for a specified call, given by callId. When mute is true, the speaker will be muted for the call. When false, the speaker will be unmuted.

Ping Method (IPPhone Component)

Used to ping the server.

Syntax

public void Ping(int timeout);
Public Sub Ping(ByVal timeout As Integer)

Remarks

This method is used to ping the SIP server by sending an OPTIONS request. If no server response is received by the component in timeout seconds, Ping will throw an error.

Note this method is only applicable when the component is active.

PlayBytes Method (IPPhone Component)

This method is used to play bytes to a call.

Syntax

public void PlayBytes(string callId, byte[] bytesToPlay, bool lastBlock);
Public Sub PlayBytes(ByVal callId As String, ByVal bytesToPlay As String, ByVal lastBlock As Boolean)

Remarks

This method is used to play bytes to a call, specified by the callId parameter. These bytes are expected to have a sampling rate of 8 kHz and a bit depth of 16 bits per sample (PCM 8 kHz 16-bit format). The bytesToPlay parameter specifies the bytes that will be sent to the call. Internally, these bytes will be stored within a buffer. Once all bytes have played and the buffer is empty, the Played event will fire.

The lastBlock parameter indicates whether the component will expect further uses of PlayBytes. When true, this indicates that no additional bytes will be provided for this particular audio stream, and Played will fire once after the bytes have been played. Until this parameter is specified as true, the component will be considered to be playing audio.

If lastBlock is false, this indicates that the component should expect more calls to PlayBytes. Once all bytes have played and the buffer is empty, Played will fire as expected, and will continue firing until the lastBlock parameter is set to true. Within Played, the user can provide further bytes to PlayBytes. Please see below for detailed examples on how to use this method with Played.

Example: Playing audio from a stream MemoryStream playBytesStream = new MemoryStream(byteSource); phone.PlayBytes("callId", new byte[0], false); phone.OnPlayed += (o, e) => { if (e.Completed) { Console.WriteLine("Playing Bytes Completed"); } else { byte[] data = new byte[4096]; // Arbitrary length int dataLen = playBytesStream.Read(data, 0, data.Length); if (dataLen > 0) { byte[] newData = new byte[dataLen]; Array.Copy(data, newData, dataLen) // Normalize array phone.PlayBytes(e.CallId, newData, false); } else { phone.PlayBytes(e.CallId, null, true); } } }; Exmaple: Playing single audio block MemoryStream playBytesStream = new MemoryStream(byteSource); phone.PlayBytes("callId", playBytesStream.ToArray(), true); phone.OnPlayed += (o, e) => { Console.WriteLine("Done!"); // No further calls to PlayBytes are expected in this case }

PlayFile Method (IPPhone Component)

Plays audio from a WAV file to a call.

Syntax

public void PlayFile(string callId, string wavFile);
Public Sub PlayFile(ByVal callId As String, ByVal wavFile As String)

Remarks

This method is used to play the audio from a WAV file to a particular call, given by callId. Audio transmission will only occur when the call has connected and CallReady has fired. Only WAV files with a sampling rate of 8 kHz and a bit depth of 16 bits per sample are supported (PCM 8 kHz 16-bit format).

Note that this component can handle playing audio to concurrent calls. This method is non-blocking and will return immediately. The Played event will fire when the audio for the specified call has finished playing. Consecutive uses of PlayText or PlayFile can prevent prior audio transmissions from being completed. In the below example, Played will only fire for the second call to PlayText:

ipphone.PlayFile("callId", "C:\\hello.wav"); // Played will not fire for this ipphone.PlayText("callId", "This will interrupt the previous use if it has not finished playing.");

The wavFile parameter specifies the path to the WAV file.

PlayText Method (IPPhone Component)

Plays audio from a string to a call using Text-to-Speech.

Syntax

public void PlayText(string callId, string text);
Public Sub PlayText(ByVal callId As String, ByVal text As String)

Remarks

This method is used to play the text from a string to a particular call, given by callId, using Text-to-Speech. Audio transmission will only occur when the call has connected and CallReady has fired.

Note that this component can handle playing audio to concurrent calls. This method is non-blocking and will return immediately. The Played event will fire when the audio for the specified call has finished playing. Consecutive uses of PlayText and PlayFile can prevent prior audio transmissions from completing. In the below example, Played will only fire for the second call to PlayText:

ipphone.PlayFile("callId", "C:\\hello.wav"); // Played will not fire for this ipphone.PlayText("callId", "This will interrupt the previous use if it has not finished playing.");

The text parameter must be a string representation of the text to be transmitted.

Reset Method (IPPhone Component)

Reset the component.

Syntax

public void Reset();
Public Sub Reset()

Remarks

This method will reset the component's properties to their default values.

SetMicrophone Method (IPPhone Component)

Sets the microphone used by the component.

Syntax

public void SetMicrophone(string microphone);
Public Sub SetMicrophone(ByVal microphone As String)

Remarks

This method is used to set the Microphone that will be used by the component.

The microphone parameter specifies the name of the microphone to be set. To get the available microphones on the system, call ListMicrophones. Then, set the microphone with a name specified in the Microphones collection.

Example ipphone.ListMicrophones(); ipphone.SetMicrophone(ipphone.Microphones[0].Name);

SetSpeaker Method (IPPhone Component)

Sets the speaker used by the component.

Syntax

public void SetSpeaker(string speaker);
Public Sub SetSpeaker(ByVal speaker As String)

Remarks

This method is used to set the speaker that will be used by the component.

The speaker parameter specifies the name of the speaker to be set. To get the available speakers on the system, call ListSpeakers. Then, set the speaker with a name specified in the Speakers collection.

Example ipphone.ListSpeakers(); ipphone.SetSpeaker(ipphone.Speakers[0].Name);

StartRecording Method (IPPhone Component)

Used to start recording the audio of a call.

Syntax

public void StartRecording(string callId, string filename);
Public Sub StartRecording(ByVal callId As String, ByVal filename As String)

Remarks

This method is used to start recording the incoming and outgoing audio of a call, specified by callId. If you wish to record the audio to file, you may specify the filename parameter. Note that when this parameter is specified, you must record to a WAV file.

You may also leave the filename parameter blank if you want more direct control over the recorded data. This will cause the Record event to fire containing the call's audio data once the recording is finished.

In both scenarios, you can stop recording the call's audio via StopRecording. By default, the recording will end if the call is terminated. Note the recorded audio will have a sampling rate of 8 kHz and a bit depth of 16 bits per sample (PCM 8 kHz 16-bit format).

Example: Using the 'Record' event MemoryStream recordStream = new MemoryStream(); phone.StartRecording("callId", ""); phone.OnRecord += (o, e) => { recordStream.Write(e.RecordedDataB, 0, e.RecordedDataB.Length); File.WriteAllBytes(recordFile, recordStream.ToArray()); };

StopPlaying Method (IPPhone Component)

Stops audio from playing to a call.

Syntax

public void StopPlaying(string callId);
Public Sub StopPlaying(ByVal callId As String)

Remarks

This method is used to stop the audio playing to a call, given by callId. Note that this will not stop audio from transmitting with an external device set using SetMicrophone, however, will stop audio transmitting from usage of PlayText, PlayFile, and PlayBytes.

Note that Played will not fire when this method is used.

StopRecording Method (IPPhone Component)

Stops recording the audio of a call.

Syntax

public void StopRecording(string callId);
Public Sub StopRecording(ByVal callId As String)

Remarks

This method is used to stop recording the audio of a call, given by callId. The component will automatically stop recording upon call termination.

Transfer Method (IPPhone Component)

Transfers a call.

Syntax

public void Transfer(string callId, string number);
Public Sub Transfer(ByVal callId As String, ByVal number As String)

Remarks

This method is used to transfer a call, specified by callId, to the phone number given by number. The component supports the following types of transfers:

Basic Transfers

Basic transfers are very simple to perform. First, the user must establish a call with the number they will be transferring (transferee). After the call is established, the user can transfer the call to the appropriate number (transfer target). The call will then be removed. For example:

string callId = ipphone1.Dial("123456789", "", true); // Establish call with transferee, hold if needed //ipphone1.Hold(callId); ipphone1.Transfer(callId, "number");

Attended Transfers

Typically, attended transfers are used to manually check if the number (or transfer target) is available for a call, provide extra information about the call, etc., before transferring. In addition to establishing a call with the transferee, the component must also establish a call with the transfer target. Once both of these calls are active, you may perform an attended transfer by calling Transfer at any moment. Afterwards, a session between these calls will be established and they will be removed. Note that Transfer must be used with the callId of the call you wish to transfer (transferee) and the number of the call you wish to transfer to (transfer target). For example:

string callId1 = ipphone1.Dial("123456789", "", true); // Establish call with Transferee, hold if needed //ipphone1.Hold(callId1); string callId2 = ipphone1.Dial("number", "", true); // Establish call with Transfer Target, hold if needed //ipphone1.Hold(callId2); ipphone1.Transfer(callId1, "number");

Note in these examples, Hold can be used to place a call on hold before a transfer. This is optional.

TypeDigit Method (IPPhone Component)

Used to type a digit.

Syntax

public void TypeDigit(string callId, string digit);
Public Sub TypeDigit(ByVal callId As String, ByVal digit As String)

Remarks

This method can be used to type a digit, mimicking the functionality of a phone's keypad.

The callId parameter specifies the call that will receive the virtual keypad input.

The digit parameter specifies the digit that will be typed. Valid inputs include: 0-9, *, #

Unhold Method (IPPhone Component)

Takes a call off hold.

Syntax

public void Unhold(string callId);
Public Sub Unhold(ByVal callId As String)

Remarks

This method is used to take a call, specified by callId, off hold.

Activated Event (IPPhone Component)

This event is fired immediately after the component is activated.

Syntax

public event OnActivatedHandler OnActivated;

public delegate void OnActivatedHandler(object sender, IpphoneActivatedEventArgs e);

public class IpphoneActivatedEventArgs : EventArgs {
}
Public Event OnActivated As OnActivatedHandler

Public Delegate Sub OnActivatedHandler(sender As Object, e As IpphoneActivatedEventArgs)

Public Class IpphoneActivatedEventArgs Inherits EventArgs
End Class

Remarks

The Activated event will fire after the component has successfully registered with the SIP Server via Activate.

CallReady Event (IPPhone Component)

This event is fired after a call has been answered, declined, or ignored.

Syntax

public event OnCallReadyHandler OnCallReady;

public delegate void OnCallReadyHandler(object sender, IpphoneCallReadyEventArgs e);

public class IpphoneCallReadyEventArgs : EventArgs {
  public string CallId { get; }
}
Public Event OnCallReady As OnCallReadyHandler

Public Delegate Sub OnCallReadyHandler(sender As Object, e As IpphoneCallReadyEventArgs)

Public Class IpphoneCallReadyEventArgs Inherits EventArgs
  Public ReadOnly Property CallId As String
End Class

Remarks

For all calls, this event will fire when audio can be transmitted and received. For incoming calls, it will fire after the call has been answered.

For outgoing calls, this event will fire after the call has either been answered, declined, or ignored. In the case that the call is declined or ignored, it will fire and the component will be sent to voicemail. Hangup can be used to end the call in all scenarios.

Note that this event will fire after OutgoingCall and DialCompleted, assuming Dial was successful.

The CallId parameter is the unique Call-ID of the call.

CallStateChanged Event (IPPhone Component)

This event is fired after a call's state has changed.

Syntax

public event OnCallStateChangedHandler OnCallStateChanged;

public delegate void OnCallStateChangedHandler(object sender, IpphoneCallStateChangedEventArgs e);

public class IpphoneCallStateChangedEventArgs : EventArgs {
  public string CallId { get; }
  public int State { get; }
}
Public Event OnCallStateChanged As OnCallStateChangedHandler

Public Delegate Sub OnCallStateChangedHandler(sender As Object, e As IpphoneCallStateChangedEventArgs)

Public Class IpphoneCallStateChangedEventArgs Inherits EventArgs
  Public ReadOnly Property CallId As String
  Public ReadOnly Property State As Integer
End Class

Remarks

The CallStateChanged event will fire each time the state of a call has changed.

The CallId parameter is the unique Call-ID of the call.

The State parameter denotes the state the call has changed to. The following values are applicable:

csInactive (0)The call is inactive (default setting).
csConnecting (1)The call is establishing a connection to the callee.
csAutConnecting (2)The call is establishing a connection to the callee with authorization credentials.
csRinging (3)The call is ringing.
csActive (4)The call is active.
csActiveInConference (5)The call is active and in a conference.
csDisconnecting (6)The call is disconnecting with the callee.
csAutDisconnecting (7)The call is disconnecting with the callee with authorization credentials.
csHolding (8)The call is currently being placed on hold, but the Hold operation has not finished.
csOnHold (9)The call is currently on hold.
csUnholding (10)The call is currently being unheld, but the Unhold operation has not finished.
csTransferring (11)The call is currently being transferred.
csAutTransferring (12)The call is currently being transferred with authorization credentials.

CallTerminated Event (IPPhone Component)

This event is fired after a call has been terminated.

Syntax

public event OnCallTerminatedHandler OnCallTerminated;

public delegate void OnCallTerminatedHandler(object sender, IpphoneCallTerminatedEventArgs e);

public class IpphoneCallTerminatedEventArgs : EventArgs {
  public string CallId { get; }
}
Public Event OnCallTerminated As OnCallTerminatedHandler

Public Delegate Sub OnCallTerminatedHandler(sender As Object, e As IpphoneCallTerminatedEventArgs)

Public Class IpphoneCallTerminatedEventArgs Inherits EventArgs
  Public ReadOnly Property CallId As String
End Class

Remarks

The CallTerminated event will fire after a call has been terminated by either end of the call.

The CallId parameter is the unique Call-ID of the call.

Deactivated Event (IPPhone Component)

This event is fired immediately after the component is deactivated.

Syntax

public event OnDeactivatedHandler OnDeactivated;

public delegate void OnDeactivatedHandler(object sender, IpphoneDeactivatedEventArgs e);

public class IpphoneDeactivatedEventArgs : EventArgs {
}
Public Event OnDeactivated As OnDeactivatedHandler

Public Delegate Sub OnDeactivatedHandler(sender As Object, e As IpphoneDeactivatedEventArgs)

Public Class IpphoneDeactivatedEventArgs Inherits EventArgs
End Class

Remarks

The Deactivated event will fire after the component has unregistered from the SIP Server via Deactivate.

DialCompleted Event (IPPhone Component)

This event is fired after the dial process has finished.

Syntax

public event OnDialCompletedHandler OnDialCompleted;

public delegate void OnDialCompletedHandler(object sender, IpphoneDialCompletedEventArgs e);

public class IpphoneDialCompletedEventArgs : EventArgs {
  public string OriginalCallId { get; }
  public string CallId { get; }
  public string Caller { get; }
  public string Callee { get; }
  public int ErrorCode { get; }
  public string Description { get; }
}
Public Event OnDialCompleted As OnDialCompletedHandler

Public Delegate Sub OnDialCompletedHandler(sender As Object, e As IpphoneDialCompletedEventArgs)

Public Class IpphoneDialCompletedEventArgs Inherits EventArgs
  Public ReadOnly Property OriginalCallId As String
  Public ReadOnly Property CallId As String
  Public ReadOnly Property Caller As String
  Public ReadOnly Property Callee As String
  Public ReadOnly Property ErrorCode As Integer
  Public ReadOnly Property Description As String
End Class

Remarks

This event will fire when the dial process, initiated by calling Dial, has completed. Note that this event will not fire if an exception occurs when the "wait" parameter of Dial is true. In this case, the component will throw an exception. However, it will fire if "wait" is true and no exception occurs, indicating Dial was successful.

The OriginalCallId parameter is the value returned by Dial.

The value of the CallId parameter depends on the redirection status of the call. There are two scenarios:

  1. The outgoing call has not been redirected. In this case, CallId is equal to OriginalCallId, and the value returned by Dial is correct.
  2. The outgoing call has been redirected any number of times. In this case, the OriginalCallId is no longer applicable, and the CallId parameter is the new unique identifier for this call. Any reference to the past value, OriginalCallId, should be updated accordingly to reflect the change due to redirection. This would also include references to the original value returned by Dial.
The Caller parameter specifies the user that initially made the call. The Callee parameter specifies the final recipient of the call.

Errors during the dial process are reported via the ErrorCode and Description parameters. An error code of 0 and description of "Dialed Successfully" indicate Dial has completed with no issues. A list of error codes can be found in the Error Codes section. In the case of a non-zero ErrorCode, the Description parameter will contain the error message (and SIP response code, if applicable), for example, "Dial Timeout" or "486: Busy Here".

Digit Event (IPPhone Component)

This event fires every time a digit is pressed using the keypad.

Syntax

public event OnDigitHandler OnDigit;

public delegate void OnDigitHandler(object sender, IpphoneDigitEventArgs e);

public class IpphoneDigitEventArgs : EventArgs {
  public string CallId { get; }
  public string Digit { get; }
}
Public Event OnDigit As OnDigitHandler

Public Delegate Sub OnDigitHandler(sender As Object, e As IpphoneDigitEventArgs)

Public Class IpphoneDigitEventArgs Inherits EventArgs
  Public ReadOnly Property CallId As String
  Public ReadOnly Property Digit As String
End Class

Remarks

The Digit event will fire after every detected keypad input from a call.

The detected input will be present in the Digit parameter. Note, this event will not fire after the component's inputs via TypeDigit. Detectable inputs include: 0-9, *, #

The CallId parameter is the unique Call-ID of the call.

Error Event (IPPhone Component)

Information about errors during data delivery.

Syntax

public event OnErrorHandler OnError;

public delegate void OnErrorHandler(object sender, IpphoneErrorEventArgs e);

public class IpphoneErrorEventArgs : EventArgs {
  public int ErrorCode { get; }
  public string Description { get; }
}
Public Event OnError As OnErrorHandler

Public Delegate Sub OnErrorHandler(sender As Object, e As IpphoneErrorEventArgs)

Public Class IpphoneErrorEventArgs Inherits EventArgs
  Public ReadOnly Property ErrorCode As Integer
  Public ReadOnly Property Description As String
End Class

Remarks

The Error event is fired in case of exceptional conditions during message processing. Normally the component throws an exception.

ErrorCode contains an error code and Description contains a textual description of the error. For a list of valid error codes and their descriptions, please refer to the Error Codes section.

IncomingCall Event (IPPhone Component)

This event is fired when there's an incoming call.

Syntax

public event OnIncomingCallHandler OnIncomingCall;

public delegate void OnIncomingCallHandler(object sender, IpphoneIncomingCallEventArgs e);

public class IpphoneIncomingCallEventArgs : EventArgs {
  public string CallId { get; }
  public string RemoteUser { get; }
}
Public Event OnIncomingCall As OnIncomingCallHandler

Public Delegate Sub OnIncomingCallHandler(sender As Object, e As IpphoneIncomingCallEventArgs)

Public Class IpphoneIncomingCallEventArgs Inherits EventArgs
  Public ReadOnly Property CallId As String
  Public ReadOnly Property RemoteUser As String
End Class

Remarks

The IncomingCall event will fire after an incoming call is detected.

The CallId parameter specifies the unique Call-ID of the call, and can be used to Answer or Decline the call.

The RemoteUser parameter indicates the username or telephone number of the remote user associated with the call.

Log Event (IPPhone Component)

This event is fired once for each log message.

Syntax

public event OnLogHandler OnLog;

public delegate void OnLogHandler(object sender, IpphoneLogEventArgs e);

public class IpphoneLogEventArgs : EventArgs {
  public int LogLevel { get; }
  public string Message { get; }
  public string LogType { get; }
}
Public Event OnLog As OnLogHandler

Public Delegate Sub OnLogHandler(sender As Object, e As IpphoneLogEventArgs)

Public Class IpphoneLogEventArgs Inherits EventArgs
  Public ReadOnly Property LogLevel As Integer
  Public ReadOnly Property Message As String
  Public ReadOnly Property LogType As String
End Class

Remarks

This event fires once for each log message generated by the component. The verbosity is controlled by the LogLevel configuration.

LogLevel indicates the detail level of the message. Possible values are:

0 (None) No messages are logged.
1 (Info - Default) Informational events such as a call's status are logged.
2 (Verbose) Detailed data such as SIP/SDP packet information is logged.
3 (Debug) Debug data including all relevant sent and received audio bytes are logged.
Note: When LogLevel is set to 3 (Debug), we strongly advise against performing long-running operations inside of this event due to large amounts of sent and received audio bytes. For example, continuously updating an interface displaying the Log data will cause major performance issues in an application. It is recommended to set LogLevel to 3 only when writing Log data to a stream or file. There will be no performance issues in this case.

Message is the log message.

LogType identifies the type of log entry. Possible values are as follows:

  • Info
  • Packet
  • RTP

OutgoingCall Event (IPPhone Component)

This event is fired when an outgoing call has been made.

Syntax

public event OnOutgoingCallHandler OnOutgoingCall;

public delegate void OnOutgoingCallHandler(object sender, IpphoneOutgoingCallEventArgs e);

public class IpphoneOutgoingCallEventArgs : EventArgs {
  public string CallId { get; }
  public string RemoteUser { get; }
}
Public Event OnOutgoingCall As OnOutgoingCallHandler

Public Delegate Sub OnOutgoingCallHandler(sender As Object, e As IpphoneOutgoingCallEventArgs)

Public Class IpphoneOutgoingCallEventArgs Inherits EventArgs
  Public ReadOnly Property CallId As String
  Public ReadOnly Property RemoteUser As String
End Class

Remarks

The OutgoingCall event is fired when an outgoing call has been made using Dial. This event signifies the start of the invite process.

The CallId parameter is the unique Call-ID of the call.

The RemoteUser parameter indicates the username or telephone number of the remote user associated with the call.

Played Event (IPPhone Component)

This event is fired after the component finishes playing available audio.

Syntax

public event OnPlayedHandler OnPlayed;

public delegate void OnPlayedHandler(object sender, IpphonePlayedEventArgs e);

public class IpphonePlayedEventArgs : EventArgs {
  public string CallId { get; }
  public bool Completed { get; }
}
Public Event OnPlayed As OnPlayedHandler

Public Delegate Sub OnPlayedHandler(sender As Object, e As IpphonePlayedEventArgs)

Public Class IpphonePlayedEventArgs Inherits EventArgs
  Public ReadOnly Property CallId As String
  Public ReadOnly Property Completed As Boolean
End Class

Remarks

The Played event will fire after the component finishes playing available audio to a call. When using PlayText or PlayFile, Completed will always be true. However, this will not always be the case when using PlayBytes.

When playing audio via PlayBytes, this event will fire when the internal byte queue is empty. In the event that the internal byte queue is empty, and the component is still expecting calls to PlayBytes (i.e., lastBlock is false), this event will continue to fire with the Completed parameter as false. In this case, additional bytes are expected to be provided. Completed will be true once all bytes have been played and the component is no longer expecting calls to PlayBytes (i.e., lastBlock is true). Please see the method description for more details.

The CallId parameter is the unique Call-ID of the call.

Record Event (IPPhone Component)

This event is fired when recorded audio data is available.

Syntax

public event OnRecordHandler OnRecord;

public delegate void OnRecordHandler(object sender, IpphoneRecordEventArgs e);

public class IpphoneRecordEventArgs : EventArgs {
  public string CallId { get; }
  public string RecordedData { get; }
public byte[] RecordedDataB { get; } }
Public Event OnRecord As OnRecordHandler

Public Delegate Sub OnRecordHandler(sender As Object, e As IpphoneRecordEventArgs)

Public Class IpphoneRecordEventArgs Inherits EventArgs
  Public ReadOnly Property CallId As String
  Public ReadOnly Property RecordedData As String
Public ReadOnly Property RecordedDataB As Byte() End Class

Remarks

This event is fired when a call's recorded data is available. This data is made available when either StopRecording is called or the call is terminated. Note that for this event to fire, StartRecording must be specified with no filename parameter.

The recorded data will be available in the RecordedData and RecordedDataB parameters, and will have a sampling rate of 8 kHz and a bit depth of 16 bits per sample (PCM 8 kHz 16-bit format).

The CallId parameter is the unique Call-ID of the call.

Silence Event (IPPhone Component)

This event is fired when the component detects silence from incoming audio streams.

Syntax

public event OnSilenceHandler OnSilence;

public delegate void OnSilenceHandler(object sender, IpphoneSilenceEventArgs e);

public class IpphoneSilenceEventArgs : EventArgs {
  public string CallId { get; }
}
Public Event OnSilence As OnSilenceHandler

Public Delegate Sub OnSilenceHandler(sender As Object, e As IpphoneSilenceEventArgs)

Public Class IpphoneSilenceEventArgs Inherits EventArgs
  Public ReadOnly Property CallId As String
End Class

Remarks

The Silence event will fire every second the component detects silence from a call's incoming audio stream. Note that this event can fire while an outgoing call is ringing.

The CallId parameter is the unique Call-ID of the call.

SSLServerAuthentication Event (IPPhone Component)

Fired after the server presents its certificate to the client.

Syntax

public event OnSSLServerAuthenticationHandler OnSSLServerAuthentication;

public delegate void OnSSLServerAuthenticationHandler(object sender, IpphoneSSLServerAuthenticationEventArgs e);

public class IpphoneSSLServerAuthenticationEventArgs : EventArgs {
  public string CertEncoded { get; }
public byte[] CertEncodedB { get; } public string CertSubject { get; } public string CertIssuer { get; } public string Status { get; } public bool Accept { get; set; } }
Public Event OnSSLServerAuthentication As OnSSLServerAuthenticationHandler

Public Delegate Sub OnSSLServerAuthenticationHandler(sender As Object, e As IpphoneSSLServerAuthenticationEventArgs)

Public Class IpphoneSSLServerAuthenticationEventArgs Inherits EventArgs
  Public ReadOnly Property CertEncoded As String
Public ReadOnly Property CertEncodedB As Byte() Public ReadOnly Property CertSubject As String Public ReadOnly Property CertIssuer As String Public ReadOnly Property Status As String Public Property Accept As Boolean End Class

Remarks

This event is where the client can decide whether to continue with the connection process or not. The Accept parameter is a recommendation on whether to continue or close the connection. This is just a suggestion: application software must use its own logic to determine whether to continue or not.

When Accept is False, Status shows why the verification failed (otherwise, Status contains the string "OK"). If it is decided to continue, you can override and accept the certificate by setting the Accept parameter to True.

SSLStatus Event (IPPhone Component)

Shows the progress of the secure connection.

Syntax

public event OnSSLStatusHandler OnSSLStatus;

public delegate void OnSSLStatusHandler(object sender, IpphoneSSLStatusEventArgs e);

public class IpphoneSSLStatusEventArgs : EventArgs {
  public string Message { get; }
}
Public Event OnSSLStatus As OnSSLStatusHandler

Public Delegate Sub OnSSLStatusHandler(sender As Object, e As IpphoneSSLStatusEventArgs)

Public Class IpphoneSSLStatusEventArgs Inherits EventArgs
  Public ReadOnly Property Message As String
End Class

Remarks

The event is fired for informational and logging purposes only. Used to track the progress of the connection.

Call Type

Contains the details of an active call.

Remarks

This type contains the details of an active call.

Fields

CallId
String (read-only)

String representation of an immutable universally unique identifier (UUID) specific to the call.

ConferenceId
String (read-only)

A unique identifier for a conference call.

Duration
Integer (read-only)

Elapsed time, in seconds, since the call has begun. Calculated using the value in StartedAt.

LastStatus
Integer (read-only)

This field indicates the call's last response code. Response codes are defined in RFC 3261.

LocalAddress
String (read-only)

The name of the local host or user-assigned IP interface through which connections are initiated or accepted.

LocalPort
Integer (read-only)

The UDP port in the local host where UDP binds.

Microphone
String (read-only)

The microphone currently in use during the call. Set through SetMicrophone.

MuteMicrophone
Boolean

This field can be set to mute the Microphone being used by the component in the given call. When True, the Microphone is muted.

MuteSpeaker
Boolean

This field can be set to mute the Speaker being used by the component in the given call. When True, the Speaker is muted.

Outgoing
Boolean (read-only)

Indicates whether the current call is outgoing. If false, the call is incoming.

Playing
Boolean (read-only)

Indicates whether the current call is playing audio via PlayText or PlayFile, or PlayBytes. After audio transmission is complete, or stopped using StopPlaying, this flag will be false.

Recording
Boolean (read-only)

Indicates whether the current call is recording the received voice from the peer. When the recording is done, this flag will be false. If the recording is stopped via StopRecording, this flag will be false.

RemoteAddress
String (read-only)

The address of the remote host we are communicating with.

RemotePort
Integer (read-only)

The port of the remote host we are communicating with. This field is typically 5060.

RemoteURI
String (read-only)

This field communicates who to call via SIP. This value contains the RemoteUser, RemoteAddress, and the RemotePort, and has the following format:

sip:user@host:port

RemoteUser
String (read-only)

The username or telephone number of the remote user associated with the call.

Speaker
String (read-only)

The speaker currently in use during the call. Set through SetSpeaker.

StartedAt
Long (read-only)

The number of milliseconds since 12:00:00 AM January 1, 1970 when this call started.

State
CallStates

This field indicates the state of the current call. The applicable values are as follows:

csInactive (0)The call is inactive (default setting).
csConnecting (1)The call is establishing a connection to the callee.
csAutConnecting (2)The call is establishing a connection to the callee with authorization credentials.
csRinging (3)The call is ringing.
csActive (4)The call is active.
csActiveInConference (5)The call is active and in a conference.
csDisconnecting (6)The call is disconnecting with the callee.
csAutDisconnecting (7)The call is disconnecting with the callee with authorization credentials.
csHolding (8)The call is currently being placed on hold, but the Hold operation has not finished.
csOnHold (9)The call is currently on hold.
csUnholding (10)The call is currently being unheld, but the Unhold operation has not finished.
csTransferring (11)The call is currently being transferred.
csAutTransferring (12)The call is currently being transferred with authorization credentials.

UserInput
String (read-only)

String representation of digits typed by the callee using their keypad.

Via
String (read-only)

The Via header sent in the most recent SIP request. Identifies the protocol name/version, transport type, IP Address of the User Agent Client, and port of the request.

Constructors

public Call();
Public Call()

Certificate Type

This is the digital certificate being used.

Remarks

This type describes the current digital certificate. The certificate may be a public or private key. The fields are used to identify or select certificates.

Fields

EffectiveDate
String (read-only)

This is the date on which this certificate becomes valid. Before this date, it is not valid. The following example illustrates the format of an encoded date:

23-Jan-2000 15:00:00.

Encoded
String

This is the certificate (PEM/base64 encoded). This field is used to assign a specific certificate. The Store and Subject fields also may be used to specify a certificate.

When Encoded is set, a search is initiated in the current Store for the private key of the certificate. If the key is found, Subject is updated to reflect the full subject of the selected certificate; otherwise, Subject is set to an empty string.

EncodedB
Byte []

This is the certificate (PEM/base64 encoded). This field is used to assign a specific certificate. The Store and Subject fields also may be used to specify a certificate.

When Encoded is set, a search is initiated in the current Store for the private key of the certificate. If the key is found, Subject is updated to reflect the full subject of the selected certificate; otherwise, Subject is set to an empty string.

ExpirationDate
String (read-only)

This is the date the certificate expires. After this date, the certificate will no longer be valid. The following example illustrates the format of an encoded date:

23-Jan-2001 15:00:00.

ExtendedKeyUsage
String

This is a comma-delimited list of extended key usage identifiers. These are the same as ASN.1 object identifiers (OIDs).

Fingerprint
String (read-only)

This is the hex-encoded, 16-byte MD5 fingerprint of the certificate. This property is primarily used for keys which do not have a corresponding X.509 public certificate, such as PEM keys that only contain a private key. It is commonly used for SSH keys.

The following example illustrates the format: bc:2a:72:af:fe:58:17:43:7a:5f:ba:5a:7c:90:f7:02

FingerprintSHA1
String (read-only)

This is the hex-encoded, 20-byte SHA-1 fingerprint of the certificate. This property is primarily used for keys which do not have a corresponding X.509 public certificate, such as PEM keys that only contain a private key. It is commonly used for SSH keys.

The following example illustrates the format: 30:7b:fa:38:65:83:ff:da:b4:4e:07:3f:17:b8:a4:ed:80:be:ff:84

FingerprintSHA256
String (read-only)

This is the hex-encoded, 32-byte SHA-256 fingerprint of the certificate. This property is primarily used for keys which do not have a corresponding X.509 public certificate, such as PEM keys that only contain a private key. It is commonly used for SSH keys.

The following example illustrates the format: 6a:80:5c:33:a9:43:ea:b0:96:12:8a:64:96:30:ef:4a:8a:96:86:ce:f4:c7:be:10:24:8e:2b:60:9e:f3:59:53

Issuer
String (read-only)

This is the issuer of the certificate. This field contains a string representation of the name of the issuing authority for the certificate.

PrivateKey
String (read-only)

This is the private key of the certificate (if available). The key is provided as PEM/Base64-encoded data.

Note: The PrivateKey may be available but not exportable. In this case, PrivateKey returns an empty string.

PrivateKeyAvailable
Boolean (read-only)

This field shows whether a PrivateKey is available for the selected certificate. If PrivateKeyAvailable is True, the certificate may be used for authentication purposes (e.g., server authentication).

PrivateKeyContainer
String (read-only)

This is the name of the PrivateKey container for the certificate (if available). This functionality is available only on Windows platforms.

PublicKey
String (read-only)

This is the public key of the certificate. The key is provided as PEM/Base64-encoded data.

PublicKeyAlgorithm
String

This field contains the textual description of the certificate's public key algorithm. The property contains either the name of the algorithm (e.g., "RSA" or "RSA_DH") or an object identifier (OID) string representing the algorithm.

PublicKeyLength
Integer (read-only)

This is the length of the certificate's public key (in bits). Common values are 512, 1024, and 2048.

SerialNumber
String (read-only)

This is the serial number of the certificate encoded as a string. The number is encoded as a series of hexadecimal digits, with each pair representing a byte of the serial number.

SignatureAlgorithm
String (read-only)

The field contains the text description of the certificate's signature algorithm. The property contains either the name of the algorithm (e.g., "RSA" or "RSA_MD5RSA") or an object identifier (OID) string representing the algorithm.

Store
String

This is the name of the certificate store for the client certificate.

The StoreType field denotes the type of the certificate store specified by Store. If the store is password protected, specify the password in StorePassword.

Store is used in conjunction with the Subject field to specify client certificates. If Store has a value, and Subject or Encoded is set, a search for a certificate is initiated. Please see the Subject field for details.

Designations of certificate stores are platform-dependent.

The following are designations of the most common User and Machine certificate stores in Windows:

MYA certificate store holding personal certificates with their associated private keys.
CACertifying authority certificates.
ROOTRoot certificates.

When the certificate store type is PFXFile, this property must be set to the name of the file. When the type is PFXBlob, the property must be set to the binary contents of a PFX file (i.e. PKCS12 certificate store).

StoreB
Byte []

This is the name of the certificate store for the client certificate.

The StoreType field denotes the type of the certificate store specified by Store. If the store is password protected, specify the password in StorePassword.

Store is used in conjunction with the Subject field to specify client certificates. If Store has a value, and Subject or Encoded is set, a search for a certificate is initiated. Please see the Subject field for details.

Designations of certificate stores are platform-dependent.

The following are designations of the most common User and Machine certificate stores in Windows:

MYA certificate store holding personal certificates with their associated private keys.
CACertifying authority certificates.
ROOTRoot certificates.

When the certificate store type is PFXFile, this property must be set to the name of the file. When the type is PFXBlob, the property must be set to the binary contents of a PFX file (i.e. PKCS12 certificate store).

StorePassword
String

If the type of certificate store requires a password, this property is used to specify the password needed to open the certificate store.

StoreType
CertStoreTypes

This is the type of certificate store for this certificate.

The component supports both public and private keys in a variety of formats. When the cstAuto value is used the component will automatically determine the type. This field can take one of the following values:

0 (cstUser - default)For Windows, this specifies that the certificate store is a certificate store owned by the current user. Note: this store type is not available in Java.
1 (cstMachine)For Windows, this specifies that the certificate store is a machine store. Note: this store type is not available in Java.
2 (cstPFXFile)The certificate store is the name of a PFX (PKCS12) file containing certificates.
3 (cstPFXBlob)The certificate store is a string (binary or base64-encoded) representing a certificate store in PFX (PKCS12) format.
4 (cstJKSFile)The certificate store is the name of a Java Key Store (JKS) file containing certificates. Note: this store type is only available in Java.
5 (cstJKSBlob)The certificate store is a string (binary or base64-encoded) representing a certificate store in Java Key Store (JKS) format. Note: this store type is only available in Java.
6 (cstPEMKeyFile)The certificate store is the name of a PEM-encoded file that contains a private key and an optional certificate.
7 (cstPEMKeyBlob)The certificate store is a string (binary or base64-encoded) that contains a private key and an optional certificate.
8 (cstPublicKeyFile)The certificate store is the name of a file that contains a PEM- or DER-encoded public key certificate.
9 (cstPublicKeyBlob)The certificate store is a string (binary or base64-encoded) that contains a PEM- or DER-encoded public key certificate.
10 (cstSSHPublicKeyBlob)The certificate store is a string (binary or base64-encoded) that contains an SSH-style public key.
11 (cstP7BFile)The certificate store is the name of a PKCS7 file containing certificates.
12 (cstP7BBlob)The certificate store is a string (binary) representing a certificate store in PKCS7 format.
13 (cstSSHPublicKeyFile)The certificate store is the name of a file that contains an SSH-style public key.
14 (cstPPKFile)The certificate store is the name of a file that contains a PPK (PuTTY Private Key).
15 (cstPPKBlob)The certificate store is a string (binary) that contains a PPK (PuTTY Private Key).
16 (cstXMLFile)The certificate store is the name of a file that contains a certificate in XML format.
17 (cstXMLBlob)The certificate store is a string that contains a certificate in XML format.
18 (cstJWKFile)The certificate store is the name of a file that contains a JWK (JSON Web Key).
19 (cstJWKBlob)The certificate store is a string that contains a JWK (JSON Web Key).
21 (cstBCFKSFile)The certificate store is the name of a file that contains a BCFKS (Bouncy Castle FIPS Key Store). Note: this store type is only available in Java and .NET.
22 (cstBCFKSBlob)The certificate store is a string (binary or base64-encoded) representing a certificate store in BCFKS (Bouncy Castle FIPS Key Store) format. Note: this store type is only available in Java and .NET.
23 (cstPKCS11)The certificate is present on a physical security key accessible via a PKCS11 interface.

To use a security key the necessary data must first be collected using the CertMgr component. The ListStoreCertificates method may be called after setting CertStoreType to cstPKCS11, CertStorePassword to the PIN, and CertStore to the full path of the PKCS11 dll. The certificate information returned in the CertList event's CertEncoded parameter may be saved for later use.

When using a certificate, pass the previously saved security key information as the Store and set StorePassword to the PIN.

Code Example: SSH Authentication with Security Key certmgr.CertStoreType = CertStoreTypes.cstPKCS11; certmgr.OnCertList += (s, e) => { secKeyBlob = e.CertEncoded; }; certmgr.CertStore = @"C:\Program Files\OpenSC Project\OpenSC\pkcs11\opensc-pkcs11.dll"; certmgr.CertStorePassword = "123456"; //PIN certmgr.ListStoreCertificates(); sftp.SSHCert = new Certificate(CertStoreTypes.cstPKCS11, secKeyBlob, "123456", "*"); sftp.SSHUser = "test"; sftp.SSHLogon("myhost", 22);

99 (cstAuto)The store type is automatically detected from the input data. This setting may be used with both public and private keys and can detect any of the supported formats automatically.

Subject
String

This is the subject of the certificate used for client authentication.

This field will be populated with the full subject of the loaded certificate. When loading a certificate the subject is used to locate the certificate in the store.

If an exact match is not found, the store is searched for subjects containing the value of the property.

If a match is still not found, the property is set to an empty string, and no certificate is selected.

The special value "*" picks a random certificate in the certificate store.

The certificate subject is a comma separated list of distinguished name fields and values. For instance "CN=www.server.com, OU=test, C=US, E=support@nsoftware.com". Common fields and their meanings are displayed below.

FieldMeaning
CNCommon Name. This is commonly a host name like www.server.com.
OOrganization
OUOrganizational Unit
LLocality
SState
CCountry
EEmail Address

If a field value contains a comma it must be quoted.

SubjectAltNames
String (read-only)

This field contains comma-separated lists of alternative subject names for the certificate.

ThumbprintMD5
String (read-only)

This field contains the MD5 hash of the certificate. It is primarily used for X.509 certificates. If the hash does not already exist, it is automatically computed.

ThumbprintSHA1
String (read-only)

This field contains the SHA-1 hash of the certificate. It is primarily used for X.509 certificates. If the hash does not already exist, it is automatically computed.

ThumbprintSHA256
String (read-only)

This field contains the SHA-256 hash of the certificate. It is primarily used for X.509 certificates. If the hash does not already exist, it is automatically computed.

Usage
String

This field contains the text description of UsageFlags.

This value will be of one or more of the following strings and will be separated by commas:

  • Digital Signatures
  • Key Authentication
  • Key Encryption
  • Data Encryption
  • Key Agreement
  • Certificate Signing
  • Key Signing

If the provider is OpenSSL, the value is a comma-separated list of X.509 certificate extension names.

UsageFlags
Integer

This field contains the flags that show intended use for the certificate. The value of UsageFlags is a combination of the following flags:

0x80Digital Signatures
0x40Key Authentication (Non-Repudiation)
0x20Key Encryption
0x10Data Encryption
0x08Key Agreement
0x04Certificate Signing
0x02Key Signing

Please see the Usage field for a text representation of UsageFlags.

This functionality currently is not available when the provider is OpenSSL.

Version
String (read-only)

This field contains the certificate's version number. The possible values are the strings "V1", "V2", and "V3".

Constructors

public Certificate();
Public Certificate()

Creates a Certificate instance whose properties can be set. This is useful for use with CERTMGR when generating new certificates.

public Certificate(string certificateFile);
Public Certificate(ByVal CertificateFile As String)

Opens CertificateFile and reads out the contents as an X509 public key.

public Certificate(byte[] certificateData);
Public Certificate(ByVal CertificateData As Byte())

Parses CertificateData as an X509 public key.

public Certificate(CertStoreTypes certStoreType, string store, string storePassword, string subject);
Public Certificate(ByVal CertStoreType As CertStoreTypes, ByVal Store As String, ByVal StorePassword As String, ByVal Subject As String)

CertStoreType identifies the type of certificate store to use. See StoreType for descriptions of the different certificate stores. Store is a file containing the certificate store. StorePassword is the password used to protect the store. After the store has been successfully opened, the component will attempt to find the certificate identified by Subject . This can be either a complete or a substring match of the X509 certificate's subject Distinguished Name (DN).

public Certificate(CertStoreTypes certStoreType, string store, string storePassword, string subject, string configurationString);
Public Certificate(ByVal CertStoreType As CertStoreTypes, ByVal Store As String, ByVal StorePassword As String, ByVal Subject As String, ByVal ConfigurationString As String)

CertStoreType identifies the type of certificate store to use. See StoreType for descriptions of the different certificate stores. Store is a file containing the certificate store. StorePassword is the password used to protect the store. ConfigurationString is a newline separated list of name-value pairs that may be used to modify the default behavior. Possible values include "PersistPFXKey", which shows whether or not the PFX key is persisted after performing operations with the private key. This correlates to the PKCS12_NO_PERSIST_KEY CyrptoAPI option. The default value is True (the key is persisted). "Thumbprint" - a MD5, SHA1, or SHA256 thumbprint of the certificate to load. When specified, this value is used to select the certificate in the store. This is applicable to cstUser, cstMachine, cstPublicKeyFile, and cstPFXFile store types. "UseInternalSecurityAPI" shows whether the platform (default) or the internal security API is used when performing certificate-related operations. After the store has been successfully opened, the component will attempt to find the certificate identified by Subject . This can be either a complete or a substring match of the X509 certificate's subject Distinguished Name (DN).

public Certificate(CertStoreTypes certStoreType, string store, string storePassword, byte[] encoded);
Public Certificate(ByVal CertStoreType As CertStoreTypes, ByVal Store As String, ByVal StorePassword As String, ByVal Encoded As Byte())

CertStoreType identifies the type of certificate store to use. See StoreType for descriptions of the different certificate stores. Store is a file containing the certificate store. StorePassword is the password used to protect the store. After the store has been successfully opened, the component will load Encoded as an X509 certificate and search the opened store for a corresponding private key.

public Certificate(CertStoreTypes certStoreType, byte[] storeBlob, string storePassword, string subject);
Public Certificate(ByVal CertStoreType As CertStoreTypes, ByVal StoreBlob As Byte(), ByVal StorePassword As String, ByVal Subject As String)

CertStoreType identifies the type of certificate store to use. See StoreType for descriptions of the different certificate stores. StoreBlob is a string (binary- or base64-encoded) containing the certificate data. StorePassword is the password used to protect the store. After the store has been successfully opened, the component will attempt to find the certificate identified by Subject . This can be either a complete or a substring match of the X509 certificate's subject Distinguished Name (DN).

public Certificate(CertStoreTypes certStoreType, byte[] storeBlob, string storePassword, string subject, string configurationString);
Public Certificate(ByVal CertStoreType As CertStoreTypes, ByVal StoreBlob As Byte(), ByVal StorePassword As String, ByVal Subject As String, ByVal ConfigurationString As String)

CertStoreType identifies the type of certificate store to use. See StoreType for descriptions of the different certificate stores. StoreBlob is a string (binary- or base64-encoded) containing the certificate data. StorePassword is the password used to protect the store. After the store has been successfully opened, the component will attempt to find the certificate identified by Subject . This can be either a complete or a substring match of the X509 certificate's subject Distinguished Name (DN).

public Certificate(CertStoreTypes certStoreType, byte[] storeBlob, string storePassword, byte[] encoded);
Public Certificate(ByVal CertStoreType As CertStoreTypes, ByVal StoreBlob As Byte(), ByVal StorePassword As String, ByVal Encoded As Byte())

CertStoreType identifies the type of certificate store to use. See StoreType for descriptions of the different certificate stores. Store is a string (binary- or base64-encoded) containing the certificate store. StorePassword is the password used to protect the store. After the store has been successfully opened, the component will load Encoded as an X509 certificate and search the opened store for a corresponding private key.

Microphone Type

This is a microphone detected on the system.

Remarks

This type describes a microphone that has been detected on the system.

Fields

Channels
Integer (read-only)

Number specifying whether the device supports mono (1) or stereo (2) output.

ManufacturerId
Integer (read-only)

Manufacturer identifier for the device driver for the device.

Name
String (read-only)

Product name in a null-terminated string.

ProductId
Integer (read-only)

Product identifier for the device as assigned by Windows.

Support
Integer (read-only)

Bitmask of optional functionalities supported by the device. This field can have one or more of the following values OR'd together:

BitmaskFlagDescription
0x0001WAVECAPS_PITCHSupports pitch control.
0x0002WAVECAPS_PLAYBACKRATESupports playback rate control.
0x0004WAVECAPS_VOLUMESupports volume control.
0x0008WAVECAPS_LRVOLUMESupports separate left and right volume control.
0x0010WAVECAPS_SYNCThe driver is synchronous and will block while playing a buffer.
0x0020WAVECAPS_SAMPLEACCURATE Returns sample-accurate position information.

SupportedFormats
Integer (read-only)

Bitmask of standard formats that are supported. This field can have one or more of the following values OR'd together:

BitmaskFormatDescription
0x00000001WAVE_FORMAT_1M0811.025 kHz, mono, 8-bit
0x00000002WAVE_FORMAT_1S0811.025 kHz, stereo, 8-bit
0x00000004WAVE_FORMAT_1M1611.025 kHz, mono, 16-bit
0x00000008WAVE_FORMAT_1S1611.025 kHz, stereo, 16-bit
0x00000010WAVE_FORMAT_2M0822.05 kHz, mono, 8-bit
0x00000020WAVE_FORMAT_2S0822.05 kHz, stereo, 8-bit
0x00000040WAVE_FORMAT_2M1622.05 kHz, mono, 16-bit
0x00000080WAVE_FORMAT_2S1622.05 kHz, stereo, 16-bit
0x00000100WAVE_FORMAT_4M0844.1 kHz, mono, 8-bit
0x00000200WAVE_FORMAT_4S0844.1 kHz, stereo, 8-bit
0x00000400WAVE_FORMAT_4M1644.1 kHz, mono, 16-bit
0x00000800WAVE_FORMAT_4S1644.1 kHz, stereo, 16-bit
0x00001000WAVE_FORMAT_48M0848 kHz, mono, 8-bit
0x00002000WAVE_FORMAT_48S0848 kHz, stereo, 8-bit
0x00004000WAVE_FORMAT_48M1648 kHz, mono, 16-bit
0x00008000WAVE_FORMAT_48S1648 kHz, stereo, 16-bit
0x00010000WAVE_FORMAT_96M0896 kHz, mono, 8-bit
0x00020000WAVE_FORMAT_96S0896 kHz, stereo, 8-bit
0x00040000WAVE_FORMAT_96M1696 kHz, mono, 16-bit
0x00080000WAVE_FORMAT_96S1696 kHz, stereo, 16-bit

Constructors

public Microphone();
Public Microphone()

Speaker Type

This is a speaker detected on the system.

Remarks

This type describes a speaker that has been detected on the system

Fields

Channels
Integer (read-only)

Number specifying whether the device supports mono (1) or stereo (2) output.

ManufacturerId
Integer (read-only)

Manufacturer identifier for the device driver for the device.

Name
String (read-only)

Product name in a null-terminated string.

ProductId
Integer (read-only)

Product identifier for the device as assigned by Windows.

Support
Integer (read-only)

Bitmask of optional functionalities supported by the device. This field can have one or more of the following values OR'd together:

BitmaskFlagDescription
0x0001WAVECAPS_PITCHSupports pitch control.
0x0002WAVECAPS_PLAYBACKRATESupports playback rate control.
0x0004WAVECAPS_VOLUMESupports volume control.
0x0008WAVECAPS_LRVOLUMESupports separate left and right volume control.
0x0010WAVECAPS_SYNCThe driver is synchronous and will block while playing a buffer.
0x0020WAVECAPS_SAMPLEACCURATE Returns sample-accurate position information.

SupportedFormats
Integer (read-only)

Bitmask of standard formats that are supported. This field can have one or more of the following values OR'd together:

BitmaskFormatDescription
0x00000001WAVE_FORMAT_1M0811.025 kHz, mono, 8-bit
0x00000002WAVE_FORMAT_1S0811.025 kHz, stereo, 8-bit
0x00000004WAVE_FORMAT_1M1611.025 kHz, mono, 16-bit
0x00000008WAVE_FORMAT_1S1611.025 kHz, stereo, 16-bit
0x00000010WAVE_FORMAT_2M0822.05 kHz, mono, 8-bit
0x00000020WAVE_FORMAT_2S0822.05 kHz, stereo, 8-bit
0x00000040WAVE_FORMAT_2M1622.05 kHz, mono, 16-bit
0x00000080WAVE_FORMAT_2S1622.05 kHz, stereo, 16-bit
0x00000100WAVE_FORMAT_4M0844.1 kHz, mono, 8-bit
0x00000200WAVE_FORMAT_4S0844.1 kHz, stereo, 8-bit
0x00000400WAVE_FORMAT_4M1644.1 kHz, mono, 16-bit
0x00000800WAVE_FORMAT_4S1644.1 kHz, stereo, 16-bit
0x00001000WAVE_FORMAT_48M0848 kHz, mono, 8-bit
0x00002000WAVE_FORMAT_48S0848 kHz, stereo, 8-bit
0x00004000WAVE_FORMAT_48M1648 kHz, mono, 16-bit
0x00008000WAVE_FORMAT_48S1648 kHz, stereo, 16-bit
0x00010000WAVE_FORMAT_96M0896 kHz, mono, 8-bit
0x00020000WAVE_FORMAT_96S0896 kHz, stereo, 8-bit
0x00040000WAVE_FORMAT_96M1696 kHz, mono, 16-bit
0x00080000WAVE_FORMAT_96S1696 kHz, stereo, 16-bit

Constructors

public Speaker();
Public Speaker()

Config Settings (IPPhone Component)

The component accepts one or more of the following configuration settings. Configuration settings are similar in functionality to properties, but they are rarely used. In order to avoid "polluting" the property namespace of the component, access to these internal properties is provided through the Config method.

IPPhone Config Settings

AuthUser:   Specifies the username to be used during client authentication.

This configuration is used to specify the username to be used when authenticating a SIP client, for example, when registering or initiating a call. When specified, this value will replace the User property within the Authorization and Proxy-Authorization headers sent in the mentioned requests.

By default, this value is empty, and the User property will be used within the mentioned headers.

Codecs:   Comma-separated list of codecs the component can use.

This configuration contains a comma-separated list of codecs, represented as integers, that the component can use to compress call data. By default, this value is:

8,0,3

The following integers correspond to these supported codecs:

0PCMU (G711MU)
3GSM
8PCMA (G711A)

DialTimeout:   Specifies the amount of time to wait for a response when making a call.

This configuration is used to specify the amount of time (in seconds) the component will wait for the outgoing call to be answered, declined, or ignored when using Dial. Note this value will be 60 by default.

When using Dial with the wait parameter as false, the timeout will be reported within DialCompleted.

Domain:   Can be used to set the address of the SIP domain.

This configuration is used to specify the domain name the component will use in SIP requests, if needed. By default this value will be empty.

DtmfMethod:   The method used for delivering the signals/tones sent when typing a digit.

This configuration is used to describe the method being used to transmit the signals/tones when calling TypeDigit. Possible values of supported methods are:

1 Inband (Default)
2 RFC 2833
3 Info (SIP Info)
LogEncodedAudioData:   Whether the component will log encoded audio data.

This configuration controls whether the component will log encoded audio data when LogLevel is set to 3 (Debug). By default, this configuration is false, and the component will only log raw audio data.

LogLevel:   The level of detail that is logged.

This configuration controls the level of detail that is logged through the Log event. Possible values are:

0 (None) No messages are logged.
1 (Info - Default) Informational events such as a call's status are logged.
2 (Verbose) Detailed data such as SIP/SDP packet information is logged.
3 (Debug) Debug data including all relevant sent and received audio bytes are logged.
Note: When LogLevel is set to 3 (Debug), we strongly advise against performing long-running operations inside of this event due to large amounts of sent and received audio bytes. For example, continuously updating an interface displaying the Log data will cause major performance issues in an application. It is recommended to set LogLevel to 3 only when writing Log data to a stream or file. There will be no performance issues in this case.

LogRTPPackets:   Whether the component will log RTP packets.

This configuration controls whether the component will log received RTP packets when LogLevel is set to 3 (Debug). By default, this configuration is false, and the component will only log audio data.

RecordType:   The type of recording the component will use.

This configuration sets the recording type the component will use when calling StartRecording. Possible values are 0 (Mono) and 1 (Stereo - Default).

RedirectLimit:   The maximum number of redirects an outgoing call can experience.

This configuration limits the number of redirects, also known as forwards or diversions, an outgoing call can experience. If the number of redirects exceeds this value, an exception will be thrown. Note this value is 0 by default.

RegistrationInterval:   Specifies the interval between subsequent registration messages.

Once the component is activated, this configuration specifies the amount of time (in seconds) between subsequent registrations. This is used to refresh the current registration and prevent the session's expiration.

SilenceInterval:   Specifies the interval the component uses to detect periods of silence.

This configuration is used to specify the interval (in milliseconds) that the component uses to detect silence from a call's incoming audio stream. This will also directly control the rate that Silence will fire in the case silence is detected. Note this value is 1000 by default.

STUNPort:   The port of the STUN server.

This configuration sets the port of the corresponding STUNServer. This value will be 3478 by default.

STUNServer:   The address of the STUN Server.

This configuration sets the address of the STUN Server the component will use to communicate with the SIP Server.

UnregisterOnActivate:   Specifies whether the component will unregister from the SIP Server before registration.

When calling Activate, this configuration will specify whether the component will unregister with the SIP Server before the initial registration. If False (default), the component will not attempt to unregister first, and will only perform registration.

VoiceIndex:   The voice that will be used when playing text.

This configuration sets the voice that will be used when calling PlayText. The available voice tokens are listed in the registry at HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\Speech\\Voices. Note this value will be 0 by default.

VoiceRate:   The speaking rate of the voice when playing text.

This configuration specifies the speaking rate of the voice when calling PlayText. Supported values range from -10 (slowest) to 10 (fastest). Note this value will be 0 by default.

Base Config Settings

BuildInfo:   Information about the product's build.

When queried, this setting will return a string containing information about the product's build.

GUIAvailable:   Tells the component whether or not a message loop is available for processing events.

In a GUI-based application, long-running blocking operations may cause the application to stop responding to input until the operation returns. The component will attempt to discover whether or not the application has a message loop and, if one is discovered, it will process events in that message loop during any such blocking operation.

In some non-GUI applications, an invalid message loop may be discovered that will result in errant behavior. In these cases, setting GUIAvailable to false will ensure that the component does not attempt to process external events.

LicenseInfo:   Information about the current license.

When queried, this setting will return a string containing information about the license this instance of a component is using. It will return the following information:

  • Product: The product the license is for.
  • Product Key: The key the license was generated from.
  • License Source: Where the license was found (e.g., RuntimeLicense, License File).
  • License Type: The type of license installed (e.g., Royalty Free, Single Server).
  • Last Valid Build: The last valid build number for which the license will work.
MaskSensitive:   Whether sensitive data is masked in log messages.

In certain circumstances it may be beneficial to mask sensitive data, like passwords, in log messages. Set this to true to mask sensitive data. The default is true.

This setting only works on these components: AS3Receiver, AS3Sender, Atom, Client(3DS), FTP, FTPServer, IMAP, OFTPClient, SSHClient, SCP, Server(3DS), Sexec, SFTP, SFTPServer, SSHServer, TCPClient, TCPServer.

UseInternalSecurityAPI:   Tells the component whether or not to use the system security libraries or an internal implementation.

When set to false, the component will use the system security libraries by default to perform cryptographic functions where applicable. In this case, calls to unmanaged code will be made. In certain environments this is not desirable. To use a completely managed security implementation set this setting to true.

Setting this setting to true tells the component to use the internal implementation instead of using the system security libraries.

On Windows, this setting is set to false by default. On Linux/macOS, this setting is set to true by default.

If using the .NET Standard Library, this setting will be true on all platforms. The .NET Standard library does not support using the system security libraries.

Note: This setting is static. The value set is applicable to all components used in the application.

When this value is set the product's system DLL is no longer required as a reference, as all unmanaged code is stored in that file.

Trappable Errors (IPPhone Component)

IPPHONE Errors

201   Timeout error. The error description contains detailed information.
202   Invalid argument error. The error description contains detailed information.
601   Protocol error. The error description contains detailed information.

UDP Errors

104   UDP is already Active.
106   You cannot change the LocalPort while the component is Active.
107   You cannot change the LocalHost at this time. A connection is in progress.
109   The component must be Active for this operation.
112   Cannot change MaxPacketSize while the component is Active.
113   Cannot change ShareLocalPort option while the component is Active.
114   Cannot change RemoteHost when UseConnection is set and the component Active.
115   Cannot change RemotePort when UseConnection is set and the component is Active.
116   RemotePort can't be zero when UseConnection is set. Please specify a valid service port number.
117   Cannot change UseConnection while the component is Active.
118   Message can't be longer than MaxPacketSize.
119   Message too short.
434   Unable to convert string to selected CodePage

SSL Errors

270   Cannot load specified security library.
271   Cannot open certificate store.
272   Cannot find specified certificate.
273   Cannot acquire security credentials.
274   Cannot find certificate chain.
275   Cannot verify certificate chain.
276   Error during handshake.
280   Error verifying certificate.
281   Could not find client certificate.
282   Could not find server certificate.
283   Error encrypting data.
284   Error decrypting data.

TCP/IP Errors

10004   [10004] Interrupted system call.
10009   [10009] Bad file number.
10013   [10013] Access denied.
10014   [10014] Bad address.
10022   [10022] Invalid argument.
10024   [10024] Too many open files.
10035   [10035] Operation would block.
10036   [10036] Operation now in progress.
10037   [10037] Operation already in progress.
10038   [10038] Socket operation on non-socket.
10039   [10039] Destination address required.
10040   [10040] Message too long.
10041   [10041] Protocol wrong type for socket.
10042   [10042] Bad protocol option.
10043   [10043] Protocol not supported.
10044   [10044] Socket type not supported.
10045   [10045] Operation not supported on socket.
10046   [10046] Protocol family not supported.
10047   [10047] Address family not supported by protocol family.
10048   [10048] Address already in use.
10049   [10049] Can't assign requested address.
10050   [10050] Network is down.
10051   [10051] Network is unreachable.
10052   [10052] Net dropped connection or reset.
10053   [10053] Software caused connection abort.
10054   [10054] Connection reset by peer.
10055   [10055] No buffer space available.
10056   [10056] Socket is already connected.
10057   [10057] Socket is not connected.
10058   [10058] Can't send after socket shutdown.
10059   [10059] Too many references, can't splice.
10060   [10060] Connection timed out.
10061   [10061] Connection refused.
10062   [10062] Too many levels of symbolic links.
10063   [10063] File name too long.
10064   [10064] Host is down.
10065   [10065] No route to host.
10066   [10066] Directory not empty
10067   [10067] Too many processes.
10068   [10068] Too many users.
10069   [10069] Disc Quota Exceeded.
10070   [10070] Stale NFS file handle.
10071   [10071] Too many levels of remote in path.
10091   [10091] Network subsystem is unavailable.
10092   [10092] WINSOCK DLL Version out of range.
10093   [10093] Winsock not loaded yet.
11001   [11001] Host not found.
11002   [11002] Non-authoritative 'Host not found' (try again or check DNS setup).
11003   [11003] Non-recoverable errors: FORMERR, REFUSED, NOTIMP.
11004   [11004] Valid name, no data record (check DNS setup).