如何通过 Twilio 中给出的任何消息 属性 区分彩信和短信

How to differentiate between MMS and SMS via any Message property given in Twilio

是否可以识别传入和传出消息是 SMS 还是 MMS。

这里是 Twilio 开发人员布道者。

入站 MMS 的请求参数 NumMedia 具有非零值,如果入站消息只是 SMS,则它将具有 NumMedia=0.

对于出站消息,您将知道它们是否是彩信,因为您 create the message with the REST API and provide one or more MediaUrls or you respond to an incoming message with a <Media> element.

如果您稍后要检查消息,使用 REST API,message resources have a NumMedia property 如果它是媒体消息,那么它将是非零的。