This function can be used to move recorded calls from server to a local machine. The function establishes a connection to the given server with the username and password provided. The username and password are checked for authentication. On success, the function will return several results according to the action.
Parameters
- script: recordings.php
- domain: domain to connect to (username.mixpbx.net)
- username: sip username
- password: manager password (found in Configuration on your Mixvoip webinterface)
- action: index | download | delete
- id: used if action=get or action=delete. Points to a file.
- calluid: enables downloading/deleting a call by its calluid (returned for example by this API)
Return values
- action=index
Returns a JSON encoded array of IDs that point to available recordings.
- action=download
Returns the read state of the file passed through the ID.
- action=delete
Deletes the file passed through the ID on the server side. If it fails, it returns an error message.
Examples without calluid
There are 3 files on the domain xyz
for user somebody
:
- example1.wav
- example2.wav
- example3.wav
- Get the IDs of the 3 files
xyz
/recordings.php?username=somebody&password=password&action=index
Returns a JSON encoded array with IDs to those 3 files. For this example, we’ll call those IDs ex_1, ex_2 and ex_3.
- Download ex_2 and ex_3
xyz
/recordings.php?username=somebody&password=password&action=download&id=ex_2
Returns readfile() value of ex_2.
xyz
/recordings.php?username=somebody&password=password&action=download&id=ex_3
Returns readfile() value of ex_3.
On failure: If any problem occured, an error message will be returned.
- Delete ex_2 from server
xyz
/recordings.php?username=somebody&password=password&action=delete&id=ex_2 Deletes the file that ex_2 points to, in this example, example2.wav would be deleted.
On failure: If any problem occured, an error message will be returned.
Examples with calluid
Let’s say the calluid is.
- Download recording for this calluid
xyz
/recordings.php?username=somebody&password=password&action=download&calluid= Downloads the file corresponding to calluid.
- Delete recording for this calluid
xyz
/recordings.php?username=somebody&password=password&action=delete&calluid= Deletes the file corresponding to calluid.
On failure: If any problem occured, an error message will be returned.