简体   繁体   中英

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. 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..

My Java code:

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

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.

You can do this using TwiML Bins in the console .

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM