# VolumeController

The VolumeController resource changes the output gain or volume of audio being played on a media stream or a conference.

## XML Definition

<volumecontroller identifier="<identifier>" appid="<appid>"
href=http://server/dialogicwebservice/mediacontrol/volumecontrollers/<identifier>
streamidentifier="<stream identifier>"
conferenceidentifier="<conference identifier>"
level=”<level>” delta=”<delta>”>
</volumecontroller>

## VolumeController Properties

Name | Description | Type | Input / Output | Optional / Mandatory
identifier | Unique identifier assigned to the specific instance of the resource. This identifier is used by the web service client when performing actions on the resource. | String | Output | N/A
appid | Unique application id included in the original HTTP POST creation process that is utilized by the web service such that clients only have access to resources that they created. | String | Output | N/A
href | An HTTP reference to the specific resource. | String | Output | N/A
streamidentifier | Unique identifier of the MediaStream that is to receive the media being played by the resource. | String | Input / Output | Mandatory if conference identifier is not being set
conferenceidentifier | Unique identifier of the Conference that is to receive the media being played by the resource. | String | Input / Output | Mandatory if stream identifier is not being set
level | Sets the current gain level. Values: {-12 ... 18} | String | Output | Optional
delta | Changes the gain relative to the current gain level. | String | Output | Optional

## Interaction Diagram

### VolumeController Creation

The following diagram illustrates the VolumeController creation process.

### VolumeController Update

The following diagram illustrates the VolumeController update process.

### VolumeController Deletion

The following diagram illustrates the VolumeController deletion process.

## Java Sample Code

public void CreateVolumeController() {
logger.info("VolumeController:: CreateVolumeController - Entered.");
//Create a HttpURLConnection with the correct server
//Send request to create an empty conference and retrieve response
String requestBody = “<volumeController streamidentifier=\"1234567\"
conferenceidentifier=\"23424244\" level=\”5\”
</volumeController>”;
HttpURLConnection connection = utils.SendHTTPRequest("http://" + MainSipServlet.IPMSHost +
":81/DialogicWebService/mediacontrol/volumeControllers", "POST", requestBody);
if (connection != null) {
xmlDoc = utils.GetHTTPXMLResponse(connection);
}
//Retrieve response codes
int responseCode = 0;
try {
responseCode = connection.getResponseCode();
} catch (IOException ex) {
Logger.getLogger(MainSipServlet.class.getName()).log(Level.SEVERE, null, ex);
}
String responseMessage = "";
try {
responseMessage = connection.getResponseMessage();
} catch (IOException ex) {
Logger.getLogger(MainSipServlet.class.getName()).log(Level.SEVERE, null, ex);
}
String responseLocation = connection.getHeaderField("location");
//close the connection
connection.disconnect();
//log results
logger.info("VolumeController:: CreateVolumeController - Http response code =" +
responseCode);
logger.info("VolumeController:: CreateVolumeController - Http response message =" +
responseMessage);
logger.info("VolumeController:: CreateVolumeController - Http response location =" +
responseLocation);
if (responseCode == 201) {
volumeControllerRef = responseLocation;
identifier = ParseIdentifier();
}
logger.info("VolumeController:: CreateVolumeController - Exited.");
}