The ININ.IceLib.UnifiedMessaging namespace contains classes for manipulating and managing Interaction Center Voicemails and Faxes.

Working with Voicemails

The voicemail functionality is implemented by classes that allow you to manage and playback voice messages received by an IC server as well as to monitor for new incoming messages.

Voicemail Retrieval

A list of current voicemail messages can be retrieved via the Voicemails property on the UnifiedMessagingManager class. To populate this list, the local Voicemail Cache must first be refreshed by calling RefreshVoicemailCache(Int32). A call to RefreshVoicemailCache(Int32) can be made at any time. Refreshing the cache will cause the following events to be fired, if applicable: NewVoicemail, VoicemailUpdated, or VoicemailDeleted.

Voicemail Playback

The primary playback functionality is available through the VoicemailMessage class. This class allows a developer to play a voice message to any of the following locations:

An instance of a VoicemailMessage contains zero or more VoicemailAttachment items. Each VoicemailAttachment represents an attachment to the voicemail that can be downloaded to a local file by calling SaveAsFile(VoicemailAttachment, String, Boolean).

Note
A VoicemailAttachment may (or may not) reference an audio file. When unified messaging is employed such that voicemails are stored within email messages, other arbitrary files can be added to the email (and show up as a VoicemailAttachment).

Examples

The example below iterates the list of available voicemail messages and downloads each message to a new local file. It is not recommended to use synchronous methods in client applications, nor is it recommended to download all voicemail files in this manner. This is purely a syntax usage example only.

CopyC#
// "session" is a valid ININ.IceLib.Connection.Session instance.
UnifiedMessagingManager manager = UnifiedMessagingManager.GetInstance(session);
manager.RefreshVoicemailCache(-1);
foreach (VoicemailMessage message in manager.Voicemails)
{
  foreach (VoicemailAttachment attachment in message.Attachments)
  {
    string fileName = System.IO.Path.GetTempFileName();
    message.SaveAsFile(attachment, fileName, false /* Don't mark as read */);
  }
}

Working with Faxes

The Fax functionality consists of a set of classes that allow you to manipulate and submit Faxes to an IC server for delivery, monitor all outgoing Fax activity for a logged-in user, and manage and download Fax messages received by an IC server.

Fax Retrieval

A list of current Fax messages can be retrieved via the Faxes property on the UnifiedMessagingManager class. To populate this list, the local Fax Cache must first be refreshed by calling RefreshFaxCache(Int32). A call to RefreshFaxCache(Int32) can be made at any time. Refreshing the cache will cause the following events to be fired, if applicable: NewFax, FaxUpdated, or FaxDeleted.

An instance of a FaxMessage contains zero or more FaxAttachment items. Each FaxAttachment represents an attachment to the Fax message that can be downloaded to a local file by calling SaveAsFile(FaxAttachment, String, Boolean).

Note
A FaxAttachment may (or may not) reference a Fax file. When unified messaging is employed such that Faxes are stored within email messages, other arbitrary files can be added to the Email (and show up as a FaxAttachment).

Examples

The example below iterates the list of available Fax messages and downloads each message to a new local file. It is not recommended to use synchronous methods in client applications, nor is it recommended to download all Fax files in this manner. This is purely a syntax usage example only.

CopyC#
// "session" is a valid ININ.IceLib.Connection.Session instance.
UnifiedMessagingManager manager = UnifiedMessagingManager.GetInstance(session);
manager.RefreshFaxCache(-1);
foreach (FaxMessage message in manager.Faxes)
{
  foreach (FaxAttachment attachment in message.Attachments)
  {
    string fileName = System.IO.Path.GetTempFileName();
    message.SaveAsFile(attachment, fileName, false /* Don't mark as read */);
  }
}

Fax Sending and Monitoring

Functionality that includes sending and monitoring Interaction Faxes are separated into a collection of Images, Attributes and Envelopes all available through a central class, FaxFile.

