Skip to contentSkip to navigationSkip to topbar
On this page

TwiML™ Voice:


The verb rejects an incoming call to your Twilio number without billing you. This is very useful for blocking unwanted calls.

If the first verb in a TwiML document is , Twilio will not pick up the call. The call ends with a status of busy or no-answer, depending on the verb's reason attribute. Any verbs after are unreachable and ignored.

Using as the first verb in your response is the only way to prevent Twilio from answering a call. Any other response will result in an answered call and your account will be billed.


Verb Attributes

attributes page anchor

The verb supports the following attributes that modify its behavior:

Attribute NameAllowed ValuesDefault Value
reasonrejected, busyrejected

reason

attributes-reason page anchor

The reason attribute takes the values rejected and busy. This tells Twilio what message to play when rejecting a call. Selecting busy will play a busy signal to the caller, while selecting rejected will play a standard not-in-service response. The default is rejected.

(information)

Info

This is a preference and what is actually played back is determined by the caller's service provider as they dictate what they want to playback to the caller.


You can't nest any verbs within and you can't nest in any other verbs.


Example 1: Reject a call playing a standard not-in-service message

examples-1 page anchor
Reject a call playing a standard not-in-service messageLink to code sample: Reject a call playing a standard not-in-service message
1
const VoiceResponse = require('twilio').twiml.VoiceResponse;
2
3
4
const response = new VoiceResponse();
5
response.reject();
6
7
console.log(response.toString());

Output

1
xml version="1.0" encoding="UTF-8"?>
2
<Response>
3
<Reject />
4
Response>

Example 2: Reject a call playing a busy signal

examples-2 page anchor
1
const VoiceResponse = require('twilio').twiml.VoiceResponse;
2
3
4
const response = new VoiceResponse();
5
response.reject({
6
reason: 'busy'
7
});
8
9
console.log(response.toString());

Output

1
xml version="1.0" encoding="UTF-8"?>
2
<Response>
3
<Reject reason="busy" />
4
Response>