diff --git a/app/dialplan_outbound/dialplan_outbound_add.php b/app/dialplan_outbound/dialplan_outbound_add.php index 8cc999b4d7..d7a3903dd1 100644 --- a/app/dialplan_outbound/dialplan_outbound_add.php +++ b/app/dialplan_outbound/dialplan_outbound_add.php @@ -66,7 +66,8 @@ $limit = check_str($_POST["limit"]); $accountcode = check_str($_POST["accountcode"]); $toll_allow = check_str($_POST["toll_allow"]); - + $pin_codes_enable = check_str($_POST["pin_codes_enabled"]); + if (strlen($pin_codes_enable) == 0) { $pin_codes_enable = "false"; } //set the default type $gateway_type = 'gateway'; $gateway_2_type = 'gateway'; @@ -546,7 +547,21 @@ $array['dialplans'][$x]['dialplan_details'][$y]['dialplan_detail_order'] = $y * 10; $array['dialplans'][$x]['dialplan_details'][$y]['dialplan_detail_group'] = '0'; } + + if ($pin_codes_enable == "true") { + $y++; + $array['dialplans'][$x]['dialplan_details'][$y]['dialplan_detail_uuid'] = uuid(); + $array['dialplans'][$x]['dialplan_details'][$y]['domain_uuid'] = $_SESSION['domain_uuid']; + $array['dialplans'][$x]['dialplan_details'][$y]['dialplan_uuid'] = $dialplan_uuid; + $array['dialplans'][$x]['dialplan_details'][$y]['dialplan_detail_tag'] = 'action'; + $array['dialplans'][$x]['dialplan_details'][$y]['dialplan_detail_type'] = 'set'; + $array['dialplans'][$x]['dialplan_details'][$y]['dialplan_detail_data'] = 'pin_number=database'; + $array['dialplans'][$x]['dialplan_details'][$y]['dialplan_detail_order'] = $y * 10; + $array['dialplans'][$x]['dialplan_details'][$y]['dialplan_detail_group'] = '0'; + } + + if (strlen($toll_allow) > 0) { $y++; $array['dialplans'][$x]['dialplan_details'][$y]['dialplan_detail_uuid'] = uuid(); @@ -1036,6 +1051,23 @@ function type_onchange(dialplan_detail_type) { echo "\n"; echo "\n"; + if (permission_exists('outbound_route_pin_codes')) { + echo "\n"; + echo "\n"; + echo " ".$text['label-pin_codes']."\n"; + echo "\n"; + echo "\n"; + echo " \n"; + echo "
\n"; + echo $text['description-enable-pin_codes']."\n"; + echo "\n"; + echo "\n"; + } + + echo "\n"; echo "\n"; echo " ".$text['label-enabled']."\n";