[英]Voice call using twilio not telling generated number in call
I am implementing otp in voice ie through call using twilio,when user enters his number and click on voice ,he has to get call n play randomly generated 4 digit number. 我正在语音中实现otp,即通过使用twilio的呼叫,当用户输入其号码并单击语音时,他必须获得呼叫n播放随机生成的4位数字。 Now the call will be going to entered number but its not telling generated number to verify...URL i used is http://demo.twilio.com/docs/voice.xml , which contains some that it was telling in voice.... Please tell me how change this URL so that it tells randomly generated number..
现在,该呼叫将进入输入的号码,但不会告诉生成的号码以进行验证...我使用的URL是http://demo.twilio.com/docs/voice.xml ,其中包含一些正在通过语音告诉的内容。 ...请告诉我如何更改此URL,以告知随机生成的数字。
My Java code: 我的Java代码:
public Call sendCall(String mobileNumber, String smsText) {
TwilioRestClient client = new TwilioRestClient(ACCOUNT_SID, AUTH_TOKEN);
// Build the parameters
List<NameValuePair> params = new ArrayList<NameValuePair>();
params.add(new BasicNameValuePair("To", mobileNumber));
params.add(new BasicNameValuePair("From", "+13122489611"));
params.add(new BasicNameValuePair("Url", "http://demo.twilio.com/docs/voice.xml"));
params.add(new BasicNameValuePair("Method", "GET"));
params.add(new BasicNameValuePair("FallbackMethod", "GET"));
params.add(new BasicNameValuePair("StatusCallbackMethod", "GET"));
params.add(new BasicNameValuePair("Record", "false"));
try{
CallFactory callFactory = client.getAccount().getCallFactory();
Call call = callFactory.create(params);
} catch (TwilioRestException e) {
e.printStackTrace();
}
return null;
}
how to replace the URl... Please help 如何更换URl ...请帮助
For using the URL parameter , ensure that you have a publicly accessible URL that provides some TwiML instructions regarding the logic you wish to produce in your app. 要使用URL参数 ,请确保您拥有一个可公开访问的URL,该URL提供了一些有关您希望在应用中生成的逻辑的TwiML指令。
You can do this using TwiML Bins in the console . 您可以在控制台中使用TwiML Bins进行此操作。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.