I am looking to repair / reinstall a solution which was coded for me some time ago. My original request was as follows;
\---|\---|\---|\---|\---|
I need a script to run on a TrixBox PBX Server (Asterisk 1.2.13 running on CentOS 4.4) to facilitate interface to a call accounting system.
What I need is a script to run on the server which will monitor the TrixBox systems current call data recording file ([login to view URL] I believe) on a live basis for changes.
As new records come in, I need the script to parse the record to pull out specific data such as extention, number called, duration of call and send the data to the serial port on the server where my call accounting will read it in.
The serial string needs to be in a fixed width format (i.e. each piece of data must be in the same position in the string at all times).
The output sent across the serial port needs to be something like this;
01/01/07 08:05AM 400 13056751820 00:02:30 0001
where 400 is the extention, 13056751820 is the number called, 00:02:30 is the duration of the call (HH:MM:SS) and 0001 is the trunk number."
\---|\---|\---|\---|\---|-
The provided solution (which I was completely satisfied with) was the installation of java and a modification of the macro-hangup call to push records in the required format to the serial port. The original installation instructions are included under detailed requirements.
The issue I am having is two fold; firstly I now need to install this on a trixbox CE v2.8.0 box; I have installed java but not sure how to install the other components which the original coder supplied ([login to view URL] [login to view URL] etc). Secondly, when I look at [login to view URL] on the new trixbox, there no longer seems to be ResetCDR and NoCDR lines!
The chosen coder will need to provide new instructions and/or modified code to accomplish the original task. I will share complete original code to the chosen coder as neccessary.
Thanks!
## Deliverables
Original Instructions & Code
\---|\---|\---|\---|\---|
Copy all file to your linux folder [/usr/src]
cd /usr/src
chmod 777 [login to view URL]
./[login to view URL]
cp [login to view URL] /usr/java/jdk1.6.0_01/jre/lib/ext
cp -rf jar /usr/java/jdk1.6.0_01/jre/lib/ext
cp [login to view URL] /usr/java/jdk1.6.0_01/jre/lib/ext
cp [login to view URL] /usr/java/jdk1.6.0_01/jre/lib
cp [login to view URL] /usr/lib
cp [login to view URL] /usr/lib
using visudo, add the following line to the bottom of the file: asterisk ALL = NOPASSWD: /usr/bin/java
[step to step guide using visudo command]
enter visudo linux command
press i to insert
add the following line to the bottom of the file: asterisk ALL = NOPASSWD: /usr/bin/java
press Esc
press :wq then Enter
Insert these lines into [macro-hangupcall], between line "exten => s,1,ResetCDR(w)" and line "exten => s,n,NoCDR()"
exten =>s,n(StartDuration),Set(answerh=$[${ANSWEREDTIME}/3600])
exten => s,n,Set(remain=$[${ANSWEREDTIME} % 3600])
exten => s,n,Set(answerm=$[${remain}/60])
exten => s,n,Set(answers=$[${remain} % 60])
exten => s,n,GotoIf($[${LEN(${answerh})} = 2]?Minute)
exten => s,n,Set(answerh=0${answerh})
exten => s,n(Minute),GotoIf($[${LEN(${answerm})} =2]?Second)
(some code ommitted)
\---|\---|\---|\---|\---|\---|--