0
votes

I am using twiml bin attached to one of my twilio numbers. When a person calls that number it should be able to dial multiple numbers. I want to stream the call only when the call has been picked up. There can be multiple ongoing streams associated with a twilio number.

<Response>
      <Start>
        <Stream track="both_tracks" url="wss://XXXX.ngrok.io /twilio-stream">
      </Stream>
     </Start>

    <Dial answerOnBridge="true" >
        <Number>+91XXXXXXXXX</Number>
        <Number>+91XXXXXXXXX</Number>
    </Dial>


</Response>

The above twiml starts the stream as soon as the number is dialed. I want it to start the stream only when the call is received at the other end.

1

1 Answers

0
votes

Unfortunately, there isn't a way to do this today, without REST API endpoint control.

You can use the REST API Calls resource to initiate calls intead. The approach you are taking doesn't work very well when the dialed parties are mobile end-points in poor coverage areas and/or devices with voicemail enabled.