Twilio Error code 12300 - Invalid Content-Type: application/json; charset=utf-8 supplied

Status
Not open for further replies.

NKDTech

Customer
Joined
Aug 23, 2022
Messages
6
Reaction score
0
Hello,

we have are using Twilio as my SIP trunk for calls and more recently SMS, Our 3CX is currently using 3CX 18.0.5.418

I have run into a problem where we are only able to send/receive SMS only once an SMS has been initiated from an extension. If the SMS is sent to our DID its not being received.
Twilio have sent me the following response to the errors im seeing:

Error 12300 indicates that we received an invalid content type. Looking at the Debugger notifications on your account, I'm seeing the following error message:

sourceComponent=14100&ErrorCode=12300&LogLevel=ERROR&Msg=Invalid+Content-Type:+application/json;+charset=utf-8+supplied&contentType=application/json;+charset=utf-8&EmailNotification=false

The URL indicated in the error is your webhook URL.

When the message came in, we sent that payload to your webhook URL and received a response with Content-type: application/json. The API will only accept a xml response, TwiML to be exact, with Content-Type: text/xml. If you need the API to perform any actions, such as sending a reply, forwarding the messages, etc., then the response with those instructions will need to be in TwiML and the correct Content-type.

Otherwise, if you only want to receive the messages without responding, we generally recommend that you respond with either a 204 No Content or a 200 OK with Content-Type: text/xml and an empty <Response/> in the body. Either way, you will still receive the message, but you will continue receiving this warning if you do not change the response to a valid content type.

I have triple checked that i am sending to the correct Webhook URL.


Any ideas what i can do to resolve?
 
Furthermore, i think there are two separate issues going on here.

1. Twilio will always send errors, this does not mean the message has been undeliverable. Could probably ignore this issue.

2. When i open 3CX App on iOS Device, select compose SMS, add a number (without sending) and receive a text while the Compose SMS box is open i receive the message.

The second point is the biggest problem here and i think an isolated issue with 3CX, as Twilio are delivering messages successfully to my 3CX URL Webhook and im receiving SMS only if the number im about to or have initiated an SMS in 3CX first.
 
That's great, looking forward to trying out the new update when its released.

Regarding the Webclient or Desktop App, the issue is the same as the iOS App. I need to start an SMS chat (with or without sending a message) to the external number first, I don't receive SMS until that step has been completed first.
 
So far I have tried the following and still no progress on receiving SMS issue

- Delete/add Twilio SIP Trunk (which gave me a new Webhook URL to try).
- Delete/add phone extensions and re-added.
- Disable/Enable Chat globally and each extension.
- Adding contacts numbers to directory

Any other ideas would be appreciated.
 
Looks like the issue has been resolved.

For those that might come across the same issue - I am using AWS lightsail and added HTTP TCP to the firewall allowed rules.
 
Status
Not open for further replies.

Forum statistics

Threads
112,067
Messages
590,596
Members
165,021
Latest member
haytham