How to disable DND from Asterisk AMI

I’m running FreePBX 14 with Asterisk 16 and we use AMI to initiate calls. Essentially what we do is to ring the extension and when the user picks up we then dial the external number. The problem we are running into is if the user is on DND, the call goes directly to voicemail which looks like a pickup and so the outbound number is dialed. This results in a voicemail being created.

What we would like to do is to turn off DND on the extension before we send the call. I can’t find any documentation on how to turn off DND via the AMI API.

Any suggestions?

Few unanswered questions here. What channel are you using to trigger the first leg of the call? How are you enabling DND, PBX feature or phone feature?

What’s happening is the user is putting themselves in DND via FOP2. This happens inadvertently apparently so they don’t realize they are on DND. When they click the button to initiate the call, our app then dials them. This is the code we are using. We are also using the Asterisk Manager PHP class.

if (!$this->recently_dialed()) {
$clip_phone_number = $this->clip_phone_number();
if ($this->name) {
$caller_id = “WF2 - {$this->name} <{$clip_phone_number}>”;
} else {
$caller_id = “WF2 - < {$clip_phone_number} >”;
$channel = “local/”.$this->user->ip_phone;
$context = env(‘AST_CONTEXT’);
$priority = 1;

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.