xiph / Icecast-Server

Icecast streaming media server (Mirror) - Please report bugs at https://gitlab.xiph.org/xiph/icecast-server/issues
https://icecast.org
GNU General Public License v2.0
465 stars 127 forks source link

Replacing <on-connect> with <event> in my Icecast.xml config file #72

Open eelcohn opened 5 months ago

eelcohn commented 5 months ago

The Changelog states that

within <mount> <on-connect> and <on-disconnect> has been replaced by <event>

, but I can' really find any documentation or examples on that. Currently I'm using the <on-connect> statement to call a script, which issues a curl command to make an API call:

<mount>
    <mount-name>/test/mount</mount-name>
    <password>xxxxxxxx</password>
    <burst-size>65536</burst-size>
    <no-yp>1</no-yp>
    <on-connect>/on-connect.sh</on-connect>
    <on-disconnect>/on-disconnect.sh</on-disconnect>
</mount>

This works perfectly, but I'm trying to do the same thing with the <event> statement.

I've tried the following code, but it does not seem to make any HTTP request to the API endpoint:

<mount>
    <mount-name>/test/event</mount-name>
    <password>xxxxxxxx</password>
    <burst-size>65536</burst-size>
    <no-yp>1</no-yp>
    <event-bindings>
        <event type="url" trigger="source-connect">
            <option name="url" value="http://127.0.0.1/api/v1/icecast" />
            <option name="action" value="mount_add" />
        </event>
        <event type="url" trigger="source-disconnect">
            <option name="url" value="http://127.0.0.1/api/v1/icecast" />
            <option name="action" value="mount_remove" />
        </event>
    </event-bindings>
</mount>

How can I use <event> to make a HTTP call to the API endpoint at http://127.0.0.1/api/v1/icecast?

eelcohn commented 1 month ago

Anyone?