d86adf97 by Manish Mihsra

Corrected new code If transferred call is not connected

1 parent 889d9b7e
......@@ -460,8 +460,6 @@ class KPAMIListen implements IEventListener
$cause=$event->getKey("Cause");
$causetxt=$event->getKey("Cause-txt");
Log::info("$accountcode:HangupEvent : $eventname $channelstate:$channelstatedesc $uniqueid $exten:$priority $channel $cause:$causetxt\n");
Log::info("Hangup".$accountcode);
if($accountcode!="")
{
//echo "$accountcode:HangupEvent : $eventname $channelstate:$channelstatedesc $uniqueid $exten:$priority $channel $cause:$causetxt\n";
......@@ -484,6 +482,21 @@ class KPAMIListen implements IEventListener
$crmcall=CRMCall::find($accountcodearr[2]);
if($crmcall)
{
$dialline=Dialline::find($crmcall->dialline_id);
if(stristr($channel, "initiateTransfer"))
{
if($dialline)
{
$dialline->channel=$_SESSION['prev_channel'];
$dialline->save();
unset($_SESSION['prev_channel']);
}
exit;
}
$nowts=microtime(true)*1000;
$crmcall->setTs('ts_Recend',$nowts);
......@@ -491,9 +504,6 @@ class KPAMIListen implements IEventListener
$crmcall->state=$eventname;
$crmcall->statuscode=$cause;
$crmcall->substatus=$causetxt;
$dialline=Dialline::find($crmcall->dialline_id);
if($dialline)
{
......@@ -832,6 +842,10 @@ class KPAMIListen implements IEventListener
$crmcall->status=$dialstatus;
$dialline=Dialline::find($crmcall->dialline_id);
if(!isset($_SESSION['prev_channel']))
$_SESSION['prev_channel'] = $dialline->channel;
if($dialline)
{
$dialline->channel=$channel;
......@@ -844,7 +858,7 @@ class KPAMIListen implements IEventListener
//start recording
$newqueue=new Kqueue();
$newqueue->recordChannel($tsip->server,$dchannel,$recfile);
$newqueue->recordChannel($tsip->server,$channel,$recfile);
$crmcall->setTs('ts_Recstart',$nowts);
......@@ -852,7 +866,7 @@ class KPAMIListen implements IEventListener
$newqueue=new Kqueue();
$newqueue->sipNotify($tsip,"dialerUI","dialend","c",$crmcall->id."~".$crmcall->number."~".base64_encode($channel));
$crmcall->addEventLog($nowts,"$accountcode:Unknown : $eventname $dchannelstate:$dchannelstatedesc $duniqueid $dexten:$dpriority $dchannel $dialstatus");
$crmcall->addEventLog($nowts,"$accountcode:Unknown : $eventname $dchannelstate:$dchannelstatedesc $duniqueid $dexten:$dpriority $channel $dialstatus");
$crmcall->save();
}
......
Styling with Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!