Jump to content
Mumble forums

Creating Mumble Instance via Web Form


arkevius
 Share

Recommended Posts

Hello all!


I was wondering how I would go about creating a Mumble instance from information gathered on a web form? I would most likely use a php script in CGI-BIN to execute a python script on the server, no?


What exactly would the python script consist of to create this instance?


The whole idea is to be able to go to a web page and enter your information (such as the server name, the root channel name, how many slots, SuperUser password, etc), and when you submit the form it would execute a script that to the information from the form and created a new Mumble instance with it.


I currently have Murmur installed with django, php, python, and ice all on an Ubuntu 12.04 server.

Link to comment
Share on other sites

From php it should be easy:


1) Generate a murmur configuration file from the form input

2) Start murmur with a -ini option pointing to the configuration

Use php function POPEN (http://php.net/manual/function.proc-open.php)

you can start it asynchronously with a START in the command line (and a /B to hide any eventual window)

 

$handle = popen("start /B ". $cmd, "r"); 
 if ($handle === FALSE) 
{    
  die("Unable to execute $cmd"); 
}
pclose($handle); 

 



This should work and can be improved (find a way get a pointer to the process ID to be able to stop the process anytime you want).

Anyway, that was just a quick anwser :)

Link to comment
Share on other sites

  • Administrators

With Ice you can administrate the murmur process from PHP or python - your choice.

What you will do is through the API provided by Ice and Mumbles definitions, simply start a new virtual server and adjust the settings.

For the murmur slice API of the stable version see http://mumble.sourceforge.net/slice/

As for reference, you may want to check existing web interfaces like MumPI in PHP and Mumble Django in Python.


I’m familiar with MumPIs code (it’s mine after all), so here some links to get you started:

Server connection: https://github.com/Kissaki/MumPI/blob/master/classes/ServerInterface.php#L43

Creating a server: https://github.com/Kissaki/MumPI/blob/master/classes/ServerInterface.php#L198

Set config value: https://github.com/Kissaki/MumPI/blob/master/classes/ServerInterface.php#L272

(You’ll notice a bit of abstraction in the ServerInterface class here, but should be able to easily follow it. :) Four class member variables.)


As you probably have noticed by my answer by now, you were right in suggesting starting up new processes for each server is not the preferred or most efficient way. A single process is able to host several virtual servers with separate configurations.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

 Share

×
×
  • Create New...