Integration demos

Introduction

In this section, you will find various practical use cases demonstrating how to adapt and use Banafo's on-premise models or the Banafo hosted API in with your infrastructure. The documentation is designed to guide you through each demo, providing detailed information on their setup and usage. Follow the step-by-step instructions to integrate these models into your own environment seamlessly.

Auto Uploader


Introduction

Banafo's Auto Uploader app is a straightforward application that runs in the background, continuously scanning audio directories you configure. It automatically transcribes any audio files found in these directories and saves the transcripts in a text file of your choice.

Prerequisites:

  • Python >= 3.9+
  • Ensure your models for pre-recorded audio are ready. You have two options: use on-premise models or the Banafo hosted API.

    • For on-premise models, follow the setup instructions here.
    • For the hosted API, register and generate your API key following the instructions here.

Supported Audio Formats:

  • .wav
  • .gsm
  • .mp3

Setup

  1. Clone the Auto Uploader repository

    git clone https://github.com/banafo-ai/banafo-asr.git
    cd integration-demos/auto_uploader
    
  2. Run the installation script:

    ./install.sh
    
  3. Configure your directories to monitor for audio files (you can add multiple directories). Make sure to specify either --api and --lang for our Banafo hosted server or --uri for your on-premise server.

    • If using the Banafo hosted API, provide your API key with the --api parameter.

          cd ../python/
          ./auto_uploader.py -x insert --lang en-US --api 1b4a82e0-54b0-11ef-2ac2-a5860d6a4a87.86b3fec75502ad01438446d15ca57ea79ab6a4f8 --path /urs/local/my-audio-location/ --txt /urs/local/my-transcripts-location/
      
          systemctl restart auto_uploader_events.service
      
    • If using your on-premise server, provide the server URI with the --uri parameter for the Auto Uploader to generate your transcripts.

          cd ../python/
          ./auto_uploader.py -x insert --uri ws://127.0.0.1:6006/ --path /urs/local/my-audio-location/ --txt /urs/local/my-transcripts-location/
      
          systemctl restart auto_uploader_events.service
      

    Note:

    • Replace /urs/local/my-audio-location/ with your preferred audio directory.

    • Replace /urs/local/my-transcripts-location/ with your preferred directory for transcript storage. If omitted, transcripts will be stored in a .txt file inside the Auto Uploader folder.

    • Full list of languages you can find here

  4. Check full list of configuration parameters(details here):

    ./auto_uploader.py
    

Using the default installation script, the Auto Uploader will automatically detect if there is an Asterisk or Freeswitch installation on your machine. If such installations are found, their directories will be added to the list of directories to monitor.

After a successful installation, you will notice:

  • The installation will be placed inside /usr/local/auto_uploader/ directory. Make sure you use this app from the source or installation directory.
  • A new systemd service called auto_uploader_events will be enabled. This daemon will monitor the preconfigured (or default) directories and generate a transcript whenever a new audio file appears. In case you decide do disable this service, you will need to manually run the scanning using the option to upload listed here

Additional options

In this section, you will find a list of additional customization possibilies for your Auto Uploader setup. After following the instruction in the Setup section, you will have the default version of the Auto Uploader installed. The following allow you to configure the app to suit your custom needs.

For any of the next customizations explained, you need to use the ./auto_uploader.py script with the specified parameters.

Most common parameters:

  • -x list: Lists the directories currently monitored by the Auto Uploader.

Example:

./auto_uploader.py -x list
  • -x insert --path=PATH --uri=URI --txt=DIR: Adds more directories to the list of monitored directories for audio files with specified on-premise transcript URI and txt location.

Example:

./auto_uploader.py -x insert --uri ws://127.0.0.1:6006/ --path /urs/local/my-audio-location/ --txt /urs/local/my-transcripts-location/

Note: After executing the insert command, you need to restart the Auto Uploader service:

systemctl restart auto_uploader_events.service
  • -x insert --path=PATH --api=API-KEY --txt=DIR: Adds more directories to the list of monitored directories for audio files using the Banafo hosted API with specified API key and txt location.

Example:

./auto_uploader.py -x insert --api 1b4a82e0-54b0-11ef-2ac2-a5860d6a4a87.86b3fec75502ad01438446d15ca57ea79ab6a4f8 --path /urs/local/my-audio-location/ --txt /urs/local/my-transcripts-location/

Note: After executing the insert command, you need to restart the Auto Uploader service:

systemctl restart auto_uploader_events.service
  • -x remove --id=ID: Removes a directory from the list of monitored directories by its ID (ID can be checked using the list command).

Example:

./auto_uploader.py -x remove --id=2

Note: After executing the remove command, you need to restart the Auto Uploader service:

systemctl restart auto_uploader_events.service
  • -x pending: Shows a list of files pending transcription.

