OBiTALK Community

General Support => Day-to-Day Use => Topic started by: Robert.Thompson on February 21, 2012, 05:02:30 PM

Title: [S]Can Call History be outload in a format other than .xml?
Post by: Robert.Thompson on February 21, 2012, 05:02:30 PM
Hello:

Can it be outloaded in CSV?

Thanks,

Rob.
Title: Re: Can Call History be outload in a format other than .xml?
Post by: QBZappy on February 21, 2012, 05:26:01 PM
Open history xml file using MS Excel, then save as any format you like.
Title: Re: Can Call History be outload in a format other than .xml?
Post by: Robert.Thompson on February 22, 2012, 07:24:52 AM
Quote from: QBZappy on February 21, 2012, 05:26:01 PM
Open history xml file using MS Excel, then save as any format you like.

I do not have MS office on my PC.

Any alternative methods?

Thanks,

Rob.
Title: Re: Can Call History be outload in a format other than .xml?
Post by: Stewart on February 22, 2012, 09:09:27 AM
Have you tried Open Office?
Title: Re: Can Call History be outload in a format other than .xml?
Post by: Robert.Thompson on February 22, 2012, 09:14:01 AM
Quote from: Stewart on February 22, 2012, 09:09:27 AM
Have you tried Open Office?

Sort of, I am using LibreOffice  3.4.4 OOO340m1 (Build:402).

It cannot open the callhistory.xml file.

Do you think that OpenOffice would be any different?

Rob.
Title: Re: Can Call History be outload in a format other than .xml?
Post by: Stewart on February 22, 2012, 11:30:43 AM
I was unable to read my OBi's file in OOO or even Excel.  Examination with a text editor showed that the file is corrupted -- several hundred bytes are missing from the middle, such that the syntax is incorrect.  The missing and butchered calls do show correctly in the Web interface.  Retrying the download did not help.  If I get a chance, I'll take a more detailed look tomorrow.
Title: Re: Can Call History be outload in a format other than .xml?
Post by: infin8loop on February 22, 2012, 08:21:59 PM
Quote from: Stewart on February 22, 2012, 11:30:43 AM
I was unable to read my OBi's file in OOO or even Excel.  Examination with a text editor showed that the file is corrupted -- several hundred bytes are missing from the middle, such that the syntax is incorrect.  The missing and butchered calls do show correctly in the Web interface.  Retrying the download did not help.  If I get a chance, I'll take a more detailed look tomorrow.

I've noticed downloading a non-corrupted xml file (either call history or config backup) through a browser is at times a hit or miss for me.  Today I tried downloading a call history file several times and every file had an xml error.  So, I slapped together yet another script to emulate the "Save All" button on the call history page.  I was able to download several error free call history xml files using the script which import into Excel just fine.   This is odd, because when I type http://192.168.0.40/callhistory.xml  (which is what the "Save All" button does) into a browser window and click open or save, the file is corrupt, but the same URL invoked by script seems to work every time.    

obi-historydumpinator.vbs is attached.  There are three variables in the script that must be changed to your specific configuration.  The call history file is saved with date/time stamp as callhistory_yyyymmdd_hhmmss.xml.  The script could be scheduled to run on a server via task scheduler to regularly save off call history if needed.  

Sorry, I don't do Mac.

Updated version obi-historydumpinatorV2.vbs: https://www.box.com/shared/9vdwpvswrvja3wbkuptd
This version includes an option to clear the OBi's history after it's dumped controlled by an additional variable that must be edited in the script. There are four variables in this version of the script that must be changed to your specific configuration.

Title: Re: Can Call History be outload in a format other than .xml?
Post by: Robert.Thompson on February 23, 2012, 06:20:59 AM
Quote from: infin8loop on February 22, 2012, 08:21:59 PM
Quote from: Stewart on February 22, 2012, 11:30:43 AM
I was unable to read my OBi's file in OOO or even Excel.  Examination with a text editor showed that the file is corrupted -- several hundred bytes are missing from the middle, such that the syntax is incorrect.  The missing and butchered calls do show correctly in the Web interface.  Retrying the download did not help.  If I get a chance, I'll take a more detailed look tomorrow.

