Selaa lähdekoodia

视频通话挂断响应

miaofuhao 2 vuotta sitten
vanhempi
commit
a46d4e6320

+ 16 - 0
WebUI/CallCenterWeb.UI/calloutNew/weChatVideo/js/mobileSip.js

@@ -1,5 +1,6 @@
1 1
  var outgoingSession = null,
2 2
 	timeInterval = null,
3
+	timeOutDrop= null,
3 4
 	incomingSession = null,
4 5
 	currentSession = null,
5 6
 	calState, nativeStream = null,
@@ -371,6 +372,7 @@ function answerCall() {
371 372
 function hangupCall() {
372 373
 	$(".receiverSpeedVideo").text("")
373 374
 	clearTimeout(timeOut)
375
+	clearTimeout(timeOutDrop)
374 376
 	clearInterval(timer)
375 377
 	closeMediaVideo()
376 378
 	$(".refreshImg").hide()
@@ -402,6 +404,8 @@ function unReg() {
402 404
 	if(!superviseMan) {
403 405
 		userAgent.unregister(true);
404 406
 		clearInterval(timer)
407
+		clearTimeout(timeOutDrop)
408
+		clearTimeout(timeOut)
405 409
 		$(".registStatus").html("已注销")
406 410
 		$(".mui-content").show();
407 411
 		$(".refreshImg").hide()
@@ -500,11 +504,23 @@ function closeMediaVideo() {
500 504
 	}
501 505
 	//yourVideoView.remove();
502 506
 }
507
+// 监听挂断事件
508
+function monitorDropcall(data){
509
+	
510
+	timeOutDrop = setInterval(function() {
511
+		console.log("isEnded"+data.isEnded())
512
+		if(data.isEnded()) {
513
+			console.log("isEnded"+data.isEnded())
514
+			clearTimeout(timeOutDrop)
515
+		}
516
+	}, 2000)
517
+}
503 518
 
504 519
 function sipCallRTCSession(e, state) {
505 520
 	
506 521
 	console.log(e.session)
507 522
 	console.log(state)  // 1是呼出,2是呼入
523
+	monitorDropcall(e.session)
508 524
 	e.session.on("confirmed", function(data){
509 525
 		console.log("confirmed")
510 526
 		if(e.session.connection.getReceivers){

+ 1 - 1
WebUI/CallCenterWeb.UI/calloutNew/weChatVideo/js/superviseMan.js

@@ -66,7 +66,7 @@ function loginSuper(){
66 66
 			
67 67
 		    $.ajax({
68 68
 		      type: "get",      
69
-		      url: huayi.config.callcenter_url +"index/addrelation",,
69
+		      url: huayi.config.callcenter_url +"index/addrelation",
70 70
 		      dataType: "json",
71 71
 		      async: true,
72 72
 		      data: {