Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
cancelCall() {
console.log("Cancel call");
VoxImplant.SDK.disconnectCall(currentCallId);
}
"&api_key=" +
api_key +
"&user_id=" +
user_id +
"&application_id=all"
);
const jsonB = await responseB.json();
const result = JSON.stringify(jsonB.result);
console.log(result);
const accnameValue = "testing";
const appnameValue = "testing";
const passwordValue = password;
//login the user to get deviceeventemitter
VoxImplant.SDK.login(
usernameValue +
"@" +
appnameValue +
"." +
accnameValue +
".voximplant.com",
passwordValue
);
this.setState({ loading: false });
this.props.navigation.navigate("Boiler");
}
TouchableOpacity,
Platform,
DeviceEventEmitter,
Image
} from 'react-native';
import { Keypad } from './Keypad';
import { CallButton } from './CallButton';
import { IncomingCallForm } from './IncomingCallForm';
import VoxImplant from "react-native-voximplant";
import loginManager from './LoginManager';
var currentCallId,
uaInstance,
number = '',
settings_video = false,
camera = VoxImplant.SDK.CameraType.CameraTypeFront;
DeviceEventEmitter.addListener(
VoxImplant.SDK.Events.CallRinging,
(callRinging) => {
console.log('Call ringing. Call id = ' + callRinging.callId);
if (uaInstance !== undefined) {
uaInstance.setState({callState: "Ringing"});
}
}
);
DeviceEventEmitter.addListener(
VoxImplant.SDK.Events.CallConnected,
(callConnected) => {
console.log('Call connected. Call id = ' + callConnected.callId);
if (uaInstance !== undefined) {
async VoxImplant() {
const accnameValue = "testing";
const appnameValue = "testing";
const email = await AsyncStorage.getItem("email");
const usernameValue = email.replace(/@[^@]+$/, "");
const passwordValue = await AsyncStorage.getItem("password");
console.log(email);
//console.log(passwordValue);
VoxImplant.SDK.login(
usernameValue +
"@" +
appnameValue +
"." +
accnameValue +
".voximplant.com",
passwordValue
);
console.log("SDK Login done");
}
makeCall(event) {
console.log("calling " + number);
VoxImplant.SDK.createCall(
number,
settings_video,
null,
function(callId) {
currentCallId = callId;
if (settings_p2p)
VoxImplant.SDK.startCall(callId, { "X-DirectCall": "true" });
else VoxImplant.SDK.startCall(callId);
this.setState(
update(this.state, {
$merge: {
status: "calling"
}
})
);
}.bind(this)
function(callId) {
currentCallId = callId;
if (settings_p2p)
VoxImplant.SDK.startCall(callId, { "X-DirectCall": "true" });
else VoxImplant.SDK.startCall(callId);
this.setState(
update(this.state, {
$merge: {
status: "calling"
}
})
);
}.bind(this)
);
rejectCall() {
VoxImplant.SDK.declineCall(currentCallId);
this.closeModal(true);
}
constructor() {
super();
VoxImplant.SDK.closeConnection();
this.state = {
page: "connection",
emailA: false,
email: "",
usernameValue: "",
passwordValue: ""
};
}
function(callId) {
currentCallId = callId;
if (settings_p2p)
VoxImplant.SDK.startCall(callId, { "X-DirectCall": "true" });
else VoxImplant.SDK.startCall(callId);
this.setState(
update(this.state, {
$merge: {
status: "calling"
}
})
);
}.bind(this)
);
componentDidMount() {
VoxImplant.SDK.connect();
}