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
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
Properties
payload.status string
rejected: the call was declined.
payload.dialcalluuid string
The id of the call that was rejected.
Errors
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:
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:
The start_voice_chat and answer_dial_call tasks then use stub.data.after_hours != true next to the is_incoming_call condition.