Example:

./auto_uploader.py -x pending
  • -x success: Shows a list of successfully transcribed files.

Example:

./auto_uploader.py -x success
  • -x errors: Shows a list of files that failed to get transcribed with their error.

Example:

./auto_uploader.py -x errors
  • -x upload: Triggers a manual scan of the directories in the list and generates transcripts for the files that have not yet been transcribed. Make sure you execute this command as root as it will need root permissions to write the transcript in a file.

Example:

sudo ./auto_uploader.py -x upload
  • -x delete: Clears all files in the database regardless of their status (pending, success, error). After executing this command, all files will be treated as not transcribed, allowing for manual upload to be performed.

Example:

./auto_uploader.py -x delete

Full list of options:

./auto_uploader.py 

Uninstall:

In case you want to remove the Auto Uploader app, run the following uninstall script:

./uninstall.sh

Note: The script will only remove the Banafo Auto Uploader application files. Your audio files and transcripts generated so far will not be removed.


FreeSwitch

Connect your PBX with the Banafo Dashboard

By setting up our Auto Uploader app as described below, you can connect FreeSwitch to Banafo and leverage the Banafo interface to streamline your workflow. Key benefits include:

  • Automatic transcription and upload of your call recordings to the Banafo Dashboard
  • Effortless access to recordings and AI-generated insights, all in one centralized platform
  • Call Classification (based on subject, outcome, success rate, product, intent, urgency)
  • Call Content Analysis (extract subject, summaries, key action points, named entities)
  • Chat with your Transcript (ask additional question)

You can setup via the following these steps:

  1. Clone the Auto Uploader repository

    git clone https://github.com/banafo-ai/banafo-asr.git
    cd banafo-asr/integration-demos/auto_uploader/scripts
    
  2. Run the installation script:

    ./install.sh
    
  3. Configure your FreeSwitch recording's directory to get monitored. Make sure to specify --api and --lang for your recordings.

    cd /usr/local/auto_uploader/python/
    ./auto_uploader.py -x insert --lang languageHere --api apiKeyHere --path /urs/local/my-FREESWITCH-audio-location/ --http 1
    
    systemctl restart auto_uploader_events.service
    

    Note:

    • Replace /urs/local/my-FREESWITCH-audio-location/ with your FreeSwitch audio directory.

    • Replace languageHere with the code for your preferred language. See the list of supported languages here.

    • Replace apiKeyHere with your apiKey. If you don't have one yet, generate it at your PBX configuration page.

  4. To fully benefit from Banafo's dashboard and effectively manage your calls in the UI, you need to edit your dialplan and configure your recording filenames as described below:

    <action application="set" data="record_name=[${caller_id_name}]-[${uuid}]_${destination_number}-${caller_id_number}_${strftime(%Y%m%d%H%M%S)}.wav"/>
    <action application="set" data="record_path=$${base_dir}/recordings/${record_name}"/>
    <action application='export' data='execute_on_answer=record_session ${record_path}'/>
    

    Note:

    • Ensure the filename format is set exactly as shown above. Banafo relies on this format to process and display the recordings properly in the UI.

By following these steps, Banafo will automatically get and visualize your call recordings from FreeSwitch, enabling seamless call management and AI features through the Banafo dashboard.

Get Banafo transcripts for your PBX calls

By setting up our Auto Uploader app as described below, you can obtain transcripts for your FreeSwitch calls. This implementation approach provides the flexibility to get our transcripts and customize you solution according to your specific needs.

There are two options to set up transcripts for your FreeSwitch recordings using Banafo.

Option 1: Using our Auto Uploader app, which includes the following steps:

  1. Ensure your models for pre-recorded audio are ready. You have two options: use on-premise models or the Banafo hosted API.

    • For on-premise models, follow the setup instructions here.
    • For the hosted API, register and generate your API key following the instructions here.
  2. Clone the Auto Uploader repository

    git clone https://github.com/banafo-ai/banafo-asr.git
    cd banafo-asr/integration-demos/auto_uploader/scripts
    
  3. Run the installation script:

    ./install.sh
    
  4. In case your FreeSwitch installation is not the default one and/or is not detected by the Auto Uploader app, you need to manually configure the recording's directory to get monitored. Make sure to specify either --api and --lang for our Banafo hosted server or --uri for your on-premise server.

    If using the Banafo hosted API, provide your API key with the --api parameter.

    cd /usr/local/auto_uploader/python/
    ./auto_uploader.py -x insert --lang languageHere --api apiKeyHere --path /urs/local/my-FREESWITCH-audio-location/ --txt /urs/local/my-transcripts-location/
    
    systemctl restart auto_uploader_events.service
    

    If using your on-premise server, provide the server URI with the --uri parameter for the Auto Uploader to generate your transcripts.

    cd /usr/local/auto_uploader/python/
    ./auto_uploader.py -x insert --uri ws://127.0.0.1:6006/ --path /urs/local/my-FREESWITCH-audio-location/ --txt /urs/local/my-transcripts-location/
    
    systemctl restart auto_uploader_events.service
    

    Note:

    • Replace /urs/local/my-FREESWITCH-audio-location/ with your FreeSwitch audio directory.

    • Replace /urs/local/my-transcripts-location/ with your preferred directory for transcript storage. If omitted, transcripts will be stored in a .txt file inside the Auto Uploader folder.

    • Replace languageHere with the code for your preferred language. See the list of supported languages here.

    • Replace apiKeyHere with your apiKey. If you don't have one yet, generate it by following these guidelines.

