Update index.php

//checks wheather the call is established or not.if it is already there then prepare for renegotiation

	document.getElementById('video-call').onclick=function()
	{
		//alert('video');
		if(peer.signal)
		{
			alert('call is already established');
			 peer.mediaType = {
       							 audio: true,
        						 video: true
    							};

    		peer.datachannel = false;
			peer.direction='two-way';
			peer.call(
        				document.getElementById('user-to-call').value
   					 );
		}
		
 /* peer.mediaType = {
        audio: true,
        video: true
    };

    peer.datachannel = false;
	peer.direction='two-way';
*/
   /* peer.bandwidth = {
        audio: 20,
        video: 30
    };*/

   /* peer.call(
        document.getElementById('user-to-call').value
    );*/
	starttalkvideodiv();
	
	}