Why AWS EC2 Instance Type Disabled?

Why are nearly all the AWS EC2 instances disabled for Wazo Platform?
I would Like to run Wazo-Platform on a high end Networking Instance but Wazo Platform is Disabled.


Only the slower instances are available.

I would like to use an Instance with Very High Networking capabilities but that is also cheaper. The AMI forces me to use the standard Instances. I’d like to use something like this


Hello, because i choose only standard instance on the marketplace. There is no reason in fact, nobody asked before you.

1 Like

Awesome, I ask because I’ve noticed there is this image that supports all instances:


I might try it out to see how well it works with the high Network instances !

@quintana
Please can you enable all of the instances. I am trying with r5n.xlarge and r5n.2xlarge.
I need to test with 25gb Network
I am using t2.small currently and my videos are very low quality and frequently cut out/back in. It’s barely possible to have 1 normal video call. During the video call, video/audio gets stuck for 30 seconds sometimes and then comes back later or sometimes longer.

I don’t think this is your issue. We are using for our development AWS and we made video conference on this instance with 20 people without any issues.

I see, so it must be a configuration issue. I’ve run a speed test on the t2.small and it looks fine, top looks fine as does RAM.

What do you suggest I do?

I followed the install steps exactly as written. In fact hahah, you basically spoonfed me them yourself last week ! :smiley:

Speedtest:

This is data during call:


The call has issues where, sometimes it just cuts out. Video stops, audio stops. And it doesnt come back for ~30 seconds, or 1 minute, or can be 1 second. Sometimes this never happens but it is frequent.

I tested on 2 phones. I called my friend in another room, we talked for ~30 seconds, then both calls froze. And we couldn’t hear anything for ~1 minute and so we gave up, and hung up.

Here is the AWS stats:


STUN server

I’m currently in vacation, so my access is limited for the moment. I don’t know why you have freeze exactly but have you check on the client side? Are you using opus? Is it on mobile or on web desktop?

Ah I apologize for bothering you on vacation, I hope you have a great holiday!

I’m not using opus, im not sure what this is. I’m using default Wazo-Platform configuration from docs installation guide, and I’m building a react native app like Skype for user-to-user voice/video call.
1-to-1, no conferences. Many users.
I’m using react-native-webrtc, Wazo JS SDK with React Native via the wazo-react-native-demo, i’m also using react-native-callkeep and react-native-incall manager. Video and audio are very laggy. Phone’s also get very hot, and battery life drains very fast. I’m trying to build a commercial product with Wazo as my calling platform. I’ll post the code here so that maybe you can help after your vacation. I am also ready to pay someone for 1-2 days support and guidance. If there is anyone out there that can help.

import React, { useReducer, useEffect, useRef } from 'react';
import {
  StyleSheet,
  View,
  Dimensions,
  Platform,
  TextInput,
  TouchableOpacity,
} from 'react-native';
import inCallManager from 'react-native-incall-manager';
import RNCallKeep from 'react-native-callkeep';
import { RTCView, registerGlobals } from 'react-native-webrtc';
import { v4 as uuid } from 'uuid';
import Wazo from '@wazo/sdk/lib/simple';
import AsyncStorage from '@react-native-community/async-storage';
import CommonText from '../components/common/text/common_text';

// Polyfill WebRTC
registerGlobals();

const options = {
  ios: { appName: 'euclid', includesCallsInRecents: false },
  android: {
    additionalPermissions: [],
    alertTitle: 'Permission Required',
    alertDescription: 'This application needs to access to allow calls',
    okButton: 'Ok',
    cancelButton: 'Cancel',
  },
};

