Download Recording Files

Download recording files of Yeastar S-Series VoIP PBX.

Steps to download a recording file

  1. Get the recording name from recording parameter in New CDR.
  2. Get the random string of recording file.
  3. Combine the random string with other parameters to form a download link.
    Note: The random string is only valid for 30 seconds, and each random string can be used only once.

Request URL

{base_url}/{api_path}/recording/get_random?token={token}

Request parameters

Parameter Required Type Description
recording Yes String Recording filename.
allowedip No String

Specify the IP address which is allowed to download recording file. By default, allowedip is not carried, which means only the application server can download recording file.

Valid values:

  • Leave the value of allowedip blank: Only the application server can download recording files.

    Example: "allowedip":" "

  • IP address: Only the application server or a server with this IP address can download recording files.

    Example: "allowedip":"192.168.5.20"

Response parameters

Parameter Type Description
status String Request result.
  • Success
  • Failed
recording String Recording filename.
random String A random string for recording file.

Combine the random string with other parameters to form a download link.

Examples

Request example

Get the random string of recording files.

POST /api/v2.0.0/recording/get_random?token=1e3b3ebb6a974cb42ed31de5413df52d
Content-Type:application/json; charset=utf-8
Host: 192.168.5.150

{
	"recording": "20191024012719-1571909237.191-4000-4001-Internal.wav"
}
Response example
HTTP/1.1 200 OK
Server: Boa/0.94.14rc21
Accept-Ranges: bytes
Connection: close
Content-Type: application/json
Access-control-allow-origin: *
Access-control-allow-methods: GET, POST, OPTIONS, PUT, DELETE

{
	"status": "Success",
	"recording": "20191024012719-1571909237.191-4000-4001-Internal.wav",
	"random": "2d2f919b742cc62f5e03c77351350f7c"
}

Download Link Example

Use the API responded random as a component of a specified request address for downloading the recording file.
Download link format:
https://{pbx ip}:{https port}/api/v2.0.0/recording/download?recording={recording}&random={random}&token={token}
Download link example:
https://192.168.5.150:8088/api/v2.0.0/recording/download?recording=20170901181806-1504261084.7-1001-1003-Internal.wav&random=120732c546381fb020f17fba676b0ea0&token=75c5891b32203d0615f9e3753a7cb779