All media files, files that are played or recorded, are stored on cloud.aculab.com. This API provides some simple management tools to access those files. A separate web services API provides the ability to upload and download files between your local machine and cloud.aculab.com.
You can also have a look at some of the web services samples that are provided.
It is important that you also read the section about media files which describes some of the effects of Eventual Consistency.
A file manager object is passed to the main(0) function of your application. It does not have to be created.
Check whether a file exists.
This method is provided to confirm the presence of a file in your online media storage area.
If the file is present, this function will return True; otherwise, it will return False.
Usage example:
if file_man.exists(my_file) is False:
print(my_file + " does not exist")
Delete a file.
This method is provided to delete a file from your online media storage area.
If successful, this function will return True; if unsuccessful, it will return False.
Usage example:
if file_man.exists(my_file) is True:
file_man.delete_file(my_file)
Rename and/or move a file.
This method is provided to rename a file on your online media storage area.
If successful, this function will return True, otherwise it will return False.
Usage example:
if file_man.exists(my_file) is True:
file_man.rename(my_file, your_file)
Check whether an encrypted file can be decrypted with the credentials supplied and that it has valid content.
When a file is uploaded to your cloud media store, it is checked for compatibility. However, and encrypted file cannot be checked at the time of uploading.
When an application is going to play an encrypted WAV file or send an encrypted TIFF, this function can be used to check the compatibility of the file before placing or answering the call. In other words, first call validate on the file, then place or answer the call, and then play or fax the file.
An encrypted file that has not been validated cannot be played or faxed. The validate function must be called first.
This method is provided to confirm that an encrypted file in your cloud media storage area can be played / faxed using the credentials supplied.
This function will return a ValidateResultType. The possible results are:
- VALIDATED
- The file is correct.
- DECRYPTERROR
- The file could not be decrypted.
- NOTENCRYPTED
- The file is not encrypted.
- VALIDATEERROR
- An incorrect cipher has been supplied; or, the file is not a compatible WAV or TIFF; or, the file was not encrypted correctly. Please see the logs for a description or the error.
- FILENOTFOUND
- The file is not found.
- OTHER
- An unspecified error occurred. Please see the logs.
Usage example:
my_cipher = AESCBCCipher(key="3e139a97574248d43bf01de3521474bf69f32ec2fc00edb866c26dcffff9d0a3",
vector="9b0ef243445da908976b7dc9c247c29e")
result = file_man.validate(my_file, my_cipher)
if result != file_man.ValidateResultType.VALIDATED:
print("File did not validate: result is {0}".format(result))