TwiML™ Voice: <Sim>

The <Dial> verb's <Sim> noun specifies a Programmable Wireless SIM to dial. Programmable Wireless is a beta product.

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.

Noun Attributes

The <Sim> noun does not currently support any of the attributes commonly used with other nouns in the <Dial> verb.

Examples

Example 1: Dialing to a SIM

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.

Loading Code Samples...
Language
SDK Version:
  • 5.x
SDK Version:
  • 7.x
SDK Version:
  • 3.x
SDK Version:
  • 5.x
SDK Version:
  • 6.x
SDK Version:
  • 5.x
Format:
  • TwiML
const VoiceResponse = require('twilio').twiml.VoiceResponse;

const response = new VoiceResponse();
const dial = response.dial();
dial.sim('DE8caa2afb9d5279926619c458dc7098a8');

console.log(response.toString());
using Twilio.TwiML;


class Example
{
    static void Main()
    {
        var response = new VoiceResponse();
        var dial = new Dial();
        dial.Sim("DE8caa2afb9d5279926619c458dc7098a8");
        response.Dial(dial);

        System.Console.WriteLine(response.ToString());
    }
}
<?php
require_once './vendor/autoload.php';
use Twilio\Twiml;

$response = new Twiml();
$dial = $response->dial();
$dial->sim('DE8caa2afb9d5279926619c458dc7098a8');

echo $response;
require 'twilio-ruby'

response = Twilio::TwiML::VoiceResponse.new
response.dial do |dial|
    dial.sim('DE8caa2afb9d5279926619c458dc7098a8')
end

puts response
from twilio.twiml.voice_response import Dial, VoiceResponse, Sim

response = VoiceResponse()
dial = Dial()
dial.sim('DE8caa2afb9d5279926619c458dc7098a8')
response.append(dial)

print(response)
import com.twilio.twiml.Dial;
import com.twilio.twiml.VoiceResponse;
import com.twilio.twiml.Sim;
import com.twilio.twiml.TwiMLException;


public class Example {
    public static void main(String[] args) {
        Sim sim = new Sim.Builder("DE8caa2afb9d5279926619c458dc7098a8").build();
        Dial dial = new Dial.Builder().sim(sim).build();
        VoiceResponse response = new VoiceResponse.Builder().dial(dial).build();

        try {
            System.out.println(response.toXml());
        } catch (TwiMLException e) {
            e.printStackTrace();
        }
    }
}
<?xml version="1.0" encoding="UTF-8"?>
<Response>
    <Dial>
        <Sim>DE8caa2afb9d5279926619c458dc7098a8</Sim>
    </Dial>
</Response>
Dialing to a SIM

Example 2: Dialing to a SIM with recording enabled

In this case, we want to record both legs of the call when dialing a Sim using <Dial>.

Loading Code Samples...
Language
SDK Version:
  • 5.x
SDK Version:
  • 7.x
SDK Version:
  • 3.x
SDK Version:
  • 5.x
SDK Version:
  • 6.x
SDK Version:
  • 5.x
Format:
  • TwiML
const VoiceResponse = require('twilio').twiml.VoiceResponse;

const response = new VoiceResponse();
const dial = response.dial({
    record: 'record-from-ringing'
});
dial.sim('DE8caa2afb9d5279926619c458dc7098a8');

console.log(response.toString());
using Twilio.TwiML;


class Example
{
    static void Main()
    {
        var response = new VoiceResponse();
        var dial = new Dial(record: "record-from-ringing");
        dial.Sim("DE8caa2afb9d5279926619c458dc7098a8");
        response.Dial(dial);

        System.Console.WriteLine(response.ToString());
    }
}
<?php
require_once './vendor/autoload.php';
use Twilio\Twiml;

$response = new Twiml();
$dial = $response->dial(['record' => 'record-from-ringing']);
$dial->sim('DE8caa2afb9d5279926619c458dc7098a8');

echo $response;
require 'twilio-ruby'

response = Twilio::TwiML::VoiceResponse.new
response.dial(record: 'record-from-ringing') do |dial|
  dial.sim('DE8caa2afb9d5279926619c458dc7098a8')
end

puts response
from twilio.twiml.voice_response import Dial, VoiceResponse, Sim

response = VoiceResponse()
dial = Dial(record='record-from-ringing')
dial.sim('DE8caa2afb9d5279926619c458dc7098a8')
response.append(dial)

print(response)
import com.twilio.twiml.Dial;
import com.twilio.twiml.VoiceResponse;
import com.twilio.twiml.Sim;
import com.twilio.twiml.TwiMLException;
import com.twilio.twiml.Language;

public class Example {
    public static void main(String[] args) {
        Sim sim = new Sim.Builder("DE8caa2afb9d5279926619c458dc7098a8").build();
        Dial dial = new Dial.Builder().record(Dial.Record.RECORD_FROM_RINGING)
            .sim(sim).build();
        VoiceResponse response = new VoiceResponse.Builder().dial(dial).build();

        try {
            System.out.println(response.toXml());
        } catch (TwiMLException e) {
            e.printStackTrace();
        }
    }
}
<?xml version="1.0" encoding="UTF-8"?>
<Response>
    <Dial record="record-from-ringing">
        <Sim>DE8caa2afb9d5279926619c458dc7098a8</Sim>
    </Dial>
