Edd Slipszenko
Edd Slipszenko

Reputation: 396

Is there anyway to send a text message from Twilio so that the from number contains an extension?

Is there anyway to send a text message from Twilio so that the from number contains an extension?

Something like this:

<?php
// Get the PHP helper library from twilio.com/docs/php/install
require_once('twilio-php/Services/Twilio.php'); // Loads the library

// Your Account Sid and Auth Token from twilio.com/user/account
$sid = "...";
$token = "...";
$client = new Services_Twilio($sid, $token);
$client->account->messages->sendMessage(
    "+441337944066+123#", // From
    "+441234567891", // To
    "Hello world" // Body
);

At the moment attempting this produces this error message:

 Fatal error: Uncaught exception 'Services_Twilio_RestException' with message 'The 'From' number +441337944066+123# is not a valid phone number or shortcode.'

Upvotes: 0

Views: 1581

Answers (2)

SeekTom
SeekTom

Reputation: 296

Twilio Support here.

Unfortunately we do not support extensions when sending messages.

However if you're looking to dial an extension on voice calls you can use the SendDigits parameter:

https://www.twilio.com/docs/api/rest/making-calls

Tom

Upvotes: 1

Liam
Liam

Reputation: 1768

It was my understanding that you needed to send messages with a FROM value being a valid Twillio number. Since the wrapper/helper is using the REST API it should still be bound by those restrictions. See documentation about that here: http://www.twilio.com/docs/api/rest/sending-messages

So, unless you purchased the number from Twillio and it has an extension, unfortunately, I don't believe that is possible.

Upvotes: 1

Related Questions