Skip to content

Commit

Permalink
- *Adds support for Firefox Nightly*
Browse files Browse the repository at this point in the history
 - Fix issue 60, issue 65 and issue 66
  • Loading branch information
bossiel committed Jan 14, 2013
1 parent 222c901 commit 4691c09
Show file tree
Hide file tree
Showing 148 changed files with 673 additions and 18,666 deletions.
182 changes: 133 additions & 49 deletions SIPml.js

Large diffs are not rendered by default.

104 changes: 71 additions & 33 deletions call.htm
Expand Up @@ -18,7 +18,7 @@
DEBUG VERSION: 'SIPml-api.js'
RELEASE VERSION: 'release/SIPml-api.js'
-->
<script src="SIPml-api.js?svn=20" type="text/javascript"> </script>
<script src="SIPml-api.js?svn=165" type="text/javascript"> </script>

<!-- Styles -->
<link href="./assets/css/bootstrap.css" rel="stylesheet" />
Expand All @@ -27,6 +27,12 @@
padding-top: 80px;
padding-bottom: 40px;
}
.navbar-inner-red {
background-color: #600000;
background-image: none;
background-repeat: no-repeat;
filter: none;
}
.full-screen{
position: absolute;
left: 0;
Expand Down Expand Up @@ -109,7 +115,7 @@
var txtRegStatus, txtCallStatus;
var btnRegister, btnUnRegister;
var btnFullScreen, btnHoldResume, btnTransfer, btnKeyPad;
var videoRemote, videoLocal;
var videoRemote, videoLocal, audioRemote;
var divVideo, divCallOptions;
var tdVideo;
var bFullScreen = false;
Expand Down Expand Up @@ -144,6 +150,8 @@
videoLocal = document.getElementById("video_local");
videoRemote = document.getElementById("video_remote");

audioRemote = document.getElementById("audio_remote");

divVideo = document.getElementById("divVideo");
divCallOptions = document.getElementById("divCallOptions");
//divVideo.style.height = '0px';
Expand Down Expand Up @@ -359,7 +367,7 @@
enable_rtcweb_breaker: (window.localStorage ? window.localStorage.getItem('org.doubango.expert.enable_rtcweb_breaker') == "true" : false),
events_listener: { events: '*', listener: onSipEventStack },
sip_headers: [
{ name: 'User-Agent', value: 'IM-client/OMA1.0 sipML5-v1.07.01.2013' },
{ name: 'User-Agent', value: 'IM-client/OMA1.0 sipML5-v1.2013.01.14' },
{ name: 'Organization', value: 'Doubango Telecom' }
]
}
Expand All @@ -386,6 +394,7 @@
function sipCall() {
// call configuration
var oConf = {
audio_remote: audioRemote,
video_local: viewVideoLocal,
video_remote: viewVideoRemote,
events_listener: { events: '*', listener: onSipEventSession },
Expand Down Expand Up @@ -552,7 +561,7 @@
}

function uiVideoDisplayEvent(b_local, b_added) {
if (!bDisableVideo) {
//if (!bDisableVideo) {
var o_elt_video = b_local ? videoLocal : videoRemote;

if (b_added) {
Expand All @@ -576,7 +585,7 @@
}
fullScreen(false);
}
}
//}
}

function uiVideoDisplayShowHide(b_show) {
Expand All @@ -591,6 +600,33 @@
btnFullScreen.disabled = !b_show;
}

function uiCallTerminated(s_description){
btnCall.value = 'Call';
btnHangUp.value = 'HangUp';
btnHoldResume.value = 'hold';
btnCall.disabled = false;
btnHangUp.disabled = true;

oSipSessionCall = null;

stopRingbackTone();
stopRingTone();

txtCallStatus.innerHTML = "<i>" + s_description + "</i>";
uiVideoDisplayShowHide(false);
divCallOptions.style.opacity = 0;

if (oNotifICall) {
oNotifICall.cancel();
oNotifICall = null;
}

uiVideoDisplayEvent(true, false);
uiVideoDisplayEvent(false, false);

setTimeout(function () { if (!oSipSessionCall) txtCallStatus.innerHTML = ''; }, 2500);
}

// Callback function for SIP Stacks
function onSipEventStack(e /*SIPml.Stack.Event*/) {
if (window.console) window.console.info('==stack event = ' + e.type);
Expand Down Expand Up @@ -652,14 +688,29 @@
btnHangUp.disabled = false;

startRingTone();

var sRemoteNumber = (oSipSessionCall.getRemoteFriendlyName() || 'unknown');
txtCallStatus.innerHTML = "<i>Incoming call from [<b>" + sRemoteNumber + "</b>]</i>";
showNotifICall(sRemoteNumber);
}
break;
}

