Skip to content

Commit

Permalink
Commit by jgullo on 2021.12.09 - Urgent patch as the sdp format 'plan…
Browse files Browse the repository at this point in the history
…-b' which was in use by default was just officially deprecated in chrome in favor of 'unified-plan' which you can read about here https://docs.google.com/document/d/1-ZfikoUtoJa9k-GZG1daN0BU3IjIanQ_JSscHxQesvU/edit As a result, we changed the specified format and updated adapter.js to support all the newest changes.  That commit also scooped up a bunch of code we did so that typing numbers or DTMF symbols when the cursor is NOT in an input field actually dials, which is a better workflow for our heavy call center users.  We need more testing on video/screenshare as the 'unified-plan' changes are most impacting when there are multiple audio or multiple video streams, but I believe it should work.
  • Loading branch information
L1kMakes committed Dec 10, 2021
1 parent a61c7b6 commit f0432ec
Show file tree
Hide file tree
Showing 9 changed files with 1,780 additions and 1,141 deletions.
1,401 changes: 843 additions & 558 deletions release/SIPml-api.full.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion release/SIPml-api.mini.js

Large diffs are not rendered by default.

1,396 changes: 839 additions & 557 deletions src/adapter.js

Large diffs are not rendered by default.

5 changes: 4 additions & 1 deletion src/tinyMEDIA/src/tmedia_session_jsep.js
Original file line number Diff line number Diff line change
Expand Up @@ -792,7 +792,10 @@ tmedia_session_jsep01.prototype.__get_lo = function () {
var o_RTCConfiguration = Object.assign({},
{
iceServers: (o_iceServers && !o_iceServers.length) ? null : o_iceServers,
sdpSemantics: "plan-b",
//sdpSemantics: "plan-b",
// 2021.12.09 - The plan-b sdp formati is officially deprecated
// in favor of the unified plan, so we must account for it.
sdpSemantics: "unified-plan",
//iceCandidatePoolSize: b_isChrome ? 2 : 0 // experiment
},

Expand Down
4 changes: 2 additions & 2 deletions web/css/style.css
Original file line number Diff line number Diff line change
Expand Up @@ -369,12 +369,12 @@ input[type=submit].LogOut {
}

#divCallOptions {
padding-top: 15px;
/*padding-top: 15px;*/
}

.call-options {
display: none;
margin: 0px 5px;
margin: 5px 0px;
width: 100%;
padding: 5px;
background-color: #f0f0f0;
Expand Down
24 changes: 12 additions & 12 deletions web/index.php
Original file line number Diff line number Diff line change
Expand Up @@ -123,30 +123,30 @@
<table style="width: 125px; height: 180px; margin: auto;">
<tr>
<td>
<input type="button" style="width: 31%" class="btn btnDialpad" value="1" onclick="sipSendDTMF('1');" />
<input type="button" style="width: 31%" class="btn btnDialpad" value="2" onclick="sipSendDTMF('2');" />
<input type="button" style="width: 31%" class="btn btnDialpad" value="3" onclick="sipSendDTMF('3');" />
<input type="button" style="width: 31%" class="btn btnDialpad" value="1" onclick="keyPadButton('1');" />
<input type="button" style="width: 31%" class="btn btnDialpad" value="2" onclick="keyPadButton('2');" />
<input type="button" style="width: 31%" class="btn btnDialpad" value="3" onclick="keyPadButton('3');" />
</td>
</tr>
<tr>
<td>
<input type="button" style="width: 31%" class="btn btnDialpad" value="4" onclick="sipSendDTMF('4');" />
<input type="button" style="width: 31%" class="btn btnDialpad" value="5" onclick="sipSendDTMF('5');" />
<input type="button" style="width: 31%" class="btn btnDialpad" value="6" onclick="sipSendDTMF('6');" />
<input type="button" style="width: 31%" class="btn btnDialpad" value="4" onclick="keyPadButton('4');" />
<input type="button" style="width: 31%" class="btn btnDialpad" value="5" onclick="keyPadButton('5');" />
<input type="button" style="width: 31%" class="btn btnDialpad" value="6" onclick="keyPadButton('6');" />
</td>
</tr>
<tr>
<td>
<input type="button" style="width: 31%" class="btn btnDialpad" value="7" onclick="sipSendDTMF('7');" />
<input type="button" style="width: 31%" class="btn btnDialpad" value="8" onclick="sipSendDTMF('8');" />
<input type="button" style="width: 31%" class="btn btnDialpad" value="9" onclick="sipSendDTMF('9');" />
<input type="button" style="width: 31%" class="btn btnDialpad" value="7" onclick="keyPadButton('7');" />
<input type="button" style="width: 31%" class="btn btnDialpad" value="8" onclick="keyPadButton('8');" />
<input type="button" style="width: 31%" class="btn btnDialpad" value="9" onclick="keyPadButton('9');" />
</td>
</tr>
<tr>
<td>
<input type="button" style="width: 31%" class="btn btnDialpad" value="*" onclick="sipSendDTMF('*');" />
<input type="button" style="width: 31%" class="btn btnDialpad" value="0" onclick="sipSendDTMF('0');" />
<input type="button" style="width: 31%" class="btn btnDialpad" value="#" onclick="sipSendDTMF('#');" />
<input type="button" style="width: 31%" class="btn btnDialpad" value="*" onclick="keyPadButton('*');" />
<input type="button" style="width: 31%" class="btn btnDialpad" value="0" onclick="keyPadButton('0');" />
<input type="button" style="width: 31%" class="btn btnDialpad" value="#" onclick="keyPadButton('#');" />
</td>
</tr>
</table>
Expand Down
Binary file added web/js/.mainPhone.js.swp
Binary file not shown.
2 changes: 1 addition & 1 deletion web/js/SIPml-api.js

Large diffs are not rendered by default.

87 changes: 78 additions & 9 deletions web/js/mainPhone.js
Original file line number Diff line number Diff line change
Expand Up @@ -1418,7 +1418,7 @@ async function sipRegister() {
else {
uiShowHideKeyPad( 1 );
}

document.addEventListener( "keyup", globalKeyPadListener );
btnRegister.disabled = false;
return;
}
Expand Down Expand Up @@ -1587,6 +1587,75 @@ function sipHangUp() {
}
}

function globalKeyPadListener( event ) {
key = event.keyCode;
dialerInput = document.getElementById( 'txtPhoneNumber' );
// Translated to keyPadKeys([0, 1, 2, 3, 4, 5, 6, 7, 8, 9, *, #, Enter, numpad0, numpad1, numpad2, numpad3, numpad4, numpad5, numpad6, numpad7, numpad8, numpad9, numpad*]);
const keyPadKeys = new Set([48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 170, 163, 13, 96, 97, 98, 99, 100, 101, 102, 103, 104, 105, 106]);
//if ( "0" == window.localStorage.getItem( 'org.doubango.uiPref.chatVisible' ) ) {
if ( "INPUT" != document.activeElement.tagName ) {
if ( keyPadKeys.has( key ) ) {
if ( key == "48" || key == "96" ) {
document.dialerInput.value = dialerInput.value + "0";
sipSendDTMF( "0" );
}
else if ( key == "49" || key == "97" ) {
dialerInput.value = dialerInput.value + "1";
sipSendDTMF( "1" );
}
else if ( key == "50" || key == "98" ) {
dialerInput.value = dialerInput.value + "2";
sipSendDTMF( "2" );
}
else if ( key == "51" || key == "99" ) {
dialerInput.value = dialerInput.value + "3";
sipSendDTMF( "3" );
}
else if ( key == "52" || key == "100" ) {
dialerInput.value = dialerInput.value + "4";
sipSendDTMF( "4" );
}
else if ( key == "53" || key == "101" ) {
dialerInput.value = dialerInput.value + "5";
sipSendDTMF( "5" );
}
else if ( key == "54" || key == "102" ) {
dialerInput.value = dialerInput.value + "6";
sipSendDTMF( "6" );
}
else if ( key == "55" || key == "103" ) {
dialerInput.value = dialerInput.value + "7";
sipSendDTMF( "7" );
}
else if ( key == "56" || key == "104" ) {
dialerInput.value = dialerInput.value + "8";
sipSendDTMF( "8" );
}
else if ( key == "57" || key == "105" ) {
dialerInput.value = dialerInput.value + "9";
sipSendDTMF( "9" );
}
else if ( key == "170" || key == "106" ) {
dialerInput.value = dialerInput.value + "*";
sipSendDTMF( "*" );
}
else if ( key == "163" ) {
dialerInput.value = dialerInput.value + "#";
sipSendDTMF( "#" );
}
else if ( key == "13" ) {
sipCall( "call-audio" );
}
}
}
}

function keyPadButton( c ) {
currentNumber = document.getElementById( 'txtPhoneNumber' ).value;
document.getElementById( 'txtPhoneNumber' ).value = currentNumber + c;
sipSendDTMF( c );
}

function sipSendDTMF(c) {
if (oSipSessionCall && c) {
if (oSipSessionCall.dtmf(c) == 0) {
Expand Down Expand Up @@ -1789,10 +1858,10 @@ function uiCallTerminated(s_description) {

// Callback function for SIP Stacks
function onSipEventStack(e /*SIPml.Stack.Event*/) {
console.log("DEBUG00 - onSipEventStack");
console.log(e);
console.log(oSipStack);
console.log(oSipSessionCall);
//console.log("DEBUG00 - onSipEventStack");
//console.log(e);
//console.log(oSipStack);
//console.log(oSipSessionCall);
tsk_utils_log_info('==stack event = ' + e.type);
switch (e.type) {
case 'started':
Expand Down Expand Up @@ -1979,10 +2048,10 @@ console.log(oSipSessionCall);

// Callback function for SIP sessions (INVITE, REGISTER, MESSAGE...)
function onSipEventSession(e /* SIPml.Session.Event */) {
console.log("DEBUG00 - onSipEventSession");
console.log(e);
console.log(oSipStack);
console.log(oSipSessionCall);
//console.log("DEBUG00 - onSipEventSession");
//console.log(e);
//console.log(oSipStack);
//console.log(oSipSessionCall);
tsk_utils_log_info('==session event = ' + e.type);

switch (e.type) {
Expand Down

0 comments on commit f0432ec

Please sign in to comment.