ONE OF THE TODO'S DONE!!

All installation and configuration problems and questions

Moderators: gerski, enjay, williamconley, Op3r, Staydog, gardo, mflorell, MJCoate, mcargile, Kumba, Michael_N

ONE OF THE TODO'S DONE!!

Postby bobbymc » Sun Sep 23, 2007 4:06 am

THIS WILL CHECK EVERY CONFRECNE ROOM BY VICIDIAL AND SEE IF THE CONFRECNE IS USED BY ANYONE LIVE IN THE SYSTEM.. IF SO DO NOHTING.. IF ITS NOT OCCUPIDE BY ANYONE BASED ON THE LIVE AGENTS TABE KICK EVERYONE OUT OF THE CONFENCE ROOM AND MAKE IT AVALIABLE..

LET ME KNOW IF YOU NEED ANYMORE HELP.. TO RUN THIS ADD THIS TO YOUR CRONTAB ADDITIONS

* * * * * root /usr/bin/php4 /PATH_TO_FILE/fix_meetme.php &>/dev/null



$res = $astman->connect("$row[server_ip]", "admin" , "amp111") MODIFY THIS LIEN TO LOG INTO UR ASTERISK MANAGER

TURN ON DEBUG=1 TO PRINT DEBUG INFO

CODE:


<?

set_time_limit(120);

foreach (split("\n", `ps auxw|grep fix_meetme.php | grep -v grep`) as $pair) {
if(stristr($pair, 'fix_meetme.php') !== FALSE)$cronphp++;
}
if($cronphp>1){exit;}

//PHP CONNECT CODE TO CONNECT TO THE DATABASE

mysql_select_db ("asterisk"); // OR WHATEVER DATABASE U USE FOR VICIDIAL

$DEBUG=0;

require_once("php-asmanager.php");
$astman = new AGI_AsteriskManager();

$result = mysql_query("SELECT server_ip from servers order by server_ip");
while ($row = mysql_fetch_array($result))
{

if($DEBUG)print "Server $row[server_ip]\n";
if ($res = $astman->connect("$row[server_ip]", "admin" , "amp111")) {
$response = $astman->send_request('Command', array('Command'=>'meetme'));
$verinfo = $response['data'];
foreach (split("\n", $verinfo) as $indexparse) {
preg_match('/(.*) (.*)/i', $indexparse, $matches);
list($meetme_room,$right) = split("[\t ]+", $matches[1]);
if($meetme_room && $meetme_room!='Conf'){
$sql = "select extension,conf_exten from vicidial_conferences where server_ip='$row[server_ip]' and conf_exten = '$meetme_room'";
list($extension,$conf_exten) = mysql_fetch_array(mysql_query($sql));
if(!$extension && $conf_exten){
if($DEBUG)print "Kill confrence $meetme_room on server $row[server_ip]\n";
mysql_query("update vicidial_conferences set extension='' where server_ip='$row[server_ip]' and conf_exten='$meetme_room'");
for ($i = 1; $i < 11; $i++)
{

$response = $astman->send_request('Command', array('Command'=>"meetme kick $meetme_room $i"));
if($DEBUG)print "meetme kick $meetme_room $i\n";
}
}
else if($extension && $conf_exten){
list($check_phone_status_time) = mysql_fetch_array(mysql_query("SELECT count(*) FROM `vicidial_live_agents` where last_update_time <= now() - interval 2 minute and extension='$extension'"));
if($check_phone_status_time){
mysql_query("update vicidial_conferences set extension='' where server_ip='$row[server_ip]' and conf_exten='$meetme_room'");
if($DEBUG)print "Kill confrence $meetme_room even tho its already assigned to a user but user is not alive\n";
for ($i = 1; $i < 11; $i++)
{
$response = $astman->send_request('Command', array('Command'=>"meetme kick $meetme_room $i"));
if($DEBUG)print "meetme kick $meetme_room $i\n";
}
}
else{
if($DEBUG)print "Confence $meetme_room is ok! on server $row[server_ip]\n";
}
}
}
}
$astman->disconnect();
}
if($DEBUG)print "-------------------\n";


}



?>
bobbymc
 
Posts: 425
Joined: Fri Jan 05, 2007 12:26 am

Postby bobbymc » Sun Sep 23, 2007 4:08 am

OH BTW IT NEEDS php-asmanager.php
bobbymc
 
Posts: 425
Joined: Fri Jan 05, 2007 12:26 am

Postby Op3r » Sun Sep 23, 2007 7:40 am

Oh my GOD!!!!

Please upload this on the VICIDIAL Issue Tracker! ...

Thanks...
Get paid for US outbound Toll Free calls. PM me.
Op3r
 
Posts: 1432
Joined: Wed Jun 07, 2006 7:53 pm
Location: Manila

Postby bobbymc » Mon Sep 24, 2007 1:43 pm

im new to contributing code how would i do that.. i got alot of other bug fixes i can add =)
bobbymc
 
Posts: 425
Joined: Fri Jan 05, 2007 12:26 am

Postby ramindia » Tue Sep 25, 2007 4:31 am

Hi

thats good script

its very usefull also

ram
Kindly post your feedback, if this solution works.
so its very usefull for others who join later as a NEWBIE.
ramindia
 
Posts: 688
Joined: Wed Oct 11, 2006 4:06 am
Location: India

Postby Op3r » Tue Sep 25, 2007 6:31 am

via here

http://www.eflo.net/VICIDIALmantis

its an bug/issue tracker.
Get paid for US outbound Toll Free calls. PM me.
Op3r
 
Posts: 1432
Joined: Wed Jun 07, 2006 7:53 pm
Location: Manila

Postby gardo » Thu Sep 27, 2007 12:30 am

put it in the tracker please. by the way, where do you get php-asmanger.php?
http://goautodial.com
Empowering the next generation contact centers
gardo
 
Posts: 1926
Joined: Fri Sep 15, 2006 10:24 am
Location: Manila, 1004

Postby mflorell » Thu Sep 27, 2007 9:12 am

Thank you very much for posting this. This is good functionality that does need to be in VICIDIAL, but I would prefer not bringing a PHP-shell script into the mix that both uses another external package and does not follow the settings in VICIDIAL for manager connections.

Adding this functionality to the AST_VDauto_dial.pl script makes more sense for the project and will be more efficient while following the settings properly.
mflorell
Site Admin
 
Posts: 18387
Joined: Wed Jun 07, 2006 2:45 pm
Location: Florida

Postby bobbymc » Fri Sep 28, 2007 11:37 pm

well the idea is there.. feel free to implement it into that script.. let me know if you guys need any help on doing so
bobbymc
 
Posts: 425
Joined: Fri Jan 05, 2007 12:26 am

Re: ONE OF THE TODO'S DONE!!

Postby bobbymc » Thu Aug 23, 2012 11:01 pm

matt would you like me to implement this into the AST_VDauto_dial.pl script?
bobbymc
 
Posts: 425
Joined: Fri Jan 05, 2007 12:26 am

Re: ONE OF THE TODO'S DONE!!

Postby mflorell » Fri Aug 24, 2012 9:16 am

The conf update perl script already does this.
mflorell
Site Admin
 
Posts: 18387
Joined: Wed Jun 07, 2006 2:45 pm
Location: Florida


Return to Support

Who is online

Users browsing this forum: No registered users and 101 guests