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:
- Telephone Handset (PlayToHandset(VoicemailAttachment, Boolean)) - The handset associated with the station a user is currently logged into. In the case of SIP audio this handset would be speakers or headphones. In a traditional phone setup the handset is typically a phone receiver.
- Number (PlayToNumber(VoicemailAttachment, String, Boolean, Boolean)) - A remote phone number
- Station (PlayToStation(VoicemailAttachment, String, Boolean, Boolean)) - A station defined in IC
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.
// "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
// "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
... 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
Class | Description | |
---|---|---|
AsyncGetFaxPropertiesEventArgs |
Provides data for the GetFaxPropertiesAsync(Int64, EventHandler<(Of <<'(AsyncGetFaxPropertiesEventArgs>)>>), Object) completedCallback.
| |
AsyncGetFaxServerSettingsCompletedEventArgs |
Provides data for the GetFaxServerSettingsAsync(EventHandler<(Of <<'(AsyncGetFaxServerSettingsCompletedEventArgs>)>>), Object) completedCallback.
| |
AsyncSaveAsFileCompletedEventArgs | ||
AsyncSendFaxCompletedEventArgs |
Provides data for the SendFaxAsync(String, EventHandler<(Of <<'(AsyncSendFaxCompletedEventArgs>)>>), Object) completedCallback
that occurs when the asynchronous operation completes.
| |
AttributeEventArgs |
Provides data for the Fax attribute change event.
| |
FaxAddressee |
The addressee who will be receiving a Fax.
| |
FaxAttachment |
Represents an attachment (containing the actual Fax file) in a FaxMessage.
| |
FaxCoverPageTemplate |
The information used to control generation of a Fax cover page.
| |
FaxDeliveryNotification |
Controls notifications about the delivery state of a Fax.
| |
FaxDeliverySchedule |
Controls when a Fax will be delivered to an addressee.
| |
FaxEnvelope |
Stores information related to the delivery of a Fax file.
| |
FaxEnvelopeProperties |
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 } } | |
FaxEventArgs | ||
FaxFile |
Provides an interface for manipulating Fax files on a file system in .i3f or .TIF format.
| |
FaxMessage |
Represents a Fax message within the Interaction Center system.
| |
FaxMonitorUpdateEventArgs |
Provides the FaxStatus for the FaxMonitorUpdate event.
| |
FaxPageAttributes |
Specifies display preferences used to render a Fax page image.
| |
FaxPageSettings |
Stores information on how a fax page is to be formatted when it is sent.
| |
FaxRecipient |
Represents a recipient of a FaxMessage.
| |
FaxResult |
Represents the result of a send Fax operation.
| |
FaxServerSettings |
Represents the Fax configuration settings on an IC server.
| |
FaxStatus |
Represent the progress of a Fax that was submitted for delivery.
| |
FaxTransmitOptions |
Represents Fax device configuration information.
| |
RateLimitedException |
The exception that is thrown when requests to refresh a voicemail or fax have been sent too frequently.
| |
UnifiedMessagingManager |
Provides access to the UnifiedMessaging namespace.
| |
VoicemailAttachment |
Represents an attachment (containing the actual Voicemail message) in a VoicemailMessage.
| |
VoicemailEventArgs | ||
VoicemailMessage |
Represents a Voicemail message within the Interaction Center system.
| |
VoicemailRecipient |
Represents both a recipient and sender of a VoicemailMessage.
| |
VoicemailServerPlayResultEventArgs |
Provides data for the VoicemailServerPlayResult event.
| |
VoiceMessageServerPlayResult |
The result sent back from the server when a Voicemail was played to the user.
|
Structures
Structure | Description | |
---|---|---|
PageResolution |
Represent the vertical and horizontal resolution of a Fax Page.
|
Enumerations
Enumeration | Description | |
---|---|---|
CallFailureType |
Indicates the type of call failure occurring during fax transmission.
| |
EventAttributeType |
Indicates the attribute that changed to trigger an attribute change event.
| |
FaxColorScheme |
Indicates the color choice for displaying a Fax page.
| |
FaxDeliveryType |
Indicates when a fax should be delivered.
| |
FaxImageQuality |
Specifies the resolutions that can be used for the fax image.
| |
FaxImageSettings |
Provides flags indicating how an image should be processed in preparation for faxing.
| |
FaxOrientation |
Indicates orientation for a Fax page (horizontal and vertical).
| |
FaxPageSize |
Enumerates various paper sizes that can be used for faxing.
| |
FaxRotation |
Indicates direction of rotation for a Fax page.
| |
FaxStatusCode |
Indicates the current status of a fax.
| |
RetryStrategyType |
Determines the strategy employed on how a fax should be resent.
| |
StorageFormat |
Indicates the storage format used when loading or saving Fax data in files.
|
Version Information
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.