0 like 0 dislike
253 views
As in ViciDial there is an auto call disposition feature but we need auto resume feature too when agent is in paused state and code is dcmx so how do we achieve this?
in Education & Reference by (820 points) | 253 views

1 Answer

0 like 0 dislike

Vicidial index.php

setInterval(function() {
recheckVDAI_query = "server_ip=" + server_ip + "&session_name=" + session_name + "&user=" + user + "&pass=" + pass + "&campaign=" + campaign + "&ACTION=VDADREcheckINCOMING" + "&agent_log_id=" + agent_log_id + "&lead_id=" + document.vicidial_form.lead_id.value;
 var xhttp = new XMLHttpRequest();
  xhttp.onreadystatechange = function() {
    if (this.readyState == 4 && this.status == 200) {
      if(this.responseText==1){
      AutoDial_ReSume_PauSe('VDADready');
      }
    }
  };
  xhttp.open("GET", "auto_ready.php?"+recheckVDAI_query, true);
  xhttp.send();
}, 30000);

auto_ready.php

$servername = "localhost";
$username = "cron";
$password = "1234";
$dbname = "asterisk";

// Create connection
$conn = new mysqli($servername, $username, $password, $dbname);
// Check connection
if ($conn->connect_error) {
    die("Connection failed: " . $conn->connect_error);
} 

$sql = "select * from vicidial_live_agents where status='PAUSED' and pause_code='DCMX' and user='".$_GET['user']."'";
$result = $conn->query($sql);

if ($result->num_rows > 0) {
    // output data of each row
   $result = $conn->query($sql); $resultu = $conn->query("update vicidial_live_agents set status='READY' where user='".$_GET['user']."' and status='PAUSED' and pause_code='DCMX'");
        echo "1";
   
} else {
    echo "0 results";
}
$conn->close();
by (1.4k points)
edited by

Related questions

0 like 0 dislike
1 answer
0 like 0 dislike
1 answer
1 like 0 dislike
1 answer
asked Jul 16, 2014 in Education & Reference by Simmi (620 points) | 115 views
0 like 0 dislike
3 answers
asked Jan 20, 2014 in Education & Reference by Sam (1.4k points) | 447 views
1 like 0 dislike
1 answer

Where your donation goes
Technology: We will utilize your donation for development, server maintenance and bandwidth management, etc for our site.

Employee and Projects: We have only 15 employees. They are involved in a wide sort of project works. Your valuable donation will definitely boost their work efficiency.

How can I earn points?
Awarded a Best Answer 10 points
Answer questions 10 points
Asking Question -20 points

1,225 questions
1,370 answers
559 comments
2,099 users