case 'm_permission_requested':
{
document.getElementById('divNavbarInner').setAttribute('class', 'navbar-inner-red');
break;
}
case 'm_permission_accepted':
case 'm_permission_refused':
{
document.getElementById('divNavbarInner').setAttribute('class', 'navbar-inner');
if(e.type == 'm_permission_refused'){
uiCallTerminated('Media stream permission denied');
}
break;
}

case 'starting': default: break;
}
};
Expand Down Expand Up @@ -713,30 +764,7 @@
txtRegStatus.innerHTML = "<i>" + e.description + "</i>";
}
else if (e.session == oSipSessionCall) {
btnCall.value = 'Call';
btnHangUp.value = 'HangUp';
btnHoldResume.value = 'hold';
btnCall.disabled = false;
btnHangUp.disabled = true;

oSipSessionCall = null;

stopRingbackTone();
stopRingTone();

txtCallStatus.innerHTML = "<i>" + e.description + "</i>";
uiVideoDisplayShowHide(false);
divCallOptions.style.opacity = 0;

if (oNotifICall) {
oNotifICall.cancel();
oNotifICall = null;
}

uiVideoDisplayEvent(true, false);
uiVideoDisplayEvent(false, false);

setTimeout(function () { if (!oSipSessionCall) txtCallStatus.innerHTML = ''; }, 2500);
uiCallTerminated(e.description);
}
break;
} // 'terminating' | 'terminated'
Expand Down Expand Up @@ -769,6 +797,15 @@
}
break;
}

case 'm_stream_audio_local_added':
case 'm_stream_audio_local_removed':
case 'm_stream_audio_remote_added':
case 'm_stream_audio_remote_removed':
{
break;
}

case 'i_ect_new_call':
{
oSipSessionTransferCall = e.session;
Expand Down Expand Up @@ -930,15 +967,15 @@
</script>
<body style="cursor:wait">
<div class="navbar navbar-fixed-top">
<div class="navbar-inner">
<div id="divNavbarInner" class="navbar-inner">
<div class="container">
<a class="btn btn-navbar" data-toggle="collapse" data-target=".nav-collapse"><span
class="icon-bar"></span><span class="icon-bar"></span><span class="icon-bar"></span>
</a>
<img alt="sipML5" class="brand" src="./images/sipml-34x39.png" />
<div class="nav-collapse">
<ul class="nav">
<li class="active"><a href="index.html?svn=20">Home</a></li>
<li class="active"><a href="index.html?svn=165">Home</a></li>
</ul>
</div>
<!--/.nav-collapse -->
Expand Down Expand Up @@ -1113,8 +1150,9 @@ <h2>
<script type="text/javascript" src="./assets/js/bootstrap-typeahead.js"></script>

<!-- Audios -->
<audio id="audio_remote" autoplay="autoplay" />
<audio id="ringtone" loop src="sounds/ringtone.wav" />
<audio id="ringbacktone" loop src="sounds/ringbacktone.wav" />
<audio id="ringbacktone" loop src="sounds/ringbacktone.wav" />

<!--
Microsoft Internet Explorer extension
Expand Down
4 changes: 3 additions & 1 deletion docgen.index.html
Expand Up @@ -97,7 +97,8 @@ <h1>Programing with the API</h1>
events_listener: { events: 'started', listener: function(<a href="docgen/symbols/SIPml.Stack.Event.html">e</a>){
var callSession = stack.<a href="docgen/symbols/SIPml.Stack.html#newSession">newSession</a>('call-audiovideo', {
video_local: document.getElementById('video-local'),
video_remote: document.getElementById('video-remote')
video_remote: document.getElementById('video-remote'),
audio_remote: document.getElementById('audio-remote')
});
callSession.<a href="docgen/symbols/SIPml.Session.Call.html#call">call</a>('alice');
}
Expand Down Expand Up @@ -226,6 +227,7 @@ <h2>Making/receiving audio/video call</h2>
callSession = <a href="docgen/symbols/SIPml.Stack.html#newSession">sipStack.newSession</a>('call-audiovideo', {
video_local: document.getElementById('video-local'),
video_remote: document.getElementById('video-remote'),
audio_remote: document.getElementById('audio-remote'),
events_listener: { events: '*', listener: eventsListener } // optional: '*' means all events
});
callSession.call('johndoe');
Expand Down
129 changes: 0 additions & 129 deletions docs/html/_conding.html

This file was deleted.

0 comments on commit 4691c09

Please sign in to comment.