Icecast Streaming Media Server Forum Index Icecast Streaming Media Server
Icecast is a Xiph Foundation Project
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Execute Script every time someone updates the metadata?

 
Post new topic   Reply to topic    Icecast Streaming Media Server Forum Index -> Icecast Server
View previous topic :: View next topic  
Author Message
cmodyssey



Joined: 28 Mar 2008
Posts: 63

PostPosted: Sun Jul 27, 2008 1:23 pm    Post subject: Execute Script every time someone updates the metadata? Reply with quote

Hi,

Is there any way of configuring icecast to launch a script every time the metadata is updated?

At the moment, I have found numerous events that can be made to trigger a script to me ran.

There is source connection and disconnection, which is configured in the following example:

Code:

<mount>

    <mount-name>/live_mount</mount-name>

    {snip}

    <on-connect>/home/bcast/icecast/on-connect-live</on-connect>
    <on-disconnect>/home/bcast/icecast/on-disconnect-live</on-disconnect>

</mount>



There is mount and listener activity too, which is configured in the following example:

Code:

<mount>

    <mount-name>/live_mount</mount-name>

    {snip}

    <authentication type="url">
        <option name="mount_add" value="http://myauthserver.com/stream_start.php"/>
        <option name="mount_remove" value="http://myauthserver.com/stream_end.php"/>
        <option name="listener_add" value="http://myauthserver.com/listener_joined.php"/>
        <option name="listener_remove" value="http://myauthserver.com/listener_left.php"/>
       
        {snip}       
       
    </authentication>

</mount>



Is there any way that I have not found that a PHP/PERL or shell script could be launched when metadata is updated?

Thanks in advance.
Back to top
View user's profile Send private message
karlH
Code Warrior
Code Warrior


Joined: 13 Jun 2005
Posts: 5476
Location: UK

PostPosted: Sun Jul 27, 2008 2:17 pm    Post subject: Reply with quote

It hasn't been requested before. Each of the mechanisms specified has some issue for working in general. The run a local script won't work on windows and the auth approach seems incorrect as it is not really authentication related. Either could be used to implement to trigger.

The only existing setup that could be used is the stream auth url option in -kh as that pushes source client auth to the auth server and non-ogg metadata is done via separate connection and still require the auth to pass before the update occurs. The php/etc script could be used to trigger whatever you'd like.

karl.
Back to top
View user's profile Send private message Send e-mail Visit poster's website
cmodyssey



Joined: 28 Mar 2008
Posts: 63

PostPosted: Sun Jul 27, 2008 6:07 pm    Post subject: Reply with quote

Hi Karl,

Thanks for this. What is kh?

Do you have any examples of how to use kh for processing non-ogg metadata?

Thanks again. Very Happy
Back to top
View user's profile Send private message
karlH
Code Warrior
Code Warrior


Joined: 13 Jun 2005
Posts: 5476
Location: UK

PostPosted: Sun Jul 27, 2008 8:45 pm    Post subject: Reply with quote

kh is the branch work at my website. To use the option just add an auth url option of stream_auth which is triggered when source client authentication is required. With ogg stream the metadata is part of the initial connection but with the likes of mp3 the metadata is inserted using a separate /admin request. From the php side of things, if admin=1 is part of the POST then it's request from /admin

karl.
Back to top
View user's profile Send private message Send e-mail Visit poster's website
cmodyssey



Joined: 28 Mar 2008
Posts: 63

PostPosted: Sun Jul 27, 2008 9:24 pm    Post subject: Reply with quote

aaahh, now I see!

I used to be on version 2.3.1 until I ran into difficulty when trying to use htpasswd authentication for status.xsl. So I'm now running on version 2.3.2.

As your 2.3-kh34 branch originates from 2.3.1, please could you let me know if your branch successfully does htpasswd authentication for status.xsl.


Also, is this the right page for documentation on your branch and stream_auth? http://svn.xiph.org/icecast/branches/kh/icecast/doc/icecast2_listenerauth.html


Thanks.
Back to top
View user's profile Send private message
karlH
Code Warrior
Code Warrior


Joined: 13 Jun 2005
Posts: 5476
Location: UK

PostPosted: Sun Jul 27, 2008 11:28 pm    Post subject: Reply with quote

kh34 does everything 2.3.2 does including authenticated webroot xsl pages. The next update will be a 2.3.2-kh1. You have the correct place for the docs, although I put any initial changes in the NEWS file.

karl.
Back to top
View user's profile Send private message Send e-mail Visit poster's website
cmodyssey



Joined: 28 Mar 2008
Posts: 63

PostPosted: Mon Jul 28, 2008 12:19 pm    Post subject: Reply with quote

Hi Karl,

I've been reading in more depth about the http://myauthserver.com/ mechanism.

I've realised that icecast passes this on to separate web server and the PHP running behind that separate web server is where place the script.

Is the built in web server that icecast has capable of CGI functionality?

I don't need the source to form the http://source:hackme@xx.xx.xx.xx:xxxx/admin/metadata?mount=/live_mount&mode=updinfo&song=Show+Name URL The source would do something like http://xx.xx.xx.xx:xxxx/cgi/myscript.pl {with POST data or something in there somewhere, haven't looked into it to that much detail yet}


If the icecast web server code does not support CGI, where did the icecast web server code come from? Maybee I can do something with that. Even if I end up running a separate separate deamon, on a separate port.

I don't want to waffle too much with random ideas, as I want to keep my questions as clear as possible!

Thanks.
Back to top
View user's profile Send private message
karlH
Code Warrior
Code Warrior


Joined: 13 Jun 2005
Posts: 5476
Location: UK

PostPosted: Mon Jul 28, 2008 2:41 pm    Post subject: Reply with quote

icecast is not CGI capable. The "web server" part of icecast is really just a simple engine for transferring content, the streaming part is handled separately.

karl.
Back to top
View user's profile Send private message Send e-mail Visit poster's website
Display posts from previous:   
Post new topic   Reply to topic    Icecast Streaming Media Server Forum Index -> Icecast Server All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2002 phpBB Group
subRebel style by ktauber