Fix the call center dialplan so that it does not create duplicates using the new call center class.
This commit is contained in:
parent
55b04e9d4d
commit
f0d90fd1e0
|
|
@ -85,12 +85,6 @@
|
|||
|
||||
//build the dialplan array
|
||||
$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["dialplan_name"] = ($this->queue_name != '') ? $this->queue_name : format_phone($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_order"] = $y * 10;
|
||||
|
||||
//delete the previous details
|
||||
//delete the previous dialplan
|
||||
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 .= "where dialplan_uuid = '".$this->dialplan_uuid."' ";
|
||||
$sql .= "and domain_uuid = '".$this->domain_uuid."' ";
|
||||
//echo $sql."<br><br>";
|
||||
$this->db->exec(check_sql($sql));
|
||||
$this->db->exec($sql);
|
||||
unset($sql);
|
||||
}
|
||||
|
||||
|
|
@ -194,9 +192,7 @@
|
|||
//save the dialplan
|
||||
$orm = new orm;
|
||||
$orm->name('dialplans');
|
||||
if (isset($dialplan["dialplan_uuid"])) {
|
||||
$orm->uuid($dialplan["dialplan_uuid"]);
|
||||
}
|
||||
$orm->uuid($this->dialplan_uuid);
|
||||
$orm->save($dialplan);
|
||||
$dialplan_response = $orm->message;
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue