diff -u /home/asterisk/puff15/gnudialer-3.0-puff-working/adminwork.h /home/asterisk/gnudialer17/gnudialer-3.0-puff/adminwork.h --- /home/asterisk/puff15/gnudialer-3.0-puff-working/adminwork.h 2005-10-25 15:09:50.000000000 -0700 +++ /home/asterisk/gnudialer17/gnudialer-3.0-puff/adminwork.h 2005-10-28 10:24:33.000000000 -0700 @@ -78,18 +78,18 @@ } bool reloadAgents() { - - std::string managerUsername = getManagerUsername(); - std::string managerPassword = getManagerPassword(); - std::string response; -// sendToDialer("reloadagents"); - ClientSocket AsteriskManager("dialer",5038); - AsteriskManager.setRecvTimeout(1000); + ClientSocket AsteriskManager(getMainHost(),5038); +// AsteriskManager.setRecvTimeout(1000); AsteriskManager >> response; - AsteriskManager << "Action: Login\r\nUserName: " + managerUsername + "\r\nSecret: " + managerPassword + "\r\nEvents: off\r\n\r\n"; + AsteriskManager << "Action: Login\r\nUserName: " + \ + getManagerUsername() + \ + "\r\nSecret: " + \ + getManagerPassword() + \ + "\r\nEvents: off\r\n\r\n"; AsteriskManager >> response; - AsteriskManager << "Action: Command\r\nCommand: reload chan_agent.so\r\n\r\n"; + AsteriskManager << "Action: Command\r\n"; + AsteriskManager << "Command: reload chan_agent.so\r\n\r\n"; AsteriskManager >> response; AsteriskManager << "Action: Logoff\r\n\r\n"; AsteriskManager >> response; Only in /home/asterisk/puff15/gnudialer-3.0-puff-working: agenthours.cgi Only in /home/asterisk/puff15/gnudialer-3.0-puff-working: all.diff Only in /home/asterisk/gnudialer17/gnudialer-3.0-puff: app_machinedetect.c Only in /home/asterisk/gnudialer17/gnudialer-3.0-puff: app_nv_backgrounddetect.c Only in /home/asterisk/gnudialer17/gnudialer-3.0-puff: app_nv_faxdetect.c Only in /home/asterisk/gnudialer17/gnudialer-3.0-puff: astcrm-1.1.2 Common subdirectories: /home/asterisk/puff15/gnudialer-3.0-puff-working/astcrm-1.1.3 and /home/asterisk/gnudialer17/gnudialer-3.0-puff/astcrm-1.1.3 Only in /home/asterisk/puff15/gnudialer-3.0-puff-working: DEADJOE Only in /home/asterisk/gnudialer17/gnudialer-3.0-puff: default.script Only in /home/asterisk/puff15/gnudialer-3.0-puff-working: dialeradmin.cgi diff -u /home/asterisk/puff15/gnudialer-3.0-puff-working/dialeradmin.cpp /home/asterisk/gnudialer17/gnudialer-3.0-puff/dialeradmin.cpp --- /home/asterisk/puff15/gnudialer-3.0-puff-working/dialeradmin.cpp 2005-10-25 15:09:50.000000000 -0700 +++ /home/asterisk/gnudialer17/gnudialer-3.0-puff/dialeradmin.cpp 2005-10-28 10:45:47.000000000 -0700 @@ -25,6 +25,7 @@ #include "adminwork.h" #include "settings.h" #include "log.h" +#include "etcinfo.h" std::string itos(int i) // convert int to string { @@ -879,14 +880,14 @@ std::cout << ""; std::cout << ""; - std::cout << ""; - std::cout << "Skip: "; - std::cout << printAlert("[?]","This is the number of records that will be skipped over in the current query.\\nThis should be reset to 0 when you change filters."); - - std::cout << ""; - - std::cout << ""; - std::cout << ""; +//#ifdef MYSQLAGE + std::cout << ""; + std::cout << "Skip: "; + std::cout << printAlert("[?]","This is the number of records that will be skipped over in the current query.\\nThis should be reset to 0 when you change filters."); + std::cout << ""; + std::cout << ""; + std::cout << ""; +//#endif std::cout << ""; std::cout << "
"; @@ -1412,7 +1413,8 @@ if (!createAgent(agent,pass)) std::cout << "Error creating agent!"; else { - + + reloadAgents(); printHead("Created Agent"); std::cout << "

\n"; printSubHead("You have created agent "); @@ -1434,6 +1436,7 @@ for (int i = 0; i < TheFields.OccurencesOf("agents"); i++) { std::string agent = TheFields.GetField("agents",i); if (deleteAgent(agent)) { + reloadAgents(); printSubHead(agent); printSubHead("
"); } @@ -1466,6 +1469,7 @@ if (!createCloser(agent,pass)) std::cout << "Error creating agent!"; else { + reloadAgents(); printHead("Created Closer"); std::cout << "

\n"; printSubHead("You have created closer "); @@ -1542,6 +1546,7 @@ if (editAgent(agentnumber,agentname,agentpass)) { + reloadAgents(); printHead("Edit Agent Info"); std::cout << "

\n"; printSubHead("You have updated agent: " + agentnumber); Only in /home/asterisk/puff15/gnudialer-3.0-puff-working: dialeradmin.cpp3306 Only in /home/asterisk/puff15/gnudialer-3.0-puff-working: gnudialer Only in /home/asterisk/gnudialer17/gnudialer-3.0-puff: gnudialer.conf diff -u /home/asterisk/puff15/gnudialer-3.0-puff-working/junk /home/asterisk/gnudialer17/gnudialer-3.0-puff/junk --- /home/asterisk/puff15/gnudialer-3.0-puff-working/junk 2005-10-25 15:09:50.000000000 -0700 +++ /home/asterisk/gnudialer17/gnudialer-3.0-puff/junk 2005-10-28 10:00:33.000000000 -0700 @@ -18,3 +18,11 @@ phone FROM DNC) AND "; + if (action == "reloadagents") { + std::cout << "Attempting to reload agents..." << std::endl; + std::system("/usr/sbin/asterisk -rx \"reload chan_agent.so\""); + } + if (action == "reloadqueues") { + std::cout << "Attempting to reload queues..." << std::endl; + std::system("/usr/sbin/asterisk -rx \"reload app_queue.so\""); + } diff -u /home/asterisk/puff15/gnudialer-3.0-puff-working/main.cpp /home/asterisk/gnudialer17/gnudialer-3.0-puff/main.cpp --- /home/asterisk/puff15/gnudialer-3.0-puff-working/main.cpp 2005-10-25 15:09:50.000000000 -0700 +++ /home/asterisk/gnudialer17/gnudialer-3.0-puff/main.cpp 2005-10-28 13:20:40.000000000 -0700 @@ -374,7 +374,8 @@ std::cout << "GnuDialer: Updating Campaign Settings" << std::endl; } TheQueues.ParseQueues(); -// TheAgents.ParseAgentList(); +// this was commented + TheAgents.ParseAgentList(); timeSinceLastQueueUpdate = currentTime; } @@ -555,26 +556,26 @@ // This block is to make sure that just in case an Unlink event fails // we still set the agent on wait so that they still get calls! - if (block.find("Event: Hangup",0) != std::string::npos && block.find("Channel: ",0) != std::string::npos) { - pos = block.find("Channel: ",0) + 9; - end = block.find("\n",pos); - std::string theChannel, theAgent; - theChannel = block.substr(pos,end-pos); - - if (gDebug) { - std::cout << "theChannel: " << theChannel << " - hungup" << std::endl; - } - if (TheAgents.existsConnected(theChannel)) { - TheAgents.whereConnected(theChannel).SetOnWait(false,false,TheAgents); - theAgent = TheAgents.whereConnected(theChannel).GetNumber(); - if (gDebug) { - std::cout << "theAgent: " << theAgent << " - on wait" << std::endl; - } - if (gLog) { - writeGnudialerLog("SetOnWait: " + theChannel); - } - } - } +// if (block.find("Event: Hangup",0) != std::string::npos && block.find("Channel: ",0) != std::string::npos) { +// pos = block.find("Channel: ",0) + 9; +// end = block.find("\n",pos); +// std::string theChannel, theAgent; +// theChannel = block.substr(pos,end-pos); +// +// if (gDebug) { +// std::cout << "theChannel: " << theChannel << " - hungup" << std::endl; +// } +// if (TheAgents.existsConnected(theChannel)) { +// TheAgents.whereConnected(theChannel).SetOnWait(false,false,TheAgents); +// theAgent = TheAgents.whereConnected(theChannel).GetNumber(); +// if (gDebug) { +// std::cout << "theAgent: " << theAgent << " - on wait" << std::endl; +// } +// if (gLog) { +// writeGnudialerLog("SetOnWait: " + theChannel); +// } +// } +// } if (block.find("Event: Agentlogin",0) != std::string::npos) { pos = block.find("Agent: ",0) + 7; @@ -1027,8 +1028,11 @@ } } +//#ifdef MYSQLAGE query += " ORDER BY attempts + pickups ASC LIMIT " + itos(skip) + "," + itos(linestodial); - +//#else +// query += " ORDER BY attempts + pickups ASC LIMIT " + itos(linestodial); +//#endif if (debug) { std::cout << queue << ": query - " << query << std::endl; } diff -u /home/asterisk/puff15/gnudialer-3.0-puff-working/Makefile /home/asterisk/gnudialer17/gnudialer-3.0-puff/Makefile --- /home/asterisk/puff15/gnudialer-3.0-puff-working/Makefile 2005-10-25 15:09:50.000000000 -0700 +++ /home/asterisk/gnudialer17/gnudialer-3.0-puff/Makefile 2005-10-27 14:29:38.000000000 -0700 @@ -23,6 +23,8 @@ DOCROOT := `./mkhelper DOCROOT` #DOCROOT=/var/www/html/ +MYSQLVER := `mysql -V | cut -c25-27` + MYSQLINC := `mysql_config --include` #MYSQLINC=/usr/include/mysql/ @@ -39,7 +41,7 @@ UB=/usr/bin/asterisk -all: printdocroot printasteriskv printmysqlinc thegnudialer dialeradmin agenthours stats up +all: printdocroot printasteriskv printmysqlver printmysqlinc thegnudialer dialeradmin agenthours stats up @echo @echo "Done! Now type \"make install\" to install." @echo @@ -65,6 +67,17 @@ @echo "IF THIS IS INCORRECT, PLEASE EDIT THE PATH MANUALLY IN Makefile" @echo +printmysqlver: + + @echo + @echo "Checking MySQL Version..." + @echo + @echo "MYSQL VERSION: " ${MYSQLVER} + @echo + @echo "THIS MUST SAY 4.1 OR HIGHER!!!!!!" + @echo "CURRENTLY THERE ARE NO CHECKS TO STOP COMPILING IF TO OLD!" + @echo + printmysqlinc: @echo @echo "Checking for mysql_config..." @@ -116,8 +129,10 @@ chmod a+rw /var/log/asterisk/gnudialer chmod a+rw /etc/asterisk/queues.conf chmod a+rw /etc/asterisk/agents.conf + chmod a+rw ${CGIBIN} cp *.html ${DOCROOT}gnudialer/ cp *.gif ${DOCROOT}gnudialer/ + cp *.script ${CGIBIN} # cp dialer.conf /etc/asterisk/dialer.conf @echo @echo "Done!" Only in /home/asterisk/gnudialer17/gnudialer-3.0-puff: old diff -u /home/asterisk/puff15/gnudialer-3.0-puff-working/queue.h /home/asterisk/gnudialer17/gnudialer-3.0-puff/queue.h --- /home/asterisk/puff15/gnudialer-3.0-puff-working/queue.h 2005-10-25 15:09:50.000000000 -0700 +++ /home/asterisk/gnudialer17/gnudialer-3.0-puff/queue.h 2005-10-28 13:14:19.000000000 -0700 @@ -26,6 +26,8 @@ #ifndef QUEUE #define QUEUE +bool debugQueueH = false; + class Setting { public: @@ -684,15 +686,30 @@ int availAgents = 0; + int theAgent, theAgentStatus; + if (debugQueueH) { + std::cout << "Members: "; + } for (int i = 0; i < TheAgents.size(); i++) { - + if (debugQueueH) { + theAgent = TheAgents.at(i).GetNumber(); + theAgentStatus = TheAgents.at(i).GetStatus(); + if (HasMemberNumber(theAgent)) { + std::cout << "(" << theAgent << ":" << theAgentStatus << ":" << (tv.tv_sec % 1000000 - theAgentStatus) << ")" ; + } + } if (TheAgents.at(i).GetStatus() > 0 && tv.tv_sec % 1000000 - TheAgents.at(i).GetStatus() > 5) { if (HasMemberNumber(TheAgents.at(i).GetNumber())) { + if (debugQueueH) { + std::cout << "(AVAIL:" << theAgent << ")" ; + } availAgents++; } } } - + if (debugQueueH) { + std::cout << std::endl; + } return availAgents; } @@ -941,6 +958,7 @@ // will be no corresponding "Unlink" action, and // thus they won't get anymore calls until they // log in again. + TheAgents.where(agentNum).SetOnWait(false,false,TheAgents); std::ostringstream AgentStream; diff -u /home/asterisk/puff15/gnudialer-3.0-puff-working/settings.h /home/asterisk/gnudialer17/gnudialer-3.0-puff/settings.h --- /home/asterisk/puff15/gnudialer-3.0-puff-working/settings.h 2005-10-25 15:09:50.000000000 -0700 +++ /home/asterisk/gnudialer17/gnudialer-3.0-puff/settings.h 2005-10-26 17:46:40.000000000 -0700 @@ -41,7 +41,7 @@ TheQueue.SupSetting("tzlatest","21"); TheQueue.SupSetting("timeout","20000"); TheQueue.SupSetting("dspmode","none"); - TheQueue.SupSetting("usecloser","true"); + TheQueue.SupSetting("usecloser","false"); TheQueue.SupSetting("active","false"); TheQueue.SupSetting("callerid","9999999999"); TheQueue.SupSetting("filter","0"); Only in /home/asterisk/puff15/gnudialer-3.0-puff-working: stats.cgi Only in /home/asterisk/gnudialer17/gnudialer-3.0-puff: test Only in /home/asterisk/gnudialer17/gnudialer-3.0-puff: test2 Only in /home/asterisk/gnudialer17/gnudialer-3.0-puff: test2.cpp Only in /home/asterisk/gnudialer17/gnudialer-3.0-puff: test.cpp Only in /home/asterisk/gnudialer17/gnudialer-3.0-puff: test.diff Only in /home/asterisk/gnudialer17/gnudialer-3.0-puff: testing Only in /home/asterisk/gnudialer17/gnudialer-3.0-puff: testjava Only in /home/asterisk/gnudialer17/gnudialer-3.0-puff: test.notes Only in /home/asterisk/gnudialer17/gnudialer-3.0-puff: testqueue2 Only in /home/asterisk/gnudialer17/gnudialer-3.0-puff: testqueue2.cpp Common subdirectories: /home/asterisk/puff15/gnudialer-3.0-puff-working/timezones and /home/asterisk/gnudialer17/gnudialer-3.0-puff/timezones diff -u /home/asterisk/puff15/gnudialer-3.0-puff-working/tzpopulate.h /home/asterisk/gnudialer17/gnudialer-3.0-puff/tzpopulate.h --- /home/asterisk/puff15/gnudialer-3.0-puff-working/tzpopulate.h 2005-10-25 15:09:50.000000000 -0700 +++ /home/asterisk/gnudialer17/gnudialer-3.0-puff/tzpopulate.h 2005-10-27 13:03:30.000000000 -0700 @@ -50,10 +50,15 @@ std::string dbName = getDbName(); std::string mySqlHost = getMySqlHost(); -std::string initialQuery = "ALTER TABLE " + campaign + " ADD tzl INT(8), ADD tzh INT(8), ADD attempts int(8), ADD pickups int(8), ADD abandons int(8), ADD disposition int(8), ADD agent varchar(10), ADD closerdispo int(8), ADD closer varchar(10), ADD subdispo varchar(10) default \'\', ADD lastupdated timestamp NOT NULL default \'0000-00-00 00:00:00\' on update CURRENT_TIMESTAMP, ADD cb_datetime timestamp NOT NULL default \'0000-00-00 00:00:00\', ADD INDEX ( attempts ), ADD INDEX ( pickups ), ADD INDEX ( disposition ), ADD INDEX ( phone ), ADD INDEX ( state )"; +//#ifdef MYSQLAGE + std::string initialQuery = "ALTER TABLE " + campaign + " ADD tzl INT(8), ADD tzh INT(8), ADD attempts int(8), ADD pickups int(8), ADD abandons int(8), ADD disposition int(8), ADD agent varchar(10), ADD closerdispo int(8), ADD closer varchar(10), ADD subdispo varchar(10) default \'\', ADD lastupdated timestamp NOT NULL default \'0000-00-00 00:00:00\' on update CURRENT_TIMESTAMP, ADD cb_datetime timestamp NOT NULL default \'0000-00-00 00:00:00\', ADD INDEX ( attempts ), ADD INDEX ( pickups ), ADD INDEX ( disposition ), ADD INDEX ( phone ), ADD INDEX ( state )"; +//#else +// std::string initialQuery = "ALTER TABLE " + campaign + " ADD tzl INT(8), ADD tzh INT(8), ADD attempts int(8), ADD pickups int(8), ADD abandons int(8), ADD disposition int(8), ADD agent varchar(10), ADD closerdispo int(8), ADD closer varchar(10), ADD subdispo varchar(10) default \'\', ADD lastupdated timestamp NOT NULL default \'0000-00-00 00:00:00\', ADD cb_datetime timestamp NOT NULL default \'0000-00-00 00:00:00\', ADD INDEX ( attempts ), ADD INDEX ( pickups ), ADD INDEX ( disposition ), ADD INDEX ( phone ), ADD INDEX ( state )"; +//#endif TheQueries.push_back(initialQuery); std::string initializeValuesQuery = "UPDATE " + campaign + " SET tzl=0, tzh=0, attempts=0, pickups=0, abandons=0, disposition=1, agent=\\\"000\\\", closerdispo=0, closer=\\\"000\\\"" ; TheQueries.push_back(initializeValuesQuery); + //std::string initializeValuesQuery = "ALTER TABLE " + campaign + " ADD INDEX ( attempts )" ; //TheQueries.push_back(initializeValuesQuery); //std::string initializeValuesQuery = "ALTER TABLE " + campaign + " ADD INDEX ( pickups )" ; Only in /home/asterisk/puff15/gnudialer-3.0-puff-working: up.cgi