浏览代码

Normalize numbers to disregard the plus

Using this right now when the number comes to inbound and outbound one number has the plus and the other doesn't they are seen as different numbers. May re-add it in the future.
FusionPBX 11 月之前
父节点
当前提交
bd3f39770d
共有 1 个文件被更改,包括 2 次插入2 次删除
  1. 2 2
      messages_contacts.php

+ 2 - 2
messages_contacts.php

@@ -94,7 +94,7 @@
 	$sql .= "from (\n";
 	$sql .= "	select number from \n";
 	$sql .= "	(\n";
-	$sql .= "		select distinct(message_from) as number from v_messages \n";
+	$sql .= "		select distinct(REPLACE(message_from, '+', '')) as number from v_messages \n";
 	$sql .= "		where domain_uuid = :domain_uuid \n";
 	$sql .= "		and message_direction = 'inbound' and message_from is not null \n";
 	//$sql .= "		and user_uuid = :user_uuid \n";
@@ -109,7 +109,7 @@
 	$sql .= "		)\n";
 	$sql .= "		and message_from ~'^\+?([0-9]+\.?[0-9]*|\.[0-9]+)$' \n";
 	$sql .= "		union \n";
-	$sql .= "		select distinct(message_to) as number from v_messages \n";
+	$sql .= "		select distinct(REPLACE(message_to, '+', '')) as number from v_messages \n";
 	$sql .= "		where domain_uuid = :domain_uuid \n";
 	$sql .= "		and message_direction = 'outbound' and message_from is not null \n";
 	//$sql .= "		and user_uuid = :user_uuid ";