For full list of the Auto Uploader options you can click here

Option 2: As a module for real-time transcripts (coming soon).

Asterisk

Connect your PBX with the Banafo Dashboard

By setting up our Auto Uploader app as described below, you can connect Asterisk to Banafo and leverage the Banafo interface to streamline your workflow. Key benefits include:

  • Automatic transcription and upload of your call recordings to the Banafo Dashboard
  • Effortless access to recordings and AI-generated insights, all in one centralized platform
  • Call Classification (based on subject, outcome, success rate, product, intent, urgency)
  • Call Content Analysis (extract subject, summaries, key action points, named entities)
  • Chat with your Transcript (ask additional question)

You can setup via the following these steps:

  1. Clone the Auto Uploader repository

    git clone https://github.com/banafo-ai/banafo-asr.git
    cd banafo-asr/integration-demos/auto_uploader/scripts
    
  2. Run the installation script:

    ./install.sh
    
  3. Configure your Asterisk recording's directory to get monitored. Make sure to specify --api and --lang for your recordings.

    cd /usr/local/auto_uploader/python/
    ./auto_uploader.py -x insert --lang languageHere --api apiKeyHere --path /urs/local/my-ASTERISK-audio-location/ --http 1
    
    systemctl restart auto_uploader_events.service
    

    Note:

    • Replace /urs/local/my-ASTERISK-audio-location/ with your Asterisk audio directory.

    • Replace languageHere with the code for your preferred language. See the list of supported languages here.

    • Replace apiKeyHere with your apiKey. If you don't have one yet, generate it at your PBX configuration page.

  4. To fully benefit from Banafo's dashboard and effectively manage your calls in the UI, you need to edit your dialplan (via the extensions.conf file) and configure your recording filenames as described below:

    same => n,Set(CALLFILENAME=[${CALLERID(name)}]-[${UNIQUEID}]_${EXTEN}-${CALLERID(num)}_${STRFTIME(${EPOCH},,%Y%m%d%H%M%S)})
    
    same => n,MixMonitor(/var/spool/asterisk/monitor/${CALLFILENAME}.wav)
    

    Note:

    • Ensure the filename format is set exactly as shown above. Banafo relies on this format to process and display the recordings properly in the UI.

By following these steps, Banafo will automatically get and visualize your call recordings from Asterisk, enabling seamless call management and AI features through the Banafo dashboard.

Get Banafo transcripts for your PBX calls

By setting up our Auto Uploader app as described below, you can obtain transcripts for your Asterisk calls. This implementation approach provides the flexibility to get our transcripts and customize you solution according to your specific needs.

There are two options to set up transcripts for your Asterisk recordings using Banafo.

Option 1: Using our Auto Uploader app, which includes the following steps:

  1. Ensure your models for pre-recorded audio are ready. You have two options: use on-premise models or the Banafo hosted API.

    • For on-premise models, follow the setup instructions here.
    • For the hosted API, register and generate your API key following the instructions here.
  2. Clone the Auto Uploader repository

    git clone https://github.com/banafo-ai/banafo-asr.git
    cd banafo-asr/integration-demos/auto_uploader/scripts
    
  3. Run the installation script:

    ./install.sh
    
  4. In case your Asterisk installation is not the default one and/or is not detected by the Auto Uploader app, you need to manually configure the recording's directory to get monitored. Make sure to specify either --api and --lang for our Banafo hosted server or --uri for your on-premise server.

    If using the Banafo hosted API, provide your API key with the --api parameter.

    cd /usr/local/auto_uploader/python/
    ./auto_uploader.py -x insert --lang languageHere --api apiKeyHere --path /urs/local/my-ASTERISK-audio-location/ --txt /urs/local/my-transcripts-location/
    
    systemctl restart auto_uploader_events.service
    

    If using your on-premise server, provide the server URI with the --uri parameter for the Auto Uploader to generate your transcripts.

    cd /usr/local/auto_uploader/python/
    ./auto_uploader.py -x insert --uri ws://127.0.0.1:6006/ --path /urs/local/my-ASTERISK-audio-location/ --txt /urs/local/my-transcripts-location/
    
    systemctl restart auto_uploader_events.service
    

    Note:

    • Replace /urs/local/my-ASTERISK-audio-location/ with your Asterisk audio directory.

    • Replace /urs/local/my-transcripts-location/ with your preferred directory for transcript storage. If omitted, transcripts will be stored in a .txt file inside the Auto Uploader folder.

    • Replace languageHere with the code for your preferred language. See the list of supported languages here.

    • Replace apiKeyHere with your apiKey. If you don't have one yet, generate it by following these guidelines.

