diff --git a/app/xml_cdr/resources/classes/xml_cdr.php b/app/xml_cdr/resources/classes/xml_cdr.php index f49b0c49bb..65e77985d7 100644 --- a/app/xml_cdr/resources/classes/xml_cdr.php +++ b/app/xml_cdr/resources/classes/xml_cdr.php @@ -478,15 +478,11 @@ if (!class_exists('xml_cdr')) { //marked as missed $missed_call = $xml->variables->missed_call; } - if (isset($call_direction) && $call_direction == 'inbound' - && isset($xml->variables->hangup_cause) + if (isset($call_direction) && $call_direction == 'inbound' + && isset($xml->variables->hangup_cause) && $xml->variables->hangup_cause == 'ORIGINATOR_CANCEL') { $missed_call = 'true'; } - if (isset($xml->variables->billsec) && $xml->variables->billsec > 0) { - //answered call - $missed_call = 'false'; - } if (isset($xml->variables->cc_side) && $xml->variables->cc_side == 'agent') { //call center $missed_call = 'false'; @@ -503,6 +499,15 @@ if (!class_exists('xml_cdr')) { //ring group or multi destination bridge statement $missed_call = 'false'; } + if (isset($xml->variables->cc_side) && $xml->variables->cc_side == 'member' + && isset($xml->variables->cc_cause) && $xml->variables->cc_cause == 'cancel') { + //call center + $missed_call = 'true'; + } + if (isset($xml->variables->billsec) && $xml->variables->billsec > 0) { + //answered call + $missed_call = 'false'; + } if (isset($xml->variables->destination_number) && substr($xml->variables->destination_number, 0, 3) == '*99') { //voicemail $missed_call = 'true'; @@ -511,11 +516,6 @@ if (!class_exists('xml_cdr')) { //voicemail $missed_call = 'true'; } - if (isset($xml->variables->cc_side) && $xml->variables->cc_side == 'member' - && isset($xml->variables->cc_cause) && $xml->variables->cc_cause == 'cancel') { - //call center - $missed_call = 'true'; - } //read the bridge statement variables if (isset($xml->variables->last_app)) {