Twilio MMS status is always remains Sent when sent using Bot framework

我的未来我决定 提交于 2019-12-13 03:44:42

问题


I am building a bot for Twilio (SMS) channel. When I send a Simple plain SMS to a number in US, it gets delivered with status in twilio message log as Delivered.

But when I attach any image to the message to send MMS, the message never gets delivered, and its status in twilio log remains sent always.

Here is how I'm attaching media to MMS.

var msg = new builder.Message(session);
msg.attachmentLayout(builder.AttachmentLayout.list)
msg.attachments([
    new builder.HeroCard(session)
        .title("This is Title")
        .subtitle("This is sub title")
        .text("This is text")
        .images([builder.CardImage.create(session, 'http://www.readersdigest.ca/wp-content/uploads/2011/01/4-ways-cheer-up-depressed-cat.jpg')])
]);

session.send(msg).endDialog();

I have also used another way to build message as:

var msg = new builder.Message(session)
    .text("This is a title - which can be long and multiple line sometimes<br/><br/>The body of the text can be really really long sometimes with different formats with links <http://google.com|Google><br/><br/>some times with a footer with `formats`")
    .addAttachment({
        contentUrl: 'http://www.readersdigest.ca/wp-content/uploads/2011/01/4-ways-cheer-up-depressed-cat.jpg',
        contentType: 'image/png',
        name: 'BotFrameworkOverview.png'
    });

Both messages never get delivered.

But a simple message with no media is successfully delivered as-

var msg = new builder.Message(session)
   .text("This is a title - which can be long and multiple line sometimes<br/><br/>The body of the text can be really really long sometimes with different formats with links <http://google.com|Google><br/><br/>some times with a footer with `formats`")

Twilio Log:

来源:https://stackoverflow.com/questions/49897741/twilio-mms-status-is-always-remains-sent-when-sent-using-bot-framework

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!