Getting StatusCallback events from Twilio in Java only -


i trying out sms , calls twilio. able send sms , make calls java code. not getting how can status callback in same java code.

is there way can status callback events in 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, there way can give twiml data (the xml voice calls) in function calling function java, instead of giving url 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); 

twilio developer evangelist here.

twilio performs status callbacks webhooks, when receive incoming call or message. in order receive these webhooks application need reachable twilio.

if having difficulty locally, might interested in checking out ngrok a great tool exposing local development environment external services twilio.

in answer other question, cannot supply twiml in api request twilio. need have server twilio can request twiml when call connects.


Comments

Popular posts from this blog

Spring Boot + JPA + Hibernate: Unable to locate persister -

go - Golang: panic: runtime error: invalid memory address or nil pointer dereference using bufio.Scanner -

c - double free or corruption (fasttop) -