3
votes

So here's my issue:

  • I initiate a Twilio call via the API
  • When the call is picked up, Twilio reaches out to my Twiml server and gets a response containing the following (notice the "record" parameter of the Dial verb):

<Dial callerId="555-555-5555" record="record-from-ringing">
	<Number statusBallbackEvent="completed" statusCallbackMethod="POST" statusCallback="https://myCallback.com">
		555-555-5556
	</Number>
</Dial>

The call gets placed and is recorded correctly, but the value of Call Sid for the recording is always the Sid of the parent call. This can be problematic if I use multiple Dial verbs during the course of one call.

Is there a way to figure out which child call initiated the recording?

1

1 Answers

0
votes

To grab your child call SID, I'd recommend using an action URL in the verb that originates it. A request to this action URL would return the 'DialCallSid' parameter in Twilio's response:

https://www.twilio.com/docs/api/twiml/dial#attributes-action-parameters

<?xml version="1.0" encoding="UTF-8"?>
<!-- page located at http://example.com/dial_callstatus.xml -->
<Response>
    <Dial action="/handleDialCallStatus.php" method="GET">
        415-123-4567
    </Dial>
    <Say>I am unreachable</Say>
</Response>

You could then store or use that SID however you would like.

Please let me know if this helps at all.