Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ on:
push:
branches: # White-list of deployable tags and branches. Note that all white-listed branches cannot include any `/` characters
- next
- multi-llms

env:
rid: ${{ github.run_id }}-${{ github.run_number }}
Expand Down Expand Up @@ -258,7 +259,7 @@ jobs:
git config user.name "${GIT_AUTHOR_NAME}"

- name: Get existing changelog from documentation Branch
run: |
run: |
git fetch origin documentation
git checkout origin/documentation -- docs/changelog/logs

Expand Down
114 changes: 114 additions & 0 deletions docs/samples/browser-plugin-meetings/app.js
Original file line number Diff line number Diff line change
Expand Up @@ -780,6 +780,7 @@ function leaveMeeting(meetingId) {
publishShareBtn.disabled = true;
unpublishShareBtn.disabled = true;
enableMeetingDependentButtons(false);
clearSipCalloutFields();
});
}

Expand Down Expand Up @@ -1296,6 +1297,115 @@ function sendDtmfTones() {
}
}

// SIP Call-Out Functions --------------------------------------------------

function validateSipCalloutFields() {
const sipAddress = document.getElementById('gc-sip-address').value.trim();
const displayName = document.getElementById('gc-sip-display-name').value.trim();
const button = document.getElementById('gc-sip-callout');
const statusElm = document.getElementById('gc-sip-callout-status');

const shouldEnable = sipAddress && displayName;
button.disabled = !shouldEnable;

// Update status message
if (statusElm) {
if (!sipAddress || !displayName) {
statusElm.innerText = 'Please fill in all required fields.';
statusElm.style.color = 'orange';
} else {
statusElm.innerText = 'Ready to call out.';
statusElm.style.color = 'green';
}
}
}


function validateCancelSipFields() {
const participantId = document.getElementById('gc-sip-participant-id').value.trim();
const button = document.getElementById('gc-sip-cancel-callout');
const shouldEnable = !!participantId;
button.disabled = !shouldEnable;
}

function clearSipCalloutFields() {
document.getElementById('gc-sip-address').value = '';
document.getElementById('gc-sip-display-name').value = '';
document.getElementById('gc-sip-participant-id').value = '';
// Reset button states
validateSipCalloutFields();
validateCancelSipFields();
// Clear status messages
document.getElementById('gc-sip-callout-status').innerText = '';
document.getElementById('gc-sip-cancel-callout-status').innerText = '';
}

function callOutSipParticipant() {
const meeting = getCurrentMeeting();

if (!meeting) {
const statusElm = document.getElementById('gc-sip-callout-status');
statusElm.innerText = 'Error: No active meeting. Please join a meeting first.';
statusElm.style.color = 'red';
return;
}
// Get user input fields
const sipAddress = document.getElementById('gc-sip-address').value.trim();
const displayName = document.getElementById('gc-sip-display-name').value.trim();
const statusElm = document.getElementById('gc-sip-callout-status');
const button = document.getElementById('gc-sip-callout');
button.disabled = true;
statusElm.innerText = 'Calling out...';
statusElm.style.color = 'blue';
meeting.sipCallOut(sipAddress, displayName)
.then((data) => {
statusElm.innerText = 'SIP call-out successful!';
statusElm.style.color = 'green';
console.log('MeetingControls#callOutSipParticipant() :: success!', data);
document.getElementById('gc-sip-address').value = '';
document.getElementById('gc-sip-display-name').value = '';
button.disabled = false;
validateSipCalloutFields();
})
.catch((error) => {
statusElm.innerText = `Error: ${error.message || 'See console'}`;
statusElm.style.color = 'red';
console.error('MeetingControls#callOutSipParticipant() :: error', error);
button.disabled = false;
});
}

function cancelSipCallOut() {
const participantId = document.getElementById('gc-sip-participant-id').value.trim();
const statusElm = document.getElementById('gc-sip-cancel-status');
const button = document.getElementById('gc-sip-cancel-callout');

if (!participantId) {
statusElm.innerText = 'Please enter a participant ID.';
statusElm.style.color = 'red';
return;
}
button.disabled = true;
statusElm.innerText = 'Cancelling...';
statusElm.style.color = 'blue';
meeting.cancelSipCallOut(
participantId,
)
.then((data) => {
statusElm.innerText = 'SIP call-out cancelled!';
statusElm.style.color = 'green';
console.log('MeetingControls#cancelSipCallOut() :: success!', data);
document.getElementById('gc-sip-participant-id').value = '';
button.disabled = false;
validateCancelSipFields();
})
.catch((error) => {
statusElm.innerText = `Error: ${error.message || 'See console'}`;
statusElm.style.color = 'red';
console.error('MeetingControls#cancelSipCallOut() :: error', error);
button.disabled = false;
});
}
const localVideoQuality = {
'360p': '360p',
'480p': '480p',
Expand Down Expand Up @@ -4084,6 +4194,10 @@ function enableMeetingDependentButtons(enable) {
meetingDependentButtons.forEach((button) => {
button.disabled = !enable;
});

// Update SIP call-out button states when meeting state changes
validateSipCalloutFields();
validateCancelSipFields();
}

enableMeetingDependentButtons(false);
Expand Down
28 changes: 28 additions & 0 deletions docs/samples/browser-plugin-meetings/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -710,6 +710,34 @@ <h2 class="collapsible">
<div id="participant-btn"></div>
</div>
<p class="note multistream" id="remote-sources-info"></p>

<!-- SIP Call-Out Section -->
<div style="margin-top: 20px; border-top: 1px solid #ccc; padding-top: 15px;">
<h4>SIP Call-Out</h4>
<p class="note">NOTE: Meeting details will be automatically retrieved from the active meeting. You only need to enter the SIP address and display name.</p>
<div class="u-mv">
<label for="gc-sip-address">SIP Address *</label>
<input id="gc-sip-address" name="sipAddress" placeholder="SIP:[email protected]" value="" type="text" oninput="validateSipCalloutFields()">

<label for="gc-sip-display-name">Display Name *</label>
<input id="gc-sip-display-name" name="sipDisplayName" placeholder="Brenda DX80" value="" type="text" oninput="validateSipCalloutFields()">

<button id="gc-sip-callout" type="button" onclick="callOutSipParticipant()" disabled
class="btn-code">Call Out SIP Participant</button>
<label id="gc-sip-callout-status"></label>
</div>

<div class="u-mv" style="margin-top: 15px; border-top: 1px solid #eee; padding-top: 10px;">
<h4>Cancel SIP Call-Out</h4>
<p class="note">NOTE: Cancel an active SIP call-out using the participant ID.</p>
<label for="gc-sip-participant-id">Participant ID *</label>
<input id="gc-sip-participant-id" name="sipParticipantId" placeholder="Enter participant ID to cancel" value="" type="text" oninput="validateCancelSipFields()">

<button id="gc-sip-cancel-callout" type="button" onclick="cancelSipCallOut()" disabled
class="btn-code">Cancel SIP Call-Out</button>
<label id="gc-sip-cancel-status"></label>
</div>
</div>
</fieldset>
</div>
<!-- meetings / breakout sessions -->
Expand Down
Loading
Loading