In addition to the viewing and editing capability exposed through the FaxFile, you also have the ability to send a Fax through the IC server. Faxes are addressed by using the AddEnvelope(FaxEnvelope) method on the FaxFile to add a new FaxEnvelope. Once a Fax has been assigned one or more envelopes, it is ready to be used in a call to SendFax(String) to have it submitted to the IC server for delivery.

Monitoring the status of outgoing Faxes is enabled through a call to EnableFaxMonitoring(Boolean). An application that has enabled monitoring for an IC user will periodically receive FaxMonitorUpdate events to indicate the state of each Fax being processed on the IC server on behalf of that user.


Examples

The following example demonstrates the processing of an incoming FaxMonitorUpdate event.

CopyC#
...
private delegate void UpdateStatusListDel(FaxStatus statusUpdate);

private void FaxMonitorUpdateHandler(object sender, FaxMonitorUpdateEventArgs e)
{
    if (this.InvokeRequired)
    {
        UpdateStatusListDel del = new UpdateStatusListDel(UpdateStatusList);
        this.BeginInvoke(del, new object[]{e.FaxStatus});
    }
    else
    {
        UpdateStatusList(e.FaxStatus);
    }
}

private void UpdateStatusList(FaxStatus statusUpdate)
{
    if (statusUpdate.Code == FaxStatusCode.None)
    {
        // Ignoring update for invalid status.
        return;
    }

    // Search for a row containing the envelope ID.  If we don't find it
    // then add a new row, otherwise update the current line
    ListViewItem newItem = null;
    BuildListItem(statusUpdate, out newItem);

    int nItemIdx = FindEnvelopeInList(statusUpdate.EnvelopeId);
    if (nItemIdx != -1)
    {
        // Replacing envelope at nItemIdx with new item
        statusList.Items[nItemIdx] = newItem;
    }
    else
        statusList.Items.Add(newItem);
}

private int FindEnvelopeInList(Int64 searchId)
{
    int nEnvelopeIndex = -1;
    lock (statusList.Items)
    {
        foreach (ListViewItem currentItem in this.statusList.Items)
        {
            Int64 envelopeId = (Int64)currentItem.Tag;
            if (searchId == envelopeId)
            {
                nEnvelopeIndex = this.statusList.Items.IndexOf(currentItem);
                break;
            }
        }
    }

    return nEnvelopeIndex;
}

Classes

  ClassDescription
