From cfd70dcf4e9f6c346ba8395607ffe031c7c4cfd8 Mon Sep 17 00:00:00 2001 From: Andy-Seattle <56096200+Andy-Seattle@users.noreply.github.com> Date: Fri, 31 Jan 2020 14:37:46 -0800 Subject: [PATCH] E.164 Inbound caller ID fix (#5138) When an inbound call has E.164 caller ID format (eg Skyetel), the + is being stripped from the caller_id_number variable before storing in the v_xml_cdr database table. If we then try and block this CDR in the Call Block application it adds the number BUT without the + so it never matches future calls. This proposed change ensures that the + is not stripped for INBOUND calls when written to v_xml_cdr and therefore when blocking the CDR it works correctly (i.e. it includes the + which then matches the call next time and blocks it). --- app/xml_cdr/v_xml_cdr_import.php | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/app/xml_cdr/v_xml_cdr_import.php b/app/xml_cdr/v_xml_cdr_import.php index 25f8097f98..5e3cc821ab 100644 --- a/app/xml_cdr/v_xml_cdr_import.php +++ b/app/xml_cdr/v_xml_cdr_import.php @@ -209,7 +209,11 @@ //get the caller details $database->fields['caller_id_name'] = urldecode($xml->variables->effective_caller_id_name); - $database->fields['caller_id_number'] = urldecode($xml->variables->effective_caller_id_number); + if ($xml->variables->call_direction == 'inbound' ){ + $database->fields['caller_id_number'] = urldecode($xml->variables->caller_id_number); + } else { + $database->fields['caller_id_number'] = urldecode($xml->variables->effective_caller_id_number); + } //get the values from the callflow. $i = 0;