Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/develop' into develop
Browse files Browse the repository at this point in the history
  • Loading branch information
jorikfon committed Nov 8, 2024
2 parents dacbbf1 + 55a91ee commit 145633e
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/Core/Asterisk/Configs/lua/extensions.lua
Original file line number Diff line number Diff line change
Expand Up @@ -1266,6 +1266,11 @@ function event_hangup_chan()
data['agi_channel'] = get_variable("CHANNEL");
data['OLD_LINKEDID']= get_variable("OLD_LINKEDID");
data['UNIQUEID'] = get_variable("pt1c_UNIQUEID");
if( data['UNIQUEID'] == '')then
-- Possible this is a call forwarding
data['UNIQUEID'] = get_variable("transfer_UNIQUEID");
end

data['VMSTATUS'] = get_variable("VMSTATUS");

-- Retrieve the verbose call ID and append the original call ID if available
Expand Down
18 changes: 18 additions & 0 deletions src/Core/Workers/Libs/WorkerCallEvents/ActionHangupChan.php
Original file line number Diff line number Diff line change
Expand Up @@ -161,6 +161,24 @@ private static function hangupChanEndCalls(WorkerCallEvents $worker, array $data
}
}

// The SRC channel has been completed and DST channel has not been created
$filter = [
'verbose_call_id=:verbose_call_id: AND endtime = "" AND dst_chan = "" AND src_chan = :src_chan:',
'bind' => [
'verbose_call_id' => $data['verbose_call_id'],
'src_chan' => $data['agi_channel'],
],
];
$m_data = CallDetailRecordsTmp::find($filter);
foreach ($m_data as $row) {
$row->writeAttribute('endtime', $row->start);
$row->writeAttribute('transfer', 0);
$res = $row->update();
if (!$res) {
SystemMessages::sysLogMsg('Action_hangup_chan', implode(' ', $row->getMessages()), LOG_DEBUG);
}
}

self::regMissedCall($data, $countRows);
}

Expand Down

0 comments on commit 145633e

Please sign in to comment.