Skip to content

Instantly share code, notes, and snippets.

@rkmax
Last active August 29, 2015 14:26
Show Gist options
  • Save rkmax/aae43231a1064cdb4f9f to your computer and use it in GitHub Desktop.
Save rkmax/aae43231a1064cdb4f9f to your computer and use it in GitHub Desktop.

SMS Gateway

Allows communication with Queblo through SMS messages, using twilio webhooks. When someone sends a SMS message to Queblo’s twilio number, then twilio makes a call to Queblo

Attributes

  • Body: content of the SMS message
  • To: Number of the recepient
  • From: Number of the sender
  • NumMedia: If the message includes images, this will be an interger greater than 0 or 0 if there are no images
  • MediaUrlN: It's the URL of the image included in the SMS message. Its an index that beggings in 0. Ej. MediaUrl0, MediaUrl1

More information in Twilio Docs

How incoming SMS are handled

![Activity Diagram Income SMS](http://yuml.me/diagram/plain/activity/ (start)[incoming sms]->, [has media]->, [not found]->(unhandle), [found]->(set mediaN as potential)->, [error]->(response SMS), [ok]->(unhandle), [no media]->(store incoming sms), (store incoming sms)-><find worker(2)>, <find worker(2)>[not found]->(unhandle), <find worker(2)>[found]->, [not confirmed]->, [jobs|1|empleos]->(confirm worker)-><save worker(2)>, <save worker(2)>[ok]->(response SMS), <save worker(2)>[error]->(unhandle), [otherwise]->(send confirmation sms)->(end), [confirmed]-><check answer(2)>, <check answer(2)>[jobs|empleos]->(response SMS), <check answer(2)>[otherwise]->(find availability request), (find availability request)->, [lenght = 0]->(response SMS), [lenght > 0]-><check answer(3)>, <check answer(3)>[yes|no|si]->(response SMS), <check answer(3)>[otherwise]->(handle multiple response), [can't process]->(unhandle), (response SMS)->(end), (handle multiple response))

Stress test

Before performing the test, we downloaded the information of the data base fromuat.queblo.com

Two groups of users were created:

  • A group that behaves like users of the web page: 50 concurrent users that make requests. The batch repeats 10 times.

    • Each request retrieves the information of the workers.
  • A group that behaves as twilio: 10 concurrent users where the batch repeats 10 times. The following requests are made randomly:

    • an sms with one of the following texts: jobs, 1, yes, all, ultima, si
    • an sms with an attached image

There are 60 total concurrent users

Group that behaves like users

Group that behaves as twilio

After running the tests in the SMS Gateway page begins to have trouble loading

As a result of the above tests, it can be seen that as the SMS Gateway services are not functioning properly and have poor performance. also causing the malfunction of the website

Thing to improve

  1. Ensure that messages are properly managed and that the SMS Gateway service works as expected, for example today when a message with the words: "jobs" or "empleos" sends a confirmation message
  2. Node.js is handling both services and the website, that causes a malfunction in services reflected in a malfunction of the web page, it is best to separate the website from the services, so one does not affect the other
  3. About 40% of the requests SMS Gateway service don't end in an appropriate manner making the system unstable Imgur
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment