Set the domain info once per inbound route dialplan

This commit is contained in:
Mark Crane 2014-07-09 07:36:13 +00:00
parent 6fb0434fd3
commit d2decc727a
1 changed files with 8 additions and 4 deletions

View File

@ -2194,6 +2194,7 @@ function save_dialplan_xml() {
foreach ($result as &$row) {
$tmp = "";
$tmp .= "\n";
$first_action = true;
$dialplan_continue = '';
if ($row['dialplan_continue'] == "true") {
@ -2411,10 +2412,13 @@ function save_dialplan_xml() {
if ($ent['dialplan_detail_tag'] == "action") {
//set the domain info for the public context
if ($row['dialplan_context'] == "public") {
$tmp .= " <action application=\"set\" data=\"call_direction=inbound\"/>\n";
$tmp .= " <action application=\"set\" data=\"domain_uuid=".$row['domain_uuid']."\"/>\n";
$tmp .= " <action application=\"set\" data=\"domain_name=".$_SESSION['domains'][$row['domain_uuid']]['domain_name']."\"/>\n";
$tmp .= " <action application=\"set\" data=\"domain=".$_SESSION['domains'][$row['domain_uuid']]['domain_name']."\"/>\n";
if ($first_action) {
$tmp .= " <action application=\"set\" data=\"call_direction=inbound\"/>\n";
$tmp .= " <action application=\"set\" data=\"domain_uuid=".$row['domain_uuid']."\"/>\n";
$tmp .= " <action application=\"set\" data=\"domain_name=".$_SESSION['domains'][$row['domain_uuid']]['domain_name']."\"/>\n";
$tmp .= " <action application=\"set\" data=\"domain=".$_SESSION['domains'][$row['domain_uuid']]['domain_name']."\"/>\n";
$first_action = false;
}
}
//get the action inline attribute
$action_inline = '';