const Dialer = ({ setLogout }: { setLogout: () => void }) => {
  const reducer = (state: any, action: any) => ({ ...state, ...action });
  const initialState = {
    isCall: false,
    ready: false,
    held: false,
    cameraOn: false,
    ext: '',
  };
  const [state, dispatch] = useReducer(reducer, initialState);
  const { ext, isCall, ready, held, cameraOn } = state;

  const session = useRef<any>(null);
  const remote = useRef<any>(null);
  const local = useRef<any>(null);
  const callId = useRef<string>('');

  const isIOS = Platform.OS === 'ios';
  const isVideo = session.current?.cameraEnabled;

  const oneTimeId = () => {
    callId.current = callId.current || uuid();
    return callId.current;
  };

  const call = async (extNum: string, video = false) => {
    if (!extNum || isCall) return;
    try {
      await Wazo.Phone.call(extNum, video);
    } catch (err) {
      console.warn(err);
    }
  };

  const terminate = () => {
    dispatch(initialState);
    session.current = null;
    local.current = null;
    remote.current = null;
    callId.current = '';
    inCallManager.stop();
  };

  const ringing = (type: 'startCall' | 'displayIncomingCall') => (
    sess: any
  ) => {
    dispatch({ isCall: true });
    session.current = sess;
    const id = oneTimeId();
    const { number, displayName, cameraEnabled } = sess;
    RNCallKeep[type](id, number, displayName, 'number', cameraEnabled);
  };

  const initializeWebRtc = async () => {
    await Wazo.Phone.connect({ audio: true, video: true });

    Wazo.Phone.on(Wazo.Phone.ON_CALL_OUTGOING, ringing('startCall'));
    Wazo.Phone.on(Wazo.Phone.ON_CALL_INCOMING, ringing('displayIncomingCall'));
    Wazo.Phone.on(Wazo.Phone.ON_CALL_FAILED, () => {
      const id = oneTimeId();
      terminate();
      RNCallKeep.endCall(id);
    });
    Wazo.Phone.on(Wazo.Phone.ON_CALL_ENDED, () => {
      const id = oneTimeId();
      terminate();
      RNCallKeep.endCall(id);
    });
    Wazo.Phone.on(Wazo.Phone.ON_CALL_ACCEPTED, async (sess: any) => {
      if (isCall || ready) return;
      session.current = sess;
      const sipSession = Wazo.Phone.getCurrentSipSession();

      if (session.current?.cameraEnabled) {
        const { peerConnection } = sipSession.sessionDescriptionHandler;
        const lStreams = peerConnection.getLocalStreams();
        const rStreams = peerConnection.getRemoteStreams();

        const anyTrack = (stream: any) => !!stream.getVideoTracks().length;
        local.current = lStreams.find(anyTrack);
        remote.current = rStreams.find(anyTrack);

        if (!isIOS) {
          RNCallKeep.backToForeground();
        }
        await inCallManager.start({ media: 'video', auto: true });
      } else if (session.current) {
        await inCallManager.start({ media: 'audio', auto: true });
      }

      await sipSession.sendReinvite();
      dispatch({ ready: true });
      const x = await RNCallKeep.checkSpeaker();
      console.warn(x);
    });
  };

  const handleAnswer = async () => {
    RNCallKeep.setCurrentCallActive();
    Wazo.Phone.accept(session.current, session.current?.cameraEnabled);
  };

  const handleHangup = async () => {
    if (!session.current) return;
    try {
      await Wazo.Phone.hangup(session.current);
    } catch (err) {
      console.warn(err);
    }
    terminate();
  };

  const initializeCallKeep = () => {
    RNCallKeep.setup(options);
    RNCallKeep.setAvailable(true);
    RNCallKeep.addEventListener('answerCall', handleAnswer);
    RNCallKeep.addEventListener('endCall', handleHangup);
  };

  const initialize = async () => {
    await initializeWebRtc();
    initializeCallKeep();
  };

  const cleanup = () => {
    Wazo.Phone.unbind();
    inCallManager.stop();
    RNCallKeep.removeEventListener('answerCall');
    RNCallKeep.removeEventListener('endCall');
  };

  useEffect(() => {
    initialize();

    return cleanup;
  }, []);

  const logout = async () => {
    await handleHangup();
    await Wazo.Auth.logout();
    await AsyncStorage.removeItem('call-session-token');
    setLogout();
  };

  const toggleHold = () => {
    Wazo.Phone[held ? 'unhold' : 'hold'](session.current);
    dispatch({ held: !held });
  };

  const toggleCamera = () => {
    Wazo.Phone[cameraOn ? 'turnCameraOn' : 'turnCameraOff'](session.current);
    dispatch({ cameraOn: !cameraOn });
  };

  return (
    <View style={{ flex: 1 }}>
      <View>
        <View style={{ marginTop: 40, flexDirection: 'row' }}>
          <TextInput
            style={styles.input}
            autoCapitalize='none'
            onChangeText={value => dispatch({ ext: value })}
            value={ext}
          />
          <TouchableOpacity style={styles.button} onPress={logout}>
            <CommonText style={{ color: 'white' }}>Logout</CommonText>
          </TouchableOpacity>
        </View>
        <View
          style={{
            height: '60%',
            width: '100%',
          }}>
          {remote.current && isCall && ready && (
            <View style={{ borderColor: 'red', borderWidth: 5, flex: 1 }}>
              <RTCView
                objectFit='cover'
                streamURL={remote.current?.toURL()}
                style={styles.remoteVideo}
                zOrder={15}
              />
            </View>
          )}
        </View>
        {!isCall && (
          <View style={{ flexDirection: 'row' }}>
            <TouchableOpacity
              onPress={() => call(ext, false)}
              style={styles.button}>
              <CommonText style={{ color: 'white' }}>Call</CommonText>
            </TouchableOpacity>
            <TouchableOpacity
              onPress={() => call(ext, true)}
              style={styles.button}>
              <CommonText style={{ color: 'white' }}>Video call</CommonText>
            </TouchableOpacity>
          </View>
        )}
        {!isIOS && local.current && isCall && ready && (
          <RTCView
            mirror
            streamURL={local.current?.toURL()}
            style={styles.localVideo}
            zOrder={1}
          />
        )}
        {isIOS && local.current && isCall && ready && (
          <RTCView
            mirror
            streamURL={local.current?.toURL()}
            style={styles.localVideo}
            zOrder={1}
          />
        )}
        {isCall && (
          <>
            <View style={{ flexDirection: 'row' }}>
              <TouchableOpacity onPress={handleHangup} style={styles.button}>
                <CommonText style={{ color: 'white' }}>Hangup</CommonText>
              </TouchableOpacity>
              <TouchableOpacity onPress={toggleHold} style={styles.button}>
                <CommonText style={{ color: 'white' }}>
                  {held ? 'Unhold' : 'Hold'}
                </CommonText>
              </TouchableOpacity>
            </View>
            {isVideo && (
              <TouchableOpacity onPress={toggleCamera} style={styles.button}>
                <CommonText style={{ color: 'white' }}>
                  {cameraOn ? 'Camera On' : 'Camera Off'}
                </CommonText>
              </TouchableOpacity>
            )}
          </>
        )}
      </View>
    </View>
  );
};

const styles = StyleSheet.create({
  button: {
    padding: 5,
    margin: 10,
    width: 175,
    height: 50,
    borderRadius: 10,
    justifyContent: 'center',
    alignItems: 'center',
    backgroundColor: 'black',
  },
  localVideo: {
    width: 100,
    height: 100,
    position: 'absolute',
    right: 10,
    bottom: -50,
  },
  remoteVideo: {
    flex: 1,
    position: 'absolute',
    left: 0,
    top: 0,
    margin: 0,
    padding: 0,
    aspectRatio: 1,
    width: Dimensions.get('window').width,
    height: Dimensions.get('window').height,
    overflow: 'hidden',
    alignItems: 'center',
  },
  input: {
    height: 40,
    width: 150,
    borderColor: 'black',
    borderWidth: 3,
    borderRadius: 10,
    margin: 10,
  },
});

export default Dialer;