This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
  | const endpointNode = document.getElementById(e.endpoint.id); | |
| if(endpointNode){ | |
| const container = endpointNode.querySelector('.endpoint__media'); | |
| e.mediaRenderer.element.width="200"; | |
| e.mediaRenderer.element.height="150"; | |
| e.mediaRenderer.render(container); | |
| } | 
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
  | e.endpoint.on(VoxImplant.EndpointEvents.RemoteMediaAdded, onRemoteMediaAdded); | |
| e.endpoint.on(VoxImplant.EndpointEvents.RemoteMediaRemoved, onRemoteMediaRemoved); | |
| function onRemoteMediaAdded(e) { | |
| logger.write(`[WebSDk] New MediaRenderer ID: ${e.mediaRenderer.id} in ${e.endpoint.id} for Call ID: ${e.call.id()}`); | |
| } | |
| function onRemoteMediaRemoved(e) { | |
| logger.write(`[WebSDk] MediaRenderer was removed ID: ${e.mediaRenderer.id} in ${e.endpoint.id} for Call ID: ${e.call.id()}`);} | 
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
  | function onEndpointRemoved(e) { | |
| logger.write(`[WebSDk] Endpoint was removed ID: ${e.endpoint.id} (${e.endpoint.isDefault?'default':'regular'}) for Call ID: ${e.call.id()}`); | |
| const container = document.getElementById('js__workbench'); | |
| const node = document.getElementById(e.endpoint.id); | |
| if(node) { | |
| container.removeChild(node); | |
| } | |
| } | 
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
  | function onEndpointAdded(e) { | |
| logger.write(`[WebSDk] New endpoint ID: ${e.endpoint.id} (${e.endpoint.isDefault?'default':'regular'}) for Call ID: ${e.call.id()}`); | |
| // create the display element for this endpoint | |
| const node = renderTemplate(e.endpoint); | |
| const container = document.getElementById('js__workbench'); | |
| container.appendChild(node); | |
| // remove the display element with this endpoint | |
| e.endpoint.on(VoxImplant.EndpointEvents.Removed,onEndpointRemoved) | |
| } | 
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
  | currentCall.on(VoxImplant.CallEvents.EndpointAdded, onEndpointAdded); | 
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
  | function checkForTermination() { | |
| if (partsCounter === 0) { | |
| conf.stop(); | |
| conf = null; | |
| } | |
| } | |
| e.call.addEventListener(CallEvents.Disconnected, function (event2) { | |
| partsCounter = partsCounter - 1; | |
| if (partsCounter === 0) { | 
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
  | VoxEngine.addEventListener(AppEvents.CallAlerting, function (e) { | |
| e.call.answer(); | |
| partsCounter = partsCounter + 1; | |
| const endpoint = conf.add({ | |
| call: e.call, | |
| mode: "FORWARD", | |
| direction: "BOTH", scheme: e.scheme | |
| }); | |
| Logger.write(`New endpoint was added ID: ${e.endpoint.id()}`); | |
| }); | 
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
  | VoxEngine.addEventListener(AppEvents.Started, function (event) { | |
| conf = VoxEngine.createConference({hd_audio: true}); | |
| conf.addEventListener(ConferenceEvents.Stopped, function (event2) { | |
| Logger.write('Conference was stopped!'); | |
| VoxEngine.terminate(); | |
| }); | |
| conf.addEventListener(ConferenceEvents.Started, function (event2) { | |
| Logger.write(`Conference is started ID: ${event2.conference.getId()}`); | |
| }); | |
| }); | 
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
  | require("conference"); | |
| let conf; | |
| let partsCounter = 0; | 
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
  | VoxEngine.addEventListener(AppEvents.CallAlerting, function(e) { | |
| const call = VoxEngine.callConference("myconf", | |
| e.callerid, | |
| e.displayName, | |
| {}, | |
| e.scheme); | |
| VoxEngine.easyProcess(e.call, call); | |
| }); | 
NewerOlder