I am trying out sms and calls from Twilio. I am able to send sms and make calls from my Java code. But I am not getting how can I get status callback in the same Java code.
Is there any way I can get status callback events in my java code?
params.add(new BasicNameValuePair("StatusCallback", "https://www.myapp.com/events"));
params.add(new BasicNameValuePair("StatusCallbackMethod", "POST"));
params.add(new BasicNameValuePair("StatusCallbackEvent", "initiated"));
params.add(new BasicNameValuePair("StatusCallbackEvent", "ringing"));
params.add(new BasicNameValuePair("StatusCallbackEvent", "answered"));
params.add(new BasicNameValuePair("StatusCallbackEvent", "completed"));
Also, is there any way we can give the TwiML data (the xml for voice calls) in the function calling function from Java, instead of giving it a URL to the TwiML/XML file. params.add(new BasicNameValuePair("Url", "http://demo.twilio.com/docs/voice.xml"));
CallFactory callFactory = client.getAccount().getCallFactory();
Call call = callFactory.create(params);