Skip to main content

Context:
I’ve developed an Azure Function with an HTTP-triggered webhook to capture voicemail events. The goal is to save voicemail transcriptions from all extensions in the company to a database. Currently, I have it working for the logged-in user's voicemails.

Questions:

  1. Is there now an option to receive account-wide voicemail events (i.e., for all extensions) through a single webhook subscription?
    I previously read a post (answered ~2 years ago) stating that such an account-wide event webhook does not exist. Has anything changed since then?

  2. If account-wide events are still not supported, then I assume I’ll need to create individual subscriptions for each extension.

    • What is the best way to retrieve all extensions in a RingCentral account so I can create these subscriptions via my .NET console app?

  3. I'm facing an issue:

    • The webhook is triggered immediately after a voicemail is created, before the transcription attachment is available.

    • Is there a filter or option to delay the webhook call until the transcription is ready?

    • Alternatively, is there a recommended strategy (e.g., polling or a delay) to ensure I receive the transcription with the event?

Here are the answers to all questions:

  1. There is no account-wide event for voicemail notification. However, you can authenticate your app with an admin user and subscribe the voicemail notification for any user in the account and have the right to access/download the voicemail content too,
  2. You don’t have to create separate subscription for each user. Instead, add the extension event filters to the eventFilters array. E.g. 
let eventFilters =  
/restapi/v1.0/account/~/extension/oext 1 ID]/voicemail,
/restapi/v1.0/account/~/extension/oext 2 ID]/voicemail,
/restapi/v1.0/account/~/extension/oext 3 ID]/voicemail,
/restapi/v1.0/account/~/extension/oext n ID]/voicemail
]
  1. What event filter do you use right now? I think the event filter in the example above will fire when the voicemail transcription is ready or if it fails or not supported. Please double check and let me know if the event is fired too soon before the transcript is available. And for  any reason you need to poll, use the message ID from the event payload to call this endpoint to get the voicemail record.

 


Thank you for answering all my questions! 🙂 The second response was especially helpful.

I’m using the voicemail filter at /restapi/v1.0/account/~/extension/~/voicemail, as shown in the code below.

/// <summary>
/// Creates a voicemail notification subscription for all user-enabled extensions.
/// </summary>
public async Task CreateVoicemailSubscriptionAsync()
{
try
{
const string voiceMailFilter = "/restapi/v1.0/account/~/extension/~/voicemail";
var voicemailFilters = newe] { voiceMailFilter };
var request = BuildSubscriptionRequestForVoiceMail(voicemailFilters);
var response = await _client.Restapi().Subscription().Post(request);

ConsolePrinter.Success("Subscription created successfully.");
LogSubscriptionResponse(response);
}
catch (Exception ex)
{
ConsolePrinter.Error("Failed to create subscription: " + ex.Message);
}
}

/// <summary>
/// Builds a CreateSubscriptionRequest object for voicemail filters.
/// </summary>
/// <param name="voicemailFilters">Array of voicemail event filters.</param>
/// <returns>A populated CreateSubscriptionRequest object.</returns>
private CreateSubscriptionRequest BuildSubscriptionRequestForVoiceMail(stringn] voicemailFilters)
{
var verificationToken = TokenGenerator.GenerateVerificationToken(_subscription.Environment);
ConsolePrinter.Info("Verification token for Azure Function (WebhookSecret): " + verificationToken);

return new CreateSubscriptionRequest
{
eventFilters = voicemailFilters,
deliveryMode = new NotificationDeliveryModeRequest
{
transportType = "WebHook",
address = rcProvider.DeliveryAddress,
verificationToken = verificationToken
},
expiresIn = _subscription.ExpiresInSeconds
};
}

 

Please double check and let me know if the event is fired too soon before the transcript is available.

In my testing so far, it has always triggered immediately. I’m sharing one of the payloads with you.

As a result, I’m now reluctantly relying on calling the Message endpoint /restapi/v1.0/account/~/extension/~/message-store/{messageId}, which is unnecessary and adds an extra hit to the RingCentral API, just to retrieve the transcription after waiting for 20 seconds.

 

 

I'm confident that if you try it on your end, you'll get the same results. 

 

If we can resolve this, we can eliminate one unnecessary hit to the RingCentral API. Alternatively, could you suggest a filter or another approach that would allow me to create a subscription with an option to receive a notification once the voicemail transcription is ready?


You are right about the voicemail event with the vmTranscrioptionStatus = InProgress. It depends on the length of the voicemail though. In my test, if the voicemail is short (around 1 min) then the status in the event is “Completed”, if the length of the voicemail is longer than a min, then the status in the event it “InProgress”. I think the voicemail event notification subscription has a threshold to fire the event. For now, the best solution is to check the status, if it’s completed, then proceed the normal way you need to process the voicemail, if it’s “InProgress” then set a delay then poll it using the /message-store/messageId API to read/check then proceed accordingly etc.

I will check with the team to see if this can be improved in some way to avoid the polling.


Reply