Hi All,
I have basic js that i’m running in python eel. Making outbound calls is working great. I can’t figure out what signalwire Resource(s) I need to setup so incoming calls route to my JS to be answered.
I started with the JS found here: unpkg.com/@signalwire/js@1.4.1/dist/index.min.js
Below is start of my app.js
// Using Signalwire JS 1.4.1 locally
// Global Variables
let client = null; // SignalWire Client
let currentCall = null; // Active Call
let projectId = “”; // SignalWire Project ID
let fromNumber = “”; // Caller ID (Your Phone Number)
let isMuted = false;
let isHeld = false;
async function initializeClient() {
await loadSettings();
const token = await fetchToken();
if (!token || !projectId) {
logMessage(“ [Frontend] Missing API token or Project ID. Cannot initialize client.”);
return;
}
logMessage(“ [Frontend] Connecting to SignalWire…”);
let retries = 10;
while (typeof window.Relay === “undefined”) {
if (retries-- <= 0) {
logMessage(“ [Frontend] SignalWire SDK failed to load.”);
return;
}
logMessage(“ [Frontend] Waiting for SignalWire SDK… Retrying in 3 seconds…”);
await new Promise(resolve => setTimeout(resolve, 3000));
}
logMessage(“ [Frontend] SignalWire SDK Loaded!”);
client = new Relay({
project: projectId,
token: token
});
client.remoteElement = “remoteAudio”;
await client.connect();
logMessage(“ [Frontend] Connected to SignalWire!”);
document.getElementById(“btnCall”).disabled = false;
}