<Reject>
The <Reject>
verb rejects a call to your SignalWire number. It is effectively an exit statement from the current document, as there is no way to return to any instructions listed after the <Reject>
verb.
Verb Attributes
Attribute | |
---|---|
reason optional | The reason attribute takes in the following values: busy and rejected. These values specify what message is to be played when SignalWire rejects a call. If this value is set to busy , the caller receives a busy signal and the call is terminated with the status busy . If this value is set to rejected , the call is terminated with the status no answer . Default value is rejected . |
Nesting
No other verbs can be nested within <Reject>
and you cannot nest <Reject>
within any other verbs.
Examples
A Simple Rejection of a Call
- XML
- JavaScript
- C#
- Python
- Ruby
<?xml version="1.0" encoding="UTF-8"?>
<Response>
<Reject />
</Response>
const { RestClient } = require("@signalwire/compatibility-api");
const response = new RestClient.LaML.VoiceResponse();
response.reject();
console.log(response.toString());
using Twilio.TwiML;
using System;
class Example
{
static void Main()
{
var response = new VoiceResponse();
response.Reject();
Console.WriteLine(response.ToString());;
}
}
from signalwire.voice_response import VoiceResponse, Reject
response = VoiceResponse()
response.reject()
print(response)
require 'signalwire/sdk'
response = Signalwire::Sdk::VoiceResponse.new do |response|
response.reject
end
puts response.to_s
SignalWire will reject the call and the caller will receive a standard "This number is not in service" response.
Busy Signal Rejection
- XML
- JavaScript
- C#
- Python
- Ruby
<?xml version="1.0" encoding="UTF-8"?>
<Response>
<Reject reason="busy" />
</Response>
const { RestClient } = require("@signalwire/compatibility-api");
const response = new RestClient.LaML.VoiceResponse();
response.reject({ reason: "busy" });
console.log(response.toString());
using Twilio.TwiML;
using System;
class Example
{
static void Main()
{
var response = new VoiceResponse();
response.Reject(reason: "busy");
Console.WriteLine(response.ToString());;
}
}
from signalwire.voice_response import VoiceResponse, Reject
response = VoiceResponse()
response.reject(reason='busy')
print(response)
require 'signalwire/sdk'
response = Signalwire::Sdk::VoiceResponse.new do |response|
response.reject(reason: busy)
end
puts response.to_s
SignalWire will reject the call and the caller will receive a busy signal.