Scotty, We Need More Power!

January 11th, 2011 by cmatthieu

Captain Kirk was always demanding more out of his Chief Engineer on Star Trek by saying, “Scotty, we need more power.”

While there is no limit on the number of inbound SMS messages your application can receive, Tropo’s 10 digit numbers are limited by the SMS carriers to sending 10 outbound messages per minute per number (UPDATE – this limit has been improved to 1 message per second, 60 messages per minute as of July 22, 2011).  All 10 digit US SMS numbers have such a rate limit but it’s up to each API provider to adhere to their request.

Our SMS Shortcodes, on the other hand, have no limit on outbound SMS messages but there is a leasing fee to acquire these “Warp Speed” numbers.  Contact sales@tropo.com if you are interested!

If you feel like Captain Kirk when using 10 digit numbers and you want more power but you are not ready to move up to our SMS Shortcodes, here’s a trick!  You can attach an unlimited number of 10 digit voice/sms numbers to your Tropo application.  Each number is capable of sending 10 messages per minute per number.  Simply spread your outbound SMS messages over a larger pool of 10 digit Tropo numbers!

Here is an example of how I was able to help a customer do this using Ruby:

rate = 10 #per minute
totalmessages = 30
numbers = ["15123330824", "15713575541"]
count = 0
total = 0
starttime = Time.new

while total <  totalmessages do
  if Time.now - starttime < 60 and count < rate
    numbers.each do |number|
      # Send SMS
      message "hello " + count.to_s, {
        :to => "tel:+14803194368",
        :callerID => "tel:+" + number,
        :network => "SMS"}
    end
    count = count + 1
    total = total + 1

  elsif Time.now - starttime > 60
    # Reseting counters
    starttime = Time.new
    count = 0
  end
end

In this example, we set the rate limit and the totalmessages that we would like to send out. We attached multiple phone numbers to our Tropo application and list them in the numbers array. Next, we loop through the numbers sending an SMS message for each number until we hit our rate limit for the minute. Finally, we wait for the rest of the minute and reset the timer and counters and loop through the rest of next batch of numbers until our totalmessages are hit.

Related posts:

  1. Canadian voice and SMS numbers, improved rate limit, and shortcodes
  2. Command Line SMS
  3. How-To: Sending an SMS using WebAPI
  4. QR Code Fun with Tropo!
  5. Customer Service Hotline

Tags: , , , ,

4 Responses to “Scotty, We Need More Power!”

  1. Shane Iseminger says:

    It’s too bad the carriers limit sending of SMS messages from long codes. In our situation, we want to offer each customer their own number for all services, which means long codes obviously (there’s no way we could do a shortcode for each customer because of the costs the CSCA imposes).

    But we really need to send messages faster than one ever six seconds. One of your competitors says they allow a rate of one SMS message per second. If I read this post correctly, that would mean they simply aren’t abiding by the rate limit the carriers request. Or is there a way you’ll be able to offer a faster rate limit in the future?

  2. Nicolas says:

    Does this rate limit apply to Canadian long numbers too ? If not, or different, what is the limit for canadian long numbers ?

    As for Shane’s question about the competitor’s rate limit, if its Twilio, they also limit to 10 per minute, but they have a queue. The 1 second is a misunderstanding of their documentation; they limit 1 message per second, but a total of 10 per minute.

  3. Dan York says:

    Nicolas,

    Yes, the rate limit also applies to Canadian long numbers. Thanks for the other feedback as well.

    Dan

  4. Ing says:

    Hi,

    I don’t know if anyone will ever read this, but I’ll give it a shot anyway.

    Could you shed some light on what happens when you’ve reached the limit? Is there a specific error message etc?

    Thanks

Leave a Reply

Please note: By submitting a comment you agree to comply with our Comment Policy. We welcome all comments, positive or negative, but do reserve the right to remove all or part of blog comments that do not comply with our policy.

Additionally, the first time you leave a comment on this blog, it will be held for moderation. After that first comment has been approved, future comments will be posted without delay.

Additional comments powered by BackType