Skip to content

Commit

Permalink
Add steering id config (#35)
Browse files Browse the repository at this point in the history
* add steerin id

* Changes around steering ID

* bub fix

---------

Co-authored-by: Giacomo Vacca <[email protected]>
  • Loading branch information
jpsantosbh and giavac authored Feb 5, 2024
1 parent d97c339 commit 677aecc
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 2 deletions.
11 changes: 9 additions & 2 deletions public/full.js
Original file line number Diff line number Diff line change
Expand Up @@ -376,13 +376,20 @@ window.connect = async () => {
connectStatus.innerHTML = 'Connecting...'

// Set a node_id for steering
const steeringId = undefined
const steeringId = () => {

const formValue= document.getElementById('steeringId').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
Expand Down
4 changes: 4 additions & 0 deletions views/index.ejs
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,10 @@
<div class="card">
<div class="card-body">
<h5>Connect</h5>
<div class="form-group">
<label for="steeringId">Steering ID</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 %>"
Expand Down

0 comments on commit 677aecc

Please sign in to comment.