When SIP calls end, the last request that was POSTed to my app gets POSTed again, slightly modified, but with the params that the Twilio docs indicate will be included in a call StatusCallback POST. This is doubly weird because I don't have a StatusCallback URL configured!
So ...an example. The environment (all URLs are https):
- Twilio SIP endpoint:
test-myaccount.sip.twilio.com
- Voice URL (POST):
myapp.myserver.com/twilioapp
- Fallback URL (GET):
s3.amazonaws.com/somebucket/twilioerror.xml
(can't imagine that's relevant, but I mention it in case it tips anyone off to weird side effects) - StatusCallback URL (POST): blank
The call flow:
1a. Call made to SIP endpoint - Twilio sends request to TwiML app server:
POST myapp.myserver.com/twilioapp
1b. TwiML app responds:
<?xml version="1.0" encoding="UTF-8"?> <Response> <Say language="en-US" voice="alice">May the fourth be with you!</Say> <Redirect>myapp.myserver.com/twilioapp/secondstep?actualdate=20140503</Redirect> </Response>
2a. Twilio plays the TTS speech, then POSTs back to the app server (per the Redirect verb):
POST myapp.myserver.com/twilioapp/secondstep?actualdate=20140503
2b. The app server responds:
<?xml version="1.0" encoding="UTF-8"?> <Response> <Say language="en-US" voice="alice">Whoops, wrong date. Goodbye!</Say> <Hangup /> </Response>
3a. Here's the funkiness I'm seeing - Twilio is then POSTing another request:
POST myapp.myserver.com/twilioapp/secondstep/?actualdate=20140503
Note (a) that the POST is to the last URL that Twilio posted to and (b) a trailing slash has been added to the URL, before the querystring params.
Params that are sent with that final POST:
AccountSid: <MyAccountSid>
Caller: sip:[email protected]
CallStatus: completed
Duration: 1
Called: sip:test-myaccount.sip.twilio.com
To: sip:test-myaccount.sip.twilio.com
CallDuration: 22
CallSid: <TheCallSid>
From: sip:[email protected]
Direction: inbound
ApiVersion: 2010-04-01
More weird: both Duration and CallDuration are included in the POST params - Duration in (rounded up) minutes, CallDuration in seconds.
So - I have no idea what's up. I've got a support ticket in, but haven't heard back in several days; figured while I was waiting on the Twilio code spelunkers to work their magic I'd ping the community and see if anyone else has noticed this behavior too.