Jump to content
Vodia PBX forum
voltier

Get CDR Records (Rest API)

Recommended Posts

There is an example in there that involves getting 50 records. Is it possible to use Rest as a replacement to JSON to get full CDR records from server?

Share this post


Link to post
Share on other sites

There are two commands there:

 

Get CDR count:

 

{"action":"count-cdr-summary","start":0,"length":1000,"domain":true}

 

And

 

Get CDR records:

 

{"action":"load-cdr-summary","start":0,"length":50,"domain":true,"user":"false","missed":"false"}

 

The first one helps you determine how many there are.

With the second one you can ask for any range. You can ask for all of them with length equal to the full count you got.

 

I hope it helps.

Share this post


Link to post
Share on other sites

Thanks Snomonepbx,

 

The context behind the question is we are trying to find a reliable/accurate way to retrieving all CDR records to be fed into our billing system. (PBX is a hosted instance). As i understand it (based on an old Snom One Administrators Guide), theres a number of ways to do it: CSV, email, Simple TCP, Soap/XML, Rest API, JSON. Right now we are using the CSV file stored on the Hosted PBX accessing the CSVs via FTP. We are wanting to remove this process by retrieving the data directly.

Few follow up questions:

  • Can CSV (file:) be sent externally
  • For the methods listed above, how would the receiving CDR server know what CDRs are new only? i.e. not re-download the entire set of data (would it only retrieve the deltas)
  • Are there any other permissions on the PBX that need to be enabled to ensure that the receiving CDR server is able to access the data
  • Are there any examples or configurations documented anywhere that show how to configure the receiving CDR server

 

 

Thanks.

Share this post


Link to post
Share on other sites

Well as you may seen in the CDR documentation found here:

 

https://vodia.com/documentation/cdr

 

  • You can write to a file the cdr folder on your server. Now giving access to that file and folder through http (on another port than the pbx http) or ftp from that server is up to you.
  • Unfortunately not at this point. That part has to be managed by the receiving server as to what is new. But if you going to store the CDRs on a separate server, it would be a good idea to have them deleted automatically the PBX after a certain time to keep them short like for 7 days or so or even daily.
  • Well you will have to know the login and password of the admin as that is necessary to login and get the sessionid before you are able to use the sessionid in the method I mentioned above for cdr retrieval.
  • I am not sure what you are asking for here but in general it is up to you how to want to store the CDR's. Whether as files, as a database, as files in database. As you can see in the link above, we provide all kinds of CDR delivery depending on what kind of server the user wants to use, including mongoDB. You can also use webcdr (or json, jsons) to deliver the cdr that can be put in an SQL database. A very simple PHP example of which has been provided on the link given above, which is a very simple one and just to show how it can be done. You can implement it any way you want.

 

I hope that helps.

 

Thanks.

Share this post


Link to post
Share on other sites

Really appreciate your help Snomonepbx!

 

In addition to your invaluable response, i did not know the vodia had a documentation section on its site. (i did not know about webcdr and mongodb and others - which is great!)

 

Thanks again

Share this post


Link to post
Share on other sites

Well as you may seen in the CDR documentation found here:

 

https://vodia.com/documentation/cdr

 

  • You can write to a file the cdr folder on your server. Now giving access to that file and folder through http (on another port than the pbx http) or ftp from that server is up to you.
  • Unfortunately not at this point. That part has to be managed by the receiving server as to what is new. But if you going to store the CDRs on a separate server, it would be a good idea to have them deleted automatically the PBX after a certain time to keep them short like for 7 days or so or even daily.
  • Well you will have to know the login and password of the admin as that is necessary to login and get the sessionid before you are able to use the sessionid in the method I mentioned above for cdr retrieval.
  • I am not sure what you are asking for here but in general it is up to you how to want to store the CDR's. Whether as files, as a database, as files in database. As you can see in the link above, we provide all kinds of CDR delivery depending on what kind of server the user wants to use, including mongoDB. You can also use webcdr (or json, jsons) to deliver the cdr that can be put in an SQL database. A very simple PHP example of which has been provided on the link given above, which is a very simple one and just to show how it can be done. You can implement it any way you want.

 

I hope that helps.

 

Thanks.

Hi,

 

Thanks for your explanation, I have gone through the example PHP code in the link you listed out. but I still little bit confused.

 

As in the scenario that the CDR gonna be stored in a separate server, which will install mysql on it.

 

In Vodia pbx, how do I put the CDR url? (is it possible to put json://mysqlserverIP/example.php)?

 

If so, does vodia pbx will access the example php file in my separated server?

 

Many Thanks!

Share this post


Link to post
Share on other sites

Hello, I am working with these two rest commands

 

Get CDR count:

{"action":"count-cdr-summary","start":0,"length":1000,"domain":true}

And

Get CDR records:

{"action":"load-cdr-summary","start":0,"length":50,"domain":true,"user":"false","missed":"false"}

Here is the process i am using. I am logged in as extension user and than using session token with required (with POST method).

But it returned me error - File json not found. Please ask your system administrator to check the log file.

Thanks

Share this post


Link to post
Share on other sites

What is the exact path you are using? You can always check in the debug window of the browser how it should look like when you do the same thing in the web interface.

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...

×
×
  • Create New...