I've noticed downloading a non-corrupted xml file (either call history or config backup) through a browser is at times a hit or miss for me.  Today I tried downloading a call history file several times and every file had an xml error.  So, I slapped together yet another script to emulate the "Save All" button on the call history page.  I was able to download several error free call history xml files using the script which import into Excel just fine.   This is odd, because when I type http://192.168.0.40/callhistory.xml  (which is what the "Save All" button does) into a browser window and click open or save, the file is corrupt, but the same URL invoked by script seems to work every time.   

obi-callhistorydumpinator.vbs is attached.  There are three variables in the script that must be changed to your specific configuration.  The call history file is saved with date/time stamp as callhistory_yyyymmdd_hhmmss.xml.  The script could be scheduled to run on a server via task scheduler to regularly save off call history if needed.   

Sorry, I don't do Mac.

Hello:

I don't know anything about vbs but I did not let that stop me from downloading and clicking your file.

I got:
Status code 12029:unknown

Is there something else that I must do?

Thanks,
Title: Re: Can Call History be outload in a format other than .xml?
Post by: QBZappy on February 23, 2012, 07:06:53 AM
Robert.Thompson

Open the file with notepad or any text editor, and follow the instructions to customize it to your local environment. It is explained in the remarks. Have a look.
Title: Re: Can Call History be outload in a format other than .xml?
Post by: Robert.Thompson on February 23, 2012, 07:47:12 AM
Quote from: QBZappy on February 23, 2012, 07:06:53 AM
Robert.Thompson

Open the file with notepad or any text editor, and follow the instructions to customize it to your local environment. It is explained in the remarks. Have a look.

Thanks QBZappy! :)

I made the changes, ran it and it created the file but I still cannot load it into LibreOffice Calc. LibreOffice Writer works, just as it did before.

I am going to try writing a Pascal program to format the callhistory.xml file into CSV.

Rob.
Title: Re: Can Call History be outload in a format other than .xml?
Post by: infin8loop on February 23, 2012, 10:36:05 AM
Quote from: Robert.Thompson on February 23, 2012, 06:20:59 AM
Hello:

I don't know anything about vbs but I did not let that stop me from downloading and clicking your file.

I got:
Status code 12029:unknown

Is there something else that I must do?

Thanks,

As the original post indicates, "There are three variables in the script that must be changed to your specific configuration".

The script must be edited to your specific environment.  There are 3 lines in the script that must be changed:

''**** You must change the following 3 values to your specific configuration

strURL = "http://192.168.0.40/callhistory.xml"
''change 192.168.0.40 above to the local IP address of your Obi

strPassword = "obipassword"
''change obipassword above to the password of your local Obi page login

strDirectoryPath = "C:\Call_History"
''change C:\Call_History above to the full path of the directory to save the history files into. The Directory must already exist.

''**** You must change the above 3 values to your specific configuration

You would get the error you mentioned if your OBi isn't at 192.168.0.40, so change that value in the script to the IPAddress returned when you dial ***1.  Likewise, change "obipassword" to your OBi's admin password and "C:\Call_History" to a directory path on your PC where you want to save the call history files to.

I posted this script because I get corrupted call history files similar to what Stewart indicated he was getting when trying to download the call history file through the browser interface.  Running this script, when properly configured, consistently produces a well formed call history xml file.  I've found that opening the xml file in Internet Explorer will quickly let you know if the file is corrupted or not.  You may have to scroll to the bottom of the screen to find the error if there is one. Look for beginning and ending tags <CallHistoryFile> and </CallHistoryFile> at the top and bottom of the file.




 
Title: Re: Can Call History be outload in a format other than .xml?
Post by: Robert.Thompson on February 23, 2012, 11:35:27 AM
Hi infin8loop:

The script runs perfectly but my problem is opening the output file in LibreOffice Calc.

My pascal program to convert the xml file is underway and I will try to post it if I succeed.

Edit: I completed the program & it can be found in the following post: http://www.obitalk.com/forum/index.php?topic=2654.0


Rob.
Title: Re: [S]Can Call History be outload in a format other than .xml?
Post by: vich on February 06, 2013, 07:00:03 PM
THANK YOU infin8loop , Just What I needed.  I would like to automate so it doesnt ask do I want to open the file.