我有一个与Twilio一起运行的应用程序.我们的想法是,您将拨打电话号码twilio将回答并为您提供菜单选项.一旦你按下一个数字它将提交帖子数据,然后挂断(该部分都正常工作)我遇到的问题是找出是否有一种方法提交发布数据如果用户只是挂起twilio尽快答案......我在他们的文档中找到了以下代码.
<?xml version="1.0" encoding="UTF-8"?>
<!-- page located at http://example.com/gather_hints.xml -->
<Response>
<Gather action="/process_gather.php" method="GET">
<Say>Enter something, or not</Say>
</Gather>
<Redirect method="GET">
/process_gather.php?Digits=TIMEOUT
</Redirect>
</Response>
Run Code Online (Sandbox Code Playgroud)
这个问题是你需要等到消息结束才能收集到超时.有没有办法让它尽快启动,如果用户挂断它会做类似去重定向标记?
谢谢!
编辑:那么在process_gather.php页面上,我可以将已完成的状态保存为变量吗?
$Completed = $_POST["completed"]; //which would set $Completed == 'completed'
Run Code Online (Sandbox Code Playgroud)
然后在那个页面我基本上可以说是否(!空($ Completed))做某事(我必须把它用到我的逻辑中,但我只是想确保我得到一般的想法)
我正在尝试创建一个用户界面,用户可以在其中输入她的凭证和电话号码,并使用Twilio API向某些收件人发送消息
因此,我解释说,我创建了我的帐户并初始化了身份验证密钥和令牌
private void button1_Click(object sender, EventArgs e)
{
string ssid = twilioSSIDBox.Text;
string token = twilioTokenBox.Text;
string number = twilioNumberBox.Text;
var client = new TwilioRestClient(Environment.GetEnvironmentVariable(ssid), Environment.GetEnvironmentVariable(token));
client.SendMessage(number, "+158965220", "Teting API message!");
}
Run Code Online (Sandbox Code Playgroud)
经过多次测试(硬编码ssid和令牌和编号)和文档咨询后,仍未在visual studio平台上发送消息,我没有收到任何错误消息或任何内容
所以我的问题是我错过了什么?我是否需要某个允许visual studio能够发送短信的库?
我正在使用Visual Studio 2015和Windows 10平台
谢谢
现在在“room.on('trackAdded')”中,我无法判断添加的曲目是否为屏幕共享。有办法告诉吗?
有没有一种使用REST API将用户添加到Twilio频道的方法?
from twilio.rest import Client
# Initialize the client
account = "ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX"
token = "your_auth_token"
client = Client(account, token)
# Update the channel
user = client.chat \
.services("ISXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX").users.list()[0]
channel = client.chat \
.services("ISXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX") \
.channels("CHXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX").list()[0]
# How to add user to channel?
Run Code Online (Sandbox Code Playgroud) 谁能告诉我如何解决这个问题。Java代码如下。
@Service
public class TwilioServiceProvider {
private static final String ACCOUNT_SID =
"ACbfadc94adf90fd6606222566aab3ef4";
private static final String AUTH_TOKEN = "f***********************";
public void sendMessage(String mobileNo){
Twilio.init(ACCOUNT_SID,AUTH_TOKEN);
Message message = Message.creator(new PhoneNumber(mobileNo),new
PhoneNumber("+18325323857"),"Account validation
successfull").create();
System.out.println(message.getAccountSid());
}
}
Run Code Online (Sandbox Code Playgroud)
我收到以下错误:
com.twilio.exception.ApiException:
The requested resource /2010-04-01/Accounts/ACbfadc94adf90fd6606222566aab3ef4/Messages.json was not found
Run Code Online (Sandbox Code Playgroud) 我正在使用 twilio sdk 将短信验证与我的 Android 应用程序集成,twilio 要求我注册我的应用程序的哈希签名,但生成哈希签名的方法不起作用,总是说它是无效的哈希签名,这是 twilio 想要哈希的路径签名

使用 Twilio notify 发送通知时出现异常。
如果我在不发送 SMS 的情况下发送通知,则在使用相同的 Twilio NotificationCreator bean 发送 SMS 后发送通知时,代码会引发异常,它工作正常。
这是 Twilio 通知的配置
@Configuration
public class TwilioConfig {
@Value("${twilio.accountSid}")
private String accountSid;
@Value("${twilio.authToken}")
private String authToken;
@Value("${twilio.serviceId}")
private String serviceId;
@Bean
public TwilioRestClient twilioRestClient() {
return new TwilioRestClient.Builder(accountSid, authToken)
.build();
}
@Bean
public NotificationCreator notificationCreator() {
return Notification.creator(serviceId);
}
}
Run Code Online (Sandbox Code Playgroud)
@Service
public class NotificationService {
@Autowired
private TwilioRestClient twilioRestClient;
@Autowired
private NotificationCreator notificationCreator;
public void sendPushNotification(String title, String body, List<String> identities) {
try {
Notification …Run Code Online (Sandbox Code Playgroud) const express = require("express");
const app = express();
const PORT = 3000;
require("dotenv").config();
const accountSid = process.env.TWILIO_ACCOUNT_SID;
const authToken = process.env.TWILIO_TOKEN;
const client = require("twilio")(accountSid, authToken);
client.messages
.create({
to: process.env.NUMBER,
from: "+18598006707",
body: "Hello Kashif",
})
.then((message) => console.log(message.sid));
app.listen(PORT, () => {
console.log("server is at", PORT);
});
Run Code Online (Sandbox Code Playgroud)
我收到“accountSid 必须以 AC 开头”,即使我的 TWILIO_ACCOUNT_SID 包含 AC。
TWILIO_ACCOUNT_SID="ACa6213af064b**************";
TWILIO_TOKEN="b5e1f89ed92c7c5****************";
NUMBER="+91783******";
Run Code Online (Sandbox Code Playgroud) init: function(config){
var that = this;
that.CONFIG = config;
that.video = Twilio.Video;
that.CONFIG.videoCall = true;
that.CONFIG.audioCall =true;
that.CONFIG.audioCallTrackCount =0;
that.CONFIG.videoCallTrackCount =0;
//alert message instance
that.ALERT_MESSAGES = Object.create(AlertMessage).init();
//ajaxing instance
that.AJAXING = Object.create(Ajaxing);
$(".fullscreen-btn").addClass('hide');
window.videoCallObject = that;
that.cachePageConstants();
//that.getTwilioTokenFromRestAPI();
return that;
},
cachePageConstants: function(){
var that = this;
$("#buttonCall").on("click", function(e){
e.preventDefault();
console.log("video button clicked");
$("#buttonCall").hide();
$("#audioCall").hide();
$("#buttonCallEnd").show();
$(".mute-btns").removeClass('hide');
document.getElementById('connecting').innerHTML = '<span style="color:#69C4CB;"><img src="/resources/css/images/refresh_gif.gif" />Calling...</span>';
that.CONFIG.videoCall =true;
that.getTwilioTokenFromRestAPI();
});
$("#audioCall").on("click", function(e){
e.preventDefault();
console.log("Audio button clicked");
$("#buttonCall").hide();
$("#audioCall").hide();
$("#buttonCallEnd").show();
$(".mute-btns").removeClass('hide');
document.getElementById('connecting').innerHTML = '<span …Run Code Online (Sandbox Code Playgroud) 我想导出所有对我的消息停止回复(选择退出)的人。我看到我的选择是
肯定有一种简单的方法可以让我获得所有选择退出的号码列表吗?
twilio ×10
twilio-api ×10
java ×3
javascript ×2
android ×1
c# ×1
node.js ×1
phone-call ×1
php ×1
python ×1
sms ×1
spring-boot ×1
voip ×1