Incoming SMS

Asked

Viewed 229 times

0

I’m trying to learn to mess with the twilio applying it to a project, even testing, in ASP.NET MVC 5.

Amid my Google dig, I found this tutorial here which explains how to use it.

I did everything according to what you have in this tutorial, but when testing, I even receive the message that the SMS was sent, but I do not receive any message at my number....

I don’t know if I’m doing something wrong in my code, or if I’m getting it wrong on the website itself. I know that Brazilian numbers generated by twilio do not send message yet, so I ended up creating another account and changing the number, because free account can not change number.

I also know that we can use test credentials to send messages without the need to pay for it. But they actually work, but no texting...

Anyway, I’ll put the controller here (although I think the problem is in my account) so that someone can help me.

Controller

    public ActionResult Index()
    {
        ViewBag.SendSmsResultMessage = TempData.ContainsKey("SendSmsResultMessage") ? TempData["SendSmsResultMessage"] : String.Empty;
        return View();
    }

    [HttpPost]
     public ActionResult SendSms(string sid, string token, string fromPhoneNumber, string toPhoneNumber, string message)
     {
         var twilioClient = new TwilioRestClient(sid, token);
         var sendMessageResult = twilioClient.SendMessage(fromPhoneNumber, toPhoneNumber, message, "");

         if (sendMessageResult.RestException == null)
             TempData["SendSmsResultMessage"] = "Mensagem enviada com sucesso!";
         else
             TempData["SendSmsResultMessage"] = "Houve um erro durante a tentativa de enviar a mensagem: " + sendMessageResult.RestException.Message;

         return RedirectToAction("Index");
     }

Has anyone ever used their service to help me ? Be another tutorial on how to create numbers and send this test ?

1 answer

1


According to the twilio documentation this functionality is not available in Brazil.

Countries that have this functionality (free SMS) are:

Australia, Austria, Belgium, Canada, Estonia, Finland, Germany, Hong Kong, Ireland, Lithuania, Mexico, Norway, Poland, Puerto Rico, Spain, Sweden, Switzerland, United Kingdom and
United States.

For links, Brazil is included in the list of countries that have this function.

Just a reminder:

The Rest of the world... Twilio is in the process of providing phone Numbers in more countries as quickly as we can. Each country has Different Regulations regarding the Purchase and sale of Telephone Numbers, so we are not Able to provide a Timeline on when Numbers in a specific country will be available.

That is: "Twilio is in the process of providing phone numbers in more countries as quickly as possible. Each country has different regulations regarding the purchase and sale of phone numbers, so we are not able to provide a timeline on when the numbers in a specific country will be available."

  • Then I’d have to buy a number so he can send a message to the right Brazilian numbers ?

  • does not work in Brazil. You will have to resort to another service.

  • 1

    thanks for the clarification. I’ve been reading the documentation on this link you sent me and added some more information to your reply! Thanks.

Browser other questions tagged

You are not signed in. Login or sign up in order to post.