Hi guys,<div>thanks for your answers...</div><div><br></div><div>My idea was to create a simple system that can be linked to radio schedule.</div><div>To avoid problems modifing a working code, I decided to do less modifications as possible by simply adding a call to 2 functions, one to add a listener and one to remove a listener. Using only 2 tables on db I can obtain all informations.</div>
<div>One table, called "online", contain a "mirror" of the online status that can be browsed in the admin section of icecast web interface. It is composed by 5 fields: id, ip, agent, start and mountpoint. Each time a new listener connects, icecast adds a record with a numerical ID, the same ID used to identify the connection on the source code. The "start" field contains the unix timestamp, filled by icecast. "Agent" is the user-agent.</div>
<div>When a listener closes the connection, my function remove the record from the online table (using the ID to choose the right one) and put a new record in the second table, called "stats", which contains 7 fileds: "id", "ip", "agent", "mount", "start", "stop" and "duration".</div>
<div>Many of the fields are taken from the online table, adding the "stop" timestamp, ancd counting the difference in seconds to fill the "duration" value.</div><div>Once you have data in the "stats" table, you can simply parse them with a PHP page... You can order them by duration or start time, but most important is that you can simply have the medium time a user stay online. You can also have the medium calculated per-hour. You are also able to exclude several IP address (local connections or relay servers).</div>
<div>All informations are directly created real-time by icecast itself, so you don't have to query the server each 5 or 10 seconds. Using a DB, you can also have different servers for streaming and stats, and if you like you can simply integrate some information in existing web sites.</div>
<div>I made also few modifications to integrate mysql configuration params in icecast.xml file.</div><div><br></div><div>About source code there is a little problem. I've start working on the code on-the-fly because I thought to create only one file, so I'm not using any of the versioning system like git.</div>
<div>How can I upload it? I think that the best solution could be to checkout an existing repository and re-apply all modifications, but it may take a lot to complete.</div><div>I considered to produce a patch using diff, but there are a lot of difference becasue I needed to recreate some files using autoreconf.</div>
<div>I will upload a tar archive of my version as soon as possible in my personal site, and I will share the link in this mailing list, so you can start to take a look in source code.</div><div>I used SVN several times, but I'm newbie in git. :)</div>
<div>-- </div><div>Luca Cireddu<br><a href="mailto:sardylan@gmail.com" target="_blank">sardylan@gmail.com</a><br><a href="http://www.lucacireddu.it" target="_blank">http://www.lucacireddu.it</a>
</div>