613cf374 by G Manojkumar

called Extension only get ring

1 parent 207e0cdb
...@@ -497,7 +497,7 @@ class KPAMIListen implements IEventListener ...@@ -497,7 +497,7 @@ class KPAMIListen implements IEventListener
497 497
498 if($crmcall->type=="Inbound"&&$crmcall->user_id==0)//InboundDROP 498 if($crmcall->type=="Inbound"&&$crmcall->user_id==0)//InboundDROP
499 { 499 {
500 $userslist=User::where('exten','like' ,'%'.$crmcall->did.'%')->get(); 500 $userslist=User::where('exten','like' ,'%'.$crmcall->did.'%')->where('status','=','Active')->get();
501 foreach ($userslist as $ulist) { 501 foreach ($userslist as $ulist) {
502 $crmcall->user_id=$ulist->id; 502 $crmcall->user_id=$ulist->id;
503 } 503 }
...@@ -665,7 +665,6 @@ class KPAMIListen implements IEventListener ...@@ -665,7 +665,6 @@ class KPAMIListen implements IEventListener
665 $dialline->channel=$dchannel; 665 $dialline->channel=$dchannel;
666 $dialline->save(); 666 $dialline->save();
667 } 667 }
668 //Log::info("DialBegin".$dialline->channel." ^ ".$dialline->dchannel." ^ ".$dialline->status);
669 $tsip=Sipid::find($crmcall->sipid_id); 668 $tsip=Sipid::find($crmcall->sipid_id);
670 669
671 $newqueue=new Kqueue(); 670 $newqueue=new Kqueue();
...@@ -997,10 +996,14 @@ class KPAMIListen implements IEventListener ...@@ -997,10 +996,14 @@ class KPAMIListen implements IEventListener
997 $tdata=array(); 996 $tdata=array();
998 $tdata['uniqueid']=$uniqueid; 997 $tdata['uniqueid']=$uniqueid;
999 $tdata['inboundchannel']=$channel; 998 $tdata['inboundchannel']=$channel;
1000 999 //Log::useFiles(storage_path().'inbound_log_'.date("Y-m-d").'.log');
1000 // Log::info("inboundNumber ".$crmcall->number);
1001 $crmcall->data=json_encode($tdata); 1001 $crmcall->data=json_encode($tdata);
1002 $crmcall->save(); 1002 $crmcall->save();
1003 1003 if($crmcall->did=='46130234'){
1004 // Log::useFiles(storage_path().'inbound_log_'.date("Y-m-d").'.log');
1005 Log::info("inboundNumber ".$crmcall->number);
1006 }
1004 $userStatus=User::where("updated_at",">",date("Y-m-d"))->where("exten","like","%".substr($exten,-4)."%")->where("usertype","!=","Admin")->where('presence', '=', '1')->select('*')->get(); 1007 $userStatus=User::where("updated_at",">",date("Y-m-d"))->where("exten","like","%".substr($exten,-4)."%")->where("usertype","!=","Admin")->where('presence', '=', '1')->select('*')->get();
1005 1008
1006 if($userStatus=="[]") 1009 if($userStatus=="[]")
...@@ -1057,8 +1060,7 @@ class KPAMIListen implements IEventListener ...@@ -1057,8 +1060,7 @@ class KPAMIListen implements IEventListener
1057 $users=$wakka->searchPhone("mobile",$crmcall->number); 1060 $users=$wakka->searchPhone("mobile",$crmcall->number);
1058 if(!empty($users)) 1061 if(!empty($users))
1059 { 1062 {
1060 $ppldata=unserialize($users[0]['peopledata']); 1063 $ppldata=unserialize($users[0]['peopledata']);
1061
1062 $crmcall->crm_id=$users[0]['id']; 1064 $crmcall->crm_id=$users[0]['id'];
1063 $crmcall->number=$users[0]['mobile']; 1065 $crmcall->number=$users[0]['mobile'];
1064 $crmcall->client=($ppldata['client']?$ppldata['client']:""); 1066 $crmcall->client=($ppldata['client']?$ppldata['client']:"");
...@@ -1076,8 +1078,15 @@ class KPAMIListen implements IEventListener ...@@ -1076,8 +1078,15 @@ class KPAMIListen implements IEventListener
1076 echo "User Not Found!!\n"; 1078 echo "User Not Found!!\n";
1077 } 1079 }
1078 $crmcall->save(); 1080 $crmcall->save();
1081 // Log::useFiles(storage_path().'inbound_log_'.date("Y-m-d").'.log');
1082 //if($crmcall->did=='46130234'){
1083 // Log::info("inbound 1".$crmcall->crm_id." ~ ".$crmcall->number." ~ ".$crmcall->did);
1084 //}
1079 } 1085 }
1080 1086 // Log::useFiles(storage_path().'inbound_log_'.date("Y-m-d").'.log');
1087 if($crmcall->did=='46130234'){
1088 Log::info("inbound ".$crmcall->crm_id." ~ ".$crmcall->number." ~ ".$crmcall->did);
1089 }
1081 $sipids=array(); 1090 $sipids=array();
1082 if($crmcall->client!="") 1091 if($crmcall->client!="")
1083 { 1092 {
...@@ -1197,7 +1206,7 @@ class KPAMIListen implements IEventListener ...@@ -1197,7 +1206,7 @@ class KPAMIListen implements IEventListener
1197 foreach($allsipids as $tsip) 1206 foreach($allsipids as $tsip)
1198 { 1207 {
1199 $newqueue=new Kqueue(); 1208 $newqueue=new Kqueue();
1200 $newqueue->sipNotify($tsip,"popupalert"," Incoming Calls",$crmcall->number."|".$crmcall->client,""); 1209 $newqueue->sipNotify($tsip,"popupalert"," Incoming Calls",$crmcall->number."|".$crmcall->client,$crmcall->did);
1201 } 1210 }
1202 } 1211 }
1203 else 1212 else
......
...@@ -143,6 +143,8 @@ function kcallHasConnection(number) ...@@ -143,6 +143,8 @@ function kcallHasConnection(number)
143 143
144 function dialerQuickOpen(varid,num,state,substate,autorun) 144 function dialerQuickOpen(varid,num,state,substate,autorun)
145 { 145 {
146 resetCallArray();
147 console.log("Manojquick");
146 if(kstychCall['mCallState']=="Wait") 148 if(kstychCall['mCallState']=="Wait")
147 { 149 {
148 var oldpreviewid=kstychCall['previewcrmid']; 150 var oldpreviewid=kstychCall['previewcrmid'];
...@@ -280,6 +282,7 @@ function kCallAction(num,action) ...@@ -280,6 +282,7 @@ function kCallAction(num,action)
280 function dialerDispNumberClick() 282 function dialerDispNumberClick()
281 { 283 {
282 var lastnumber=$("#spandialer_num").html(); 284 var lastnumber=$("#spandialer_num").html();
285 console.log(lastnumber);
283 kstychCall['callWrapupTime']=300; 286 kstychCall['callWrapupTime']=300;
284 287
285 if(kstychCall['mCallState']=="Dispo") 288 if(kstychCall['mCallState']=="Dispo")
...@@ -325,7 +328,9 @@ function dialerAddConfCall() ...@@ -325,7 +328,9 @@ function dialerAddConfCall()
325 function incomingCall(calllog,crmid,numnchn) 328 function incomingCall(calllog,crmid,numnchn)
326 { 329 {
327 //document.getElementById("hangup").play(); 330 //document.getElementById("hangup").play();
328 stopRingTone(); 331 //stopRingTone();
332 console.log("incoming 1");
333 resetCallArray();
329 $("#dialersearchresults").html('<div id=divworking></div><div style="clear:both"></div>'); 334 $("#dialersearchresults").html('<div id=divworking></div><div style="clear:both"></div>');
330 335
331 var number = numnchn.substring(0, numnchn.indexOf('@')); 336 var number = numnchn.substring(0, numnchn.indexOf('@'));
...@@ -337,10 +342,11 @@ function incomingCall(calllog,crmid,numnchn) ...@@ -337,10 +342,11 @@ function incomingCall(calllog,crmid,numnchn)
337 342
338 kSetDData('C','callid',calllog); 343 kSetDData('C','callid',calllog);
339 kSetDData('C','crmid',crmid); 344 kSetDData('C','crmid',crmid);
340 345 console.log(crmid);
341 if(crmid>0)showRecruit(crmid); 346 if(crmid>0)showRecruit(crmid);
342 else 347 else
343 { 348 {
349 console.log("incoming else");
344 createSearchRecordDiv('dialersearchresults'); 350 createSearchRecordDiv('dialersearchresults');
345 } 351 }
346 352
...@@ -356,6 +362,7 @@ function incomingCall(calllog,crmid,numnchn) ...@@ -356,6 +362,7 @@ function incomingCall(calllog,crmid,numnchn)
356 362
357 function dialerUIUpdate(var1,var2,var3) 363 function dialerUIUpdate(var1,var2,var3)
358 { 364 {
365 console.log("UIupdate");
359 var3parts=var3.split("~"); 366 var3parts=var3.split("~");
360 var3parts[2]=atob(var3parts[2]); 367 var3parts[2]=atob(var3parts[2]);
361 if(var1=="dialstart") 368 if(var1=="dialstart")
...@@ -424,10 +431,17 @@ function dialerUIUpdate(var1,var2,var3) ...@@ -424,10 +431,17 @@ function dialerUIUpdate(var1,var2,var3)
424 431
425 function incomingPopupAlert(var1,var2,var3) 432 function incomingPopupAlert(var1,var2,var3)
426 { 433 {
434 var loginRoleArray=["R14306"];
435 var fullexten = $('#userExtension').val();
436 console.log(fullexten);
437 var exten =fullexten.split(':')[0];
438 console.log("exten1 "+exten);
427 //var incomingnotify=growlSNotify(var1,var2,"top-right"); 439 //var incomingnotify=growlSNotify(var1,var2,"top-right");
428 //setTimeout(function(){$.gritter.remove(incomingnotify, {fade: true,speed: 'slow'});incomingnotify=0;},1500); 440 //setTimeout(function(){$.gritter.remove(incomingnotify, {fade: true,speed: 'slow'});incomingnotify=0;},1500);
429 if($('#userLoginRole').val()=="Supervisor")startRingTone(); 441 if((kstychCall['ts_Talk']===0 && kstychCall['ts_Call']===0)){
430 //console.log($('#userLoginRole').val()); 442 if($.inArray($('#userLoginRole').val(), loginRoleArray)>-1 && (var3===exten))startRingTone();
443 }
444 console.log(var1+"Var 1"+"Var 2"+var2+"Var 3"+var3);
431 $.titleAlert(var1+" "+var2, { 445 $.titleAlert(var1+" "+var2, {
432 requireBlur:true, 446 requireBlur:true,
433 stopOnFocus:true, 447 stopOnFocus:true,
...@@ -902,7 +916,16 @@ function updateDialerState(objstr,key,val,key2,val2) ...@@ -902,7 +916,16 @@ function updateDialerState(objstr,key,val,key2,val2)
902 { 916 {
903 resetCallArray(); 917 resetCallArray();
904 } 918 }
905 919 console.log("manojstatechanged");
920 if(val=="Manual"){
921 console.log("Manoj");
922 resetCallArray();
923
924 }
925 if(val2=="Incoming"){
926 console.log("Manoj Incoming");
927 resetCallArray();
928 }
906 929
907 930
908 $("#dialersearchresults").html(""); 931 $("#dialersearchresults").html("");
...@@ -921,7 +944,8 @@ function updateDialerState(objstr,key,val,key2,val2) ...@@ -921,7 +944,8 @@ function updateDialerState(objstr,key,val,key2,val2)
921 function(retstr){ 944 function(retstr){
922 if(kstychCall['previewcrmid']!="") 945 if(kstychCall['previewcrmid']!="")
923 { 946 {
924 kSetDData('C','previewcrmid',""); 947 console.log("manojpreview");
948 //kSetDData('C','previewcrmid',"");
925 updateDialerState(); 949 updateDialerState();
926 } 950 }
927 else 951 else
......
...@@ -242,6 +242,8 @@ foreach($tmodules as $mname=>$marr) ...@@ -242,6 +242,8 @@ foreach($tmodules as $mname=>$marr)
242 <?php } ?> 242 <?php } ?>
243 <div><a href="#" class="btn btn-primary" onclick="menuAction('message');return false;"><i class="fa fa-list"></i> <span>View all messages <?php if($messagescount>0)echo "($messagescount)"; ?></span></a></div> 243 <div><a href="#" class="btn btn-primary" onclick="menuAction('message');return false;"><i class="fa fa-list"></i> <span>View all messages <?php if($messagescount>0)echo "($messagescount)"; ?></span></a></div>
244 </ul> 244 </ul>
245 <input type="hidden" id="userLoginRole" value="{{Auth::user()->username}}">
246 <input type="hidden" id="userExtension" value="{{isset(Auth::user()->exten)?(Auth::user()->exten):'0'}}">
245 </li> 247 </li>
246 <li class="dropdown notif" style='height:35px'> 248 <li class="dropdown notif" style='height:35px'>
247 <a href="#" class="dropdown-toggle" data-toggle="dropdown" style='height:35px' onclick='$("#topmenunotifucount").html("");'><i class="notif-block fa fa-bell"></i><span class="badge badge-info" id=topmenunotifucount><?php if(isset($meta['ncnt'])&&$meta['ncnt']>0)echo $meta['ncnt']; ?></span></a> 249 <a href="#" class="dropdown-toggle" data-toggle="dropdown" style='height:35px' onclick='$("#topmenunotifucount").html("");'><i class="notif-block fa fa-bell"></i><span class="badge badge-info" id=topmenunotifucount><?php if(isset($meta['ncnt'])&&$meta['ncnt']>0)echo $meta['ncnt']; ?></span></a>
......
Styling with Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!