Skip to content

Commit

Permalink
Create an additional dialplan to set call_direction outbound.
Browse files Browse the repository at this point in the history
  • Loading branch information
markjcrane authored May 28, 2022
1 parent 147956f commit a0718f3
Showing 1 changed file with 51 additions and 2 deletions.
53 changes: 51 additions & 2 deletions app/dialplan_outbound/dialplan_outbound_add.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
The Initial Developer of the Original Code is
Mark J Crane <[email protected]>
Portions created by the Initial Developer are Copyright (C) 2008-2021
Portions created by the Initial Developer are Copyright (C) 2008-2022
the Initial Developer. All Rights Reserved.
Contributor(s):
Expand Down Expand Up @@ -419,7 +419,55 @@
//set the uuid
$dialplan_uuid = uuid();

//build the array
//build the array - set call_direction
$x = 0;
$array['dialplans'][$x]['domain_uuid'] = $_SESSION['domain_uuid'];
$array['dialplans'][$x]['dialplan_uuid'] = $dialplan_uuid;
$array['dialplans'][$x]['app_uuid'] = $app_uuid;
$array['dialplans'][$x]['dialplan_name'] = 'call_direction-outbound';
$array['dialplans'][$x]['dialplan_order'] = '22';
$array['dialplans'][$x]['dialplan_continue'] = 'true';
$array['dialplans'][$x]['dialplan_context'] = $dialplan_context;
$array['dialplans'][$x]['dialplan_enabled'] = $dialplan_enabled;
$array['dialplans'][$x]['dialplan_description'] = $dialplan_description;
$y = 0;
$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'] = 'condition';
$array['dialplans'][$x]['dialplan_details'][$y]['dialplan_detail_type'] = '${user_exists}';
$array['dialplans'][$x]['dialplan_details'][$y]['dialplan_detail_data'] = 'false';
$array['dialplans'][$x]['dialplan_details'][$y]['dialplan_detail_order'] = $y * 10;
$array['dialplans'][$x]['dialplan_details'][$y]['dialplan_detail_group'] = '0';
$array['dialplans'][$x]['dialplan_details'][$y]['dialplan_detail_enabled'] = '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'] = 'condition';
$array['dialplans'][$x]['dialplan_details'][$y]['dialplan_detail_type'] = 'destination_number';
$array['dialplans'][$x]['dialplan_details'][$y]['dialplan_detail_data'] = $dialplan_expression;
$array['dialplans'][$x]['dialplan_details'][$y]['dialplan_detail_order'] = $y * 10;
$array['dialplans'][$x]['dialplan_details'][$y]['dialplan_detail_group'] = '0';
$array['dialplans'][$x]['dialplan_details'][$y]['dialplan_detail_enabled'] = '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'] = 'export';
$array['dialplans'][$x]['dialplan_details'][$y]['dialplan_detail_data'] = 'call_direction=outbound';
$array['dialplans'][$x]['dialplan_details'][$y]['dialplan_detail_inline'] = 'true';
$array['dialplans'][$x]['dialplan_details'][$y]['dialplan_detail_order'] = $y * 10;
$array['dialplans'][$x]['dialplan_details'][$y]['dialplan_detail_group'] = '0';
$array['dialplans'][$x]['dialplan_details'][$y]['dialplan_detail_enabled'] = 'true';
$y++;
$x++;

//set the uuid
$dialplan_uuid = uuid();

//build the array - outbound route
$array['dialplans'][$x]['domain_uuid'] = $_SESSION['domain_uuid'];
$array['dialplans'][$x]['dialplan_uuid'] = $dialplan_uuid;
$array['dialplans'][$x]['app_uuid'] = $app_uuid;
Expand Down Expand Up @@ -498,6 +546,7 @@
$array['dialplans'][$x]['dialplan_details'][$y]['dialplan_detail_tag'] = 'action';
$array['dialplans'][$x]['dialplan_details'][$y]['dialplan_detail_type'] = 'export';
$array['dialplans'][$x]['dialplan_details'][$y]['dialplan_detail_data'] = 'call_direction=outbound';
$array['dialplans'][$x]['dialplan_details'][$y]['dialplan_detail_inline'] = 'true';
$array['dialplans'][$x]['dialplan_details'][$y]['dialplan_detail_order'] = $y * 10;
$array['dialplans'][$x]['dialplan_details'][$y]['dialplan_detail_group'] = '0';
$array['dialplans'][$x]['dialplan_details'][$y]['dialplan_detail_enabled'] = 'true';
Expand Down

0 comments on commit a0718f3

Please sign in to comment.