Giter Club home page Giter Club logo

plugin-sms's Introduction

#SMS

Send SMS Messages from Flex

SMS

Set your accountSid and serviceBaseURL in /public/appConfig.js

To build, run npm run build.

To deploy:

  1. Ensure "Include Account Sid & Auth Token" is checked under Functions Configuration
  2. Add CHAT_SERVICE_SID and FLEX_FLOW_SID (the sms FlexFlow Sid) to your Twilio Functions Environment Variables
  3. Deploy the Twilio Function from src/functions with route /create-new-sms
  4. Copy /build/plugin-sms.js to your Twilio Assets directory

plugin-sms's People

Contributors

lehel-twilio avatar martinamps avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

plugin-sms's Issues

Tasks are not created by agents

I successfully sent an SMS, but when I reply to the SMS, no task is created in the agent.

Is there any possible cause for this?
Please let me know.

Compilation failure -- OutboundSMSButton.js

I'm receiving the following error after an npm start for a clean repo clone.

./src/OutboundSmsPlugin.js
Module not found: `/Users/mrcr/Code/Refresh/plugin-sms/src/OutboundSmsButton.js` does not match the corresponding path on disk `OutboundSMSButton.js`.

Not Found Phone Number SID on replying to message created by this plugin

Not Found Phone Number SID: Phone Number Did is not associated with your Account.
Possible Causes
The Account SID doesn't own the Phone Number SID.

Possible Solutions
The Phone Number SID should be owned by the Account SID.

Hi,This is an Error came out of a outbound sms sending in flex proxy. Basically,the Initial outbound sms is initiated ok. But,replying In the plugin initiated sms its showing this error.
But,The from phone number is correct as per my settings

The create channel fails.

I've implemented it as described in the documentation, but when I click "SUBMIT" in the UI, the console.log for create-new-sms in functions shows a log that the create channel is failing.

Can you tell me why this is happening?

The following is the error message. The request seems to have failed.
failed to create channel {
code: 400,
message: 'HTTP 400 Bad Request',
more_info: 'https://www.twilio.com/docs/errors/400',
status: 400
}

Also, here is the data that is sent in the POST
sending FlexFlowSid=FW91f9462218cf48a25fa1faf6a007edb7&Identity=818013489755&Target=818013489755&ChatUserFriendlyName=818013489755& ChatFriendlyName=818013489755%20chat&PreEngagementData=%7B%22targetWorker%22%3A%22takuya_2Ekusunoki%22%7D

craete-new-sms fuction is sending 2 SMS

I've noticed that as soon as there is a Flex Task created, in my case that happens when a client sends/replies to a SMS, the following bit of code sends duplicated SMS until the Task is completed.

client.messages.create({ body: event.Message, to: to, from: from }).then(() => { console.log('adding message to', channelResponse.data.sid); client.chat.services(context.CHAT_SERVICE_SID) .channels(channelResponse.data.sid) .messages .create({ body: event.Message, from: from }).then(() => callback(null, response)); }).catch(err => { console.error(err); callback(err); });

CORS error on submit click

I have followed below steps to deploy sms plugin.
Please let me know if I need to perform additional steps to make it work.

Steps :

  1. Modify appConfig.js file to set serviceBaseUrl (SSO url)
  2. Run command
    twilio serverless:deploy
  3. functions are deployed with https://plugin-sms-xxxx-dev.twil.io/functions deployment URL
  4. Modify appConfig.js to point serviceBaseUrl to the deployed path.
    5.Run below command

twilio flex:plugins:deploy --major --changelog "Plugin to send sms " --description "SMS in Flex"

twilio flex:plugins:release --plugin [email protected] --name "Autogenerated Release 16xxxxx645" --description "The description of this Flex Plugin Configuration."

On submit button click getting
image

Please help

Request to flex-api.twilio.com/v1/Channels failed with status code 400

Hello,

we have issue with axios request.
In logs of Function can see:

failed to create channel { code: 400,
  message: 'HTTP 400 Bad Request',
  more_info: 'https://www.twilio.com/docs/errors/400',
  status: 400 }
  
UnhandledPromiseRejectionWarning: Unhandled promise rejection: Error: Request failed with status code 400
  at createError (/var/task/node_modules/axios/lib/core/createError.js:16:15)
  at settle (/var/task/node_modules/axios/lib/core/settle.js:17:12)
  at IncomingMessage.handleStreamEnd (/var/task/node_modules/axios/lib/adapters/http.js:237:11)
  at emitNone (events.js:111:20)
  at IncomingMessage.emit (events.js:208:7)
  at endReadableNT (_stream_readable.js:1064:12)
  at _com...

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.