2
0
Mark Crane 11 жил өмнө
parent
commit
ac3581a844
4 өөрчлөгдсөн 276 нэмэгдсэн , 78 устгасан
  1. 0 0
      sipml5/SIPml-api.js
  2. 179 54
      sipml5/call.htm
  3. 85 8
      sipml5/expert.htm
  4. 12 16
      sipml5/index.php

Файлын зөрүү хэтэрхий том тул дарагдсан байна
+ 0 - 0
sipml5/SIPml-api.js


+ 179 - 54
sipml5/call.htm

@@ -18,7 +18,7 @@
     DEBUG VERSION: 'SIPml-api.js'
     RELEASE VERSION: 'release/SIPml-api.js'
     -->
-    <script src="SIPml-api.js?svn=179" type="text/javascript"> </script>
+    <script src="SIPml-api.js?svn=224" type="text/javascript"> </script>
 
     <!-- Styles -->
     <link href="./assets/css/bootstrap.css" rel="stylesheet" />
@@ -123,7 +123,7 @@
 
     // to avoid caching
     //if (window.location.href.indexOf("svn=") == -1) {
-    //    window.location.href += (window.location.href.indexOf("?") == -1 ? "?svn=13" : "&svn=13");
+    //    window.location.href += (window.location.href.indexOf("?") == -1 ? "?svn=224" : "&svn=224");
     //}
 
     var sTransferNumber;
@@ -132,9 +132,10 @@
     var videoRemote, videoLocal, audioRemote;
     var bFullScreen = false;
     var oNotifICall;
-    var oReadyStateTimer;
     var bDisableVideo = false;
     var viewVideoLocal, viewVideoRemote; // <video> (webrtc) or <div> (webrtc4all)
+    var oConfigCall;
+    var oReadyStateTimer;
 
     C = 
     {
@@ -142,6 +143,9 @@
     };
 
     window.onload = function () {
+        if(window.console) {
+            window.console.info("location=" + window.location);
+        }
         videoLocal = document.getElementById("video_local");
         videoRemote = document.getElementById("video_remote");
         audioRemote = document.getElementById("audio_remote");
@@ -150,23 +154,66 @@
         document.body.onkeyup = onKeyUp;
         divCallCtrl.onmousemove = onDivCallCtrlMouseMove;
 
+        // set debug level
+        SIPml.setDebugLevel((window.localStorage && window.localStorage.getItem('org.doubango.expert.disable_debug') == "true") ? "error" : "info");
+
         loadCredentials();
         loadCallOptions();
 
+        // Initialize call button
+        uiBtnCallSetText("Call");
+
+        var getPVal = function (PName) {
+            var query = window.location.search.substring(1);
+            var vars = query.split('&');
+            for (var i = 0; i < vars.length; i++) {
+                var pair = vars[i].split('=');
+                if (decodeURIComponent(pair[0]) === PName) {
+                    return decodeURIComponent(pair[1]);
+                }
+            }
+            return null;
+        }
+
+        var preInit = function() {
+            // set default webrtc type (before initialization)
+            var s_webrtc_type = getPVal("wt");
+            if (s_webrtc_type) {
+                if(window.console) {
+                    window.console.info("s_webrtc_type=" + s_webrtc_type);
+                }
+                SIPml.setWebRtcType(s_webrtc_type);
+            }
+
+            // initialize SIPML5
+            SIPml.init(postInit);
+        }
+
         oReadyStateTimer = setInterval(function () {
             if (document.readyState === "complete") {
                 clearInterval(oReadyStateTimer);
                 // initialize SIPML5
-                SIPml.init(postInit);
+                preInit();
             }
         },
         500);
+
+        /*if (document.readyState === "complete") {
+            preInit();
+        }
+        else {
+            document.onreadystatechange = function () {
+                 if (document.readyState === "complete") {
+                    preInit();
+                }
+            }
+       }*/
     };
 
     function postInit() {
         // check webrtc4all version
         if (SIPml.isWebRtc4AllSupported() && SIPml.isWebRtc4AllPluginOutdated()) {            
-            if (confirm("Your WebRtc4all extension is outdated. A new version(" +SIPml.getWebRtc4AllVersion()+") with critical bug fix is available. Do you want to install it?\nIMPORTANT: You must restart your browser after the installation.")) {
+            if (confirm("Your WebRtc4all extension is outdated ("+SIPml.getWebRtc4AllVersion()+"). A new version with critical bug fix is available. Do you want to install it?\nIMPORTANT: You must restart your browser after the installation.")) {
                 window.location = 'http://code.google.com/p/webrtc4all/downloads/list';
                 return;
             }
@@ -265,9 +312,22 @@
                 window.location = 'https://www.google.com/intl/en/chrome/browser/';
             }
         }
-
+        
         btnRegister.disabled = false;
         document.body.style.cursor = 'default';
+        oConfigCall = {
+            audio_remote: audioRemote,
+            video_local: viewVideoLocal,
+            video_remote: viewVideoRemote,
+            bandwidth: { audio:undefined, video:undefined },
+            video_size: { minWidth:undefined, minHeight:undefined, maxWidth:undefined, maxHeight:undefined },
+            events_listener: { events: '*', listener: onSipEventSession },
+            sip_caps: [
+                            { name: '+g.oma.sip-im' },
+                            { name: '+sip.ice' },
+                            { name: 'language', value: '\"en,fr\"' }
+                        ]
+        };
     }
 
 
