Twilio SMS sent from +12345 - sms

I am sending SMS using Twilio Node (http://twilio.github.io/twilio-node/).
In the from field I've set the number that Twilio gave me, yet when I receive the SMS it shows as +1 (234) 5.
The only thing I can think of is that I am using the trial account, but their FAQ doesn't say anything about this...
https://www.twilio.com/help/faq/twilio-basics/how-does-twilios-free-trial-work
Code snippet:
// Require and initialize the Twilio module with your credentials
var client = require('twilio')('A-FAKE-8cc', 'b53090-FAKE-6808');
// Send an SMS message
client.sendSms({
to:'+' + to,
from: '+15734XXXXXX',
body: 'Your code is ' + code
}, function(err, responseData) {
if (err) {
console.log(err);
} else {
console.log(responseData.from);
console.log(responseData.body);
}
}
);
Here is another piece of info: my twilio number is in the US, while my destination is in Israel - does it matter? Also, when I verified my number I received the code from this +12345 as well.
Confirming my suspicion: I've just verified a US number this time, and it showed the correct number (both from my app and from twilio).

Hey to be very honest your location doesn't matter to have a call on the Twilio platform apart from that if you want to have an upgraded account i'll suggest you to apply for Github's student developer program you'll get 50$ from that and you can buy some virtual numbers from that.
And to successfully make calls i am linking a repository which will help you in sending messages as well as calls over the internet.Getting started with Twilio at MLH INIT

Related

RingCentral Main Company Number SMS `Phone number doesn't belong to extension` error

I tried to send SMS and listed the from as our Main Company Number but it would not go out. Said Phone number doesn't belong to extension per the error below. The RC account I am using for running my API calls does not have a phone line/number assigned.
Do I have to be logged in with the account that matches the from phone number?
{
"errorCode": "FeatureNotAvailable",
"message": "Phone number doesn't belong to extension",
"errors": [
{
"errorCode": "MSG-304",
"message": "Phone number doesn't belong to extension"
}
]
}
You can send SMS from the Main Company Number for a single user or multiple users using the following approaches:
Scenario 1: Send and Respond using a single user
In-order to send SMS from the main company number:
Set the Operator Extension
Authorize using the Operator Extension
Send SMS using the Main Company Number
Operator Extension: When a caller presses 0 (zero) or does not enter an extension number, the system connects the call to the designated operator extension by default. An Administrator can configure the operator extension
to have different call handling rules.
Scenario 2: Send and Respond using Multiple Users
In-order to send and SMS from Main Company Number and respond to it using multiple users, set up a call-queue and configure the operator extension to point to the Call Queue.
Create a Call-Queue and assign a password to it.
Set the Operator Extension to point to Call Queue.
Authorize using the Operator Extension ( Call Queue )
Send SMS using the Main Company Number
More info is available here:
https://devcommunity.ringcentral.com/ringcentraldev/topics/how-to-send-sms-from-the-main-company-number
To verify the numbers your user extension can send SMS from, call the following endpoint:
GET /restapi/v1.0/account/{accountId}/extension/{extensionId}/phone-number
This will return an array of phone numbers. Check the features property. The ones that can be used will have the SMSSender and/or MMSSender features. More info on this is available in the Developer Guide:
http://ringcentral-api-docs.readthedocs.io/en/latest/messages_sms-and-pager/#listing-valid-sms-sending-numbers

Receive SMS on twillion phone number

I have attached call back URL in the Twilio account with the Twilio phone number. But still i am not getting a hit on the call back URL when sending SMS to twilio number. There is no history in Twilio about the message received, though it is showing sent from my mobile phone.
I did a work around to recieve messages.
In a background thread, I am continuously listening to see if the 'number of messages' changed:
def newMsgCame(self,client,old_len):
new_len = len(client.messages.list(to="<my twilio number>"))
if(new_len > old_len):
return True,new_len
return False,new_len
If yes, then I return the latest message:
def getMsg(self,client):
messages = client.messages.list(to="<my twilio number>")
if (len(messages) != 0):
return messages[0].body
return ""
This might fail in many scenarios though.

Parse Background Job can send a message to all users currently logged in?

I am new to Parse and I want to know if there is a way to schedule a Background job that starts every 3 minutes and sends a message (an integer or something) to all users that at that moment are logged in. I could not find any help here reading the guide. I hope someone can help me here.
I was in need to push information for all logged in users in several apps which were built with Parse.com.
None of the solutions introduced earlier by Emilio, because we were in need to trigger some live event for logged users only.
So we decided to work with PubNub within CloudCode in Parse : http://www.pubnub.com/blog/realtime-collaboration-sync-parse-api-pubnub/
Our strategy is to open a "channel" available for all users, and if a user is active (logged in), we are pushing to this dedicated "channel" some information which are triggered by the app, and create some new events or call to action.
This is a sample code to send information to a dedicated channel :
Parse.Cloud.define("sendPubNubMessage", function(request, response) {
var message = JSON.stringify(request.params.message);
var PubNubUrl;
var PubNubKeys;
Parse.Config.get().then(function(config) {
PubNubKeys = config.get('PubNubkeys');
}).then(function() {
PubNubUrl = 'https://pubsub.pubnub.com/publish/';
PubNubUrl+= PubNubKeys.Publish_Key + '/';
PubNubUrl+= PubNubKeys.Subscribe_Key + '/0/';
PubNubUrl+= request.params.channel +'/0/';
PubNubUrl+= message;
return Parse.Cloud.httpRequest({
url: PubNubUrl,
headers: {
'Content-Type': 'application/json;charset=utf-8'
}
}).then(function(httpResponse) {
return httpResponse;
});
}).then(function(httpResponse) {
response.success(httpResponse.text);
}, function(error) {
response.error(error);
});
});
This is an another sample code used to send a message to a dedicated channel once something was changed on a specific class :
Parse.Cloud.afterSave("your_class", function(request, response) {
if (!request.object.existed()) {
Parse.Cloud.run('sendPubNubMessage', {
'message': JSON.stringify({
'collection': 'sample',
'objectId': request.object.id
}),
'channel' : 'all' // could be request.object.get('user').id
});
}
});
#Toucouleur is right in suggesting PubNub for your Parse project. PubNub acts essentially like an open socket between client and server so that the sever can send messages to clients and vice versa. There are 70+ SDKs supported, including one here for Win Phone.
One approach for your problem would be to Subscribe all users to a Channel when they log in, and Unsubscribe from that Channel when they exit the app or timeout.
When you want to send a message you can publish to a Channel and all users Subscribed will receive that message in < 1/4 second. PubNub makes sending those messages as Push Notifications really simple as well.
Another feature you may find useful is "Presence" which can give you realtime information about who is currently Subscribed to your "Channel".
If you think a code sample would help let me know!
Here's a few ideas I came up with.
Send a push notification to all users, but don't add an alert text. No alert will show for users who have the app closed and you can handle the alert in the App Delegate. Disadvantage: Uses a lot of push notifications, and not all of them are going to be used.
When the app comes to foreground, add a flag to the PFInstallation object that specifies the user is online, when it goes to the background, set the flag to false. Send a push notification to the installations that have the flag set to true. Disadvantages: If the app crashes, you would be sending notifications to users that are not online. Updating the user twice per session can increase your Parse request count.
Add a new property to the PFInstallation object where you store the last time a user did something, you can also set it on a timer of 30s/1m while the app is open. Send a push notification to users that have been active in the last 30s/1m. Disadvantage: Updating the PFInstallation every 30 seconds might cause an increase on your Parse request count. More accuracy (smaller interval) means more requests. The longer the session length of your users, the more requests you will use.

Plivo Bulk SMS destination limits?

I'm testing Plivo for sending bulk SMS. I'm using the .NET REST API to send the messages.
Plivo's documentation for bulk SMS indicates that you can just concatenate numbers with a delimiter. This works fine. Does anyone know how many numbers can be included or can you tell me how many you have successfully sent in one API request?
var plivo = new RestAPI("xxxxxxxxxxxxxxxxxxx", "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx");
var sendData = new Dictionary<string, string>
{
{ "src", "0000000000" },
{ "dst", "00000000000<00000000000<00000000000<00000000000<00000000000<HOW MANY MORE???" },
{ "text", "test sms from plivo" }
};
IRestResponse<MessageResponse> resp = plivo.send_message(sendData);
I couldn't find this information.
According to Plivo support:
"There is no limit to the number of destination numbers you can add in the "dst"parameter of the outbound message API.
However, the outgoing rate limit is 5 messages per second per account."
Regardless of this response, I'm sure there is still some theoretical limit. Based off the other information I've gathered, it's better to split the API calls up anyway using multiple Plivo number (sender id's). If you have a suitable number of long codes, you shouldn't have to worry about this limit.
Related information:
Long code SMS restrictions
How do I send 6000+ messages using a long code?
In other words, use multiple long codes and split up your destination numbers accordingly to send out in parallel.
Edit* Received another response that seems more accurate
"You can add upto 250 numbers per API request. That should be the ideal limit on the destination parameter."
For anyone wondering what the actual bulk-messaging limit is nowadays (2021), it is 1,000 numbers per API call.
Thankfully this is now clearly stated on Plivo's API Docs page in the Bulk Messaging section:
The Message API supports up to 1,000 unique destination numbers.

