Changed WEBFORM links in vicidial.php to use window.open instead of traditional links due to IE7 issue

Added stand-alone voicemail accounts configurable through admin.php
cleanup of admin.php code to fit standard

git-svn-id: svn://192.168.202.10@1235 3d104415-ff17-0410-8863-d5cf3c621b8a
This commit is contained in:
mattf
2009-09-21 02:14:33 +00:00
parent 1d541415da
commit e6d8b78e1b
12 changed files with 8881 additions and 8234 deletions
+8
View File
@@ -236,6 +236,14 @@ NOTE: Upgrading from 1.1.12-3 to 2.0.1 is at the bottom
exten => 8320,2,Hangup
# the VD_amd_post.agi script is now depricated
60. Added additional Voicemail configuration through admin.php. Voicemail boxes
can now be created without being tied to a phone. These voicemail boxes
are added to the active voicemail server and there must be an active
voicemail server defined in the system settings for these to work.
61. Changed WEBFORM links to work as window.open instead of traditional links
with 'target' tags which IE7 apparently has problems with
+51 -23
View File
@@ -41,6 +41,7 @@
# 90812-0053 - Added clear out non-used vicidial_conferences sessions
# 90821-1246 - Fixed central voicemail server conf file, changed voicemail to use phone password
# 90903-1626 - Added musiconhold and meetme conf file generation
# 90919-1516 - Added generation of standalone voicemail boxes in voicemail conf file
#
$DB=0; # Debug flag
@@ -62,40 +63,40 @@ $reset_test = "$hour$min";
### begin parsing run-time options ###
if (length($ARGV[0])>1)
{
{
$i=0;
while ($#ARGV >= $i)
{
$args = "$args $ARGV[$i]";
$i++;
}
{
$args = "$args $ARGV[$i]";
$i++;
}
if ($args =~ /--help/i)
{
print "allowed run time options:\n [-t] = test\n [-debug] = verbose debug messages\n[-debugX] = Extra-verbose debug messages\n\n";
}
{
print "allowed run time options:\n [-t] = test\n [-debug] = verbose debug messages\n[-debugX] = Extra-verbose debug messages\n\n";
}
else
{
{
if ($args =~ /-debug/i)
{
$DB=1; # Debug flag
}
{
$DB=1; # Debug flag
}
if ($args =~ /--debugX/i)
{
$DBX=1;
print "\n----- SUPER-DUPER DEBUGGING -----\n\n";
}
{
$DBX=1;
print "\n----- SUPER-DUPER DEBUGGING -----\n\n";
}
if ($args =~ /-t/i)
{
$TEST=1;
$T=1;
{
$TEST=1;
$T=1;
}
}
}
}
else
{
# print "no command line options set\n";
}
{
# print "no command line options set\n";
}
### end parsing run-time options ###
@@ -128,6 +129,7 @@ foreach(@conf)
# 7 - AST_VDauto_dial_FILL\n";
# 8 - ip_relay for blind monitoring\n";
# 9 - Timeclock auto logout\n";
# - Other setting are set by configuring them in the database
if ($VARactive_keepalives =~ /X/)
{
@@ -1456,6 +1458,32 @@ if ( ($active_asterisk_server =~ /Y/) && ($generate_vicidial_conf =~ /Y/) && ($r
$i++;
}
##### Get the other voicemail box entries #####
$stmtA = "SELECT voicemail_id,fullname,pass,email FROM vicidial_voicemail where active='Y';";
# print "$stmtA\n";
$sthA = $dbhA->prepare($stmtA) or die "preparing: ",$dbhA->errstr;
$sthA->execute or die "executing: $stmtA ", $dbhA->errstr;
$sthArows=$sthA->rows;
if ($sthArows > 0)
{
$vm .= "\n";
$vm .= "; Other Voicemail Entries:\n";
}
$i=0;
while ($sthArows > $i)
{
@aryA = $sthA->fetchrow_array;
$voicemail_id[$i] = $aryA[0];
$fullname[$i] = $aryA[1];
$pass[$i] = $aryA[2];
$email[$i] = $aryA[3];
$vm .= "$voicemail_id[$i] => $pass[$i],$fullname[$i],$email[$i]\n";
$i++;
}
$sthA->finish();
}
##### END generate voicemail accounts for all distinct phones on dedicated voicemail server
+142 -80
View File
@@ -1,36 +1,24 @@
#!/usr/bin/perl
#
# AST_vm_update.pl version 2.0.5 *DBI-version*
# AST_vm_update.pl version 2.2.0 *DBI-version*
#
# DESCRIPTION:
# uses the Asterisk Manager interface and Net::MySQL to update the count of
# voicemail messages for each mailbox (in the phone table) in the voicemail
# uses the Asterisk Manager interface to update the count of voicemail messages
# for each mailbox (in the phone and vicidial_voicemail tables) in the voicemail
# table list is used by client apps for voicemail notification
#
# SUMMARY:
# This program was designed for people using the Asterisk PBX with voicemail
#
# For the client program to notify of new messaged, this program must be in the
# cron running every minute
#
# For this program to work you need to have the "asterisk" MySQL database
# created and create the tables listed in the CONF_MySQL.txt file, also make sure
# that the machine running this program has read/write/update/delete access
# to that database
#
# It is recommended that you run this program on the local Asterisk machine
#
# If this script is run ever minute there is a theoretical limit of
# 600 mailboxes that it can check due to the wait interval. If you have
# 1200 mailboxes that it can check due to the wait interval. If you have
# more than this either change the cron when this script is run or change the
# wait interval below
#
# Copyright (C) 2006 Matt Florell <vicidial@gmail.com> LICENSE: AGPLv2
# Copyright (C) 2009 Matt Florell <vicidial@gmail.com> LICENSE: AGPLv2
#
# 50823-1422 - Added database server variable definitions lookup
# 50823-1452 - Added commandline arguments for debug at runtime
# 60717-1204 - changed to DBI by Marin Blu
# 60715-2301 - changed to use /etc/astguiclient.conf for configs
# 60717-1204 - Changed to DBI by Marin Blu
# 60715-2301 - Changed to use /etc/astguiclient.conf for configs
# 90919-1739 - Added other voicemail checking from vicidial_voicemail table
#
# constants
@@ -40,35 +28,35 @@ $MT[0]='';
### begin parsing run-time options ###
if (length($ARGV[0])>1)
{
{
$i=0;
while ($#ARGV >= $i)
{
$args = "$args $ARGV[$i]";
$i++;
}
{
$args = "$args $ARGV[$i]";
$i++;
}
if ($args =~ /--help/i)
{
print "allowed run time options:\n [-t] = test\n [-debug] = verbose debug messages\n\n";
}
{
print "allowed run time options:\n [-t] = test\n [-debug] = verbose debug messages\n\n";
}
else
{
{
if ($args =~ /-debug/i)
{
$DB=1; # Debug flag
}
{
$DB=1; # Debug flag
}
if ($args =~ /-t/i)
{
$TEST=1;
$T=1;
{
$TEST=1;
$T=1;
}
}
}
}
else
{
# print "no command line options set\n";
}
{
# print "no command line options set\n";
}
### end parsing run-time options ###
# default path to astguiclient configuration file:
@@ -118,45 +106,43 @@ use Time::HiRes ('gettimeofday','usleep','sleep'); # necessary to have perl sle
use DBI;
use Net::Telnet ();
$dbhA = DBI->connect("DBI:mysql:$VARDB_database:$VARDB_server:$VARDB_port", "$VARDB_user", "$VARDB_pass")
$dbhA = DBI->connect("DBI:mysql:$VARDB_database:$VARDB_server:$VARDB_port", "$VARDB_user", "$VARDB_pass")
or die "Couldn't connect to database: " . DBI->errstr;
### Grab Server values from the database
$stmtA = "SELECT telnet_host,telnet_port,ASTmgrUSERNAME,ASTmgrSECRET,ASTmgrUSERNAMEupdate,ASTmgrUSERNAMElisten,ASTmgrUSERNAMEsend,max_vicidial_trunks,answer_transfer_agent,local_gmt,ext_context FROM servers where server_ip = '$server_ip';";
$sthA = $dbhA->prepare($stmtA) or die "preparing: ",$dbhA->errstr;
if ($DB) {print "|$stmtA|\n";}
$sthA->execute or die "executing: $stmtA ", $dbhA->errstr;
$sthArows=$sthA->rows;
$rec_count=0;
if ($sthArows > 0)
{
@aryA = $sthA->fetchrow_array;
$DBtelnet_host = "$aryA[0]";
$DBtelnet_port = "$aryA[1]";
$DBASTmgrUSERNAME = "$aryA[2]";
$DBASTmgrSECRET = "$aryA[3]";
$DBASTmgrUSERNAMEupdate = "$aryA[4]";
$DBASTmgrUSERNAMElisten = "$aryA[5]";
$DBASTmgrUSERNAMEsend = "$aryA[6]";
$DBmax_vicidial_trunks = "$aryA[7]";
$DBanswer_transfer_agent= "$aryA[8]";
$DBSERVER_GMT = "$aryA[9]";
$DBext_context = "$aryA[10]";
if ($DBtelnet_host) {$telnet_host = $DBtelnet_host;}
if ($DBtelnet_port) {$telnet_port = $DBtelnet_port;}
if ($DBASTmgrUSERNAME) {$ASTmgrUSERNAME = $DBASTmgrUSERNAME;}
if ($DBASTmgrSECRET) {$ASTmgrSECRET = $DBASTmgrSECRET;}
if ($DBASTmgrUSERNAMEupdate) {$ASTmgrUSERNAMEupdate = $DBASTmgrUSERNAMEupdate;}
if ($DBASTmgrUSERNAMElisten) {$ASTmgrUSERNAMElisten = $DBASTmgrUSERNAMElisten;}
if ($DBASTmgrUSERNAMEsend) {$ASTmgrUSERNAMEsend = $DBASTmgrUSERNAMEsend;}
if ($DBmax_vicidial_trunks) {$max_vicidial_trunks = $DBmax_vicidial_trunks;}
if ($DBanswer_transfer_agent) {$answer_transfer_agent = $DBanswer_transfer_agent;}
if ($DBSERVER_GMT) {$SERVER_GMT = $DBSERVER_GMT;}
if ($DBext_context) {$ext_context = $DBext_context;}
{
@aryA = $sthA->fetchrow_array;
$DBtelnet_host = "$aryA[0]";
$DBtelnet_port = "$aryA[1]";
$DBASTmgrUSERNAME = "$aryA[2]";
$DBASTmgrSECRET = "$aryA[3]";
$DBASTmgrUSERNAMEupdate = "$aryA[4]";
$DBASTmgrUSERNAMElisten = "$aryA[5]";
$DBASTmgrUSERNAMEsend = "$aryA[6]";
$DBmax_vicidial_trunks = "$aryA[7]";
$DBanswer_transfer_agent= "$aryA[8]";
$DBSERVER_GMT = "$aryA[9]";
$DBext_context = "$aryA[10]";
if ($DBtelnet_host) {$telnet_host = $DBtelnet_host;}
if ($DBtelnet_port) {$telnet_port = $DBtelnet_port;}
if ($DBASTmgrUSERNAME) {$ASTmgrUSERNAME = $DBASTmgrUSERNAME;}
if ($DBASTmgrSECRET) {$ASTmgrSECRET = $DBASTmgrSECRET;}
if ($DBASTmgrUSERNAMEupdate) {$ASTmgrUSERNAMEupdate = $DBASTmgrUSERNAMEupdate;}
if ($DBASTmgrUSERNAMElisten) {$ASTmgrUSERNAMElisten = $DBASTmgrUSERNAMElisten;}
if ($DBASTmgrUSERNAMEsend) {$ASTmgrUSERNAMEsend = $DBASTmgrUSERNAMEsend;}
if ($DBmax_vicidial_trunks) {$max_vicidial_trunks = $DBmax_vicidial_trunks;}
if ($DBanswer_transfer_agent) {$answer_transfer_agent = $DBanswer_transfer_agent;}
if ($DBSERVER_GMT) {$SERVER_GMT = $DBSERVER_GMT;}
if ($DBext_context) {$ext_context = $DBext_context;}
}
$sthA->finish();
$sthA->finish();
@PTextensions=@MT; @PTvoicemail_ids=@MT; @PTmessages=@MT; @PTold_messages=@MT; @NEW_messages=@MT; @OLD_messages=@MT;
$stmtA = "SELECT extension,voicemail_id,messages,old_messages from phones where server_ip='$server_ip'";
@@ -167,14 +153,14 @@ $sthArows=$sthA->rows;
$rec_count=0;
while ($sthArows > $rec_count)
{
@aryA = $sthA->fetchrow_array;
$PTextensions[$rec_count] = "$aryA[0]";
$PTvoicemail_ids[$rec_count] = "$aryA[1]";
$PTmessages[$rec_count] = "$aryA[2]";
$PTold_messages[$rec_count] = "$aryA[3]";
$rec_count++;
@aryA = $sthA->fetchrow_array;
$PTextensions[$rec_count] = "$aryA[0]";
$PTvoicemail_ids[$rec_count] = "$aryA[1]";
$PTmessages[$rec_count] = "$aryA[2]";
$PTold_messages[$rec_count] = "$aryA[3]";
$rec_count++;
}
$sthA->finish();
$sthA->finish();
### connect to asterisk manager through telnet
@@ -225,11 +211,91 @@ foreach(@PTextensions)
}
$i++;
### sleep for 10 hundredths of a second
usleep(1*100*1000);
### sleep for 5 hundredths of a second
usleep(1*50*1000);
}
##### BEGIN check vicidial_voicemail entries #####
### find out if this server is the active_voicemail_server
$stmtA = "SELECT count(*) from system_settings where active_voicemail_server='$server_ip';";
$sthA = $dbhA->prepare($stmtA) or die "preparing: ",$dbhA->errstr;
if ($DB) {print "|$stmtA|\n";}
$sthA->execute or die "executing: $stmtA ", $dbhA->errstr;
$sthArows=$sthA->rows;
$rec_count=0;
if ($sthArows > 0)
{
@aryA = $sthA->fetchrow_array;
$active_voicemail_server = $aryA[0];
}
$sthA->finish();
if ($active_voicemail_server > 0)
{
if($DB){print "Active Voicemail Server, checking vicidial_voicemail boxes...\n";}
@PTvoicemail_ids=@MT; @PTmessages=@MT; @PTold_messages=@MT; @NEW_messages=@MT; @OLD_messages=@MT;
$stmtA = "SELECT voicemail_id,messages,old_messages from vicidial_voicemail where active='Y';";
if ($DB) {print "|$stmtA|\n";}
$sthA = $dbhA->prepare($stmtA) or die "preparing: ",$dbhA->errstr;
$sthA->execute or die "executing: $stmtA ", $dbhA->errstr;
$sthArows=$sthA->rows;
$rec_count=0;
while ($sthArows > $rec_count)
{
@aryA = $sthA->fetchrow_array;
$PTvoicemail_ids[$rec_count] = $aryA[0];
$PTmessages[$rec_count] = $aryA[1];
$PTold_messages[$rec_count] = $aryA[2];
$rec_count++;
}
$sthA->finish();
$i=0;
foreach(@PTvoicemail_ids)
{
@list_channels=@MT;
$t->buffer_empty;
@list_channels = $t->cmd(String => "Action: MailboxCount\nMailbox: $PTvoicemail_ids[$i]\n\nAction: Ping\n\n", Prompt => '/Response: Pong.*/');
$j=0;
foreach(@list_channels)
{
if ($list_channels[$j] =~ /Mailbox: $PTvoicemail_ids[$i]/)
{
$NEW_messages[$i] = "$list_channels[$j+1]";
$NEW_messages[$i] =~ s/NewMessages: |\n//gi;
$OLD_messages[$i] = "$list_channels[$j+2]";
$OLD_messages[$i] =~ s/OldMessages: |\n//gi;
}
$j++;
}
if($DB){print "MailboxCount- $PTvoicemail_ids[$i] NEW:|$NEW_messages[$i]| OLD:|$OLD_messages[$i]| ";}
if ( ($NEW_messages[$i] eq $PTmessages[$i]) && ($OLD_messages[$i] eq $PTold_messages[$i]) )
{
if($DB){print "MESSAGE COUNT UNCHANGED, DOING NOTHING FOR THIS MAILBOX\n";}
}
else
{
$stmtA = "UPDATE vicidial_voicemail set messages='$NEW_messages[$i]',old_messages='$OLD_messages[$i]' where voicemail_id='$voicemail_id';";
if($DB){print STDERR "\n|$stmtA|\n";}
$affected_rows = $dbhA->do($stmtA); # or die "Couldn't execute query:|$stmtA|\n";
}
$i++;
### sleep for 5 hundredths of a second
usleep(1*50*1000);
}
}
##### END check vicidial_voicemail entries #####
$t->buffer_empty;
@hangup = $t->cmd(String => "Action: Logoff\n\n", Prompt => "/.*/");
$t->buffer_empty;
@@ -241,7 +307,3 @@ $dbhA->disconnect();
if($DB){print "DONE... Exiting... Goodbye... See you later... \n";}
exit;
+26 -1
View File
@@ -20,7 +20,8 @@ Changes:
90428-0208 - Added blind_monitor function
90513-1720 - Added sounds_list function
90721-1432 - Added rank and owner
90904-1535 - Added moh_list function
90904-1535 - Added moh_list musiconhold function
90916-2342 - Added vm_list voicemail list
@@ -93,6 +94,30 @@ ERROR: moh_list CENTRAL SOUND CONTROL IS NOT ACTIVE
--------------------------------------------------------------------------------
vm_list - outputs a list of voicemail boxes in the system
NOTE: api user for this function must have user_level set to 7 or higher
OPTIONAL FIELDS-
format - format of the output(tab, link, selectframe)
comments - name of the field to populate
Example URL strings for API calls:
http://server/vicidial/non_agent_api.php?source=test&user=6666&pass=1234&function=vm_list&format=selectframe&comments=fieldname&stage=date
Example responses:
<success is inferred by output of voicemail boxes list>
ERROR: vm_list USER DOES NOT HAVE PERMISSION TO VIEW VOICEMAIL BOXES LIST
ERROR: vm_list CENTRAL SOUND CONTROL IS NOT ACTIVE
--------------------------------------------------------------------------------
blind_monitor - calls user-defined phone and places them in session as blind monitor
+2 -5
View File
@@ -2123,11 +2123,8 @@ exten => 8310,3,Wait,3600
exten => 8310,4,Hangup
; this is used for playing a message to an answering machine forwarded from AMD in VICIDIAL
; replace conf with the message file you want to leave
exten => 8320,1,WaitForSilence(2000,2) ; AMD got machine. leave message after recording
exten => 8320,2,Playback(conf)
exten => 8320,3,AGI(VD_amd_post.agi,${EXTEN})
exten => 8320,4,Hangup
exten => 8320,1,AGI(VD_amd.agi,${EXTEN}-----YES)
exten => 8320,2,Hangup
; this is used to allow the GUI to send you directly into voicemail
; don't forget to set GUI variable $voicemail_exten to this extension
@@ -1404,8 +1404,8 @@ agent_search_method ENUM('LO','LB','SO') default 'LB',
list_id BIGINT(14) UNSIGNED default '999',
campaign_id VARCHAR(8),
phone_code VARCHAR(10) default '1',
unique index (did_pattern),
menu_id VARCHAR(50) default '',
unique index (did_pattern),
index (group_id)
);
@@ -1797,6 +1797,16 @@ rank SMALLINT(5),
unique index mohfile (filename, moh_id)
);
CREATE TABLE vicidial_voicemail (
voicemail_id VARCHAR(10) NOT NULL UNIQUE PRIMARY KEY,
active ENUM('Y','N') default 'Y',
pass VARCHAR(10) NOT NULL,
fullname VARCHAR(100) NOT NULL,
messages INT(4) default '0',
old_messages INT(4) default '0',
email VARCHAR(100)
);
ALTER TABLE vicidial_campaign_server_stats ENGINE=HEAP;
@@ -1921,7 +1931,7 @@ CREATE INDEX phone_number on vicidial_closer_log (phone_number);
CREATE INDEX date_user on vicidial_closer_log (call_date,user);
CREATE INDEX comment_a on live_inbound_log (comment_a);
UPDATE system_settings SET db_schema_version='1173',db_schema_update_date=NOW();
UPDATE system_settings SET db_schema_version='1174',db_schema_update_date=NOW();
GRANT RELOAD ON *.* TO cron@'%';
GRANT RELOAD ON *.* TO cron@localhost;
+12
View File
@@ -548,3 +548,15 @@ ALTER TABLE system_settings ADD db_schema_update_date DATETIME;
ALTER TABLE system_settings ADD enable_second_webform ENUM('0','1') default '0';
UPDATE system_settings SET db_schema_version='1173',db_schema_update_date=NOW();
CREATE TABLE vicidial_voicemail (
voicemail_id VARCHAR(10) NOT NULL UNIQUE PRIMARY KEY,
active ENUM('Y','N') default 'Y',
pass VARCHAR(10) NOT NULL,
fullname VARCHAR(100) NOT NULL,
messages INT(4) default '0',
old_messages INT(4) default '0',
email VARCHAR(100)
);
UPDATE system_settings SET db_schema_version='1174',db_schema_update_date=NOW();
@@ -302,6 +302,34 @@ Enable Second Webform||
WaitForSilence Options||
If Wait For Silence is desired on calls that are detected as Answering Machines then this field has those options. There are two settings separated by a comma, the first option is how long to detect silence in milliseconds and the second option is for how many times to detect that before playing the message. Default is EMPTY for disabled. A standard value for this would be wait for 2 seconds of silence twice||
This field is for entering the prompt to play when the agent gets an answering machine and clicks on the Answering Machine Message button in the transfer conference frame. You must set this to either an audio file in the audio store or a TTS prompt if TTS is enabled on your system||
EXTENDED ALTERNATE PHONE NUMBERS FOR THIS LEAD||
ADD NEW VOICEMAIL BOX||
ADDING NEW VOICEMAIL BOX||
MODIFY VOICEMAIL BOX||
MODIFY A VOICEMAIL BOX||
DELETE VOICEMAIL BOX||
VOICEMAIL BOXES LIST||
VOICEMAIL BOXES||
ADD NEW VOICEMAIL BOX||
Voicemail ID||
This is the all numbers identifier of this mailbox. This must not be a duplicate of an existing voicemail ID or the voicemail ID of a phone on the system, minimum of 2 characters||
This is name associated with this voicemail box. max 100 characters, minimum of 2 characters||
This is the password that is used to gain access to the voicemail box when dialing in to check messages max 10 characters, minimum of 2 characters||
This option allows you to set the voicemail box to active or inactive. If the box is inactive you cannot leave messages on it and you cannot check messages in it||
This optional setting allows you to have the voicemail messages sent to an email account, if your system is set up to send out email. If this field is empty then no emails will be sent out||
VOICEMAIL BOX NOT ADDED||
there is already a voicemail box in the system with this ID||
there is already a phone in the system with this voicemail ID||
VOICEMAIL BOX ADDED||
VOICEMAIL BOX NOT MODIFIED||
VOICEMAIL BOX MODIFIED||
VOICEMAIL BOX NOT DELETED||
VOICEMAIL BOX DELETION COMPLETED||
VOICEMAIL BOX DELETION CONFIRMATION||
Click here to delete voicemail box||
DELETE THIS VOICEMAIL BOX||
Click here to see Admin chages to this voicemail box||
The following fields must have data||
add-file: user_territories.php
+24 -20
View File
@@ -254,10 +254,11 @@
# 90909-0921 - Fixed park issues
# 90916-1144 - Added Second web form button, Answering Machine Message change
# 90917-1325 - Fixed script loading bug with customer webform at the same time
# 90920-2108 - Changed web forms to use window.open instead of traditional links(IE7 compatibility issue)
#
$version = '2.2.0-231';
$build = '90917-1325';
$version = '2.2.0-232';
$build = '90920-2108';
$mel=1; # Mysql Error Log enabled = 1
$mysql_log_count=61;
$one_mysql_log=0;
@@ -4805,10 +4806,14 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";}
TEMP_VDIC_web_form_address_two = VDIC_web_form_address_two + "" + web_form_vars_two;
}
document.getElementById("WebFormSpan").innerHTML = "<a href=\"" + TEMP_VDIC_web_form_address + "\" target=\"" + web_form_target + "\" onMouseOver=\"WebFormRefresH();\"><IMG SRC=\"./images/vdc_LB_webform.gif\" border=0 alt=\"Web Form\"></a>\n";
document.getElementById("WebFormSpan").innerHTML = "<a href=\"#\" onclick=\"WebFormRefresH('','','YES');\"><IMG SRC=\"./images/vdc_LB_webform.gif\" border=0 alt=\"Web Form\"></a>\n";
// document.getElementById("WebFormSpan").innerHTML = "<a href=\"" + TEMP_VDIC_web_form_address + "\" target=\"" + web_form_target + "\" onMouseOver=\"WebFormRefresH();\"><IMG SRC=\"./images/vdc_LB_webform.gif\" border=0 alt=\"Web Form\"></a>\n";
if (enable_second_webform > 0)
{
document.getElementById("WebFormSpanTwo").innerHTML = "<a href=\"" + TEMP_VDIC_web_form_address_two + "\" target=\"" + web_form_target + "\" onMouseOver=\"WebFormTwoRefresH();\"><IMG SRC=\"./images/vdc_LB_webform_two.gif\" border=0 alt=\"Web Form 2\"></a>\n";
document.getElementById("WebFormSpanTwo").innerHTML = "<a href=\"#\" onclick=\"WebFormTwoRefresH('','','YES');\"><IMG SRC=\"./images/vdc_LB_webform_two.gif\" border=0 alt=\"Web Form 2\"></a>\n";
// document.getElementById("WebFormSpanTwo").innerHTML = "<a href=\"" + TEMP_VDIC_web_form_address_two + "\" target=\"" + web_form_target + "\" onMouseOver=\"WebFormTwoRefresH();\"><IMG SRC=\"./images/vdc_LB_webform_two.gif\" border=0 alt=\"Web Form 2\"></a>\n";
}
if (LeaDPreVDispO == 'CALLBK')
@@ -6016,12 +6021,15 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";}
TEMP_VDIC_web_form_address_two = VDIC_web_form_address_two + "" + web_form_vars_two;
}
document.getElementById("WebFormSpan").innerHTML = "<a href=\"#\" onclick=\"WebFormRefresH('','','YES');\"><IMG SRC=\"./images/vdc_LB_webform.gif\" border=0 alt=\"Web Form\"></a>\n";
document.getElementById("WebFormSpan").innerHTML = "<a href=\"" + TEMP_VDIC_web_form_address + "\" target=\"" + web_form_target + "\" onMouseOver=\"WebFormRefresH();\"><IMG SRC=\"./images/vdc_LB_webform.gif\" border=0 alt=\"Web Form\"></a>\n";
// document.getElementById("WebFormSpan").innerHTML = "<a href=\"" + TEMP_VDIC_web_form_address + "\" target=\"" + web_form_target + "\" onMouseOver=\"WebFormRefresH();\"><IMG SRC=\"./images/vdc_LB_webform.gif\" border=0 alt=\"Web Form\"></a>\n";
if (enable_second_webform > 0)
{
document.getElementById("WebFormSpanTwo").innerHTML = "<a href=\"" + TEMP_VDIC_web_form_address_two + "\" target=\"" + web_form_target + "\" onMouseOver=\"WebFormTwoRefresH();\"><IMG SRC=\"./images/vdc_LB_webform_two.gif\" border=0 alt=\"Web Form 2\"></a>\n";
document.getElementById("WebFormSpanTwo").innerHTML = "<a href=\"#\" onclick=\"WebFormTwoRefresH('','','YES');\"><IMG SRC=\"./images/vdc_LB_webform_two.gif\" border=0 alt=\"Web Form 2\"></a>\n";
// document.getElementById("WebFormSpanTwo").innerHTML = "<a href=\"" + TEMP_VDIC_web_form_address_two + "\" target=\"" + web_form_target + "\" onMouseOver=\"WebFormTwoRefresH();\"><IMG SRC=\"./images/vdc_LB_webform_two.gif\" border=0 alt=\"Web Form 2\"></a>\n";
}
if ( (LIVE_campaign_recording == 'ALLCALLS') || (LIVE_campaign_recording == 'ALLFORCE') )
@@ -6137,7 +6145,7 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";}
// ################################################################################
// refresh the content of the web form URL
function WebFormRefresH(taskrefresh,submittask)
function WebFormRefresH(taskrefresh,submittask,taskopen)
{
if (VDCL_group_id.length > 1)
{var group = VDCL_group_id;}
@@ -6234,21 +6242,19 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";}
TEMP_VDIC_web_form_address = VDIC_web_form_address + "" + web_form_vars;
}
document.getElementById("WebFormSpan").innerHTML = "<a href=\"#\" onclick=\"WebFormRefresH('','','YES');\"><IMG SRC=\"./images/vdc_LB_webform.gif\" border=0 alt=\"Web Form\"></a>\n";
if (taskrefresh == 'OUT')
if (taskopen == 'YES')
{
document.getElementById("WebFormSpan").innerHTML = "<a href=\"" + TEMP_VDIC_web_form_address + "\" target=\"" + web_form_target + "\" onMouseOver=\"WebFormRefresH('IN');\"><IMG SRC=\"./images/vdc_LB_webform.gif\" border=0 alt=\"Web Form\"></a>\n";
}
else
{
document.getElementById("WebFormSpan").innerHTML = "<a href=\"" + TEMP_VDIC_web_form_address + "\" target=\"" + web_form_target + "\" onMouseOut=\"WebFormRefresH('OUT');\"><IMG SRC=\"./images/vdc_LB_webform.gif\" border=0 alt=\"Web Form\"></a>\n";
window.open(TEMP_VDIC_web_form_address, web_form_target, 'toolbar=1,scrollbars=1,location=1,statusbar=1,menubar=1,resizable=1,width=640,height=450');
}
}
// ################################################################################
// refresh the content of the second web form URL
function WebFormTwoRefresH(taskrefresh,submittask)
function WebFormTwoRefresH(taskrefresh,submittask,taskopen)
{
if (VDCL_group_id.length > 1)
{var group = VDCL_group_id;}
@@ -6348,13 +6354,11 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";}
if (enable_second_webform > 0)
{
if (taskrefresh == 'OUT')
document.getElementById("WebFormSpanTwo").innerHTML = "<a href=\"#\" onclick=\"WebFormTwoRefresH('','','YES');\"><IMG SRC=\"./images/vdc_LB_webform_two.gif\" border=0 alt=\"Web Form 2\"></a>\n";
if (taskopen == 'YES')
{
document.getElementById("WebFormSpanTwo").innerHTML = "<a href=\"" + TEMP_VDIC_web_form_address_two + "\" target=\"" + web_form_target + "\" onMouseOver=\"WebFormTwoRefresH('IN');\"><IMG SRC=\"./images/vdc_LB_webform_two.gif\" border=0 alt=\"Web Form 2\"></a>\n";
}
else
{
document.getElementById("WebFormSpanTwo").innerHTML = "<a href=\"" + TEMP_VDIC_web_form_address_two + "\" target=\"" + web_form_target + "\" onMouseOut=\"WebFormTwoRefresH('OUT');\"><IMG SRC=\"./images/vdc_LB_webform_two.gif\" border=0 alt=\"Web Form 2\"></a>\n";
window.open(TEMP_VDIC_web_form_address_two, web_form_target, 'toolbar=1,scrollbars=1,location=1,statusbar=1,menubar=1,resizable=1,width=640,height=450');
}
}
}
File diff suppressed because it is too large Load Diff
+24 -2
View File
@@ -16,6 +16,7 @@
# 90628-1016 - Added Text-to-speech options
# 90830-2213 - Added Music On Hold options
# 90904-1534 - Added launch_moh_chooser
# 90916-2334 - Added Voicemail options
#
@@ -410,6 +411,19 @@ else
document.getElementById("audio_chooser_span").innerHTML = Iframe_content;
}
function launch_vm_chooser(fieldname,stage,vposition)
{
var audiolistURL = "./non_agent_api.php";
var audiolistQuery = "source=admin&function=vm_list&user=" + user + "&pass=" + pass + "&format=selectframe&stage=" + stage + "&comments=" + fieldname;
var Iframe_content = '<IFRAME SRC="' + audiolistURL + '?' + audiolistQuery + '" style="width:740;height:440;background-color:white;" scrolling="NO" frameborder="0" allowtransparency="true" id="audio_chooser_frame' + epoch + '" name="audio_chooser_frame" width="740" height="460" STYLE="z-index:2"> </iframe>';
document.getElementById("audio_chooser_span").style.position = "absolute";
document.getElementById("audio_chooser_span").style.left = "220px";
document.getElementById("audio_chooser_span").style.top = vposition + "px";
document.getElementById("audio_chooser_span").style.visibility = 'visible';
document.getElementById("audio_chooser_span").innerHTML = Iframe_content;
}
function close_chooser()
{
document.getElementById("audio_chooser_span").style.visibility = 'hidden';
@@ -683,7 +697,7 @@ if ( ($ADD==3511) or ($ADD==2511) or ($ADD==2611) or ($ADD==4511) or ($ADD==5511
}
else
{value='';}
new_content = "Voicemail Box: <input type=text name=option_route_value_" + option + " id=option_route_value_" + option + " size=20 maxlength=255 value=\"" + selected_value + "\"> ";
new_content = "Voicemail Box: <input type=text name=option_route_value_" + option + " id=option_route_value_" + option + " size=12 maxlength=10 value=\"" + selected_value + "\"> <a href=\"javascript:launch_vm_chooser('option_route_value_" + option + "','date'," + chooser_height + ");\">voicemail chooser</a>";
}
if (selected_route=='AGI')
{
@@ -831,7 +845,7 @@ if ( ($ADD==3111) or ($ADD==2111) or ($ADD==2011) or ($ADD==4111) or ($ADD==5111
}
else
{value = '101';}
new_content = "Voicemail Box: <input type=text name=" + option + "_value id=" + option + "_value size=20 maxlength=255 value=\"" + value + "\"> ";
new_content = "Voicemail Box: <input type=text name=" + option + "_value id=" + option + "_value size=12 maxlength=10 value=\"" + value + "\"> <a href=\"javascript:launch_vm_chooser('" + option + "_value','date'," + chooser_height + ");\">voicemail chooser</a>";
}
if (new_content.length < 1)
@@ -1126,6 +1140,8 @@ $SSenable_tts_integration = $row[1];
else {$audio_sh=''; $audio_fc='BLACK';}
if ($sh=='moh') {$moh_sh="bgcolor=\"$moh_color\""; $moh_fc="$moh_font";}
else {$moh_sh=''; $moh_fc='BLACK';}
if ($sh=='vm') {$vm_sh="bgcolor=\"$vm_color\""; $vm_fc="$vm_font";}
else {$vm_sh=''; $vm_fc='BLACK';}
if ($sh=='tts') {$tts_sh="bgcolor=\"$tts_color\""; $tts_fc="$tts_font";}
else {$tts_sh=''; $tts_fc='BLACK';}
@@ -1149,6 +1165,8 @@ $SSenable_tts_integration = $row[1];
<a href="<?php echo $ADMIN ?>?ADD=311111111111111"><FONT FACE="ARIAL,HELVETICA" COLOR=<?php echo $settings_fc ?> SIZE=<?php echo $header_font_size ?>> System Settings </a></TD>
</TR><TR BGCOLOR=<?php echo $admin_color ?>><TD ALIGN=LEFT <?php echo $status_sh ?>> &nbsp;
<a href="<?php echo $ADMIN ?>?ADD=321111111111111"><FONT FACE="ARIAL,HELVETICA" COLOR=<?php echo $status_fc ?> SIZE=<?php echo $header_font_size ?>> System Statuses </a></TD>
</TR><TR BGCOLOR=<?php echo $admin_color ?>><TD ALIGN=LEFT <?php echo $vm_sh ?>> &nbsp;
<a href="<?php echo $ADMIN ?>?ADD=170000000000"><FONT FACE="ARIAL,HELVETICA" COLOR=<?php echo $vm_fc ?> SIZE=<?php echo $header_font_size ?>> Voicemail </a></TD>
</TR>
<?php if ( ($sounds_central_control_active > 0) or ($SSsounds_central_control_active > 0) )
{ ?>
@@ -1236,6 +1254,10 @@ $SSenable_tts_integration = $row[1];
?>
<TR BGCOLOR=<?php echo $moh_color ?>><TD ALIGN=LEFT COLSPAN=2> &nbsp; <a href="<?php echo $ADMIN ?>?ADD=160000000000"><FONT FACE="ARIAL,HELVETICA" COLOR=BLACK SIZE=<?php echo $subheader_font_size ?>> Show MOH Entries </a> &nbsp; | &nbsp; <a href="<?php echo $ADMIN ?>?ADD=161111111111"><FONT FACE="ARIAL,HELVETICA" COLOR=BLACK SIZE=<?php echo $subheader_font_size ?>> Add A New MOH Entry </a></TD></TR>
<?php }
if ( (strlen($vm_sh) > 1) and (strlen($admin_hh) > 1) ) {
?>
<TR BGCOLOR=<?php echo $vm_color ?>><TD ALIGN=LEFT COLSPAN=2> &nbsp; <a href="<?php echo $ADMIN ?>?ADD=170000000000"><FONT FACE="ARIAL,HELVETICA" COLOR=BLACK SIZE=<?php echo $subheader_font_size ?>> Show Voicemail Entries </a> &nbsp; | &nbsp; <a href="<?php echo $ADMIN ?>?ADD=171111111111"><FONT FACE="ARIAL,HELVETICA" COLOR=BLACK SIZE=<?php echo $subheader_font_size ?>> Add A New Voicemail Entry </a></TD></TR>
<?php }
if (strlen($settings_sh) > 1) {
?>
<TR BGCOLOR=<?php echo $settings_color ?>><TD ALIGN=LEFT COLSPAN=2> &nbsp; <a href="<?php echo $ADMIN ?>?ADD=311111111111111"><FONT FACE="ARIAL,HELVETICA" COLOR=BLACK SIZE=<?php echo $subheader_font_size ?>> System Settings </a></TD></TR>
+126 -9
View File
@@ -25,11 +25,12 @@
# 90522-0506 - Security fix
# 90530-0946 - Added QueueMetrics blind monitoring option
# 90721-1428 - Added rank and owner as vicidial_list fields
# 90904-1535 - Added moh_list
# 90904-1535 - Added moh_list musiconhold list
# 90916-2342 - Added vm_list voicemail list
#
$version = '2.2.0-12';
$build = '90904-1535';
$version = '2.2.0-13';
$build = '90916-2342';
require("dbconnect.php");
@@ -592,6 +593,122 @@ if ($function == 'moh_list')
################################################################################
### vm_list - sends a list of the voicemail boxes in the system
################################################################################
if ($function == 'vm_list')
{
$stmt="SELECT count(*) from vicidial_users where user='$user' and pass='$pass' and user_level > 6;";
if ($DB) {echo "|$stmt|\n";}
$rslt=mysql_query($stmt, $link);
$row=mysql_fetch_row($rslt);
$allowed_user=$row[0];
if ($allowed_user < 1)
{
$result = 'ERROR';
$result_reason = "vm_list USER DOES NOT HAVE PERMISSION TO VIEW VOICEMAIL BOXES LIST";
echo "$result: $result_reason: |$user|$allowed_user|\n";
$data = "$allowed_user";
api_log($link,$api_logging,$api_script,$user,$agent_user,$function,$value,$result,$result_reason,$source,$data);
exit;
}
else
{
$server_name = getenv("SERVER_NAME");
$server_port = getenv("SERVER_PORT");
if (eregi("443",$server_port)) {$HTTPprotocol = 'https://';}
else {$HTTPprotocol = 'http://';}
$admDIR = "$HTTPprotocol$server_name:$server_port";
echo "\n";
echo "<HTML><head><title>NON-AGENT API</title>\n";
echo "<script language=\"Javascript\">\n";
echo "function choose_file(filename,fieldname)\n";
echo " {\n";
echo " if (filename.length > 0)\n";
echo " {\n";
echo " parent.document.getElementById(fieldname).value = filename;\n";
echo " document.getElementById(\"selectframe\").innerHTML = '';\n";
echo " document.getElementById(\"selectframe\").style.visibility = 'hidden';\n";
echo " parent.close_chooser();\n";
echo " }\n";
echo " }\n";
echo "function close_file()\n";
echo " {\n";
echo " document.getElementById(\"selectframe\").innerHTML = '';\n";
echo " document.getElementById(\"selectframe\").style.visibility = 'hidden';\n";
echo " parent.close_chooser();\n";
echo " }\n";
echo "</script>\n";
echo "</head>\n\n";
echo "<body>\n";
echo "<a href=\"javascript:close_file();\"><font size=1 face=\"Arial,Helvetica\">close frame</font></a>\n";
echo "<div id='selectframe' style=\"height:400px;width:710px;overflow:scroll;\">\n";
echo "<table border=0 cellpadding=1 cellspacing=2 width=690 bgcolor=white><tr>\n";
echo "<td width=30>#</td>\n";
echo "<td colspan=2>Voicemail Boxes</td>\n";
echo "<td>Name</td>\n";
echo "<td>Email</td>\n";
echo "</tr>\n";
$stmt="SELECT voicemail_id,fullname,email from vicidial_voicemail where active='Y' order by voicemail_id";
$rslt=mysql_query($stmt, $link);
$vm_to_print = mysql_num_rows($rslt);
$k=0;
$sf=0;
while ($vm_to_print > $k)
{
$rowx=mysql_fetch_row($rslt);
$voicemail_id[$k] = $rowx[0];
$fullname[$k] = $rowx[1];
$email[$k] = $rowx[2];
$sf++;
if (eregi("1$|3$|5$|7$|9$", $sf))
{$bgcolor='bgcolor="#E6E6E6"';}
else
{$bgcolor='bgcolor="#F6F6F6"';}
echo "<tr $bgcolor><td width=30><font size=1 face=\"Arial,Helvetica\">$sf</td>\n";
echo "<td colspan=2><a href=\"javascript:choose_file('$voicemail_id[$k]','$comments');\"><font size=2 face=\"Arial,Helvetica\">$voicemail_id[$k]</a></td>\n";
echo "<td><font size=2 face=\"Arial,Helvetica\">$fullname[$k]</td>\n";
echo "<td><font size=2 face=\"Arial,Helvetica\">$email[$k]</td></tr>\n";
$k++;
}
$stmt="SELECT voicemail_id,fullname,email,extension from phones where active='Y' order by voicemail_id";
$rslt=mysql_query($stmt, $link);
$vm_to_print = mysql_num_rows($rslt);
$k=0;
$sf=0;
while ($vm_to_print > $k)
{
$rowx=mysql_fetch_row($rslt);
$voicemail_id[$k] = $rowx[0];
$fullname[$k] = $rowx[1];
$email[$k] = $rowx[2];
$extension[$k] = $rowx[3];
$sf++;
if (eregi("1$|3$|5$|7$|9$", $sf))
{$bgcolor='bgcolor="#E6E6E6"';}
else
{$bgcolor='bgcolor="#F6F6F6"';}
echo "<tr $bgcolor><td width=30><font size=1 face=\"Arial,Helvetica\">$sf</td>\n";
echo "<td colspan=2><a href=\"javascript:choose_file('$voicemail_id[$k]','$comments');\"><font size=2 face=\"Arial,Helvetica\">$voicemail_id[$k]</a></td>\n";
echo "<td><font size=2 face=\"Arial,Helvetica\">$extension[$k] - $fullname[$k]</td>\n";
echo "<td><font size=2 face=\"Arial,Helvetica\">$email[$k]</td></tr>\n";
$k++;
}
echo "</table></div></body></HTML>\n";
exit;
}
}
################################################################################
### blind_monitor - sends call to phone from session from listening
################################################################################
@@ -976,7 +1093,7 @@ if ( (eregi("POSTAL",$postalgmt)) && (strlen($postal_code)>4) )
{
if (preg_match('/^1$/', $phone_code))
{
$stmt="select * from vicidial_postal_codes where country_code='$phone_code' and postal_code LIKE \"$postal_code%\";";
$stmt="select postal_code,state,GMT_offset,DST,DST_range,country,country_code from vicidial_postal_codes where country_code='$phone_code' and postal_code LIKE \"$postal_code%\";";
$rslt=mysql_query($stmt, $link);
$pc_recs = mysql_num_rows($rslt);
if ($pc_recs > 0)
@@ -997,7 +1114,7 @@ if ($postalgmt_found < 1)
### UNITED STATES ###
if ($phone_code =='1')
{
$stmt="select * from vicidial_phone_codes where country_code='$phone_code' and areacode='$USarea';";
$stmt="select country_code,country,areacode,state,GMT_offset,DST,DST_range,geographic_description from vicidial_phone_codes where country_code='$phone_code' and areacode='$USarea';";
$rslt=mysql_query($stmt, $link);
$pc_recs = mysql_num_rows($rslt);
if ($pc_recs > 0)
@@ -1012,7 +1129,7 @@ if ($postalgmt_found < 1)
### MEXICO ###
if ($phone_code =='52')
{
$stmt="select * from vicidial_phone_codes where country_code='$phone_code' and areacode='$USarea';";
$stmt="select country_code,country,areacode,state,GMT_offset,DST,DST_range,geographic_description from vicidial_phone_codes where country_code='$phone_code' and areacode='$USarea';";
$rslt=mysql_query($stmt, $link);
$pc_recs = mysql_num_rows($rslt);
if ($pc_recs > 0)
@@ -1027,7 +1144,7 @@ if ($postalgmt_found < 1)
### AUSTRALIA ###
if ($phone_code =='61')
{
$stmt="select * from vicidial_phone_codes where country_code='$phone_code' and state='$state';";
$stmt="select country_code,country,areacode,state,GMT_offset,DST,DST_range,geographic_description from vicidial_phone_codes where country_code='$phone_code' and state='$state';";
$rslt=mysql_query($stmt, $link);
$pc_recs = mysql_num_rows($rslt);
if ($pc_recs > 0)
@@ -1043,7 +1160,7 @@ if ($postalgmt_found < 1)
if (!$PC_processed)
{
$PC_processed++;
$stmt="select * from vicidial_phone_codes where country_code='$phone_code';";
$stmt="select country_code,country,areacode,state,GMT_offset,DST,DST_range,geographic_description from vicidial_phone_codes where country_code='$phone_code';";
$rslt=mysql_query($stmt, $link);
$pc_recs = mysql_num_rows($rslt);
if ($pc_recs > 0)
@@ -1604,7 +1721,7 @@ $GMT_gmt = "$tz";
$GMT_day = "$pday";
$GMT_hour = ($phour + $pmin);
$stmt="SELECT * FROM vicidial_call_times where call_time_id='$local_call_time';";
$stmt="SELECT call_time_id,call_time_name,call_time_comments,ct_default_start,ct_default_stop,ct_sunday_start,ct_sunday_stop,ct_monday_start,ct_monday_stop,ct_tuesday_start,ct_tuesday_stop,ct_wednesday_start,ct_wednesday_stop,ct_thursday_start,ct_thursday_stop,ct_friday_start,ct_friday_stop,ct_saturday_start,ct_saturday_stop,ct_state_call_times FROM vicidial_call_times where call_time_id='$local_call_time';";
if ($DB) {echo "$stmt\n";}
$rslt=mysql_query($stmt, $link);
$rowx=mysql_fetch_row($rslt);