@@ -301,9 +361,9 @@
         else {
             /*txtDisplayName.value = "005";
             txtPrivateIdentity.value = "005";
-            txtPublicIdentity.value = "sip:[email protected].42";
+            txtPublicIdentity.value = "sip:[email protected]8";
             txtPassword.value = "005";
-            txtRealm.value = "192.168.0.42";
+            txtRealm.value = "192.168.0.28";
             txtPhoneNumber.value = "005";*/
         }
     };
@@ -343,6 +403,9 @@
             // save credentials
             saveCredentials();
 
+            // update debug level to be sure new values will be used if the user haven't updated the page
+            SIPml.setDebugLevel((window.localStorage && window.localStorage.getItem('org.doubango.expert.disable_debug') == "true") ? "error" : "info");
+
             // create SIP stack
             oSipStack = new SIPml.Stack({
                     realm: txtRealm.value,
@@ -355,8 +418,12 @@
                     ice_servers: (window.localStorage ? window.localStorage.getItem('org.doubango.expert.ice_servers') : null),
                     enable_rtcweb_breaker: (window.localStorage ? window.localStorage.getItem('org.doubango.expert.enable_rtcweb_breaker') == "true" : false),
                     events_listener: { events: '*', listener: onSipEventStack },
+                    enable_early_ims: (window.localStorage ? window.localStorage.getItem('org.doubango.expert.disable_early_ims') != "true" : true), // Must be true unless you're using a real IMS network
+                    enable_media_stream_cache: (window.localStorage ? window.localStorage.getItem('org.doubango.expert.enable_media_caching') == "true" : false),
+                    bandwidth: (window.localStorage ? tsk_string_to_object(window.localStorage.getItem('org.doubango.expert.bandwidth')) : null), // could be redefined a session-level
+                    video_size: (window.localStorage ? tsk_string_to_object(window.localStorage.getItem('org.doubango.expert.video_size')) : null), // could be redefined a session-level
                     sip_headers: [
-                            { name: 'User-Agent', value: 'IM-client/OMA1.0 sipML5-v1.2013.05.24' },
+                            { name: 'User-Agent', value: 'IM-client/OMA1.0 sipML5-v1.2014.04.18' },
                             { name: 'Organization', value: 'Doubango Telecom' }
                     ]
                 }
@@ -380,27 +447,31 @@
     }
 
     // makes a call (SIP INVITE)
