ich einen Anruf zu schaffen wie so Twilio Java lib mit:Parsing Twilio statuscallback Call/Konferenz Veranstaltungen
PhoneNumber phoneNumberTo = new PhoneNumber(to);
PhoneNumber phoneNumberFrom = new PhoneNumber(from);
com.twilio.rest.api.v2010.account.Call call = new CallCreator(phoneNumberTo, phoneNumberFrom, URI.create(twimlUrl))
.setStatusCallback(URI.create(twStatusCallbackUrl))
.setStatusCallbackEvent(Arrays.asList(
com.twilio.rest.api.v2010.account.Call.Event.ANSWERED.toString(),
com.twilio.rest.api.v2010.account.Call.Event.COMPLETED.toString(),
com.twilio.rest.api.v2010.account.Call.Event.INITIATED.toString(),
com.twilio.rest.api.v2010.account.Call.Event.RINGING.toString()))
.create(this.client);
ich Ereignisse wie application/x-www-form-urlencoded
erhalten nennen. Gibt es eine bewährte Methode zum Analysieren der gesendeten Formulardaten in ein Twilio-Aufrufereignisobjekt?
Beispiel des Status von Twilio gesendet:
START TIME =09-Jan-2017 16:00:16
requestURI=/api/calls/12345/
authType=null
characterEncoding=UTF-8
contentLength=591
contentType=application/x-www-form-urlencoded; charset=utf-8
contextPath=
header=accept=*/*
header=cache-control=max-age=259200
header=content-length=591
header=content-type=application/x-www-form-urlencoded; charset=utf-8
header=host=api.example.com
header=x-twilio-signature=BLAH/BLAH
header=user-agent=TwilioProxy/1.1
header=connection=close
locale=en_US
method=POST
parameter=Called=+44123456789
parameter=ToState=London
parameter=CallerCountry=GB
parameter=Direction=outbound-api
parameter=Timestamp=Mon, 09 Jan 2017 16:00:16 +0000
parameter=CallbackSource=call-progress-events
parameter=CallerState=London
parameter=ToZip=
parameter=SequenceNumber=3
parameter=CallSid=BLAHBLAH
parameter=To=+44123456789
parameter=CallerZip=
parameter=ToCountry=GB
parameter=ApiVersion=2010-04-01
parameter=CalledZip=
parameter=CalledCity=
parameter=CallStatus=completed
parameter=Duration=1
parameter=From=+44123456789
parameter=CallDuration=5
parameter=AccountSid=BLAHBLAH
parameter=CalledCountry=GB
parameter=CallerCity=
parameter=Caller=+44123456789
parameter=FromCountry=GB
parameter=ToCity=
parameter=FromCity=
parameter=CalledState=London
parameter=FromZip=
parameter=FromState=London
pathInfo=null
protocol=HTTP/1.1
queryString=null
remoteAddr=X.X.X.X
remoteHost=X.X.X.X
remoteUser=null
requestedSessionId=null
scheme=http
serverName=api.example.com
serverPort=8082
servletPath=/api/calls/12345/
isSecure=false
Danke, aber ich bin mir sicher, das ist nur die veraltete Art, einen Anruf zu tätigen (v5). Es tut genau das, was ich oben mache, und zeigt auch nicht, wie man mit den zurückkommenden Callback-Ereignissen umgeht. Hatte gehofft, dass die API die statuscallback-Ereignisse abgefangen und irgendwo ein internes Modell des Anrufs aktualisiert hat. Nehmen wir an, dass das der Fall ist? –