3

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?

sv-alex
  • 31
  • 2

1 Answers1

0

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.

Megan Speir
  • 3,745
  • 1
  • 15
  • 25
  • 1
    Just wanted to add that if you record, RecordingSid is sent along with DialCallSid in parameters scope and that with an action attribute for the any verbs after, are unreachable so you'll have to handle multiple differently. – Alex Baban Jun 29 '16 at 21:43
  • Thanks for the reply, but what I really want is to be able to pair each recording with the child call that initiated it. In my case I have Sids for the parent call, all child calls, and the recording, I just can't determine which child call initiated which recording. – sv-alex Jun 30 '16 at 13:04
  • i am having the same issue. calling an endpoint that is used to store information about the call and that you later have to stitch together is not ideal at all. i see this reply is 3.5+ years old so i'm not expecting any help here. but it looks like the only way is to maintain your own endpoint, call it when a child call starts with a recording resource as a query param and then use that data to reconstruct the recording structure. Yuck. – gabereal Jan 31 '20 at 23:59