-    function sipCall() {
-        // call configuration
-        var oConf = {
-            audio_remote: audioRemote,
-            video_local: viewVideoLocal,
-            video_remote: viewVideoRemote,
-            events_listener: { events: '*', listener: onSipEventSession },
-            sip_caps: [
-                            { name: '+g.oma.sip-im' },
-                            { name: '+sip.ice' },
-                            { name: 'language', value: '\"en,fr\"' }
-                        ]
-        };
+    function sipCall(s_type) {
         if (oSipStack && !oSipSessionCall && !tsk_string_is_null_or_empty(txtPhoneNumber.value)) {
+            if(s_type == 'call-screenshare') {
+                if(!SIPml.isScreenShareSupported()) {
+                    alert('Screen sharing not supported. Are you using chrome 26+?');
+                    return;
+                }
+                if (!location.protocol.match('https')){
+                    if (confirm("Screen sharing requires https://. Do you want to be redirected?")) {
+                        sipUnRegister();
+                        window.location = 'https://ns313841.ovh.net/call.htm';
+                    }
+                    return;
+                }
+            }
             btnCall.disabled = true;
             btnHangUp.disabled = false;
 
-            // check whether video is disabled or not
-            bDisableVideo = (window.localStorage && window.localStorage.getItem('org.doubango.expert.disable_video') == "true");
+            if(window.localStorage) {
+                oConfigCall.bandwidth = tsk_string_to_object(window.localStorage.getItem('org.doubango.expert.bandwidth')); // already defined at stack-level but redifined to use latest values
+                oConfigCall.video_size = tsk_string_to_object(window.localStorage.getItem('org.doubango.expert.video_size')); // already defined at stack-level but redifined to use latest values
+            }
+            
             // create call session
-            oSipSessionCall = oSipStack.newSession(bDisableVideo ? 'call-audio' : 'call-audiovideo', oConf);
+            oSipSessionCall = oSipStack.newSession(s_type, oConfigCall);
             // make call
             if (oSipSessionCall.call(txtPhoneNumber.value) != 0) {
                 oSipSessionCall = null;
@@ -413,7 +484,7 @@
         }
         else if (oSipSessionCall) {
             txtCallStatus.innerHTML = '<i>Connecting...</i>';
-            oSipSessionCall.accept(oConf);
+            oSipSessionCall.accept(oConfigCall);
         }
     }
 
@@ -572,31 +643,29 @@
     }
 
     function uiVideoDisplayEvent(b_local, b_added) {
-        //if (!bDisableVideo) {
-            var o_elt_video = b_local ? videoLocal : videoRemote;
+        var o_elt_video = b_local ? videoLocal : videoRemote;
 
-            if (b_added) {
-                if (SIPml.isWebRtc4AllSupported()) {
-                    if (b_local){ if(window.__o_display_local) window.__o_display_local.style.visibility = "visible"; }
-                    else { if(window.__o_display_remote) window.__o_display_remote.style.visibility = "visible"; }
+        if (b_added) {
+            if (SIPml.isWebRtc4AllSupported()) {
+                if (b_local){ if(window.__o_display_local) window.__o_display_local.style.visibility = "visible"; }
+                else { if(window.__o_display_remote) window.__o_display_remote.style.visibility = "visible"; }
                    
-                }
-                else {
-                    o_elt_video.style.opacity = 1;
-                }
-                uiVideoDisplayShowHide(true);
             }
             else {
-                if (SIPml.isWebRtc4AllSupported()) {
-                    if (b_local){ if(window.__o_display_local) window.__o_display_local.style.visibility = "hidden"; }
-                    else { if(window.__o_display_remote) window.__o_display_remote.style.visibility = "hidden"; }
-                }
-                else{
-                    o_elt_video.style.opacity = 0;
-                }
-                fullScreen(false);
+                o_elt_video.style.opacity = 1;
+            }
+            uiVideoDisplayShowHide(true);
+        }
+        else {
+            if (SIPml.isWebRtc4AllSupported()) {
+                if (b_local){ if(window.__o_display_local) window.__o_display_local.style.visibility = "hidden"; }
+                else { if(window.__o_display_remote) window.__o_display_remote.style.visibility = "hidden"; }
             }
-        //}
+            else{
+                o_elt_video.style.opacity = 0;
+            }
+            fullScreen(false);
+        }
     }
 
     function uiVideoDisplayShowHide(b_show) {
@@ -611,8 +680,48 @@
         btnFullScreen.disabled = !b_show;
     }
 
+    function uiDisableCallOptions() {
+        if(window.localStorage) {
+            window.localStorage.setItem('org.doubango.expert.disable_callbtn_options', 'true');
+            uiBtnCallSetText('Call');
+            alert('Use expert view to enable the options again (/!\\requires re-loading the page)');
+        }
+    }
+
+    function uiBtnCallSetText(s_text) {
+        switch(s_text) {
+            case "Call":
+                {
+                    var bDisableCallBtnOptions = (window.localStorage && window.localStorage.getItem('org.doubango.expert.disable_callbtn_options') == "true");
+                    btnCall.value = btnCall.innerHTML = bDisableCallBtnOptions ? 'Call' : 'Call <span id="spanCaret" class="caret">';
+                    btnCall.setAttribute("class", bDisableCallBtnOptions ? "btn btn-primary" : "btn btn-primary dropdown-toggle");
+                    btnCall.onclick = bDisableCallBtnOptions ? function(){ sipCall(bDisableVideo ? 'call-audio' : 'call-audiovideo'); } : null;
+                    ulCallOptions.style.visibility = bDisableCallBtnOptions ? "hidden" : "visible";
+                    if(!bDisableCallBtnOptions && ulCallOptions.parentNode != divBtnCallGroup){
+                        divBtnCallGroup.appendChild(ulCallOptions);
+                    }
+                    else if(bDisableCallBtnOptions && ulCallOptions.parentNode == divBtnCallGroup) {
+                        document.body.appendChild(ulCallOptions);
+                    }
+                    
+                    break;
+                }
+            default:
+                {
+                    btnCall.value = btnCall.innerHTML = s_text;
+                    btnCall.setAttribute("class", "btn btn-primary");
+                    btnCall.onclick = function(){ sipCall(bDisableVideo ? 'call-audio' : 'call-audiovideo'); };
+                    ulCallOptions.style.visibility = "hidden";
+                    if(ulCallOptions.parentNode == divBtnCallGroup){
+                        document.body.appendChild(ulCallOptions);
+                    }
+                    break;
+                }
+        }
+    }
+
     function uiCallTerminated(s_description){
-        btnCall.value = 'Call';
+        uiBtnCallSetText("Call");
         btnHangUp.value = 'HangUp';
         btnHoldResume.value = 'hold';
         btnCall.disabled = false;
@@ -692,8 +801,10 @@
                     }
                     else {
                         oSipSessionCall = e.newSession;
+                        // start listening for events
+                        oSipSessionCall.setConfiguration(oConfigCall);
 
-                        btnCall.value = 'Answer';
+                        uiBtnCallSetText('Answer');
                         btnHangUp.value = 'Reject';
                         btnCall.disabled = false;
                         btnHangUp.disabled = false;
@@ -986,7 +1097,7 @@
                 <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=179">Home</a></li>
+                        <li class="active"><a href="index.html?svn=224">Home</a></li>
                     </ul>
                 </div>
                 <!--/.nav-collapse -->
@@ -1050,9 +1161,9 @@
                     </tr>
                     <tr>
                         <td colspan="2" align="right">
-                            <input type="button" class="btn-success" id="btnRegister" value="LogIn" disabled onclick='sipRegister();' />
+                            <input type="button" class="btn btn-success" id="btnRegister" value="LogIn" disabled onclick='sipRegister();' />
                             &nbsp;
-                            <input type="button" class="btn-danger" id="btnUnRegister" value="LogOut" disabled onclick='sipUnRegister();' />
+                            <input type="button" class="btn btn-danger" id="btnUnRegister" value="LogOut" disabled onclick='sipUnRegister();' />
                         </td>
                     </tr>
                     <tr>
@@ -1087,8 +1198,14 @@
                     </tr>
                     <tr>
                         <td colspan="1" align="right">
-                            <input type="button" class="btn-primary" style="" id="btnCall" value="Call" onclick='sipCall();' disabled /> &nbsp;
-                            <input type="button" class="btn-primary" style="" id="btnHangUp" value="HangUp" onclick='sipHangUp();' disabled />
+                            <div class="btn-toolbar" style="margin: 0; vertical-align:middle">
+                                <div id="divBtnCallGroup" class="btn-group">
+                                    <button id="btnCall" disabled class="btn btn-primary" data-toggle="dropdown">Call</button>
+                                </div>&nbsp;&nbsp;
+                                <div class="btn-group">
+                                    <input type="button" id="btnHangUp" style="margin: 0; vertical-align:middle; height: 100%;" class="btn btn-primary" value="HangUp" onclick='sipHangUp();' disabled />
+                                </div>
+                             </div>
                         </td>
                     </tr>
                     <tr>
@@ -1131,7 +1248,7 @@
                 Will open confirmation dialogs if not already done
             -->
             <object id="fakeVideoDisplay" classid="clsid:5C2C407B-09D9-449B-BB83-C39B7802A684" style="visibility:hidden;"> </object>
-            <object id="fakeLooper" classid="clsid:7082C446-54A8-4280-A18D-54143846211A" style="visibility:hidden;"> </object>
+            <object id="fakeLooper" classid="clsid:7082C446-54A8-4280-A18D-54143846211A" style="visibility:visible; width:0px; height:0px"> </object>
             <object id="fakeSessionDescription" classid="clsid:DBA9F8E2-F9FB-47CF-8797-986A69A1CA9C" style="visibility:hidden;"> </object>
             <object id="fakeNetTransport" classid="clsid:5A7D84EC-382C-4844-AB3A-9825DBE30DAE" style="visibility:hidden;"> </object>
             <object id="fakePeerConnection" classid="clsid:56D10AD3-8F52-4AA4-854B-41F4D6F9CEA3" style="visibility:hidden;"> </object>
@@ -1155,6 +1272,14 @@
             <tr><td colspan=3><input type="button" style="width: 100%" class="btn btn-medium btn-danger" value="close" onclick="closeKeyPad();" /></td></tr>
         </table>
     </div>
+    <!-- Call button options -->
+    <ul id="ulCallOptions" class="dropdown-menu" style="visibility:hidden">
+        <li><a href="#" onclick='sipCall("call-audio");'>Audio</a></li>
+        <li><a href="#" onclick='sipCall("call-audiovideo");'>Video</a></li>
+        <li id='liScreenShare' ><a href="#" onclick='sipCall("call-screenshare");'>Screen Share</a></li>
+        <li class="divider"></li>
+        <li><a href="#" onclick='uiDisableCallOptions();'><b>Disable these options</b></a></li>
+    </ul>
 
     <!-- Le javascript
     ================================================== -->

+ 85 - 8
sipml5/expert.htm

@@ -48,7 +48,7 @@
         txtSIPOutboundProxyUrl = document.getElementById("txtSIPOutboundProxyUrl");
         txtInfo = document.getElementById("txtInfo");
 
-        txtWebsocketServerUrl.disabled = !window.WebSocket;
+        txtWebsocketServerUrl.disabled = !window.WebSocket || navigator.appName == "Microsoft Internet Explorer"; // Do not use WS on IE
         document.getElementById("btnSave").disabled = !window.localStorage;
         document.getElementById("btnRevert").disabled = !window.localStorage;
 
@@ -65,6 +65,12 @@
         }
         window.localStorage.setItem('org.doubango.expert.sip_outboundproxy_url', txtSIPOutboundProxyUrl.value);
         window.localStorage.setItem('org.doubango.expert.ice_servers', txtIceServers.value);
+        window.localStorage.setItem('org.doubango.expert.bandwidth', txtBandwidth.value);
+        window.localStorage.setItem('org.doubango.expert.video_size', txtSizeVideo.value);
+        window.localStorage.setItem('org.doubango.expert.disable_early_ims', cbEarlyIMS.checked ? "true" : "false");
+        window.localStorage.setItem('org.doubango.expert.disable_debug', cbDebugMessages.checked ? "true" : "false");
+        window.localStorage.setItem('org.doubango.expert.enable_media_caching', cbCacheMediaStream.checked ? "true" : "false");
+        window.localStorage.setItem('org.doubango.expert.disable_callbtn_options', cbCallButtonOptions.checked ? "true" : "false");
 
         txtInfo.innerHTML = '<i>Saved</i>';
     }
@@ -75,6 +81,13 @@
         txtWebsocketServerUrl.value = (window.localStorage.getItem('org.doubango.expert.websocket_server_url') || "");
         txtSIPOutboundProxyUrl.value = (window.localStorage.getItem('org.doubango.expert.sip_outboundproxy_url') || "");
         txtIceServers.value = (window.localStorage.getItem('org.doubango.expert.ice_servers') || "");
+        txtBandwidth.value = (window.localStorage.getItem('org.doubango.expert.bandwidth') || "");
+        txtSizeVideo.value = (window.localStorage.getItem('org.doubango.expert.video_size') || "");
+        cbEarlyIMS.checked = (window.localStorage.getItem('org.doubango.expert.disable_early_ims') == "true");
+        cbDebugMessages.checked = (window.localStorage.getItem('org.doubango.expert.disable_debug') == "true");
+        cbCacheMediaStream.checked = (window.localStorage.getItem('org.doubango.expert.enable_media_caching') == "true");
+        cbCallButtonOptions.checked = (window.localStorage.getItem('org.doubango.expert.disable_callbtn_options') == "true");
+
 
         if (!bNotUserAction) {
             txtInfo.innerHTML = '<i>Reverted</i>';
@@ -129,7 +142,54 @@
                         <input type="text" style="width: 100%; height: 100%" id="txtIceServers" value="" placeholder="e.g. [{ url: 'stun:stun.l.google.com:19302'}, { url:'turn:[email protected]', credential:'myPassword'}]" />
                     </td>
                 </tr>
-
+                <tr>
+                    <td>
+                        <label style="height: 100%">Max bandwidth (kbps)<sup><a href="#aBandwidth">[5]</a></sup>:</label>
+                    </td>
+                    <td>
+                        <input type="text" style="width: 100%; height: 100%" id="txtBandwidth" value="" placeholder="{ audio:64, video:512 }" />
+                    </td>
+                </tr>
+                <tr>
+                    <td>
+                        <label style="height: 100%">Video size<sup><a href="#aSizeVideo">[6]</a></sup>:</label>
+                    </td>
+                    <td>
+                        <input type="text" style="width: 100%; height: 100%" id="txtSizeVideo" value="" placeholder="{ minWidth: 640, minHeight:480, maxWidth: 640, maxHeight:480 }" />
+                    </td>
+                </tr>
+                <tr>
+                    <td>
+                        <label style="height: 100%">Disable 3GPP Early IMS<sup><a href="#aEarlyIMS">[7]</a></sup>:</label>
+                    </td>
+                    <td>
+                        <input type='checkbox' id='cbEarlyIMS' />
+                    </td>
+                </tr>
+                <tr>
+                    <td>
+                        <label style="height: 100%">Disable debug messages<sup><a href="#aDebugMessages">[8]</a></sup>:</label>
+                    </td>
+                    <td>
+                        <input type='checkbox' id='cbDebugMessages' />
+                    </td>
+                </tr>
+                <tr>
+                    <td>
+                        <label style="height: 100%">Cache the media stream<sup><a href="#aCacheMediaStream">[9]</a></sup>:</label>
+                    </td>
+                    <td>
+                        <input type='checkbox' id='cbCacheMediaStream' />
+                    </td>
+                </tr>
+                <tr>
+                    <td>
+                        <label style="height: 100%">Disable Call button options<sup><a href="#aCallButtonOptions">[10]</a></sup>:</label>
+                    </td>
+                    <td>
+                        <input type='checkbox' id='cbCallButtonOptions' />
+                    </td>
+                </tr>
                 <tr>
                     <td colspan="2" align="right">
                         <input type="button" class="btn-success" id="btnSave" value="Save" onclick='settingsSave();' />
@@ -137,13 +197,14 @@
                         <input type="button" class="btn-danger" id="btnRevert" value="Revert" onclick='settingsRevert();' />
                     </td>
                </tr>
+
             </table>
         </div>
     </div>
 
     <hr />
     <footer>
-        
+            
             <a name="aRTCWebBreaker"><sup><b>[1]</b></sup></a> The <b>RTCWeb Breaker</b> is used to enable audio and video transcoding when the endpoints do not support the same codecs or the remote server is not RTCWeb-compliant. Please note that the <b>Media Coder</b> will most likely be disabled on the <b>sipml5.org</b> hosted server.<br />
             For example, you can enable this feature if:
             <ul>
@@ -155,15 +216,31 @@
                 <li>Your media server is not RTCWeb-capable (e.g. <b>FreeSWITCH</b>)</li>
             </ul>
             Please check the <a href="http://webrtc2sip.org/technical-guide-1.0.pdf">Technical guide</a> for more information about the <b>RTCWeb Breaker</b> and <b>Media Coder</b>.<br />
-
+            
             <a name="aWebSocketServerURL"><sup><b>[2]</b></sup></a> The <b>WebSocket Server URL</b> is only required if you're a developer and using your own SIP Proxy gateway not publicly reachable. <br />
-
+            
             <a name="aSIPOutboundProxyURL"><sup><b>[3]</b></sup></a> The <b>SIP outbound Proxy URL</b> is used to set the destination IP address and Port to use for all outgoing requests regardless the <i>domain name</i> (a.k.a <i>realm</i>).
             This is a good option for developers using a SIP domain name without valid DNS A/NAPTR/SRV records. <br />
-
+            
             <a name="aIceServers"><sup><b>[4]</b></sup></a> This must be an array of STUN/TURN servers to use. The format is as explained at <a href="http://www.w3.org/TR/webrtc/#rtciceserver-type">http://www.w3.org/TR/webrtc/#rtciceserver-type</a> <br />
-            Example: <i>[{ url: 'stun:stun.l.google.com:19302'}, { url:'turn:[email protected]', credential:'myPassword'}]</i>
-        
+            To disable TURN/STUN to speedup ICE candidates gathering you can use an empty array. e.g. <i>[]</i>. <br />
+            Example: <i>[{ url: 'stun:stun.l.google.com:19302'}, { url:'turn:[email protected]', credential:'myPassword'}]</i> <br />
+            
+            <a name="aBandwidth"><sup><b>[5]</b></sup></a> Defines the maximum audio and video bandwidth to use. This will change the outhoing SDP to include a "b:AS=" attribute. Use <i>0</i> to let the browser negotiates the right value using RTCP-REMB and congestion control.<br />
+            Example: <i>{ audio:64, video:512 }</i> <br />
+
+            <a name="aSizeVideo"><sup><b>[6]</b></sup></a> Defines the maximum and minimum video size to be used. All values are optional. The browser will try to find the best video size between <i>max</i> and <i>min</i> based on the camera capabilities. <br />
+            Example: <i><b>{</b> minWidth: 640, minHeight:480, maxWidth: 640, maxHeight:480 <b>}</b></i>. The <b>{</b> and <b>}</b> around the values are required. <br />
+            
+            <a name="aEarlyIMS"><sup><b>[7]</b></sup></a> Whether to enable 3GGP Early IMS as per <a href="http://www.arib.or.jp/english/html/overview/doc/STD-T63v9_60/5_Appendix/Rel6/33/33978-660.pdf" target=_blank>TR 33.978</a>. This option should not be checked unless you're using a real IMS/LTE network. <br />
+            If earlyIMS is disabled then, authentication will be done as per <i>3GPP TS 24.229 - 5.1.1.2.2</i>. <br />
+            
+            <a name="aDebugMessages"><sup><b>[8]</b></sup></a> Whether to disable debug messages. SIPML5 supports #4 debug levels: <i>INFO</i>, <i>WARN</i>, <i>ERROR</i> and <i>FATAL</i>. Default level is <i>INFO</i>. Check this option to set the level value to <i>ERROR</i>. <br />
+            
+            <a name="aCacheMediaStream"><sup><b>[9]</b></sup></a> Whether to reuse the same media stream for all calls. If your website is <b>not using https</b> then, the browser will request access to the camera (or microphone) every time you try to make a call. Caching the media stream will avoid getting these notifications for each call. <br />
+            
+            <a name="aCallButtonOptions"><sup><b>[10]</b></sup></a> Whether to add options (<i>Audio</i>, <i>Video</i>, <i>Screen share</i>) in the the call button. <br />
+
     </footer>
 </body>
 </html>

+ 12 - 16
sipml5/index.php

@@ -1,11 +1,4 @@
-<?php
-
-require_once "root.php";
-require_once "resources/require.php";
-require_once "resources/check_auth.php";
-
-?>
-<!DOCTYPE html>
+<!DOCTYPE html>
 <!--
 * Copyright (C) 2012 Doubango Telecom <http://www.doubango.org>
 * License: BSD
@@ -57,12 +50,12 @@ require_once "resources/check_auth.php";
             <span class="icon-bar"></span>
             <span class="icon-bar"></span>
           </a>
-          <a class="brand" href="./index.html">Doubango Telecom</a>
+          <a class="brand" target=_blank href="http://doubango.org">Doubango Telecom</a>
           <div class="nav-collapse">
             <ul class="nav">
-              <li class="active"><a href="index.html?svn=179">Home</a></li>
+              <li class="active"><a href="index.html?svn=224">Home</a></li>
               <li><a href="http://code.google.com/p/sipml5/source/checkout" target="_blank">Source code</a></li>
-              <li><a href="docgen/index.html?svn=179">Programmer's Guide</a></li>
+              <li><a href="docgen/index.html?svn=224">Programmer's Guide</a></li>
               <li><a href="contact.htm">Contact</a></li>
             </ul>
           </div><!--/.nav-collapse -->
@@ -78,7 +71,7 @@ require_once "resources/check_auth.php";
         <p>This is the world's first open source (<a target=_blank href="http://opensource.org/licenses/BSD-3-Clause">BSD license</a>) HTML5 SIP client entirely written in javascript for integration in social networks (FaceBook, Twitter, Google+), online games, e-commerce websites, email signatures... No extension, plugin or gateway is needed. The media stack rely on <a href="http://en.wikipedia.org/wiki/WebRTC" target="_blank">WebRTC</a>.<br />
          The client can be used to connect to any SIP or IMS network from your preferred browser to make and receive audio/video calls and instant messages.<br />
         </p>
-        <p><a class="btn btn-primary btn-large" href="call.htm?svn=179" target="_blank">Enjoy our live demo &raquo;</a></p>
+        <p><a class="btn btn-primary btn-large" href="call.htm?svn=224" target="_blank">Enjoy our live demo &raquo;</a></p>
       </div>
 
 
@@ -88,12 +81,13 @@ require_once "resources/check_auth.php";
                   <tr><td><h2><a name="aSipSdpStack">Javascript SIP/SDP stack</a></h2></td></tr>
                   <tr class="spaceUnder"><td>
                        <p>The SIP and SDP stacks (<b>~1 Mo</b>) are entirely written in javascript and the network transport uses WebSockets as per <a href="http://tools.ietf.org/html/draft-ibc-sipcore-sip-websocket">draft-ibc-sipcore-sip-websocket</a>.
-                       The <a href="call.htm?svn=179" target="_blank">live demo</a> doesn't require any installation and can be used to connect to any SIP server using UDP, TCP or TLS transports.
+                       The <a href="call.htm?svn=224" target="_blank">live demo</a> doesn't require any installation and can be used to connect to any SIP server using UDP, TCP or TLS transports.
                        </p>
                        <p>Short but not exhaustive list of supported features:</p>
                       <ul>
                         <li><b>Works on Chrome, Firefox, IE, Safari, Opera and Bowser</b></li>
                         <li>Audio / Video call</li>
+                        <li><a href="https://code.google.com/p/sipml5/wiki/ScreenShare" target=_blank>Screen/Desktop sharing from Chrome to <b><u>any</u></b> SIP client</a></li>
                         <li>Instant messaging</li>
                         <li>Presence</li>
                         <li>Call Hold / Resume</li>
@@ -101,6 +95,8 @@ require_once "resources/check_auth.php";
                         <li>Multi-line and multi-account</li>
                         <li>Dual-tone multi-frequency signaling (DTMF) using SIP INFO</li>
                         <li><a href="http://click2dial.org" target=_blank>Click-to-Call</a></li>
+                        <li><a href="https://code.google.com/p/telepresence/" target=_blank>SIP TelePresence (Video Group chat)</a></li>
+                        <li>3GPP IMS standards</li>
                       </ul>
                       <p><a class="btn" href="http://code.google.com/p/sipml5/" target="_blank">View details &raquo;</a></p>       
                    </td></tr>
@@ -154,9 +150,9 @@ require_once "resources/check_auth.php";
                                     var stack =  new <a href="docgen/symbols/SIPml.Stack.html#constructor">SIPml.Stack</a>({realm: 'example.org', impi: 'bob', impu: 'sip:[email protected]', password: 'mysecret',
                                         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'),
-                                                            audio_remote: document.getElementById('audio-remote')
+                                                            video_local: document.getElementById('video-local'), // &lt;video id="video-local" .../&gt;
+                                                            video_remote: document.getElementById('video-remote'), // &lt;video id="video-remote" .../&gt;
+                                                            audio_remote: document.getElementById('audio-remote') // &lt;audio id="audio-remote" .../&gt;
                                                         });
                                                     callSession.<a href="docgen/symbols/SIPml.Session.Call.html#call">call</a>('alice');
                                                 } 

Энэ ялгаанд хэт олон файл өөрчлөгдсөн тул зарим файлыг харуулаагүй болно