Icecast-Server icon indicating copy to clipboard operation
Icecast-Server copied to clipboard

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

Open eelcohn opened this issue 1 year ago • 1 comments

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 avatar Jan 24 '24 14:01 eelcohn

Anyone?

eelcohn avatar May 23 '24 16:05 eelcohn