Skip to content

Commit

Permalink
agi: fix on demand record code on simple huntgroups
Browse files Browse the repository at this point in the history
  • Loading branch information
Kaian committed Sep 6, 2024
1 parent 04e5c79 commit d6412dd
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 7 deletions.
5 changes: 5 additions & 0 deletions asterisk/agi/src/Agi/Action/HuntGroupCallAction.php
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,11 @@ public function process()
$options .= "c";
}

// For record asterisk builtin feature code (FIXME Dont use both X's)
if ($huntGroup->getCompany()->getOnDemandRecord() == 2) {
$options .= "xX";
}

// Call the PSJIP endpoint
$this->agi->setVariable("DIAL_DST", $endpointName);
$this->agi->setVariable("DIAL_TIMEOUT", $timeout);
Expand Down
7 changes: 1 addition & 6 deletions asterisk/agi/src/Dialplan/Trunks.php
Original file line number Diff line number Diff line change
Expand Up @@ -94,15 +94,10 @@ public function process()
$this->agi->setVariable("__COMPANYID", $company->getId());
$this->agi->setVariable("__COMPANYTYPE", $company->getType());
$this->agi->setVariable("__BRANDID", $brand->getId());
$this->agi->setVariable("__ONDEMANDCODE", $company->getOnDemandRecordCode());
$this->agi->setVariable("__ONDEMANDCODE", $company->getOnDemandRecordDTMFs());
$this->agi->setVariable("CHANNEL(musicclass)", $company->getMusicClass());
$this->agi->setVariable("CHANNEL(language)", $ddi->getLanguageCode());

// Check company On demand record code
if ($company->getOnDemandRecord()) {
$this->agi->setVariable("FEATUREMAP(automixmon)", $company->getOnDemandRecordDTMFs());
}

// Set DDI as the caller
$this->channelInfo->setChannelCaller(new DdiAgent($this->agi, $ddi));

Expand Down
2 changes: 1 addition & 1 deletion asterisk/agi/src/Dialplan/Users.php
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,7 @@ public function process()
$this->agi->setVariable("__COMPANYID", $company->getId());
$this->agi->setVariable("__COMPANYTYPE", $company->getType());
$this->agi->setVariable("__BRANDID", $brand->getId());
$this->agi->setVariable("__ONDEMANDCODE", $company->getOnDemandRecordCode());
$this->agi->setVariable("__ONDEMANDCODE", $company->getOnDemandRecordDTMFs());

// Mark this call as generated from user
$this->agi->setVariable("__CALL_TYPE", "internal");
Expand Down

0 comments on commit d6412dd

Please sign in to comment.