Fix the call center dialplan so that it does not create duplicates using the new call center class.
This commit is contained in:
parent
fb5c1a6ef9
commit
8130e970ab
|
|
@ -85,12 +85,6 @@
|
||||||
|
|
||||||
//build the dialplan array
|
//build the dialplan array
|
||||||
$dialplan["app_uuid"] = "95788e50-9500-079e-2807-fd530b0ea370";
|
$dialplan["app_uuid"] = "95788e50-9500-079e-2807-fd530b0ea370";
|
||||||
if (strlen($this->dialplan_uuid) > 0) {
|
|
||||||
$dialplan["dialplan_uuid"] = $this->dialplan_uuid;
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
$this->dialplan_uuid = uuid();
|
|
||||||
}
|
|
||||||
$dialplan["domain_uuid"] = $this->domain_uuid;
|
$dialplan["domain_uuid"] = $this->domain_uuid;
|
||||||
$dialplan["dialplan_name"] = ($this->queue_name != '') ? $this->queue_name : format_phone($this->destination_number);
|
$dialplan["dialplan_name"] = ($this->queue_name != '') ? $this->queue_name : format_phone($this->destination_number);
|
||||||
$dialplan["dialplan_number"] = $this->destination_number;
|
$dialplan["dialplan_number"] = $this->destination_number;
|
||||||
|
|
@ -174,13 +168,17 @@
|
||||||
$dialplan["dialplan_details"][$y]["dialplan_detail_group"] = "2";
|
$dialplan["dialplan_details"][$y]["dialplan_detail_group"] = "2";
|
||||||
$dialplan["dialplan_details"][$y]["dialplan_detail_order"] = $y * 10;
|
$dialplan["dialplan_details"][$y]["dialplan_detail_order"] = $y * 10;
|
||||||
|
|
||||||
//delete the previous details
|
//delete the previous dialplan
|
||||||
if(strlen($this->dialplan_uuid) > 0) {
|
if(strlen($this->dialplan_uuid) > 0) {
|
||||||
|
$sql = "delete from v_dialplans ";
|
||||||
|
$sql .= "where dialplan_uuid = '".$this->dialplan_uuid."' ";
|
||||||
|
$sql .= "and domain_uuid = '".$this->domain_uuid."' ";
|
||||||
|
$this->db->exec($sql);
|
||||||
|
|
||||||
$sql = "delete from v_dialplan_details ";
|
$sql = "delete from v_dialplan_details ";
|
||||||
$sql .= "where dialplan_uuid = '".$this->dialplan_uuid."' ";
|
$sql .= "where dialplan_uuid = '".$this->dialplan_uuid."' ";
|
||||||
$sql .= "and domain_uuid = '".$this->domain_uuid."' ";
|
$sql .= "and domain_uuid = '".$this->domain_uuid."' ";
|
||||||
//echo $sql."<br><br>";
|
$this->db->exec($sql);
|
||||||
$this->db->exec(check_sql($sql));
|
|
||||||
unset($sql);
|
unset($sql);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -194,9 +192,7 @@
|
||||||
//save the dialplan
|
//save the dialplan
|
||||||
$orm = new orm;
|
$orm = new orm;
|
||||||
$orm->name('dialplans');
|
$orm->name('dialplans');
|
||||||
if (isset($dialplan["dialplan_uuid"])) {
|
$orm->uuid($this->dialplan_uuid);
|
||||||
$orm->uuid($dialplan["dialplan_uuid"]);
|
|
||||||
}
|
|
||||||
$orm->save($dialplan);
|
$orm->save($dialplan);
|
||||||
$dialplan_response = $orm->message;
|
$dialplan_response = $orm->message;
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue