voximplant

Voximplant scenario crashes


Here's my Voximplant scenario:

val callSettings = CallSettings()
val array = mapOf("X-PARAMCUSTOM" to "test")
callSettings.extraHeaders = array

when I add these lines to my scenario, it crashes with the following error:

java.lang.UnsupportedOperationException

Can you explain why. Here's my code:

VoxEngine.addEventListener(AppEvents.CallAlerting, (e) => {
var  newCall = VoxEngine.callUser(
  e.destination,
  e.callerid,
  e.displayName,
  null,
  e.headers
);

Solution

  • You need to pass an object to the callUser() method, not just a list of properties:

    const  CallSettings = {
      username: 'user',
      callerid: e.callerid,
    };
    const  newCall = VoxEngine.callUser(CallSettings);
    

    You can find more information in the Voximplant calls documentation here: https://voximplant.com/docs/guides/calls/scenario