</Response>
Dialing to a SIM with recording enabled

Need some help?

We all do sometimes; code is hard. Get help now from our support team, or lean on the wisdom of the crowd browsing the Twilio tag on Stack Overflow.

1 / 1
Loading Code Samples...
SDK Version:
  • 5.x
SDK Version:
  • 7.x
SDK Version:
  • 3.x
SDK Version:
  • 5.x
SDK Version:
  • 6.x
SDK Version:
  • 5.x
Format:
  • TwiML
const VoiceResponse = require('twilio').twiml.VoiceResponse;

const response = new VoiceResponse();
const dial = response.dial();
dial.sim('DE8caa2afb9d5279926619c458dc7098a8');

console.log(response.toString());
using Twilio.TwiML;


class Example
{
    static void Main()
    {
        var response = new VoiceResponse();
        var dial = new Dial();
        dial.Sim("DE8caa2afb9d5279926619c458dc7098a8");
        response.Dial(dial);

        System.Console.WriteLine(response.ToString());
    }
}
<?php
require_once './vendor/autoload.php';
use Twilio\Twiml;

$response = new Twiml();
$dial = $response->dial();
$dial->sim('DE8caa2afb9d5279926619c458dc7098a8');

echo $response;
require 'twilio-ruby'

response = Twilio::TwiML::VoiceResponse.new
response.dial do |dial|
    dial.sim('DE8caa2afb9d5279926619c458dc7098a8')
end

puts response
from twilio.twiml.voice_response import Dial, VoiceResponse, Sim

response = VoiceResponse()
dial = Dial()
dial.sim('DE8caa2afb9d5279926619c458dc7098a8')
response.append(dial)

print(response)
import com.twilio.twiml.Dial;
import com.twilio.twiml.VoiceResponse;
import com.twilio.twiml.Sim;
import com.twilio.twiml.TwiMLException;


public class Example {
    public static void main(String[] args) {
        Sim sim = new Sim.Builder("DE8caa2afb9d5279926619c458dc7098a8").build();
        Dial dial = new Dial.Builder().sim(sim).build();
        VoiceResponse response = new VoiceResponse.Builder().dial(dial).build();

        try {
            System.out.println(response.toXml());
        } catch (TwiMLException e) {
            e.printStackTrace();
        }
    }
}
<?xml version="1.0" encoding="UTF-8"?>
<Response>
    <Dial>
        <Sim>DE8caa2afb9d5279926619c458dc7098a8</Sim>
    </Dial>
</Response>
SDK Version:
  • 5.x
SDK Version:
  • 7.x
SDK Version:
  • 3.x
SDK Version:
  • 5.x
SDK Version:
  • 6.x
SDK Version:
  • 5.x
Format:
  • TwiML
const VoiceResponse = require('twilio').twiml.VoiceResponse;

const response = new VoiceResponse();
const dial = response.dial({
    record: 'record-from-ringing'
});
dial.sim('DE8caa2afb9d5279926619c458dc7098a8');

console.log(response.toString());
using Twilio.TwiML;


class Example
{
    static void Main()
    {
        var response = new VoiceResponse();
        var dial = new Dial(record: "record-from-ringing");
        dial.Sim("DE8caa2afb9d5279926619c458dc7098a8");
        response.Dial(dial);

        System.Console.WriteLine(response.ToString());
    }
}
<?php
require_once './vendor/autoload.php';
use Twilio\Twiml;

$response = new Twiml();
$dial = $response->dial(['record' => 'record-from-ringing']);
$dial->sim('DE8caa2afb9d5279926619c458dc7098a8');

echo $response;
require 'twilio-ruby'

response = Twilio::TwiML::VoiceResponse.new
response.dial(record: 'record-from-ringing') do |dial|
  dial.sim('DE8caa2afb9d5279926619c458dc7098a8')
end

puts response
from twilio.twiml.voice_response import Dial, VoiceResponse, Sim

response = VoiceResponse()
dial = Dial(record='record-from-ringing')
dial.sim('DE8caa2afb9d5279926619c458dc7098a8')
response.append(dial)

print(response)
import com.twilio.twiml.Dial;
import com.twilio.twiml.VoiceResponse;
import com.twilio.twiml.Sim;
import com.twilio.twiml.TwiMLException;
import com.twilio.twiml.Language;

public class Example {
    public static void main(String[] args) {
        Sim sim = new Sim.Builder("DE8caa2afb9d5279926619c458dc7098a8").build();
        Dial dial = new Dial.Builder().record(Dial.Record.RECORD_FROM_RINGING)
            .sim(sim).build();
        VoiceResponse response = new VoiceResponse.Builder().dial(dial).build();

        try {
            System.out.println(response.toXml());
        } catch (TwiMLException e) {
            e.printStackTrace();
        }
    }
}
<?xml version="1.0" encoding="UTF-8"?>
<Response>
    <Dial record="record-from-ringing">
        <Sim>DE8caa2afb9d5279926619c458dc7098a8</Sim>
    </Dial>
</Response>