Skip to content

4.3.69

Compare
Choose a tag to compare
@k-anderson k-anderson released this 09 Dec 23:22
· 291 commits to 4.3 since this release

Generic badge

Changes for 4.3.69

Changes to branch 4.3 after version 4.3.68.

Commits
  • - kazoo_speech: ASR Billing Features and kazoo_asr Refactor - by John White

    This PR enhances the kazoo_speech application by augmenting the

    kazoo_asr abstraction as well as introduce new billing features.

    • Add transcribe field to the mailbox schema

    • Add and export callbacks togen_asr_provider for content-types

    • Enhance the kazoo_asr behavior to handle default and accepted

    content types on behalf of the specific providers

    • Create an abstraction for ASR requests

    • Create account ledger entries on successful transcription as well as

    the impact the reseller ledgers.

    • Create asr_flat_rate module to handle flat rate billing of ASR

    requests.

    • Create quantifiers in kz_services for asr transcriptions.
    
    "asr": {
    
    "google": {
    
    "rate": 1,
    
    "name": "Google ASR"
    
    },
    
    "ispeech": {
    
    "rate": 1,
    
    "name": "ispeech ASR"
    
    }
    
    },
    
    "plan": {
    
    ....
    
    "voicemails": {
    
    "mailbox": {
    
    "name": "Voicemail Box",
    
    "rate": 1.99,
    
    "cascade": true
    
    },
    
    "transcription": {
    
    "cascade": true,
    
    "rate": 1,
    
    "name": "VMBox Transcription MRC"
    
    }
    
    },
    
    ....
    
    

    The only configuration change in this PR is adding the transcribe

    flag to the JSON schema.

    Two new callbacks have been added to gen_asr_provider to help

    facilitate a more generic approach to handling the preferred

    content-types for a provider as well as act as a gatekeeper and help

    identify if conversion is required or even currently supported for the

    submitted media.

    • preferred_content_type/0

    • accepted_content_types/0

    This callback is designed to return the ASR provider's preferred

    content-type for requests.

    This callback is designed to return the accepted content-types and

    assist in determining if the media payload will require conversion.

    The content-type callbacks have been added to kazoo_asr as well any

    kapps_config calls from the current providers in favor of keeping

    with the abstraction.

    Originally the ASR logic was hardcoded into the voicemail notify and

    save logic in kvm_util. I've removed that and replaced it with an

    asr_request.

    The asr_request module is designed to be a generic request type to

    handle creating and servicing ASR requests which are proxied with

    kazoo_asr to the configured provider.. Additionally it also handles

    the billing and services logic and introduces a asr_flat_rate module

    that can consult an ASR service plan item for rates.

    The long term vision is to create a primitive that can in the future

    could be augmented to handle multiple types of ASR requests apart from

    file conversion (i.e. streaming from an active call).

    I've added some placeholder fields in #asr_req record should metered

    billing be desired.

    asr_flat_rate is the only and default billing_method for an

    asr_request.

    It is patterned after jonny5 and aims to perform the following actions

    on an asr_req:

    • authorize

    account and reseller have funds

    • debit

    ledger entries created for account and reseller if configured

    Some ASR primitives have been gently introduced into kz_services: -

    asr getter methods have been added to kzd_service_plans and

    kz_service_plans - default quantifiers for transcribe enabled

    maiboxes in services.hrl - kz_services_asr module for interacting

    with the transcription usage ledgers

  • Include custom SIP headers in Pivot request - by James Aimonetti

    When the INVITE arrives with custom SIP headers, include those in the Pivot request so the receiving web service can make appropriate decisions.