Added conf_secret field to phones to enable different passwords for conf files of IAX/SIP phones and their vicidial agent login

git-svn-id: svn://192.168.202.10@1161 3d104415-ff17-0410-8863-d5cf3c621b8a
This commit is contained in:
mattf
2009-06-21 12:41:43 +00:00
parent 7da0e193a7
commit 66420967b9
6 changed files with 34 additions and 14 deletions
+9 -6
View File
@@ -25,6 +25,7 @@
# 90529-0652 - Added phone_context and fixed calledid and voicemail for phones entries
# 90614-0753 - Added in-group routing to call menu feature
# 90617-0821 - Added phone ring timeout and call menu custom dialplan entry
# 90621-0823 - Added phones conf file secret field use
#
$DB=0; # Debug flag
@@ -798,7 +799,7 @@ if ( ($active_asterisk_server =~ /Y/) && ($generate_vicidial_conf =~ /Y/) && ($r
##### Get the IAX phone entries #####
$stmtA = "SELECT extension,dialplan_number,voicemail_id,pass,template_id,conf_override,email,template_id,conf_override,outbound_cid,fullname,phone_context,phone_ring_timeout FROM phones where server_ip='$server_ip' and protocol='IAX2' and active='Y' order by extension;";
$stmtA = "SELECT extension,dialplan_number,voicemail_id,pass,template_id,conf_override,email,template_id,conf_override,outbound_cid,fullname,phone_context,phone_ring_timeout,conf_secret FROM phones where server_ip='$server_ip' and protocol='IAX2' and active='Y' order by extension;";
# print "$stmtA\n";
$sthA = $dbhA->prepare($stmtA) or die "preparing: ",$dbhA->errstr;
$sthA->execute or die "executing: $stmtA ", $dbhA->errstr;
@@ -820,6 +821,7 @@ if ( ($active_asterisk_server =~ /Y/) && ($generate_vicidial_conf =~ /Y/) && ($r
$fullname[$i] = "$aryA[10]";
$phone_context[$i] = "$aryA[11]";
$phone_ring_timeout[$i] = "$aryA[12]";
$conf_secret[$i] = "$aryA[13]";
$i++;
}
$sthA->finish();
@@ -842,7 +844,7 @@ if ( ($active_asterisk_server =~ /Y/) && ($generate_vicidial_conf =~ /Y/) && ($r
$Piax .= "\n\[$extension[$i]\]\n";
$Piax .= "username=$extension[$i]\n";
$Piax .= "secret=$pass[$i]\n";
$Piax .= "secret=$conf_secret[$i]\n";
$Piax .= "callerid=\"$fullname[$i]\" <$outbound_cid[$i]>\n";
$Piax .= "mailbox=$voicemail[$i]\n";
$Piax .= "$template_contents[$i]\n";
@@ -861,7 +863,7 @@ if ( ($active_asterisk_server =~ /Y/) && ($generate_vicidial_conf =~ /Y/) && ($r
{
$Piax .= "\n\[$extension[$i]\]\n";
$Piax .= "username=$extension[$i]\n";
$Piax .= "secret=$pass[$i]\n";
$Piax .= "secret=$conf_secret[$i]\n";
$Piax .= "callerid=\"$fullname[$i]\" <$outbound_cid[$i]>\n";
$Piax .= "mailbox=$voicemail[$i]\n";
$Piax .= "context=$phone_context[$i]\n";
@@ -880,7 +882,7 @@ if ( ($active_asterisk_server =~ /Y/) && ($generate_vicidial_conf =~ /Y/) && ($r
##### Get the SIP phone entries #####
$stmtA = "SELECT extension,dialplan_number,voicemail_id,pass,template_id,conf_override,email,template_id,conf_override,outbound_cid,fullname,phone_context,phone_ring_timeout FROM phones where server_ip='$server_ip' and protocol='SIP' and active='Y' order by extension;";
$stmtA = "SELECT extension,dialplan_number,voicemail_id,pass,template_id,conf_override,email,template_id,conf_override,outbound_cid,fullname,phone_context,phone_ring_timeout,conf_secret FROM phones where server_ip='$server_ip' and protocol='SIP' and active='Y' order by extension;";
# print "$stmtA\n";
$sthA = $dbhA->prepare($stmtA) or die "preparing: ",$dbhA->errstr;
$sthA->execute or die "executing: $stmtA ", $dbhA->errstr;
@@ -902,6 +904,7 @@ if ( ($active_asterisk_server =~ /Y/) && ($generate_vicidial_conf =~ /Y/) && ($r
$fullname[$i] = "$aryA[10]";
$phone_context[$i] = "$aryA[11]";
$phone_ring_timeout[$i] = "$aryA[12]";
$conf_secret[$i] = "$aryA[13]";
$i++;
}
$sthA->finish();
@@ -924,7 +927,7 @@ if ( ($active_asterisk_server =~ /Y/) && ($generate_vicidial_conf =~ /Y/) && ($r
$Psip .= "\n\[$extension[$i]\]\n";
$Psip .= "username=$extension[$i]\n";
$Psip .= "secret=$pass[$i]\n";
$Psip .= "secret=$conf_secret[$i]\n";
$Psip .= "callerid=\"$fullname[$i]\" <$outbound_cid[$i]>\n";
$Psip .= "mailbox=$voicemail[$i]\n";
$Psip .= "$template_contents[$i]\n";
@@ -943,7 +946,7 @@ if ( ($active_asterisk_server =~ /Y/) && ($generate_vicidial_conf =~ /Y/) && ($r
{
$Psip .= "\n\[$extension[$i]\]\n";
$Psip .= "username=$extension[$i]\n";
$Psip .= "secret=$pass[$i]\n";
$Psip .= "secret=$conf_secret[$i]\n";
$Psip .= "callerid=\"$fullname[$i]\" <$outbound_cid[$i]>\n";
$Psip .= "mailbox=$voicemail[$i]\n";
$Psip .= "context=$phone_context[$i]\n";
+4 -4
View File
@@ -155,7 +155,7 @@ if (length($ARGV[0])>1)
$time = timelocal(0,0,2,$cli_date[2],$cli_date[1],$cli_date[0]);
}
}
print "\n----- DATE OVERRIDE: $shipdate -----\n\n";
if (!$Q) {print "\n----- DATE OVERRIDE: $shipdate -----\n\n";}
}
else
{
@@ -735,7 +735,7 @@ sub select_format_loop
{
@ivr_path = split(/\//,$ivr_location);
$path_file = $ivr_path[$#ivr_path];
`$wgetbin --output-document=$tempdir/$path_file $ivr_location `;
`$wgetbin -q --output-document=$tempdir/$path_file $ivr_location `;
}
}
##### END standard audio lookup #####
@@ -768,7 +768,7 @@ sub select_format_loop
$rec_countB++;
if ($ftp_audio_transfer > 0)
{
`$wgetbin --output-document=$tempdir/$path_file $aryB[2] `;
`$wgetbin -q --output-document=$tempdir/$path_file $aryB[2] `;
}
}
$sthB->finish();
@@ -815,7 +815,7 @@ sub select_format_loop
$rec_countB++;
if ($ftp_audio_transfer > 0)
{
`$wgetbin --output-document=$tempdir/$path_file $aryB[2] `;
`$wgetbin -q --output-document=$tempdir/$path_file $aryB[2] `;
}
}
$sthB->finish();
+2 -1
View File
@@ -71,6 +71,7 @@ template_id VARCHAR(15) NOT NULL,
conf_override TEXT,
phone_context VARCHAR(20) default 'default',
phone_ring_timeout SMALLINT(3) default '60',
conf_secret VARCHAR(20) default 'test',
index (server_ip),
unique index extenserver (extension, server_ip)
);
@@ -1654,7 +1655,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='1153';
UPDATE system_settings SET db_schema_version='1154';
GRANT RELOAD ON *.* TO cron@'%';
GRANT RELOAD ON *.* TO cron@localhost;
+4
View File
@@ -193,3 +193,7 @@ ALTER TABLE vicidial_call_menu MODIFY menu_invalid_prompt VARCHAR(255) default '
ALTER TABLE vicidial_call_menu_options MODIFY option_route_value VARCHAR(255);
UPDATE system_settings SET db_schema_version='1153';
ALTER TABLE phones ADD conf_secret VARCHAR(20) default 'test';
UPDATE system_settings SET db_schema_version='1154';
@@ -173,6 +173,8 @@ Custom Dilplan Entry||
This field allows you to enter in any dialplan elements that you want for the Call Menu||
You can enter multiple propmts in this field and the other prompt fields by separating them with a pipe character||
Setting this field to zero 0 will mean that there will be no wait time after the prompt is played||
Conf File Secret||
This is the secret, or password, for the phone in the iax or sip auto-generated conf file for this phone. Limit is 20 characters alphanumeric dash and underscore accepted. Default is test||
add-file: user_territories.php
+13 -3
View File
@@ -1040,6 +1040,8 @@ if (isset($_GET["custom_dialplan_entry"])) {$custom_dialplan_entry=$_GET["cus
elseif (isset($_POST["custom_dialplan_entry"])) {$custom_dialplan_entry=$_POST["custom_dialplan_entry"];}
if (isset($_GET["phone_ring_timeout"])) {$phone_ring_timeout=$_GET["phone_ring_timeout"];}
elseif (isset($_POST["phone_ring_timeout"])) {$phone_ring_timeout=$_POST["phone_ring_timeout"];}
if (isset($_GET["conf_secret"])) {$conf_secret=$_GET["conf_secret"];}
elseif (isset($_POST["conf_secret"])) {$conf_secret=$_POST["conf_secret"];}
if (isset($script_id)) {$script_id= strtoupper($script_id);}
if (isset($lead_filter_id)) {$lead_filter_id = strtoupper($lead_filter_id);}
@@ -1468,6 +1470,7 @@ if ($non_latin < 1)
$source_menu = ereg_replace("[^-_0-9a-zA-Z]","",$source_menu);
$call_time_id = ereg_replace("[^-_0-9a-zA-Z]","",$call_time_id);
$phone_context = ereg_replace("[^-_0-9a-zA-Z]","",$phone_context);
$conf_secret = ereg_replace("[^-_0-9a-zA-Z]","",$conf_secret);
### ALPHA-NUMERIC and underscore and dash and slash and dot
$menu_prompt = ereg_replace("[^-\/\|\._0-9a-zA-Z]","",$menu_prompt);
@@ -1811,11 +1814,12 @@ else
# 90612-0909 - Added audio prompt selection feature to survey screen
# 90614-0827 - Added In-Group routing to Call Menu screen, Added pull-down Call Menu option to DID screen
# 90617-0733 - Added phone ring timeout and call menu custom dialplan entries
# 90621-0821 - Added phon Conf File Secret field to use a separate password from the user interface for a phone
#
# make sure you have added a user to the vicidial_users MySQL table with at least user_level 8 to access this page the first time
$admin_version = '2.2.0-197';
$build = '90617-0733';
$admin_version = '2.2.0-198';
$build = '90621-0821';
$STARTtime = date("U");
$SQLdate = date("Y-m-d H:i:s");
@@ -4685,6 +4689,11 @@ if ($SSoutbound_autodial_active > 0)
<BR>
<B>Phone Context -</B> This is the dial plan context that this phone will use to dial out. If you are running a call center and you do not want your agents to be able to dial out outside of the ViciDial applicaiton for example, then you would set this field to a dialplan context that does not exist, something like agent-nodial. default is default.
<BR>
<A NAME="phones-conf_secret">
<BR>
<B>Conf File Secret -</B> This is the secret, or password, for the phone in the iax or sip auto-generated conf file for this phone. Limit is 20 characters alphanumeric dash and underscore accepted. Default is test.
<BR>
<A NAME="phones-dtmf_send_extension">
<BR>
@@ -11787,7 +11796,7 @@ if ($ADD==41111111111)
{
echo "<br>PHONE MODIFIED: $extension\n";
$stmt="UPDATE phones set extension='$extension', dialplan_number='$dialplan_number', voicemail_id='$voicemail_id', phone_ip='$phone_ip', computer_ip='$computer_ip', server_ip='$server_ip', login='$login', pass='$pass', status='$status', active='$active', phone_type='$phone_type', fullname='$fullname', company='$company', picture='$picture', protocol='$protocol', local_gmt='$local_gmt', ASTmgrUSERNAME='$ASTmgrUSERNAME', ASTmgrSECRET='$ASTmgrSECRET', login_user='$login_user', login_pass='$login_pass', login_campaign='$login_campaign', park_on_extension='$park_on_extension', conf_on_extension='$conf_on_extension', VICIDIAL_park_on_extension='$VICIDIAL_park_on_extension', VICIDIAL_park_on_filename='$VICIDIAL_park_on_filename', monitor_prefix='$monitor_prefix', recording_exten='$recording_exten', voicemail_exten='$voicemail_exten', voicemail_dump_exten='$voicemail_dump_exten', ext_context='$ext_context', dtmf_send_extension='$dtmf_send_extension', call_out_number_group='$call_out_number_group', client_browser='$client_browser', install_directory='$install_directory', local_web_callerID_URL='" . mysql_real_escape_string($local_web_callerID_URL) . "', VICIDIAL_web_URL='" . mysql_real_escape_string($VICIDIAL_web_URL) . "', AGI_call_logging_enabled='$AGI_call_logging_enabled', user_switching_enabled='$user_switching_enabled', conferencing_enabled='$conferencing_enabled', admin_hangup_enabled='$admin_hangup_enabled', admin_hijack_enabled='$admin_hijack_enabled', admin_monitor_enabled='$admin_monitor_enabled', call_parking_enabled='$call_parking_enabled', updater_check_enabled='$updater_check_enabled', AFLogging_enabled='$AFLogging_enabled', QUEUE_ACTION_enabled='$QUEUE_ACTION_enabled', CallerID_popup_enabled='$CallerID_popup_enabled', voicemail_button_enabled='$voicemail_button_enabled', enable_fast_refresh='$enable_fast_refresh', fast_refresh_rate='$fast_refresh_rate', enable_persistant_mysql='$enable_persistant_mysql', auto_dial_next_number='$auto_dial_next_number', VDstop_rec_after_each_call='$VDstop_rec_after_each_call', DBX_server='$DBX_server', DBX_database='$DBX_database', DBX_user='$DBX_user', DBX_pass='$DBX_pass', DBX_port='$DBX_port', DBY_server='$DBY_server', DBY_database='$DBY_database', DBY_user='$DBY_user', DBY_pass='$DBY_pass', DBY_port='$DBY_port', outbound_cid='$outbound_cid', enable_sipsak_messages='$enable_sipsak_messages', email='$email', template_id='$template_id', conf_override='$conf_override',phone_context='$phone_context',phone_ring_timeout='$phone_ring_timeout' where extension='$old_extension' and server_ip='$old_server_ip';";
$stmt="UPDATE phones set extension='$extension', dialplan_number='$dialplan_number', voicemail_id='$voicemail_id', phone_ip='$phone_ip', computer_ip='$computer_ip', server_ip='$server_ip', login='$login', pass='$pass', status='$status', active='$active', phone_type='$phone_type', fullname='$fullname', company='$company', picture='$picture', protocol='$protocol', local_gmt='$local_gmt', ASTmgrUSERNAME='$ASTmgrUSERNAME', ASTmgrSECRET='$ASTmgrSECRET', login_user='$login_user', login_pass='$login_pass', login_campaign='$login_campaign', park_on_extension='$park_on_extension', conf_on_extension='$conf_on_extension', VICIDIAL_park_on_extension='$VICIDIAL_park_on_extension', VICIDIAL_park_on_filename='$VICIDIAL_park_on_filename', monitor_prefix='$monitor_prefix', recording_exten='$recording_exten', voicemail_exten='$voicemail_exten', voicemail_dump_exten='$voicemail_dump_exten', ext_context='$ext_context', dtmf_send_extension='$dtmf_send_extension', call_out_number_group='$call_out_number_group', client_browser='$client_browser', install_directory='$install_directory', local_web_callerID_URL='" . mysql_real_escape_string($local_web_callerID_URL) . "', VICIDIAL_web_URL='" . mysql_real_escape_string($VICIDIAL_web_URL) . "', AGI_call_logging_enabled='$AGI_call_logging_enabled', user_switching_enabled='$user_switching_enabled', conferencing_enabled='$conferencing_enabled', admin_hangup_enabled='$admin_hangup_enabled', admin_hijack_enabled='$admin_hijack_enabled', admin_monitor_enabled='$admin_monitor_enabled', call_parking_enabled='$call_parking_enabled', updater_check_enabled='$updater_check_enabled', AFLogging_enabled='$AFLogging_enabled', QUEUE_ACTION_enabled='$QUEUE_ACTION_enabled', CallerID_popup_enabled='$CallerID_popup_enabled', voicemail_button_enabled='$voicemail_button_enabled', enable_fast_refresh='$enable_fast_refresh', fast_refresh_rate='$fast_refresh_rate', enable_persistant_mysql='$enable_persistant_mysql', auto_dial_next_number='$auto_dial_next_number', VDstop_rec_after_each_call='$VDstop_rec_after_each_call', DBX_server='$DBX_server', DBX_database='$DBX_database', DBX_user='$DBX_user', DBX_pass='$DBX_pass', DBX_port='$DBX_port', DBY_server='$DBY_server', DBY_database='$DBY_database', DBY_user='$DBY_user', DBY_pass='$DBY_pass', DBY_port='$DBY_port', outbound_cid='$outbound_cid', enable_sipsak_messages='$enable_sipsak_messages', email='$email', template_id='$template_id', conf_override='$conf_override',phone_context='$phone_context',phone_ring_timeout='$phone_ring_timeout',conf_secret='$conf_secret' where extension='$old_extension' and server_ip='$old_server_ip';";
$rslt=mysql_query($stmt, $link);
$stmtA="UPDATE servers SET rebuild_conf_files='Y' where generate_vicidial_conf='Y' and active_asterisk_server='Y' and server_ip='$server_ip';";
@@ -18978,6 +18987,7 @@ if ($ADD==31111111111)
echo "<tr bgcolor=#B6D3FC><td align=right>VMailDump Exten: </td><td align=left><input type=text name=voicemail_dump_exten size=20 maxlength=20 value=\"$row[30]\">$NWB#phones-voicemail_dump_exten$NWE</td></tr>\n";
echo "<tr bgcolor=#B6D3FC><td align=right>Exten Context: </td><td align=left><input type=text name=ext_context size=20 maxlength=20 value=\"$row[31]\">$NWB#phones-ext_context$NWE</td></tr>\n";
echo "<tr bgcolor=#B6D3FC><td align=right>Phone Context: </td><td align=left><input type=text name=phone_context size=20 maxlength=20 value=\"$row[70]\">$NWB#phones-phone_context$NWE</td></tr>\n";
echo "<tr bgcolor=#B6D3FC><td align=right>Conf File Secret: </td><td align=left><input type=text name=conf_secret size=20 maxlength=20 value=\"$row[72]\">$NWB#phones-conf_secret$NWE</td></tr>\n";
echo "<tr bgcolor=#B6D3FC><td align=right>DTMFSend Channel: </td><td align=left><input type=text name=dtmf_send_extension size=40 maxlength=100 value=\"$row[32]\">$NWB#phones-dtmf_send_extension$NWE</td></tr>\n";
echo "<tr bgcolor=#B6D3FC><td align=right>Outbound Call Group: </td><td align=left><input type=text name=call_out_number_group size=40 maxlength=100 value=\"$row[33]\">$NWB#phones-call_out_number_group$NWE</td></tr>\n";
echo "<tr bgcolor=#B6D3FC><td align=right>Browser Location: </td><td align=left><input type=text name=client_browser size=40 maxlength=100 value=\"$row[34]\">$NWB#phones-client_browser$NWE</td></tr>\n";