00ecc086 by Manish Mihsra

Added logic for getting registered number from existing database

1 parent 9913f5dd
......@@ -1919,7 +1919,7 @@ function popMail($userid)
{
$users=array();
$mobile10=substr($number,-10);
$tusers=$this->getPersons("RIGHT($key,10) = $mobile10");
$tusers=$this->getPersons("RIGHT($key,10) = $mobile10", "");
if($tusers)
{
foreach($tusers as $tusr)
......
......@@ -277,11 +277,6 @@ class KPAMIListen implements IEventListener
$dialline=Dialline::where('server','=',$this->sipip)->where("dialstr","=",env("sip_dialstr"))->where("status","=","Free")->first();
if($dialline)
{
$dialline->status='Inbound';
$dialline->uniqueid=$uniqueid;
$dialline->number=$phonenumber;
$dialline->channel=$channel;
$dialline->save();
$nowts=microtime(true)*1000;
......@@ -314,6 +309,13 @@ class KPAMIListen implements IEventListener
$crmcall->data=json_encode($tdata);
$crmcall->save();
$dialline->call_id=$crmcall->id;
$dialline->status='Inbound';
$dialline->uniqueid=$uniqueid;
$dialline->number=$phonenumber;
$dialline->channel=$channel;
$dialline->save();
/*$userStatus=User::where("updated_at",">",date("Y-m-d"))->where("exten","like","%".substr($exten,-4)."%")->where("usertype","!=","Admin")->where('presence', '=', '1')->select('*')->get();
if($userStatus=="[]")
......@@ -1479,7 +1481,7 @@ class KPAMIListen implements IEventListener
$crmcalldata=json_decode($crmcall->data,true);
if(!isset($crmcalldata["userbusyfile"]))$crmcalldata["userbusyfile"]=0;
//if($dialline->status == $status[1])$this->checkMobileNumberExist($crmcall);
if($dialline->status == $status[1])$this->checkMobileNumberExist($crmcall);
$sipids=array();
......@@ -1491,7 +1493,7 @@ class KPAMIListen implements IEventListener
->where("status", "=", "1")
->where("ready", "=", "1")
->where("prepare_call", "=", "1")
->orderBy("updated_at", "desc")
->orderBy("updated_at", "asc")
->first();
}
......@@ -1502,7 +1504,7 @@ class KPAMIListen implements IEventListener
$sipid=Sipid::where('server', '=', $this->sipip)
->where("status", "=", "1")
->where("ready", "=", "1")
->orderBy("updated_at", "desc")
->orderBy("updated_at", "ssc")
->first();
}
......@@ -1528,7 +1530,7 @@ class KPAMIListen implements IEventListener
if($crmcall->client==".")
{
$wakka = new KHRMSLib();
$users=$wakka->searchPhone("mobile",$crmcall->number);
$users=$wakka->searchPhone("mobile", $crmcall->number, "");
if(!empty($users))
{
$ppldata=unserialize($users[0]['peopledata']);
......
Styling with Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!