For full list of the Auto Uploader options you can click here

Option 2: As a module for real-time transcripts (coming soon).

FreePBX

Connect your PBX with the Banafo Dashboard

By setting up our Auto Uploader app as described below, you can connect FreePBX to Banafo and leverage the Banafo interface to streamline your workflow. Key benefits include:

  • Automatic transcription and upload of your call recordings to the Banafo Dashboard
  • Effortless access to recordings and AI-generated insights, all in one centralized platform
  • Call Classification (based on subject, outcome, success rate, product, intent, urgency)
  • Call Content Analysis (extract subject, summaries, key action points, named entities)
  • Chat with your Transcript (ask additional question)

You can setup via the following these steps:

  1. Clone the Auto Uploader repository

    git clone https://github.com/banafo-ai/banafo-asr.git
    cd banafo-asr/integration-demos/auto_uploader/scripts
    
  2. Run the installation script:

    ./install.sh
    
  3. Configure your FreePBX recording's directory to get monitored. Make sure to specify --api and --lang for your recordings.

    cd /usr/local/auto_uploader/python/
    ./auto_uploader.py -x insert --lang languageHere --api apiKeyHere --path /urs/local/my-FreePBX-audio-location/ --http 1
    
    systemctl restart auto_uploader_events.service
    

    Note:

    • Replace /urs/local/my-FreePBX-audio-location/ with your FreePBX audio directory.

    • Replace languageHere with the code for your preferred language. See the list of supported languages here.

    • Replace apiKeyHere with your apiKey. If you don't have one yet, generate it at your PBX configuration page.

  4. Ensure that call recordings are enabled in the FreePBX interface.

By following these steps, Banafo will automatically get and visualize your call recordings from FreePBX, enabling seamless call management and AI features through the Banafo dashboard.

Get Banafo transcripts for your PBX calls

By setting up our Auto Uploader app as described below, you can obtain transcripts for your FreePBX calls. This implementation approach provides the flexibility to get our transcripts and customize you solution according to your specific needs.

There are two options to set up transcripts for your FreePBX recordings using Banafo.

Option 1: Using our Auto Uploader app, which includes the following steps:

  1. Ensure your models for pre-recorded audio are ready. You have two options: use on-premise models or the Banafo hosted API.

    • For on-premise models, follow the setup instructions here.
    • For the hosted API, register and generate your API key following the instructions here.
  2. Clone the Auto Uploader repository

    git clone https://github.com/banafo-ai/banafo-asr.git
    cd banafo-asr/integration-demos/auto_uploader/scripts
    
  3. Run the installation script:

    ./install.sh
    
  4. In case your FreePBX installation is not the default one and/or is not detected by the Auto Uploader app, you need to manually configure the recording's directory to get monitored. Make sure to specify either --api and --lang for our Banafo hosted server or --uri for your on-premise server.

    If using the Banafo hosted API, provide your API key with the --api parameter.

    cd /usr/local/auto_uploader/python/
    ./auto_uploader.py -x insert --lang languageHere --api apiKeyHere --path /urs/local/my-FreePBX-audio-location/ --txt /urs/local/my-transcripts-location/
    
    systemctl restart auto_uploader_events.service
    

    If using your on-premise server, provide the server URI with the --uri parameter for the Auto Uploader to generate your transcripts.

    cd /usr/local/auto_uploader/python/
    ./auto_uploader.py -x insert --uri ws://127.0.0.1:6006/ --path /urs/local/my-FreePBX-audio-location/ --txt /urs/local/my-transcripts-location/
    
    systemctl restart auto_uploader_events.service
    

    Note:

    • Replace /urs/local/my-FreePBX-audio-location/ with your FreePBX audio directory.

    • Replace /urs/local/my-transcripts-location/ with your preferred directory for transcript storage. If omitted, transcripts will be stored in a .txt file inside the Auto Uploader folder.

    • Replace languageHere with the code for your preferred language. See the list of supported languages here.

    • Replace apiKeyHere with your apiKey. If you don't have one yet, generate it by following these guidelines.

  5. Ensure that call recordings are enabled in the FreePBX interface.

For full list of the Auto Uploader options you can click here