Public classAsyncGetFaxPropertiesEventArgs
Public classAsyncGetFaxServerSettingsCompletedEventArgs
Public classAsyncSaveAsFileCompletedEventArgs
Public classAsyncSendFaxCompletedEventArgs
Provides data for the SendFaxAsync(String, EventHandler<(Of <<'(AsyncSendFaxCompletedEventArgs>)>>), Object) completedCallback that occurs when the asynchronous operation completes.
Public classAttributeEventArgs
Provides data for the Fax attribute change event.
Public classFaxAddressee
The addressee who will be receiving a Fax.
Public classFaxAttachment
Represents an attachment (containing the actual Fax file) in a FaxMessage.
Public classFaxCoverPageTemplate
The information used to control generation of a Fax cover page.
Public classFaxDeliveryNotification
Controls notifications about the delivery state of a Fax.
Public classFaxDeliverySchedule
Controls when a Fax will be delivered to an addressee.
Public classFaxEnvelope
Stores information related to the delivery of a Fax file.
Public classFaxEnvelopeProperties
Class to contain the properties of a fax in progress. An instance of FaxEnvelopeProperties is created as a result of a call to GetFaxProperties(Int64) or GetFaxPropertiesAsync(Int64, EventHandler<(Of <<'(AsyncGetFaxPropertiesEventArgs>)>>), Object). In the case of the latter this object is returned in the AsyncGetFaxPropertiesEventArgs object. Objects of this class contain all of the important information about a fax and can be used whenever you want to display properties of an on-going fax.

Examples

The following example demonstrates getting the properties of an on-going fax.
CopyC#
  private void GetFaxProperties(FaxStatus status)
  {
        if (_UnifiedMessagingManager != null)
        {
            _UnifiedMessagingManager.GetFaxPropertiesAsync(Convert.ToInt32(status.EnvelopeId), new EventHandler<AsyncGetFaxPropertiesEventArgs>(OnGetFaxPropertiesCompleted), null);
        }
 }
 private void OnGetFaxPropertiesCompleted(object sender, AsyncGetFaxPropertiesEventArgs args)
{
    if (args.Error != null)
    {
        MessageBox.Show(this, args.Error.Message, "Fax Monitor", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
    }
    else
    {
        //Do something here to display the fax properties data
    }
}
Public classFaxEventArgs
Provides data for the NewFax, FaxDeleted, and FaxUpdated events.
Public classFaxFile
Provides an interface for manipulating Fax files on a file system in .i3f or .TIF format.
Public classFaxMessage
Represents a Fax message within the Interaction Center system.
Public classFaxMonitorUpdateEventArgs
Provides the FaxStatus for the FaxMonitorUpdate event.
Public classFaxPageAttributes
Specifies display preferences used to render a Fax page image.
Public classFaxPageSettings
Stores information on how a fax page is to be formatted when it is sent.
Public classFaxRecipient
Represents a recipient of a FaxMessage.
Public classFaxResult
Represents the result of a send Fax operation.
Public classFaxServerSettings
Represents the Fax configuration settings on an IC server.
Public classFaxStatus
Represent the progress of a Fax that was submitted for delivery.
Public classFaxTransmitOptions
Represents Fax device configuration information.
Public classRateLimitedException
The exception that is thrown when requests to refresh a voicemail or fax have been sent too frequently.
Public classUnifiedMessagingManager
Provides access to the UnifiedMessaging namespace.
Public classVoicemailAttachment
Represents an attachment (containing the actual Voicemail message) in a VoicemailMessage.
Public classVoicemailEventArgs
Provides data for the NewVoicemail, VoicemailDeleted, and VoicemailUpdated events.
Public classVoicemailMessage
Represents a Voicemail message within the Interaction Center system.
Public classVoicemailRecipient
Represents both a recipient and sender of a VoicemailMessage.
Public classVoicemailServerPlayResultEventArgs
Provides data for the VoicemailServerPlayResult event.
Public classVoiceMessageServerPlayResult
The result sent back from the server when a Voicemail was played to the user.

Structures

  StructureDescription
Public structurePageResolution
Represent the vertical and horizontal resolution of a Fax Page.

Enumerations

  EnumerationDescription
Public enumerationCallFailureType
Indicates the type of call failure occurring during fax transmission.
Public enumerationEventAttributeType
Indicates the attribute that changed to trigger an attribute change event.
Public enumerationFaxColorScheme
Indicates the color choice for displaying a Fax page.
Public enumerationFaxDeliveryType
Indicates when a fax should be delivered.
Public enumerationFaxImageQuality
Specifies the resolutions that can be used for the fax image.
Public enumerationFaxImageSettings
Provides flags indicating how an image should be processed in preparation for faxing.
Public enumerationFaxOrientation
Indicates orientation for a Fax page (horizontal and vertical).
Public enumerationFaxPageSize
Enumerates various paper sizes that can be used for faxing.
Public enumerationFaxRotation
Indicates direction of rotation for a Fax page.
Public enumerationFaxStatusCode
Indicates the current status of a fax.
Public enumerationRetryStrategyType
Determines the strategy employed on how a fax should be resent.
Public enumerationStorageFormat
Indicates the storage format used when loading or saving Fax data in files.

Version Information

Supported for IC Server version 2015 R1 and beyond.
For 4.0, supported for IC Server version 4.0 GA and beyond.
For 3.0, supported for IC Server version 3.0 GA and beyond.