[asterisk-users] How to get TCP access to CDR Master.csv

2007-10-24 Thread asterisk-users
Hi.

 

I'd like to get access to the CDR's generated by Asterisk (1.4) in real-time
from a remote connection coming in on TCP. Basically what I have is a
Windows application that is used to process incoming, outgoing and missed
call records putting them into a database for some analysing etc. This app
can connect to a TCP server and read from this connection the CDR's as they
are coming in (being generated).

 

I can't find this as a feature of the standard Asterisk... but maybe I'm
missing something? The closest I could get is something around the manager
api but it's not really what I'm after. I'd like to access the CDR's them
selves.

 

Being a (more or less) novice Linux user the only thing I can think of is
trying to do this using Perl scripts where it would set up a listening
socket and when connection is received it would do something like (in
princip, not managed to do this properly yet):

 

...

print $connection `tail -f /var/log/asterisk/cdr-custom/Master.csv`

...

 

But even this is full of issues to solve. Things like only one connection at
a time (which I can live with) from the remote computer. The fact that tail
will not write to the socket (yeah, a major issue probably) which I'm
thinking of trying to solve by reading line by line somehow and writing back
to the socket... not even sure if this is possible.

 

So basically I'm hoping someone has a nice solution for this. With or witout
scripting, external programs of some sort (runnin ubuntu 7.04 or 6.06) or
whatever works. I'd really appreciate your input here.

 

Sincerely, Baldvin

 

___
--Bandwidth and Colocation Provided by http://www.api-digital.com--

asterisk-users mailing list
To UNSUBSCRIBE or update options visit:
   http://lists.digium.com/mailman/listinfo/asterisk-users

Re: [asterisk-users] How to get TCP access to CDR Master.csv

2007-10-24 Thread John Hass




Hello,

I am not sure if I totally understand the question but if your looking
to stream the connection you could create a simple bash script like this


#!/bin/bash
while true; do
 tail -f /var/log/asterisk/cdr-custom/Master.csv | nc -p 1024 -l
done

There probably is a better solution then this, but this will get you
going

>From any machine you should be able to type `telnet ip.of.machine 1024`


--John


[EMAIL PROTECTED] wrote:

  
  
  

  
  Hi.
   
  I‘d like to get access to the CDR‘s generated by
Asterisk (1.4) in real-time from a remote connection coming in on TCP.
Basically what I have is a Windows application that is used to process
incoming, outgoing and missed call records putting them into a database
for
some analysing etc. This app can connect to a TCP server and read from
this
connection the CDR‘s as they  are coming in (being generated).
   
  I can‘t find this as a „feature“ of the
standard Asterisk... but maybe I‘m missing something? The closest I
could
get is something around the manager api but it‘s not really what I‘m
after. I‘d like to access the CDR‘s them selves.
   
  Being a (more or less) novice Linux user the
only thing I
can think of is trying to do this using Perl scripts where it would set
up a
listening socket and when connection is received it would do something
like (in
princip, not managed to do this properly yet):
   
  ...
  print $connection `tail –f
/var/log/asterisk/cdr-custom/Master.csv`
  ...
   
  But even this is full of issues to solve. Things
like only
one connection at a time (which I can live with) from the remote
computer. The
fact that tail will not write to the socket (yeah, a major issue
probably)
which I‘m thinking of trying to solve by reading line by line somehow
and
writing back to the socket... not even sure if this is possible.
   
  So basically I‘m hoping someone has a nice
solution
for this. With or witout scripting, external programs of some sort
(runnin
ubuntu 7.04 or 6.06) or whatever works. I‘d really appreciate your
input
here.
   
  Sincerely, Baldvin
   
  
  

___
--Bandwidth and Colocation Provided by http://www.api-digital.com--

asterisk-users mailing list
To UNSUBSCRIBE or update options visit:
   http://lists.digium.com/mailman/listinfo/asterisk-users





___
--Bandwidth and Colocation Provided by http://www.api-digital.com--

asterisk-users mailing list
To UNSUBSCRIBE or update options visit:
   http://lists.digium.com/mailman/listinfo/asterisk-users

Re: [asterisk-users] How to get TCP access to CDR Master.csv

2007-10-24 Thread Klaverstyn, David C
I’m no expert in this field bit I would have though logging the calls to MySQL 
and then queering the MySQL database would be the best not to mention the 
easiest way to get the details you are looking for.

 

From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of John Hass
Sent: Thursday, 25 October 2007 8:39 AM
To: [EMAIL PROTECTED]; Asterisk Users Mailing List - Non-Commercial Discussion
Subject: Re: [asterisk-users] How to get TCP access to CDR Master.csv

 

