13201: Dial: Cannot Dial out from a Dial Call Segment
ERROR
This error occurs when the TwiML returned from a <Dial><Number> url tries to execute another <Dial>. Twilio runs that url on the called party's side after answer and before the call is bridged, and that pre-bridge TwiML cannot contain <Dial>.
- Your application returned a
<Dial>verb from the webhook configured in the<Number>urlattribute. - You used the
<Number>urlwebhook to route or transfer the call instead of screening or informing the called party before the bridge. That webhook is limited to TwiML such as<Play>,<Say>,<Gather>, and<Hangup>. - You expected the called party's pre-bridge call segment to create a new outbound leg directly.
<Dial>can only dial a new party from an active call context, and Twilio does not allow that nested<Dial>in this pre-bridge flow.
- Remove the nested
<Dial>from the TwiML returned by the<Number>url. Use that TwiML only for called-party instructions or screening before the bridge. - If you need the called party to hear a message or choose whether to accept the call, return supported pre-bridge TwiML such as
<Play>,<Say>,<Gather>, and<Hangup>. - If you need to continue the original call flow after the
<Dial>attempt, move that logic to the parent call by using the<Dial>actionURL or the next verb in the original TwiML document. - If you need to redirect or change a live call asynchronously, update the in-progress call with the Calls API instead of trying to start a new
<Dial>from the called party's pre-bridge TwiML.