diff --git a/public/full.js b/public/full.js index aafee5b..b4561de 100644 --- a/public/full.js +++ b/public/full.js @@ -373,13 +373,18 @@ window.connect = async () => { connectStatus.innerHTML = 'Connecting...' // Set a node_id for steering - const steeringId = undefined + const steeringId = () { + const formValue= document.getElementById('destination').value; + return !!formValue && formValue.trim().length ? formValue.trim() : undefined; + } + + const call = await client.dial({ to: document.getElementById('destination').value, logLevel: 'debug', debug: { logWsTraffic: true }, - nodeId: steeringId, + nodeId: steeringId(), }) window.__call = call diff --git a/views/index.ejs b/views/index.ejs index 23650a0..83bc72a 100644 --- a/views/index.ejs +++ b/views/index.ejs @@ -50,6 +50,10 @@ <div class="card"> <div class="card-body"> <h5>Connect</h5> + <div class="form-group"> + <label for="steeringId">Address</label> + <input type="text" class="form-control" id="steeringId" placeholder="optional freeswitch nodeid" /> + </div> <div class="form-group"> <label for="destination">Address</label> <input type="text" class="form-control" id="destination" placeholder="<%= destination %>"