Browse Source

Use the original message from and mesage_to

Removing the plus causes problems for Telnyx.
Telenyx uses e.164 on all North American Calls

This the replace(message_from, '+', '') made the message thread not find the messages. This could be fixed but not efficiently.
FusionPBX 10 months ago
parent
commit
208deddfc9
1 changed files with 4 additions and 2 deletions
  1. 4 2
      messages_contacts.php

+ 4 - 2
messages_contacts.php

@@ -94,7 +94,8 @@
 	$sql .= "from (\n";
 	$sql .= "	select number from \n";
 	$sql .= "	(\n";
-	$sql .= "		select distinct(REPLACE(message_from, '+', '')) as number from v_messages \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 +110,8 @@
 	$sql .= "		)\n";
 	$sql .= "		and message_from ~'^\+?([0-9]+\.?[0-9]*|\.[0-9]+)$' \n";
 	$sql .= "		union \n";
-	$sql .= "		select distinct(REPLACE(message_to, '+', '')) as number from v_messages \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 ";