This page goes over how you can use the CDR API to have CDR data flow back and forth from difuse. We will go over two primary ways of interacting with the CDR programatically:
This makes sense if you want to get a feel for the API, all you need to do is login to the admin user (only admin users session token is accepted for this method of authentication) and then visit this URL: https://10.254.248.1/pbx/cdr/data, replace 10.254.248.1 with your IP or domain name. You can tweak the page and limit using the page and limit params respectively.
The above URL is what you would need to use to get a response like this:
Please remember that the extension would be a number and NOT a name, and the key would NOT be the extension's secret instead it's the SHA256 hash of that secret.
Now in this section we'll go over how we can get Difuse to POST/PUT CDR entries as they appear in the database. For giving the details of your Server you need to go to /pbx/settings by navigating to PBX > Settings.
You should be able to see this form on the top most section of the Extra Configurations tab:
PBX - Settings - Extra Configurations - CDR API
Let's go over the options one by one:
Enable CDR Log To API: This is the toggle switch, once enabled it will take whatever entries appeared in the database after the last entry was sent and then send it to the given API URL with the given method.
API Key: This is if your API needs it (basically adds the token you give here to x-api-key header)
Bearer Token: A Bearer Token is an authentication string sent in the Authorization: Bearer header to securely identify users in API requests. If your API needs this, it can be given here.
Username/Password: This is for good old basic authentication
Method: There's only 2 to choose from POST or PUT, if you don't know which pick POST here.
Parameters: Here you can select a wide array of fields that you want to post to your API.
WARNING
The CDR Log Job runs every 60 seconds, so a call that you make will not appear instantly on the other server.