Hello,
I’m sorry for the late reply. Here is the basic server setup information you requested:
- Licence type: Starter
- Number of users: Currently, we are still testing, so it is limited to 3 users.
- Server hardware: VPS
- Version of Rocket.Chat Server: 6.11.1
- Operating System: Ubuntu
- Deployment Method: Docker
- Number of Running Instances: 1
- DB Replicaset Oplog: Primary
- NodeJS Version: 14.21.3
- MongoDB Version: 5.0.24
Client information:
- Client type: Edge 127.0.2651.105
Steps to replicate the issue:
- Go to Administration > Apps > Marketplace.
- Search for the WhatsApp Cloud app.
- Click on Install and accept the necessary permissions.
- Create a chat with the WhatsApp-Cloud bot in the #omnichannel channel.
- Enter the required data to connect to the Facebook developer account and set up the Facebook developer webhook using the link and token provided by the WhatsApp-Cloud bot.
- Send a template using the POST API provided by WhatsApp-Cloud. In my case, I filled out the request body with the following information:
{
"phoneNumbers": [
"5255xxxxxxxx"
],
"connectedWhatsAppNo": "357638614xxxxxx",
"template": {
"name": "appointment_confirmation",
"language": {
"code": "en_MX",
"policy": "deterministic"
},
"components": [
{
"type": "body",
"parameters": [
{
"type": "text",
"text": "Lorem ipsum dolor"
},
{
"type": "text",
"text": "sit amet, consectetur"
},
{
"type": "text",
"text": "adipiscing elit"
},
{
"type": "text",
"text": "Cras nibh mauris"
},
{
"type": "text",
"text": "malesuada sed enim"
}
]
}
]
}
}
Note: This is a custom template that I created in Facebook Developer, and it requires 5 parameters to be filled in.
7. You receive the template on your number (5255xxxxxxxx) and reply from that same number with a “Hello” message.
8. The “Hello” message is received in Rocket.Chat. Then, you reply from Rocket.Chat using the same user (administrator/agent/supervisor).
9. When sending the message from Rocket.Chat, the following error appears in the chat:
Sorry! Couldn't perform the operation since we're experiencing some issues while connecting to WhatsApp.
Details:
Error Code: 500
Error Message: internal_server_error
Error Details: 131030: (#131030) Recipient phone number not in allowed list.
I activated Rocket.Chat logs (level 2: errors, information, and debugging). When sending a message from Rocket.Chat, the following is recorded in the log:
{
"level": 20,
"time": "2024-08-23T17:37:47.634Z",
"pid": 1,
"hostname": "xxxxx",
"name": "Integrations",
"section": "Outgoing WebHook",
"msg": "Got the event arguments for the event: sendMessage",
"argObject": {
"event": "sendMessage",
"message": {
"_id": "xxxxx",
"rid": "xxxxxx",
"msg": "Hello world",
"ts": "2024-08-23T17:37:47.535Z",
"u": {
"_id": "xxxxx",
"username": "xxxxx",
"name": "xxxxx"
},
"_updatedAt": "2024-08-23T17:37:47.570Z",
"urls": [],
"mentions": [],
"channels": [],
"md": [
{
"type": "PARAGRAPH",
"value": [
{
"type": "PLAIN_TEXT",
"value": "Hello world"
}
]
}
]
},
"room": {
"_id": "xxxx",
"cl": false,
"estimatedWaitingTimeQueue": 9999999,
"fname": "xxxxx",
"lm": "2024-08-23T17:37:09.094Z",
"msgs": 5,
"open": true,
"priorityWeight": 99,
"queuedAt": "2024-08-23T17:36:46.237Z",
"source": {
"type": "app",
"id": "xxxxx",
"alias": "WhatsApp Cloud",
"sidebarIcon": "whatsapp",
"defaultIcon": "whatsapp",
"label": "+1 555-6xx-xxxx"
},
"t": "l",
"ts": "2024-08-23T17:36:46.237Z",
"usersCount": 2,
"v": {
"_id": "xxxxx",
"username": "52155xxxxxx",
"token": "xxxxx",
"status": "online",
"activity": [
"2024-08"
],
"lastMessageTs": "2024-08-23T17:36:57.293Z"
},
"_updatedAt": "2024-08-23T17:37:09.174Z",
"lastMessage": {
"_id": "xxxxx",
"rid": "xxxx",
"msg": "Hello world",
"ts": "2024-08-23T17:37:09.094Z",
"u": {
"_id": "xxxx",
"username": "xxxxx",
"name": "xxxxxx"
},
"_updatedAt": "2024-08-23T17:37:09.131Z",
"urls": [],
"mentions": [],
"channels": [],
"md": [
{
"type": "PARAGRAPH",
"value": [
{
"type": "PLAIN_TEXT",
"value": "Hello world"
}
]
}
]
},
"metrics": {
"v": {
"lq": "2024-08-23T17:36:46.261Z"
},
"reaction": {
"fd": "2024-08-23T17:37:09.174Z",
"ft": 22.937,
"tt": 22.937
},
"response": {
"avg": 22.913,
"fd": "2024-08-23T17:37:09.174Z",
"ft": 22.913,
"total": 1,
"tt": 22.913
},
"servedBy": {
"lr": "2024-08-23T17:37:09.094Z"
}
},
"servedBy": {
"_id": "xxxx",
"username": "xxxxx"
},
"customFields": {
"whatsAppCloudMessage": {
"visitorWaId": "xxxxxx",
"contactWaId": "xxxxxx"
},
"whatsAppCloudSessionExpiration": "2024-08-24T17:36:57.486Z"
},
"default": false,
"ro": false,
"sysMes": true,
"responseBy": {
"_id": "xxxxxx",
"username": "xxxxx",
"firstResponseTs": "2024-08-23T17:37:09.094Z",
"lastMessageTs": "2024-08-23T17:37:09.094Z"
}
}
}
}
I noticed that the phone number to which the message is being sent is logged as 52155xxxxxx
, while the original number should be 5255xxxxxx
. The extra ‘1’ in the middle is causing an error.
I attempted to correct this number in the Rocket.Chat Omnichannel Contact Center. However, the active chat with the contact still shows 52155xxxxxx
as the phone number.
This discrepancy between the intended phone number and the one being used in the system is causing message delivery issues. I’m looking for guidance on how to properly update and sync the contact’s phone number across all relevant Rocket.Chat systems to ensure correct message routing.
Has anyone encountered a similar issue with phone number mismatches in Omnichannel, particularly when integrating with WhatsApp? Any insights on troubleshooting or resolving this would be greatly appreciated.
Please let me know if you need any more details. Thank you for your help!