1. Help Center
  2. New to Corti?
  3. Implementing Clear/Voyager AI - Call Recorder Integration

Automating Your Call Recorder Export

Once your Call Recorder has established a secondary archive, Corti can help to automate data transfer for you

Once we have confirmed that the necessary pieces of data are being received from your CAD and/or Call recorder - the next step is to automate the export. We have an example script below, but if you have questions or issues, please reach out to your CSM.


The below anonymized example script will:

  1. Create the connection to the SFTP drive
  2. Create a dated file in the SFTP drive
  3. Copy the files from a source folder to the dated file
  4. Delete the files from the source folder

 

Important Notes:

  • You will need to add the Corti-provided appropriate identifying information for the SFTP drive (e.g. HostName, private key, etc.)
  • Corti will also be able to provide the dll file used by the below script. Corti can drop this file on your customer specific SFTP server. Please let your CSM know if this is of interest.
  • Ensure that the correct source folder is being used, remembering that as written the files will be deleted after the script is run
  • Use Windows Task Scheduler to schedule the task

 

try

{

Add-Type -Path "WinSCPnet.dll"

$session = New-Object WinSCP.Session

$sessionOptions = New-Object WinSCP.SessionOptions

$sessionOptions.Protocol = [WinSCP.Protocol]::Sftp

$sessionOptions.HostName = "api.[customername].motocorti.io"

$sessionOptions.PortNumber = 2222

$sessionOptions.UserName = "corti"

$sessionOptions.Password = ""

$sessionOptions.SshPrivateKeyPath = ""

$sessionOptions.SshHostKeyFingerprint = ""




$today = Get-Date -Format "yyyy-MM-dd"

#$sourceFolder = "F:\NICE\NICE Inform Recorder\Content\audio1\{0}" -f $today

$sourceFolder = "c:\export\" -f $today

$destinationFolder = "input/{0}" -f $today




    try

    {

        # Connect

        $session.Open($sessionOptions)




# Create remote directory

$session.CreateDirectory($destinationFolder)

}

catch

{write-host "Directory Exists" }

try

{

        # Upload files

        $transferOptions = New-Object WinSCP.TransferOptions

        $transferOptions.TransferMode = [WinSCP.TransferMode]::Binary




        $transferResult =

            $session.PutFilesToDirectory($sourceFolder, $destinationFolder, "*", $False, $transferOptions)




        # Throw on any error

        $transferResult.Check()




        # Print results

        foreach ($transfer in $transferResult.Transfers)

        {

            Write-Host "Upload of $($transfer.FileName) succeeded"

            Remove-Item -Path $transfer.FileName -Force

        }

    }

    finally

    {

        # Disconnect, clean up

        $session.Dispose()

    }




    exit 0

}

catch

{

    Write-Host "Error: $($_.Exception.Message)"

    exit 1

}