无论如何,从Twilio发送短信,使从号码包含一个扩展


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

是否有从Twilio发送短信,使从号码包含扩展?

像这样:

<?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
);

此时尝试此操作会产生以下错误消息:

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

Twilio Support here

遗憾的是,我们不支持发送消息时的扩展。

然而,如果你想在语音呼叫中拨打分机,你可以使用SendDigits参数:

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

汤姆

这是我的理解,你需要发送的消息与FROM值是一个有效的Twillio号码。由于包装器/帮助器正在使用REST API,因此它仍然应该受到这些限制的约束。请参阅这里的文档:http://www.twilio.com/docs/api/rest/sending-messages

所以,除非你从Twillio购买了这个号码,并且它有一个扩展,不幸的是,我认为这是不可能的。