// Initialize the Immersitech library
imm_handle handle = imm_initialize_library(license_file_path, room_layout_file_path, websocket_file_path, output_config, &error_code);

// Create a new room
imm_create_room( handle, 0 );

// Add participants 1 and 2 to the room
imm_add_participant( handle, 0, 1, "participant_1", input_config);
imm_add_participant( handle, 0, 2, "participant_2", input_config);

// Turn on and off the different effects in the library (thread safe)
imm_set_participant_state( handle, 0, 1, IMM_CONTROL_ANC_ENABLE, 1);		// Turn on Noise Cancellation for participant 1
imm_set_participant_state( handle, 0, 2, IMM_CONTROL_MIXING_3D_ENABLE, 70); // Turn on 3D Mixing for participant 2

// Move participants to different 3D locations
imm_set_participant_position( handle, 0, 1, {-100, 0, -50}, {0,0});
imm_set_participant_position( handle, 0, 2, { 10, 30, 20 }, {0,0});

// Input each participant's audio
imm_input_audio_short( handle, 0, 1, my_audio_data_1, num_frames);
imm_input_audio_short( handle, 0, 2, my_audio_data_2, num_frames);

// Receive the processed output for each participant
imm_output_audio_short( handle, 0, 1, output_buffer_1);
imm_output_audio_short( handle, 0, 2, output_buffer_2);

// When done cleanup by remove participants
imm_remove_participant( handle, 0, 1 );
imm_remove_participant( handle, 0, 2 );

// Destroy the room
imm_destroy_room( handle, 0 );

// Destroy the library
imm_destroy_library( handle );
// No integration necessary, simply load the precompiled Immersitech freeswitch modules
// Control the audio effects using the freeswitch command (fs_cli) such as below

// You can view all the available room layouts by using following command:
imm_adapter get_json_all_room_layouts

// Change a room layout any time with:
imm_adapter set_room_layout 3500 4

// The spatial position of any participant can be viewed by using the get_participant_position commands:
imm_adapter get_participant_position 3500 1

// Any participant can be moved to any seat, resulting in a change in their spatial sound field:
imm_adapter set_participant_seat 3500 1 2

// You can change or view the state of any participant in real time:
imm_adapter set_participant_state 3500 2 IMM_CONTROL_AGC_ENABLE 1
// Initialize the websocket connection with the audio server
websocket = new WebSocket( 'sip:70000@mysite.net', "I_am_valid_immersitech_please_accept_me" );

// Once connected, control all the audio effects with simple JSON commands
// In this example, turn Bob's noise cancellation on
websocket.send('{"Command": "set_participant_state", "room_id": 1, "participant_id": 2, "control_to_edit": "IMM_CONTROL_ANC_ENABLE", "value": true }');

// Disconnect when done
websocket.close();