Integration demos

Introduction

In this section, you will find various practical use cases demonstrating how to adapt and use the Banafo API 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 is a simple background application that continuously scans the audio folders you specify. It automatically uploads any audio files it finds to your Banafo dashboard, where you can access transcripts, AI insights, and more.

Prerequisites:

  • Python >= 3.9+
  • Make sure your hosted API is set up correctly—register and generate your API key by 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 your API key generated from the Banafo Dashboard 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/ --http 1
    
    systemctl restart auto_uploader_events.service
    

    Note:

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

    • Full list of available 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.

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.

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.

Looking for Another PBX?

Our integration app is designed to work universally with any standards-compliant PBX system. Even if your PBX isn't listed in the step-by-step guides above, you can still use the same integration process with your own setup.

Connect your PBX with the Banafo Dashboard

By setting up our Auto Uploader app as described below, you can connect your favorite 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 PBX 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-PBX-audio-location/ --http 1
    
    systemctl restart auto_uploader_events.service
    

    Note:

    • Replace /urs/local/my-PBX-audio-location/ with your PBX 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 your PBX and stored in the directory you configured above.

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