1. Tasks
  2. Reject Dial Call

Tasks

Reject Dial Call

Declines a ringing phone call. Useful for turning away calls the template doesn't want to take, eg outside business hours or when nobody should take them.

When a phone call comes in through a SIP connection, the stub gets an _update_from_dial with is_incoming_call set to true. Run this task to decline the call instead of answering it with Answer Dial Call.

The caller's phone system is told the call was declined. What the caller hears then depends on the phone system, eg a busy tone or voicemail. No missed call event follows a rejected call.

A call that is neither answered nor rejected is turned away automatically after 25 seconds, and the stub gets a missed call event with the reason answer_timeout. Reject a call yourself when you already know you won't take it, so the caller isn't left waiting.

Basic usage

loading...

Parameters

dialcalluuid
required
string

The id of the call, from stubpost.data._incoming_dial_data.call_data.dialcalluuid on the incoming call event. The call must still be ringing.

Result

loading...

Properties

payload.status
string

rejected: the call was declined.


payload.dialcalluuid
string

The id of the call that was rejected.

Errors

message Meaning
dialcalluuid is required The dialcalluuid param is missing
unknown_call No call with this dialcalluuid in your organization
call_not_ringing The call isn't ringing anymore. error.details.status says why, eg missed when the caller hung up first, or it was already answered

These are conceptual errors.

Examples

Reject calls while the stub is busy

Decline calls when the stub is in a state where nobody should take them:

loading...

Answer during business hours, reject after hours

Keep a flag on the stub, eg stub.data.after_hours, set by a schedule. Answer with Answer Dial Call when it's not set, and reject when it is. The conditions on the two sides must be opposites, so every call gets exactly one of them:

loading...

The start_voice_chat and answer_dial_call tasks then use stub.data.after_hours != true next to the is_incoming_call condition.