How would I design this scenario in Twilio?

I'm working on a YRS 2013 project and would like to use Twilio. I already have a Twilio account set up with over $100 worth of funds on it. I am working on a project which uses an external API and finds events near a location and date. The project is written in Ruby using Sinatra (which is going to be deployed to Heroku).
I am wondering whether you guys could guide me on how to approach this scenario: a user texts to the number of my Twilio account (the message would contain the location and date data), we process the body of that sms, and send back the results to the number that asked for them. I'm not sure where to start; for example if Twilio would handle some of that task or I would just use Twilio's API and do checking for smss and returning the results. I thinking about not using a database.
Could you guide me on how to approach this task?
I need to present the project on Friday; so I'm on a tight deadline! Thanks for our help.
They have some great documentation on how to do most of this.
When you receive a text you should parse it into the format you need
Put it into your existing project and when it returns the event or events in the area you need to check how long the string is due to a constraint that twilio has of restricting messages to 160 characters or less.
Ensure that you split the message elegantly and not in the middle of an event. If you were returned "Boston Celtics Game", "The Nut Cracker Play". you want to make sure that if both events cannot be put in one message that the first message says "Boston Celtics Game, Another text coming in 1 second" Or something similar.
In order to receive a text message from a mobile device, you'll have to expose an endpoint that is reachable by Twilio. Here is an example
class ReceiveTextController < ActionController
def index
# let's pretend that we've mapped this action to
# http://localhost:3000/sms in the routes.rb file
message_body = params["Body"]
from_number = params["From"]
SMSLogger.log_text_message from_number, message_body
end
end
In this example, the index action receives a POST from Twilio. It grabs the message body, and the phone number of the sender and logs it. Retrieving the information from the Twilio POST is as simple as looking at the params hash
{
"AccountSid"=>"asdf876a87f87a6sdf876876asd8f76a8sdf595asdD",
"Body"=> body,
"ToZip"=>"94949",
"FromState"=>"MI",
"ToCity"=>"NOVATO",
"SmsSid"=>"asd8676585a78sd5f548a64sd4f64a467sg4g858",
"ToState"=>"CA",
"To"=>"5555992673",
"ToCountry"=>"US",
"FromCountry"=>"US",
"SmsMessageSid"=>"hjk87h9j8k79hj8k7h97j7k9hj8k7",
"ApiVersion"=>"2008-08-01",
"FromCity"=>"GRAND RAPIDS",
"SmsStatus"=>"received",
"From"=>"5555992673",
"FromZip"=>"49507"
}
Source

Resources