# Class: VoiceMessaging

## Constructor

#### new VoiceMessaging()

  Provides voice messaging informational functionality to the application. Voice Messaging service can be used to retrieve current user's voice mail number or to know if there are any new messages in the voice mail.

  Please note that to dial the voice mail number, the application needs to use Calls service.
  This class doesn't provide call functionality. It gives only the information required to work with voice messaging using Calls service.

  ##### See:

    - {AvayaClientServices.Services.Call.Calls}

## Methods

#### getVoicemailNumber() → {string|undefined}

  Returns the user’s voice mail number, if any, or an undefined value otherwise.

  ##### Returns:

  { string | undefined }

#### getVoiceMessagingStatus() → {AvayaClientServices.Services.VoiceMessaging.VoiceMessagingStatusParameters}

  Returns the voice messaging status object.

  ##### Returns:

  { AvayaClientServices.Services.VoiceMessaging.VoiceMessagingStatusParameters }

### Callbacks

#### addOnVoicemailNumberChangedCallback(callback)

  Add new onVoicemailNumberChangedCallback.

  ##### Parameters:

  Name | Type | Description
  --- | --- | ---
  `callback` | AvayaClientServices.Services.VoiceMessaging.VoiceMessaging#onVoicemailNumberChangedCallback |

#### addOnVoiceMessagingServiceAvailableCallback(callback)

  Adds new onVoiceMessagingServiceAvailableCallback.

  ##### Parameters:

  Name | Type | Description
  --- | --- | ---
  `callback` | AvayaClientServices.Services.VoiceMessaging.VoiceMessaging#onVoiceMessagingServiceAvailableCallback |

#### addOnVoiceMessagingServiceUnavailableCallback(callback)

  Adds new onVoiceMessagingServiceUnavailableCallback.

  ##### Parameters:

  Name | Type | Description
  --- | --- | ---
  `callback` | AvayaClientServices.Services.VoiceMessaging.VoiceMessaging#onVoiceMessagingServiceUnavailableCallback |

#### addOnVoiceMessagingStatusChangedCallback(callback)

  Add new onVoiceMessagingStatusChangedCallback.

  ##### Parameters:

  Name | Type | Description
  --- | --- | ---
  `callback` | AvayaClientServices.Services.VoiceMessaging.VoiceMessaging#onVoiceMessagingStatusChangedCallback |

#### removeOnVoicemailNumberChangedCallback(callback)

  Removes existing onVoicemailNumberChangedCallback.

  ##### Parameters:

  Name | Type | Description
  --- | --- | ---
  `callback` | AvayaClientServices.Services.VoiceMessaging.VoiceMessaging#onVoicemailNumberChangedCallback |

#### removeOnVoiceMessagingServiceAvailableCallback(callback)

  Removes existing onVoiceMessagingServiceAvailableCallback.

  ##### Parameters:

  Name | Type | Description
  --- | --- | ---
  `callback` | AvayaClientServices.Services.VoiceMessaging.VoiceMessaging#onVoiceMessagingServiceAvailableCallback |

#### removeOnVoiceMessagingServiceUnavailableCallback(callback)

  Removes existing onVoiceMessagingServiceUnavailableCallback.

  ##### Parameters:

  Name | Type | Description
  --- | --- | ---
  `callback` | AvayaClientServices.Services.VoiceMessaging.VoiceMessaging#onVoiceMessagingServiceUnavailableCallback |

#### removeVoiceMessagingStatusChangedCallback(callback)

  Removes existing onVoiceMessagingStatusChangedCallback.

  ##### Parameters:

  Name | Type | Description
  --- | --- | ---
  `callback` | AvayaClientServices.Services.VoiceMessaging.VoiceMessaging#onVoiceMessagingStatusChangedCallback |

### Capabilities

#### getSubscribeForVoicemailNumberChangesCapability() → {AvayaClientServices.Base.Capability}

  Returns the capability indicating whether it's possible to subscribe for notifications on the user's voice mail number changes.

  ##### Returns:

  { AvayaClientServices.Base.Capability }

  Capability object indicating whether it's possible to subscribe for notifications on the user's voice mail number changes.

#### getSubscribeForVoiceMessagingStatusChangesCapability() → {AvayaClientServices.Base.Capability}

  Returns the capability indicating whether it's possible to subscribe for notifications on the user's voice messaging status changes.

  ##### Returns:

  { AvayaClientServices.Base.Capability }

  Capability object indicating whether it's possible to subscribe for notifications on the user's voice messaging status changes.

## Type Definitions

#### onVoicemailNumberChangedCallback(number)

  Interface for the callback function to be invoked if the user's voice mail number is changed.

  ##### Parameters:

  Name | Type | Description
  --- | --- | ---
  `number` | string | New voice mail number.

#### onVoiceMessagingServiceAvailableCallback(voiceMessaging)

  Interface for the callback function to be invoked when voice messaging service is available.

  ##### Parameters:

  Name | Type | Description
  --- | --- | ---
  `voiceMessaging` | AvayaClientServices.Services.VoiceMessaging.VoiceMessaging | An instance of voice messaging module.

#### onVoiceMessagingServiceUnavailableCallback(voiceMessaging)

  Interface for the callback function to be invoked when voice messaging service is unavailable.

  ##### Parameters:

  Name | Type | Description
  --- | --- | ---
  `voiceMessaging` | AvayaClientServices.Services.VoiceMessaging.VoiceMessaging | An instance of voice messaging module.

#### onVoiceMessagingStatusChangedCallback(voiceMessagingStatus)

  Interface for the callback function to be invoked when the status of the message waiting indicator is changed.

  ##### Parameters:

  Name | Type | Description
  --- | --- | ---
  `voiceMessagingStatus` | AvayaClientServices.Services.VoiceMessaging.VoiceMessagingStatusParameters |