TwiML™ Voice: <Sim>
The <Dial>
verb's <Sim>
noun specifies a Programmable Wireless SIM to dial.
In order to make a call to a SIM, voice_enabled
must be set to true
in the SIM's Rate Plan. See the Programmable Wireless voice overview for details.
The <Sim>
noun does not currently support any of the attributes commonly used with other nouns in the <Dial>
verb.
In this example, we want to connect the current call to a SIM with Sid DE8caa2afb9d5279926619c458dc7098a8
.
To connect the call to the SIM, use a <Dial>
verb with a <Sim>
noun nested inside.
_10const VoiceResponse = require('twilio').twiml.VoiceResponse;
_10const response = new VoiceResponse();
_10const dial = response.dial();
_10dial.sim('DE8caa2afb9d5279926619c458dc7098a8');
_10console.log(response.toString());
_10<?xml version="1.0" encoding="UTF-8"?>
_10 <Sim>DE8caa2afb9d5279926619c458dc7098a8</Sim>
In this case, we want to record both legs of the call when dialing a Sim using <Dial>
.
_10const VoiceResponse = require('twilio').twiml.VoiceResponse;
_10const response = new VoiceResponse();
_10const dial = response.dial({
_10 record: 'record-from-ringing'
_10dial.sim('DE8caa2afb9d5279926619c458dc7098a8');
_10console.log(response.toString());
_10<?xml version="1.0" encoding="UTF-8"?>
_10 <Dial record="record-from-ringing">
_10 <Sim>DE8caa2afb9d5279926619c458dc7098a8</Sim>