diff --git a/src/Core/Asterisk/Configs/Generators/Extensions/OutgoingContext.php b/src/Core/Asterisk/Configs/Generators/Extensions/OutgoingContext.php index a362d0b45..a4a5b495c 100644 --- a/src/Core/Asterisk/Configs/Generators/Extensions/OutgoingContext.php +++ b/src/Core/Asterisk/Configs/Generators/Extensions/OutgoingContext.php @@ -246,7 +246,8 @@ private function generateProviderContext(string &$conf, $id_dialplan, array $rou $dialCommand = $this->getDialCommand($rout); // Set DIAL_COMMAND variable - $conf .= 'same => n,ExecIf($["${DIAL_COMMAND}x" == "x"]?Set(DIAL_COMMAND='.$dialCommand.'))' . "\n\t"; + $conf .= 'same => n,Set(DIAL_COMMAND='.$dialCommand.')' . "\n\t"; + $conf .= 'same => n,ExecIf($["${DEF_DIAL_COMMAND}x" != "x"]?Set(DIAL_COMMAND=${DEF_DIAL_COMMAND}))' . "\n\t"; // Customize all-outgoing context $conf .= 'same => n,GosubIf($["${DIALPLAN_EXISTS(all-outgoing-custom,${EXTEN},1)}" == "1"]?all-outgoing-custom,${EXTEN},1)' . "\n\t";