Hello,

I am not sure if I totally understand the question but if your looking to 
stream the connection you could create a simple bash script like this


#!/bin/bash
while true; do
 tail -f /var/log/asterisk/cdr-custom/Master.csv | nc -p 1024 -l
done

There probably is a better solution then this, but this will get you going

From any machine you should be able to type `telnet ip.of.machine 1024`


--John


[EMAIL PROTECTED] wrote: 

Hi.

 

I‘d like to get access to the CDR‘s generated by Asterisk (1.4) in real-time 
from a remote connection coming in on TCP. Basically what I have is a Windows 
application that is used to process incoming, outgoing and missed call records 
putting them into a database for some analysing etc. This app can connect to a 
TCP server and read from this connection the CDR‘s as they  are coming in 
(being generated).

 

I can‘t find this as a „feature“ of the standard Asterisk... but maybe I‘m 
missing something? The closest I could get is something around the manager api 
but it‘s not really what I‘m after. I‘d like to access the CDR‘s them selves.

 

Being a (more or less) novice Linux user the only thing I can think of is 
trying to do this using Perl scripts where it would set up a listening socket 
and when connection is received it would do something like (in princip, not 
managed to do this properly yet):

 

...

print $connection `tail –f /var/log/asterisk/cdr-custom/Master.csv`

...

 

But even this is full of issues to solve. Things like only one connection at a 
time (which I can live with) from the remote computer. The fact that tail will 
not write to the socket (yeah, a major issue probably) which I‘m thinking of 
trying to solve by reading line by line somehow and writing back to the 
socket... not even sure if this is possible.

 

So basically I‘m hoping someone has a nice solution for this. With or witout 
scripting, external programs of some sort (runnin ubuntu 7.04 or 6.06) or 
whatever works. I‘d really appreciate your input here.

 

Sincerely, Baldvin

 

 






 
___
--Bandwidth and Colocation Provided by http://www.api-digital.com--
 
asterisk-users mailing list
To UNSUBSCRIBE or update options visit:
   http://lists.digium.com/mailman/listinfo/asterisk-users

 

___
--Bandwidth and Colocation Provided by http://www.api-digital.com--

asterisk-users mailing list
To UNSUBSCRIBE or update options visit:
   http://lists.digium.com/mailman/listinfo/asterisk-users

Re: [asterisk-users] How to get TCP access to CDR Master.csv

2007-10-24 Thread Tzafrir Cohen
On Wed, Oct 24, 2007 at 10:29:41PM -, [EMAIL PROTECTED] wrote:
 Hi.
 
 I'd like to get access to the CDR's generated by Asterisk (1.4) in real-time
 from a remote connection coming in on TCP. Basically what I have is a
 Windows application that is used to process incoming, outgoing and missed
 call records putting them into a database for some analysing etc. This app
 can connect to a TCP server and read from this connection the CDR's as they
 are coming in (being generated).

CDR also generates manager events in real time. An Asterisk manager
listener can get them and notify your application.

-- 
   Tzafrir Cohen   
icq#16849755  jabber:[EMAIL PROTECTED]
+972-50-7952406   mailto:[EMAIL PROTECTED]   
http://www.xorcom.com  iax:[EMAIL PROTECTED]/tzafrir

___
--Bandwidth and Colocation Provided by http://www.api-digital.com--

asterisk-users mailing list
To UNSUBSCRIBE or update options visit:
   http://lists.digium.com/mailman/listinfo/asterisk-users


Re: [asterisk-users] How to get TCP access to CDR Master.csv

2007-10-24 Thread asterisk-users
#!/bin/bash
while true; do
 tail -f /var/log/asterisk/cdr-custom/Master.csv | nc -p 1024 -l
done 

 

Thank you John, this bash script is exactly what I was looking for. Very 
simple, yet works.

 

As for doing this with insert into database and then polling for it... well I 
don‘t like polling. It‘s a good idea, but in the end, for this solution/in this 
case, the system reading the socket will in fact file the data (post 
processing) in a sql database for storing and querying.

 

tnx,

Baldvin

 

From: John Hass [mailto:[EMAIL PROTECTED] 
Sent: 24. október 2007 22:39
To: [EMAIL PROTECTED]; Asterisk Users Mailing List - Non-Commercial Discussion
Subject: Re: [asterisk-users] How to get TCP access to CDR Master.csv

 

___
--Bandwidth and Colocation Provided by http://www.api-digital.com--

asterisk-users mailing list
To UNSUBSCRIBE or update options visit:
   http://lists.digium.com/mailman/listinfo/asterisk-users