From b2d79cddab5455f33b214179a2bccb88b95d1ba6 Mon Sep 17 00:00:00 2001 From: mattf Date: Thu, 12 Feb 2009 00:33:44 +0000 Subject: [PATCH] Changed numerous files to give VICIDIAL the ability to quickly update conf files(And reload Asterisk) depending on settings in the VICIDIAL admin interface. For more information please look at the ASTERISK_CONF-GEN.txt file. git-svn-id: svn://192.168.202.10@1051 3d104415-ff17-0410-8863-d5cf3c621b8a --- UPGRADE | 6 + bin/ADMIN_keepalive_ALL.pl | 478 +++- bin/ADMIN_update_server_ip.pl | 36 +- docs/ASTERISK_CONF-GEN.txt | 26 + docs/conf_examples/extensions.conf.sample | 10 +- docs/conf_examples/extensions.conf.sample-1.4 | 10 +- docs/conf_examples/iax.conf.sample | 757 +----- docs/conf_examples/iax.conf.sample-1.4 | 804 +----- docs/conf_examples/sip.conf.sample | 774 +----- docs/conf_examples/sip.conf.sample-1.4 | 104 + docs/conf_examples/voicemail.conf.sample | 110 +- extras/MySQL_AST_CREATE_tables.sql | 37 +- extras/upgrade_2.0.5.sql | 39 + install.pl | 80 +- .../TO_BE_TRANSLATED_2.0.5.txt | 70 + www/vicidial/admin.php | 2161 ++++++++++++----- www/vicidial/admin_search_lead.php | 2 +- 17 files changed, 2500 insertions(+), 3004 deletions(-) create mode 100644 docs/ASTERISK_CONF-GEN.txt create mode 100644 docs/conf_examples/sip.conf.sample-1.4 diff --git a/UPGRADE b/UPGRADE index 8b9529e9..fd9ef801 100644 --- a/UPGRADE +++ b/UPGRADE @@ -249,6 +249,12 @@ NOTE: Upgrading from 1.1.12-3 to 2.0.1 is at the bottom 57. Small redesign of the agent interface to use grey backgrounds and new tabs +58. Added Asterisk version prompt to the install.pl script to allow for the + copying of the proper conf files for the installed Asterisk version + +59. Added auto-generation of SIP and IAX phones and carriers into the Asterisk + conf files so that you can fully configure them using only the admin.php + web interface. See the ASTERISK_CONF-GEN.txt file for more information diff --git a/bin/ADMIN_keepalive_ALL.pl b/bin/ADMIN_keepalive_ALL.pl index dc0661b4..41dc5ac1 100644 --- a/bin/ADMIN_keepalive_ALL.pl +++ b/bin/ADMIN_keepalive_ALL.pl @@ -6,13 +6,14 @@ # Replaces all other ADMIN_keepalive scripts # Uses /etc/astguiclient.conf file to know which processes to keepalive # -# Copyright (C) 2008 Matt Florell LICENSE: AGPLv2 +# Copyright (C) 2009 Matt Florell LICENSE: AGPLv2 # # -# 61011-1348 - first build -# 61120-2011 - added option 7 for AST_VDauto_dial_FILL.pl -# 80227-1526 - added option 8 for ip_relay -# 80526-1350 - added option 9 for timeclock auto-logout +# 61011-1348 - First build +# 61120-2011 - Added option 7 for AST_VDauto_dial_FILL.pl +# 80227-1526 - Added option 8 for ip_relay +# 80526-1350 - Added option 9 for timeclock auto-logout +# 90211-1236 - Added auto-generation of conf files functions # $DB=0; # Debug flag @@ -435,6 +436,473 @@ if ($timeclock_auto_logout > 0) } + + + + + + +################################################################################ +##### START Creation of auto-generated conf files +################################################################################ + +# default path to astguiclient configuration file: +$PATHconf = '/etc/astguiclient.conf'; + +open(conf, "$PATHconf") || die "can't open $PATHconf: $!\n"; +@conf = ; +close(conf); +$i=0; +foreach(@conf) + { + $line = $conf[$i]; + $line =~ s/ |>|\n|\r|\t|\#.*|;.*//gi; + if ( ($line =~ /^PATHlogs/) && ($CLIlogs < 1) ) + {$PATHlogs = $line; $PATHlogs =~ s/.*=//gi;} + if ( ($line =~ /^VARserver_ip/) && ($CLIserver_ip < 1) ) + {$VARserver_ip = $line; $VARserver_ip =~ s/.*=//gi;} + if ( ($line =~ /^VARDB_server/) && ($CLIDB_server < 1) ) + {$VARDB_server = $line; $VARDB_server =~ s/.*=//gi;} + if ( ($line =~ /^VARDB_database/) && ($CLIDB_database < 1) ) + {$VARDB_database = $line; $VARDB_database =~ s/.*=//gi;} + if ( ($line =~ /^VARDB_user/) && ($CLIDB_user < 1) ) + {$VARDB_user = $line; $VARDB_user =~ s/.*=//gi;} + if ( ($line =~ /^VARDB_pass/) && ($CLIDB_pass < 1) ) + {$VARDB_pass = $line; $VARDB_pass =~ s/.*=//gi;} + if ( ($line =~ /^VARDB_port/) && ($CLIDB_port < 1) ) + {$VARDB_port = $line; $VARDB_port =~ s/.*=//gi;} + $i++; + } + +# Customized Variables +$server_ip = $VARserver_ip; # Asterisk server IP +if (!$VARDB_port) {$VARDB_port='3306';} + +use DBI; + +$dbhA = DBI->connect("DBI:mysql:$VARDB_database:$VARDB_server:$VARDB_port", "$VARDB_user", "$VARDB_pass") + or die "Couldn't connect to database: " . DBI->errstr; + +##### Get the settings for this server's server_ip ##### +$stmtA = "SELECT active_asterisk_server,generate_vicidial_conf,rebuild_conf_files FROM servers where server_ip='$server_ip';"; +# 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) + { + @aryA = $sthA->fetchrow_array; + $active_asterisk_server = "$aryA[0]"; + $generate_vicidial_conf = "$aryA[1]"; + $rebuild_conf_files = "$aryA[2]"; + $i++; + } +$sthA->finish(); + + +if ( ($active_asterisk_server =~ /Y/) && ($generate_vicidial_conf =~ /Y/) && ($rebuild_conf_files =~ /Y/) ) + { + if ($DB) {print "generating new auto-gen conf files\n";} + + $stmtA="UPDATE servers SET rebuild_conf_files='N' where server_ip='$server_ip';"; + $affected_rows = $dbhA->do($stmtA); + + ### format the new server_ip dialstring for example to use with extensions.conf + $S='*'; + if( $VARserver_ip =~ m/(\S+)\.(\S+)\.(\S+)\.(\S+)/ ) + { + $a = leading_zero($1); + $b = leading_zero($2); + $c = leading_zero($3); + $d = leading_zero($4); + $VARremDIALstr = "$a$S$b$S$c$S$d"; + } + + $Lext = "\n"; + $Lext .= "; Local Server: $server_ip\n"; + $Lext .= "exten => _$VARremDIALstr*.,1,Goto(default,\${EXTEN:16},1)\n"; + + ##### Get the server_id for this server's server_ip ##### + $stmtA = "SELECT server_id FROM servers where server_ip='$server_ip';"; + # 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) + { + @aryA = $sthA->fetchrow_array; + $server_id = "$aryA[0]"; + $i++; + } + $sthA->finish(); + + ##### Get the server_ips and server_ids of all VICIDIAL servers on the network ##### + $stmtA = "SELECT server_ip,server_id FROM servers where server_ip!='$server_ip' and active_asterisk_server='1';"; + # print "$stmtA\n"; + $sthA = $dbhA->prepare($stmtA) or die "preparing: ",$dbhA->errstr; + $sthA->execute or die "executing: $stmtA ", $dbhA->errstr; + $sthArows=$sthA->rows; + $i=0; + while ($sthArows > $i) + { + @aryA = $sthA->fetchrow_array; + $server_ip[$i] = "$aryA[0]"; + $server_id[$i] = "$aryA[1]"; + + if( $server_ip[$i] =~ m/(\S+)\.(\S+)\.(\S+)\.(\S+)/ ) + { + $a = leading_zero($1); + $b = leading_zero($2); + $c = leading_zero($3); + $d = leading_zero($4); + $VARremDIALstr = "$a$S$b$S$c$S$d"; + } + $ext .= "TRUNK$server_id[$i] = IAX2/$server_id:test\@$server_ip[$i]:4569\n"; + + $iax .= "register => $server_id:test\@$server_ip[$i]:4569\n"; + + $Lext .= "; Remote Server VDAD extens: $server_id[$i] $server_ip[$i]\n"; + $Lext .= "exten => _$VARremDIALstr*.,1,Dial(\${TRUNK$server_id[$i]}/\${EXTEN:16},55,o)\n"; + + $Liax .= "\n"; + $Liax .= "[$server_id[$i]]\n"; + $Liax .= "accountcode=IAX$server_id[$i]\n"; + $Liax .= "secret=test\n"; + $Liax .= "type=friend\n"; + $Liax .= "context=default\n"; + $Liax .= "auth=plaintext\n"; + $Liax .= "host=dynamic\n"; + $Liax .= "permit=0.0.0.0/0.0.0.0\n"; + $Liax .= "disallow=all\n"; + $Liax .= "allow=ulaw\n"; + $Liax .= "qualify=yes\n"; + + $i++; + } + $sthA->finish(); + + + ##### Get the IAX carriers for this server_ip ##### + $stmtA = "SELECT carrier_id,carrier_name,registration_string,template_id,account_entry,globals_string,dialplan_entry FROM vicidial_server_carriers where server_ip='$server_ip' and active='Y' and protocol='IAX2';"; + $sthA = $dbhA->prepare($stmtA) or die "preparing: ",$dbhA->errstr; + $sthA->execute or die "executing: $stmtA ", $dbhA->errstr; + $sthArows=$sthA->rows; + $i=0; + while ($sthArows > $i) + { + @aryA = $sthA->fetchrow_array; + $carrier_id[$i] = "$aryA[0]"; + $carrier_name[$i] = "$aryA[1]"; + $registration_string[$i] = "$aryA[2]"; + $template_id[$i] = "$aryA[3]"; + $account_entry[$i] = "$aryA[4]"; + $globals_string[$i] = "$aryA[5]"; + $dialplan_entry[$i] = "$aryA[6]"; + $i++; + } + $sthA->finish(); + + $i=0; + while ($sthArows > $i) + { + $template_contents[$i]=''; + if ( (length($template_id[$i]) > 1) && ($template_id[$i] !~ /--NONE--/) ) + { + $stmtA = "SELECT template_contents FROM vicidial_conf_templates where template_id='$template_id';"; + $sthA = $dbhA->prepare($stmtA) or die "preparing: ",$dbhA->errstr; + $sthA->execute or die "executing: $stmtA ", $dbhA->errstr; + $sthBrows=$sthA->rows; + if ($sthBrows > 0) + { + @aryA = $sthA->fetchrow_array; + $template_contents[$i] = "$aryA[0]"; + } + $sthA->finish(); + } + $ext .= "$globals_string[$i]\n"; + + $iax .= "$registration_string[$i]\n"; + + $Lext .= "; VICIDIAL Carrier: $carrier_id[$i] - $carrier_name[$i]\n"; + $Lext .= "$dialplan_entry[$i]\n"; + + $Liax .= "; VICIDIAL Carrier: $carrier_id[$i] - $carrier_name[$i]\n"; + $Liax .= "$account_entry[$i]\n"; + $Liax .= "$template_contents[$i]\n"; + + $i++; + } + + + + ##### Get the SIP carriers for this server_ip ##### + $stmtA = "SELECT carrier_id,carrier_name,registration_string,template_id,account_entry,globals_string,dialplan_entry FROM vicidial_server_carriers where server_ip='$server_ip' and active='Y' and protocol='SIP';"; + $sthA = $dbhA->prepare($stmtA) or die "preparing: ",$dbhA->errstr; + $sthA->execute or die "executing: $stmtA ", $dbhA->errstr; + $sthArows=$sthA->rows; + $i=0; + while ($sthArows > $i) + { + @aryA = $sthA->fetchrow_array; + $carrier_id[$i] = "$aryA[0]"; + $carrier_name[$i] = "$aryA[1]"; + $registration_string[$i] = "$aryA[2]"; + $template_id[$i] = "$aryA[3]"; + $account_entry[$i] = "$aryA[4]"; + $globals_string[$i] = "$aryA[5]"; + $dialplan_entry[$i] = "$aryA[6]"; + $i++; + } + $sthA->finish(); + + $i=0; + while ($sthArows > $i) + { + $template_contents[$i]=''; + if ( (length($template_id[$i]) > 1) && ($template_id[$i] !~ /--NONE--/) ) + { + $stmtA = "SELECT template_contents FROM vicidial_conf_templates where template_id='$template_id';"; + $sthA = $dbhA->prepare($stmtA) or die "preparing: ",$dbhA->errstr; + $sthA->execute or die "executing: $stmtA ", $dbhA->errstr; + $sthBrows=$sthA->rows; + if ($sthBrows > 0) + { + @aryA = $sthA->fetchrow_array; + $template_contents[$i] = "$aryA[0]"; + } + $sthA->finish(); + } + $ext .= "$globals_string[$i]\n"; + + $sip .= "$registration_string[$i]\n"; + + $Lext .= "; VICIDIAL Carrier: $carrier_id[$i] - $carrier_name[$i]\n"; + $Lext .= "$dialplan_entry[$i]\n"; + + $Lsip .= "; VICIDIAL Carrier: $carrier_id[$i] - $carrier_name[$i]\n"; + $Lsip .= "$account_entry[$i]\n"; + $Lsip .= "$template_contents[$i]\n"; + + $i++; + } + + + + ##### Get the IAX phone entries ##### + $stmtA = "SELECT extension,dialplan_number,voicemail_id,pass,template_id,conf_override,email,template_id,conf_override FROM phones where server_ip='$server_ip' and protocol='IAX2' and 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; + $i=0; + while ($sthArows > $i) + { + @aryA = $sthA->fetchrow_array; + $extension[$i] = "$aryA[0]"; + $dialplan[$i] = "$aryA[1]"; + $voicemail[$i] = "$aryA[2]"; + $pass[$i] = "$aryA[3]"; + $template_id[$i] = "$aryA[4]"; + $conf_override[$i] ="$aryA[5]"; + $email[$i] = "$aryA[6]"; + $template_id[$i] = "$aryA[7]"; + $conf_override[$i] ="$aryA[8]"; + $i++; + } + $sthA->finish(); + + $i=0; + while ($sthArows > $i) + { + $conf_entry_written=0; + $template_contents[$i]=''; + if ( (length($template_id[$i]) > 1) && ($template_id[$i] !~ /--NONE--/) ) + { + $stmtA = "SELECT template_contents FROM vicidial_conf_templates where template_id='$template_id[$i]';"; + $sthA = $dbhA->prepare($stmtA) or die "preparing: ",$dbhA->errstr; + $sthA->execute or die "executing: $stmtA ", $dbhA->errstr; + $sthBrows=$sthA->rows; + if ($sthBrows > 0) + { + @aryA = $sthA->fetchrow_array; + $template_contents[$i] = "$aryA[0]"; + + $Piax .= "\n\[$extension[$i]\]\n"; + $Piax .= "username=$extension[$i]\n"; + $Piax .= "secret=$pass[$i]\n"; + $Piax .= "mailbox=$voicemail[$i]\n"; + $Piax .= "$template_contents[$i]\n"; + + $conf_entry_written++; + } + $sthA->finish(); + } + if (length($conf_override[$i]) > 10) + { + $Piax .= "\n\[$extension[$i]\]\n"; + $Piax .= "$conf_override[$i]\n"; + $conf_entry_written++; + } + if ($conf_entry_written < 1) + { + $Piax .= "\n\[$extension[$i]\]\n"; + $Piax .= "username=$extension[$i]\n"; + $Piax .= "secret=$pass[$i]\n"; + $Piax .= "mailbox=$voicemail[$i]\n"; + $Piax .= "context=default\n"; + $Piax .= "type=friend\n"; + $Piax .= "auth=md5\n"; + $Piax .= "host=dynamic\n"; + } + $Pext .= "exten => $dialplan[$i],1,Dial(IAX2/$extension[$i])\n"; + $Pext .= "exten => $dialplan[$i],2,Voicemail,u$voicemail[$i]\n"; + + $vm .= "$voicemail[$i] => $voicemail[$i],$extension[$i] Mailbox,$email[$i]\n"; + + $i++; + } + + + ##### Get the SIP phone entries ##### + $stmtA = "SELECT extension,dialplan_number,voicemail_id,pass,template_id,conf_override,email,template_id,conf_override FROM phones where server_ip='$server_ip' and protocol='SIP' and 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; + $i=0; + while ($sthArows > $i) + { + @aryA = $sthA->fetchrow_array; + $extension[$i] = "$aryA[0]"; + $dialplan[$i] = "$aryA[1]"; + $voicemail[$i] = "$aryA[2]"; + $pass[$i] = "$aryA[3]"; + $template_id[$i] = "$aryA[4]"; + $conf_override[$i] ="$aryA[5]"; + $email[$i] = "$aryA[6]"; + $template_id[$i] = "$aryA[7]"; + $conf_override[$i] ="$aryA[8]"; + $i++; + } + $sthA->finish(); + + $i=0; + while ($sthArows > $i) + { + $conf_entry_written=0; + $template_contents[$i]=''; + if ( (length($template_id[$i]) > 1) && ($template_id[$i] !~ /--NONE--/) ) + { + $stmtA = "SELECT template_contents FROM vicidial_conf_templates where template_id='$template_id[$i]';"; + $sthA = $dbhA->prepare($stmtA) or die "preparing: ",$dbhA->errstr; + $sthA->execute or die "executing: $stmtA ", $dbhA->errstr; + $sthBrows=$sthA->rows; + if ($sthBrows > 0) + { + @aryA = $sthA->fetchrow_array; + $template_contents[$i] = "$aryA[0]"; + + $Psip .= "\n\[$extension[$i]\]\n"; + $Psip .= "username=$extension[$i]\n"; + $Psip .= "secret=$pass[$i]\n"; + $Psip .= "mailbox=$voicemail[$i]\n"; + $Psip .= "$template_contents[$i]\n"; + + $conf_entry_written++; + } + $sthA->finish(); + } + if (length($conf_override[$i]) > 10) + { + $Psip .= "\n\[$extension[$i]\]\n"; + $Psip .= "$conf_override[$i]\n"; + $conf_entry_written++; + } + if ($conf_entry_written < 1) + { + $Psip .= "\n\[$extension[$i]\]\n"; + $Psip .= "username=$extension[$i]\n"; + $Psip .= "secret=$pass[$i]\n"; + $Psip .= "mailbox=$voicemail[$i]\n"; + $Psip .= "context=default\n"; + $Psip .= "type=friend\n"; + $Psip .= "host=dynamic\n"; + } + $Pext .= "exten => $dialplan[$i],1,Dial(SIP/$extension[$i])\n"; + $Pext .= "exten => $dialplan[$i],2,Voicemail,u$voicemail[$i]\n"; + + $vm .= "$voicemail[$i] => $voicemail[$i],$extension[$i] Mailbox,$email[$i]\n"; + + $i++; + } + + + if ($DB) {print "writing auto-gen conf files\n";} + + open(ext, ">/etc/asterisk/extensions-vicidial.conf") || die "can't open /etc/asterisk/extensions-vicidial.conf: $!\n"; + open(iax, ">/etc/asterisk/iax-vicidial.conf") || die "can't open /etc/asterisk/iax-vicidial.conf: $!\n"; + open(sip, ">/etc/asterisk/sip-vicidial.conf") || die "can't open /etc/asterisk/sip-vicidial.conf: $!\n"; + open(vm, ">/etc/asterisk/voicemail-vicidial.conf") || die "can't open /etc/asterisk/voicemail-vicidial.conf: $!\n"; + + print ext "[globals]\n"; + print ext "$ext\n"; + print ext "[vicidial-auto]\n"; + print ext "exten => h,1,DeadAGI(agi://127.0.0.1:4577/call_log--HVcauses--PRI-----NODEBUG-----${HANGUPCAUSE}-----${DIALSTATUS}-----${DIALEDTIME}-----${ANSWEREDTIME})\n"; + print ext "$Lext\n"; + print ext "$Pext\n"; + + print iax "$iax\n"; + print iax "$Liax\n"; + print iax "$Piax\n"; + + print sip "$sip\n"; + print sip "$Lsip\n"; + print sip "$Psip\n"; + + print vm "[vicidial-auto]\n"; + print vm "$vm\n"; + + close(ext); + close(iax); + close(sip); + close(vm); + + + sleep(1); + + ### reload Asterisk + if ($DB) {print "reloading asterisk\n";} + `echo reload > /root/asterisk_command_reload`; + `screen -XS asterisk readbuf /root/asterisk_command_reload`; + `screen -XS asterisk paste .`; + + } + + + + + + + + +################################################################################ +##### END Creation of auto-generated conf files +################################################################################ + + + + + if ($DB) {print "DONE\n";} exit; + + + +sub leading_zero($) +{ + $_ = $_[0]; + s/^(\d)$/0$1/; + s/^(\d\d)$/0$1/; + return $_; +} # End of the leading_zero() routine. diff --git a/bin/ADMIN_update_server_ip.pl b/bin/ADMIN_update_server_ip.pl index 8ebab0d6..966b1406 100644 --- a/bin/ADMIN_update_server_ip.pl +++ b/bin/ADMIN_update_server_ip.pl @@ -6,12 +6,12 @@ # astguiclient.conf file to reflect a change in IP address. The script will # automatically default to the first eth address in the ifconfig output. # -# Copyright (C) 2008 Matt Florell LICENSE: AGPLv2 +# Copyright (C) 2009 Matt Florell LICENSE: AGPLv2 # # CHANGELOG -# 71205-2144 - added display of extensions.conf example for call routing -# 80321-0220 - updated for new settings -# +# 71205-2144 - Added display of extensions.conf example for call routing +# 80321-0220 - Updated for new settings +# 90211-1247 - Added asterisk version # # default path to astguiclient configuration file: $PATHconf = '/etc/astguiclient.conf'; @@ -158,6 +158,8 @@ if (-e "$PATHconf") {$VARDB_port = $line; $VARDB_port =~ s/.*=//gi;} if ( ($line =~ /^VARactive_keepalives/) && ($CLIactive_keepalives < 1) ) {$VARactive_keepalives = $line; $VARactive_keepalives =~ s/.*=//gi;} + if ( ($line =~ /^VARasterisk_version/) && ($CLIasterisk_version < 1) ) + {$VARasterisk_version = $line; $VARasterisk_version =~ s/.*=//gi;} if ( ($line =~ /^VARFTP_host/) && ($CLIFTP_host < 1) ) {$VARFTP_host = $line; $VARFTP_host =~ s/.*=//gi;} if ( ($line =~ /^VARFTP_user/) && ($CLIFTP_user < 1) ) @@ -339,6 +341,9 @@ print conf "# 8 - ip_relay (used for blind agent monitoring)\n"; print conf "# 9 - Timeclock auto logout\n"; print conf "VARactive_keepalives => $VARactive_keepalives\n"; print conf "\n"; +print conf "# Asterisk version VICIDIAL is installed for\n"; +print conf "VARasterisk_version => $VARasterisk_version\n"; +print conf "\n"; print conf "# FTP recording archive connection information\n"; print conf "VARFTP_host => $VARFTP_host\n"; print conf "VARFTP_user => $VARFTP_user\n"; @@ -423,6 +428,22 @@ $stmtA = "UPDATE vicidial_server_trunks SET server_ip='$VARserver_ip' where serv $affected_rows = $dbhA->do($stmtA); if ($DB) {print " |$affected_rows|$stmtA|\n";} +print " Updating vicidial_server_carriers table...\n"; +$stmtA = "UPDATE vicidial_server_carriers SET server_ip='$VARserver_ip' where server_ip='$VARold_server_ip';"; +$affected_rows = $dbhA->do($stmtA); +if ($DB) {print " |$affected_rows|$stmtA|\n";} + +print " Updating vicidial_inbound_dids table...\n"; +$stmtA = "UPDATE vicidial_inbound_dids SET server_ip='$VARserver_ip' where server_ip='$VARold_server_ip';"; +$affected_rows = $dbhA->do($stmtA); +if ($DB) {print " |$affected_rows|$stmtA|\n";} + +print " Setting servers to rebuild conf files...\n"; +$stmtA="UPDATE servers SET rebuild_conf_files='Y' where generate_vicidial_conf='Y' and active_asterisk_server='Y';"; +$affected_rows = $dbhA->do($stmtA); +if ($DB) {print " |$affected_rows|$stmtA|\n";} + + $dbhA->disconnect(); ### format the new server_ip dialstring for example to use with extensions.conf @@ -436,8 +457,11 @@ if( $VARserver_ip =~ m/(\S+)\.(\S+)\.(\S+)\.(\S+)/ ) $VARremDIALstr = "$a$S$b$S$c$S$d"; } -print "\nSERVER IP ADDRESS CHANGE FOR VICIDIAL FINISHED!\n"; -print "\nPlease remember to change your extensions.conf entries for the new IP address:\n"; +print "\n"; +print "SERVER IP ADDRESS CHANGE FOR VICIDIAL FINISHED!\n"; +print "\n"; +print "If you are not having VICIDIAL auto-generate your conf files, please\n"; +print "remember to change your extensions.conf entries for the new IP address:\n"; print "exten => _$VARremDIALstr*.,1,Goto(default,${EXTEN:16},1)\n"; print "exten => _8600XXX*.,1,AGI(agi-VDADfixCXFER.agi)\n"; print "exten => _78600XXX*.,1,AGI(agi-VDADfixCXFER.agi)\n"; diff --git a/docs/ASTERISK_CONF-GEN.txt b/docs/ASTERISK_CONF-GEN.txt new file mode 100644 index 00000000..ef6158de --- /dev/null +++ b/docs/ASTERISK_CONF-GEN.txt @@ -0,0 +1,26 @@ +ASTERISK CONF FILE GENERATION 2009-02-11 + +This file details the process for how the system automatically generates Asterisk conf files purely from VICIDIAL settings. + +The conf files that are generated are: + /etc/asterisk/extensions-vicidial.conf + /etc/asterisk/iax-vicidial.conf + /etc/asterisk/sip-vicidial.conf + /etc/asterisk/voicemail-vicidial.conf + +All of the above files are included in their respective conf files by #include links that you can see if you look at the sample conf files in the docs directory. + +IMPORTANT!!! - Files will only be generated for SIP and IAX phones and carriers that are listed as active=Y in the VICIDIAL administration web interface. + - Files will only be generated on servers where the server record is set to active_asterisk_server='Y' and generate_vicidial_conf='Y' + - The automatic reloading of new conf files by the system is only possible if you started Asterisk with the start_asterisk_boot.pl script, or if Asterisk is running in a screen session named 'asterisk'. + +After any phone, server or carrier entry is edited in the admin interface, a flag(rebuild_conf_files='Y') will be set to have the ADMIN_keepalive_ALL.pl script(that should be running once a minute in the crontab) run and generate new conf files and reload Asterisk. + +Phones are defined in the admin.php -> Admin -> Show Phones +Carriers are defined in the admin.php -> Admin -> Servers -> Show Carriers + +If you have special settings that you want to use for phones such as codecs you can use either a Template(admin.php -> Admin -> Servers -> Show Templates) or enter in the full account record(not including the "[extension]") into the "Conf Override" field. + +If you are using a SIP carrier, then you may need to manually set "externip=XXX.XXX.XXX.XXX" in the /etc/asterisk/sip.conf file where XXX.XXX.XXX.XXX is the external IP address of your server as the outside world(or your carrier) sees it. + + diff --git a/docs/conf_examples/extensions.conf.sample b/docs/conf_examples/extensions.conf.sample index a66e3f78..39429724 100644 --- a/docs/conf_examples/extensions.conf.sample +++ b/docs/conf_examples/extensions.conf.sample @@ -2,6 +2,8 @@ static=yes writeprotect=no +#include extensions-vicidial.conf + [globals] CONSOLE=Console/dsp ; Console interface for demo TRUNK=Zap/g1 ; Trunk interface @@ -28,19 +30,17 @@ exten => h,1,DeadAGI(agi://127.0.0.1:4577/call_log--HVcauses--PRI-----NODEBUG--- [default] +include => vicidial-auto + ; VICI-GROUP DIRECT SUPPORT LINE (VICIHELP[84244357]) exten => _84244XXX,1,Dial(IAX2/vicihelp/${EXTEN:5}) -; BE SURE TO CHANGE THIS LINE FOR YOUR IP ADDRESS! -exten => _010*010*010*015*.,1,Goto(default,${EXTEN:16},1) +; Local agent alert extensions exten => _8600XXX*.,1,AGI(agi-VDADfixCXFER.agi) exten => _78600XXX*.,1,AGI(agi-VDADfixCXFER.agi) ; Local blind monitoring exten => _08600XXX,1,Dial(${TRUNKblind}/6${EXTEN:1},55,To) -; ### server 2 exten: -; exten => _010*010*010*016*.,1,Dial(${TRUNKIAX1}/${EXTEN:16},55,o) - ;;;;;;;;;; BEGIN Voicemail and Prompts Section ;;;;;;;;;;;;;;;;;;;;;;; ; Give voicemail at extension 8500 diff --git a/docs/conf_examples/extensions.conf.sample-1.4 b/docs/conf_examples/extensions.conf.sample-1.4 index 3088a2b4..f321a8cd 100644 --- a/docs/conf_examples/extensions.conf.sample-1.4 +++ b/docs/conf_examples/extensions.conf.sample-1.4 @@ -2,6 +2,8 @@ static=yes writeprotect=no +#include extensions-vicidial.conf + [globals] CONSOLE=Console/dsp ; Console interface for demo TRUNK=Zap/g1 ; Trunk interface @@ -28,19 +30,17 @@ exten => h,1,DeadAGI(agi://127.0.0.1:4577/call_log--HVcauses--PRI-----NODEBUG--- [default] +include => vicidial-auto + ; VICI-GROUP DIRECT SUPPORT LINE (VICIHELP[84244357]) exten => _84244XXX,1,Dial(IAX2/vicihelp/${EXTEN:5}) -; BE SURE TO CHANGE THIS LINE FOR YOUR IP ADDRESS! -exten => _010*010*010*015*.,1,Goto(default,${EXTEN:16},1) +; Local agent alert extensions exten => _8600XXX*.,1,AGI(agi-VDADfixCXFER.agi) exten => _78600XXX*.,1,AGI(agi-VDADfixCXFER.agi) ; Local blind monitoring exten => _08600XXX,1,Dial(${TRUNKblind}/6${EXTEN:1},55,To) -; ### server 2 exten: -; exten => _010*010*010*016*.,1,Dial(${TRUNKIAX1}/${EXTEN:16},55,o) - ;;;;;;;;;; BEGIN Voicemail and Prompts Section ;;;;;;;;;;;;;;;;;;;;;;; ; Give voicemail at extension 8500 diff --git a/docs/conf_examples/iax.conf.sample b/docs/conf_examples/iax.conf.sample index 9a10d3ff..3ff22852 100644 --- a/docs/conf_examples/iax.conf.sample +++ b/docs/conf_examples/iax.conf.sample @@ -2,11 +2,14 @@ bindport=4569 iaxcompat=yes bandwidth=high +disallow=all allow=all allow=gsm ; Always allow GSM, it's cool :) jitterbuffer=no tos=lowdelay +#include iax-vicidial.conf + ;register => 1112223333:PASSWORD@iax.binfone.com register => ASTloop:test@127.0.0.1:40569 register => ASTblind:test@127.0.0.1:41569 @@ -52,757 +55,3 @@ username=1112223333 secret=PASSWORD host=iax.binfone.com context=incoming-IAX-context-in-extensions.conf - -[ASTtest2] -type=friend -accountcode=IAXtrunk2 -context=default -auth=plaintext -host=dynamic -permit=0.0.0.0/0.0.0.0 -secret=test -disallow=all -allow=ulaw -qualify=yes - -[firefly01] -type=friend -accountcode=firefly01 -context=default -auth=plaintext -host=dynamic -permit=0.0.0.0/0.0.0.0 -secret=test -disallow=all -allow=gsm -qualify=yes - - -[cc300] -type=friend -accountcode=cc300 -context=default -auth=md5 -host=dynamic -permit=0.0.0.0/0.0.0.0 -secret=test -disallow=all -allow=ulaw -allow=alaw -allow=gsm -qualify=yes - -[cc301] -type=friend -accountcode=cc301 -context=default -auth=md5 -host=dynamic -permit=0.0.0.0/0.0.0.0 -secret=test -disallow=all -allow=ulaw -allow=alaw -allow=gsm -qualify=yes - -[cc302] -type=friend -accountcode=cc302 -context=default -auth=md5 -host=dynamic -permit=0.0.0.0/0.0.0.0 -secret=test -disallow=all -allow=ulaw -allow=alaw -allow=gsm -qualify=yes - -[cc303] -type=friend -accountcode=cc303 -context=default -auth=md5 -host=dynamic -permit=0.0.0.0/0.0.0.0 -secret=test -disallow=all -allow=ulaw -allow=alaw -allow=gsm -qualify=yes - -[cc304] -type=friend -accountcode=cc304 -context=default -auth=md5 -host=dynamic -permit=0.0.0.0/0.0.0.0 -secret=test -disallow=all -allow=ulaw -allow=alaw -allow=gsm -qualify=yes - -[cc305] -type=friend -accountcode=cc305 -context=default -auth=md5 -host=dynamic -permit=0.0.0.0/0.0.0.0 -secret=test -disallow=all -allow=ulaw -allow=alaw -allow=gsm -qualify=yes - -[cc306] -type=friend -accountcode=cc306 -context=default -auth=md5 -host=dynamic -permit=0.0.0.0/0.0.0.0 -secret=test -disallow=all -allow=ulaw -allow=alaw -allow=gsm -qualify=yes - -[cc307] -type=friend -accountcode=cc307 -context=default -auth=md5 -host=dynamic -permit=0.0.0.0/0.0.0.0 -secret=test -disallow=all -allow=ulaw -allow=alaw -allow=gsm -qualify=yes - -[cc308] -type=friend -accountcode=cc308 -context=default -auth=md5 -host=dynamic -permit=0.0.0.0/0.0.0.0 -secret=test -disallow=all -allow=ulaw -allow=alaw -allow=gsm -qualify=yes - -[cc309] -type=friend -accountcode=cc309 -context=default -auth=md5 -host=dynamic -permit=0.0.0.0/0.0.0.0 -secret=test -disallow=all -allow=ulaw -allow=alaw -allow=gsm -qualify=yes - -[cc310] -type=friend -accountcode=cc310 -context=default -auth=md5 -host=dynamic -permit=0.0.0.0/0.0.0.0 -secret=test -disallow=all -allow=ulaw -allow=alaw -allow=gsm -qualify=yes - -[cc311] -type=friend -accountcode=cc311 -context=default -auth=md5 -host=dynamic -permit=0.0.0.0/0.0.0.0 -secret=test -disallow=all -allow=ulaw -allow=alaw -allow=gsm -qualify=yes - -[cc312] -type=friend -accountcode=cc312 -context=default -auth=md5 -host=dynamic -permit=0.0.0.0/0.0.0.0 -secret=test -disallow=all -allow=ulaw -allow=alaw -allow=gsm -qualify=yes - -[cc313] -type=friend -accountcode=cc313 -context=default -auth=md5 -host=dynamic -permit=0.0.0.0/0.0.0.0 -secret=test -disallow=all -allow=ulaw -allow=alaw -allow=gsm -qualify=yes - -[cc314] -type=friend -accountcode=cc314 -context=default -auth=md5 -host=dynamic -permit=0.0.0.0/0.0.0.0 -secret=test -disallow=all -allow=ulaw -allow=alaw -allow=gsm -qualify=yes - -[cc315] -type=friend -accountcode=cc315 -context=default -auth=md5 -host=dynamic -permit=0.0.0.0/0.0.0.0 -secret=test -disallow=all -allow=ulaw -allow=alaw -allow=gsm -qualify=yes - -[cc316] -type=friend -accountcode=cc316 -context=default -auth=md5 -host=dynamic -permit=0.0.0.0/0.0.0.0 -secret=test -disallow=all -allow=ulaw -allow=alaw -allow=gsm -qualify=yes - -[cc317] -type=friend -accountcode=cc317 -context=default -auth=md5 -host=dynamic -permit=0.0.0.0/0.0.0.0 -secret=test -disallow=all -allow=ulaw -allow=alaw -allow=gsm -qualify=yes - -[cc318] -type=friend -accountcode=cc318 -context=default -auth=md5 -host=dynamic -permit=0.0.0.0/0.0.0.0 -secret=test -disallow=all -allow=ulaw -allow=alaw -allow=gsm -qualify=yes - -[cc319] -type=friend -accountcode=cc319 -context=default -auth=md5 -host=dynamic -permit=0.0.0.0/0.0.0.0 -secret=test -disallow=all -allow=ulaw -allow=alaw -allow=gsm -qualify=yes - -[cc320] -type=friend -accountcode=cc320 -context=default -auth=md5 -host=dynamic -permit=0.0.0.0/0.0.0.0 -secret=test -disallow=all -allow=ulaw -allow=alaw -allow=gsm -qualify=yes - -[cc321] -type=friend -accountcode=cc321 -context=default -auth=md5 -host=dynamic -permit=0.0.0.0/0.0.0.0 -secret=test -disallow=all -allow=ulaw -allow=alaw -allow=gsm -qualify=yes - -[cc322] -type=friend -accountcode=cc322 -context=default -auth=md5 -host=dynamic -permit=0.0.0.0/0.0.0.0 -secret=test -disallow=all -allow=ulaw -allow=alaw -allow=gsm -qualify=yes - -[cc323] -type=friend -accountcode=cc323 -context=default -auth=md5 -host=dynamic -permit=0.0.0.0/0.0.0.0 -secret=test -disallow=all -allow=ulaw -allow=alaw -allow=gsm -qualify=yes - -[cc324] -type=friend -accountcode=cc324 -context=default -auth=md5 -host=dynamic -permit=0.0.0.0/0.0.0.0 -secret=test -disallow=all -allow=ulaw -allow=alaw -allow=gsm -qualify=yes - -[cc325] -type=friend -accountcode=cc325 -context=default -auth=md5 -host=dynamic -permit=0.0.0.0/0.0.0.0 -secret=test -disallow=all -allow=ulaw -allow=alaw -allow=gsm -qualify=yes - -[cc326] -type=friend -accountcode=cc326 -context=default -auth=md5 -host=dynamic -permit=0.0.0.0/0.0.0.0 -secret=test -disallow=all -allow=ulaw -allow=alaw -allow=gsm -qualify=yes - -[cc327] -type=friend -accountcode=cc327 -context=default -auth=md5 -host=dynamic -permit=0.0.0.0/0.0.0.0 -secret=test -disallow=all -allow=ulaw -allow=alaw -allow=gsm -qualify=yes - -[cc328] -type=friend -accountcode=cc328 -context=default -auth=md5 -host=dynamic -permit=0.0.0.0/0.0.0.0 -secret=test -disallow=all -allow=ulaw -allow=alaw -allow=gsm -qualify=yes - -[cc329] -type=friend -accountcode=cc329 -context=default -auth=md5 -host=dynamic -permit=0.0.0.0/0.0.0.0 -secret=test -disallow=all -allow=ulaw -allow=alaw -allow=gsm -qualify=yes - -[cc330] -type=friend -accountcode=cc330 -context=default -auth=md5 -host=dynamic -permit=0.0.0.0/0.0.0.0 -secret=test -disallow=all -allow=ulaw -allow=alaw -allow=gsm -qualify=yes - -[cc331] -type=friend -accountcode=cc331 -context=default -auth=md5 -host=dynamic -permit=0.0.0.0/0.0.0.0 -secret=test -disallow=all -allow=ulaw -allow=alaw -allow=gsm -qualify=yes - -[cc332] -type=friend -accountcode=cc332 -context=default -auth=md5 -host=dynamic -permit=0.0.0.0/0.0.0.0 -secret=test -disallow=all -allow=ulaw -allow=alaw -allow=gsm -qualify=yes - -[cc333] -type=friend -accountcode=cc333 -context=default -auth=md5 -host=dynamic -permit=0.0.0.0/0.0.0.0 -secret=test -disallow=all -allow=ulaw -allow=alaw -allow=gsm -qualify=yes - -[cc334] -type=friend -accountcode=cc334 -context=default -auth=md5 -host=dynamic -permit=0.0.0.0/0.0.0.0 -secret=test -disallow=all -allow=ulaw -allow=alaw -allow=gsm -qualify=yes - -[cc335] -type=friend -accountcode=cc335 -context=default -auth=md5 -host=dynamic -permit=0.0.0.0/0.0.0.0 -secret=test -disallow=all -allow=ulaw -allow=alaw -allow=gsm -qualify=yes - -[cc336] -type=friend -accountcode=cc336 -context=default -auth=md5 -host=dynamic -permit=0.0.0.0/0.0.0.0 -secret=test -disallow=all -allow=ulaw -allow=alaw -allow=gsm -qualify=yes - -[cc337] -type=friend -accountcode=cc337 -context=default -auth=md5 -host=dynamic -permit=0.0.0.0/0.0.0.0 -secret=test -disallow=all -allow=ulaw -allow=alaw -allow=gsm -qualify=yes - -[cc338] -type=friend -accountcode=cc338 -context=default -auth=md5 -host=dynamic -permit=0.0.0.0/0.0.0.0 -secret=test -disallow=all -allow=ulaw -allow=alaw -allow=gsm -qualify=yes - -[cc339] -type=friend -accountcode=cc339 -context=default -auth=md5 -host=dynamic -permit=0.0.0.0/0.0.0.0 -secret=test -disallow=all -allow=ulaw -allow=alaw -allow=gsm -qualify=yes - -[cc340] -type=friend -accountcode=cc340 -context=default -auth=md5 -host=dynamic -permit=0.0.0.0/0.0.0.0 -secret=test -disallow=all -allow=ulaw -allow=alaw -allow=gsm -qualify=yes - -[cc341] -type=friend -accountcode=cc341 -context=default -auth=md5 -host=dynamic -permit=0.0.0.0/0.0.0.0 -secret=test -disallow=all -allow=ulaw -allow=alaw -allow=gsm -qualify=yes - -[cc342] -type=friend -accountcode=cc342 -context=default -auth=md5 -host=dynamic -permit=0.0.0.0/0.0.0.0 -secret=test -disallow=all -allow=ulaw -allow=alaw -allow=gsm -qualify=yes - -[cc343] -type=friend -accountcode=cc343 -context=default -auth=md5 -host=dynamic -permit=0.0.0.0/0.0.0.0 -secret=test -disallow=all -allow=ulaw -allow=alaw -allow=gsm -qualify=yes - -[cc344] -type=friend -accountcode=cc344 -context=default -auth=md5 -host=dynamic -permit=0.0.0.0/0.0.0.0 -secret=test -disallow=all -allow=ulaw -allow=alaw -allow=gsm -qualify=yes - -[cc345] -type=friend -accountcode=cc345 -context=default -auth=md5 -host=dynamic -permit=0.0.0.0/0.0.0.0 -secret=test -disallow=all -allow=ulaw -allow=alaw -allow=gsm -qualify=yes - -[cc346] -type=friend -accountcode=cc346 -context=default -auth=md5 -host=dynamic -permit=0.0.0.0/0.0.0.0 -secret=test -disallow=all -allow=ulaw -allow=alaw -allow=gsm -qualify=yes - -[cc347] -type=friend -accountcode=cc347 -context=default -auth=md5 -host=dynamic -permit=0.0.0.0/0.0.0.0 -secret=test -disallow=all -allow=ulaw -allow=alaw -allow=gsm -qualify=yes - -[cc348] -type=friend -accountcode=cc348 -context=default -auth=md5 -host=dynamic -permit=0.0.0.0/0.0.0.0 -secret=test -disallow=all -allow=ulaw -allow=alaw -allow=gsm -qualify=yes - -[cc349] -type=friend -accountcode=cc349 -context=default -auth=md5 -host=dynamic -permit=0.0.0.0/0.0.0.0 -secret=test -disallow=all -allow=ulaw -allow=alaw -allow=gsm -qualify=yes - -[cc350] -type=friend -accountcode=cc350 -context=default -auth=md5 -host=dynamic -permit=0.0.0.0/0.0.0.0 -secret=test -disallow=all -allow=ulaw -allow=alaw -allow=gsm -qualify=yes - -[cc351] -type=friend -accountcode=cc351 -context=default -auth=md5 -host=dynamic -permit=0.0.0.0/0.0.0.0 -secret=test -disallow=all -allow=ulaw -allow=alaw -allow=gsm -qualify=yes - diff --git a/docs/conf_examples/iax.conf.sample-1.4 b/docs/conf_examples/iax.conf.sample-1.4 index d0b49bfe..1382c77e 100644 --- a/docs/conf_examples/iax.conf.sample-1.4 +++ b/docs/conf_examples/iax.conf.sample-1.4 @@ -1,13 +1,45 @@ [general] -bindport=4569 -iaxcompat=yes -bandwidth=high -allow=all -allow=gsm ; Always allow GSM, it's cool :) -jitterbuffer=no -tos=lowdelay -iaxthreadcount = 200 -iaxmaxthreadcount = 1000 +bindport=4569 ; bindport and bindaddr may be specified +bindaddr=0.0.0.0 ; more than once to bind to multiple +;iaxcompat=yes +;nochecksums=no +delayreject=yes +;amaflags=default +adsi=no +;accountcode=vicidial +language=en +mohinterpret=passthrough +mohsuggest=default +disallow=all +allow=ulaw +allow=gsm +jitterbuffer=yes +forcejitterbuffer=no +maxjitterbuffer=1000 +maxjitterinterps=10 +resyncthreshold=1000 +trunkfreq=20 ; How frequently to send trunk msgs (in ms) +trunktimestamps=yes +minregexpire = 60 +maxregexpire = 360 +iaxthreadcount = 50 +iaxmaxthreadcount = 250 +;register => marko:secretpass@tormenta.linux-support.net +;register => joe@remotehost:5656 +;register => marko:[torkey]@tormenta.linux-support.net +;register => user:pass@iaxtel.com +;register => FWDNumber:passwd@iax.fwdnet.net +authdebug=no +regcontext=default +autokill=yes +codecpriority=host +allowfwdownload=no +;rtcachefriends=yes ; Cache realtime friends by adding them to the internal list +;rtupdate=yes ; Send registry updates to database using realtime? (yes|no) +;rtautoclear=yes ; Auto-Expire friends created on the fly on the same schedule +;rtignoreregexpire=yes ; When reading a peer from Realtime, if the peer's registration + +#include iax-vicidial.conf ;register => 1112223333:PASSWORD@iax.binfone.com register => ASTloop:test@127.0.0.1:40569 @@ -54,757 +86,3 @@ username=1112223333 secret=PASSWORD host=iax.binfone.com context=incoming-IAX-context-in-extensions.conf - -[ASTtest2] -type=friend -accountcode=IAXtrunk2 -context=default -auth=plaintext -host=dynamic -permit=0.0.0.0/0.0.0.0 -secret=test -disallow=all -allow=ulaw -qualify=yes - -[firefly01] -type=friend -accountcode=firefly01 -context=default -auth=plaintext -host=dynamic -permit=0.0.0.0/0.0.0.0 -secret=test -disallow=all -allow=gsm -qualify=yes - - -[cc300] -type=friend -accountcode=cc300 -context=default -auth=md5 -host=dynamic -permit=0.0.0.0/0.0.0.0 -secret=test -disallow=all -allow=ulaw -allow=alaw -allow=gsm -qualify=yes - -[cc301] -type=friend -accountcode=cc301 -context=default -auth=md5 -host=dynamic -permit=0.0.0.0/0.0.0.0 -secret=test -disallow=all -allow=ulaw -allow=alaw -allow=gsm -qualify=yes - -[cc302] -type=friend -accountcode=cc302 -context=default -auth=md5 -host=dynamic -permit=0.0.0.0/0.0.0.0 -secret=test -disallow=all -allow=ulaw -allow=alaw -allow=gsm -qualify=yes - -[cc303] -type=friend -accountcode=cc303 -context=default -auth=md5 -host=dynamic -permit=0.0.0.0/0.0.0.0 -secret=test -disallow=all -allow=ulaw -allow=alaw -allow=gsm -qualify=yes - -[cc304] -type=friend -accountcode=cc304 -context=default -auth=md5 -host=dynamic -permit=0.0.0.0/0.0.0.0 -secret=test -disallow=all -allow=ulaw -allow=alaw -allow=gsm -qualify=yes - -[cc305] -type=friend -accountcode=cc305 -context=default -auth=md5 -host=dynamic -permit=0.0.0.0/0.0.0.0 -secret=test -disallow=all -allow=ulaw -allow=alaw -allow=gsm -qualify=yes - -[cc306] -type=friend -accountcode=cc306 -context=default -auth=md5 -host=dynamic -permit=0.0.0.0/0.0.0.0 -secret=test -disallow=all -allow=ulaw -allow=alaw -allow=gsm -qualify=yes - -[cc307] -type=friend -accountcode=cc307 -context=default -auth=md5 -host=dynamic -permit=0.0.0.0/0.0.0.0 -secret=test -disallow=all -allow=ulaw -allow=alaw -allow=gsm -qualify=yes - -[cc308] -type=friend -accountcode=cc308 -context=default -auth=md5 -host=dynamic -permit=0.0.0.0/0.0.0.0 -secret=test -disallow=all -allow=ulaw -allow=alaw -allow=gsm -qualify=yes - -[cc309] -type=friend -accountcode=cc309 -context=default -auth=md5 -host=dynamic -permit=0.0.0.0/0.0.0.0 -secret=test -disallow=all -allow=ulaw -allow=alaw -allow=gsm -qualify=yes - -[cc310] -type=friend -accountcode=cc310 -context=default -auth=md5 -host=dynamic -permit=0.0.0.0/0.0.0.0 -secret=test -disallow=all -allow=ulaw -allow=alaw -allow=gsm -qualify=yes - -[cc311] -type=friend -accountcode=cc311 -context=default -auth=md5 -host=dynamic -permit=0.0.0.0/0.0.0.0 -secret=test -disallow=all -allow=ulaw -allow=alaw -allow=gsm -qualify=yes - -[cc312] -type=friend -accountcode=cc312 -context=default -auth=md5 -host=dynamic -permit=0.0.0.0/0.0.0.0 -secret=test -disallow=all -allow=ulaw -allow=alaw -allow=gsm -qualify=yes - -[cc313] -type=friend -accountcode=cc313 -context=default -auth=md5 -host=dynamic -permit=0.0.0.0/0.0.0.0 -secret=test -disallow=all -allow=ulaw -allow=alaw -allow=gsm -qualify=yes - -[cc314] -type=friend -accountcode=cc314 -context=default -auth=md5 -host=dynamic -permit=0.0.0.0/0.0.0.0 -secret=test -disallow=all -allow=ulaw -allow=alaw -allow=gsm -qualify=yes - -[cc315] -type=friend -accountcode=cc315 -context=default -auth=md5 -host=dynamic -permit=0.0.0.0/0.0.0.0 -secret=test -disallow=all -allow=ulaw -allow=alaw -allow=gsm -qualify=yes - -[cc316] -type=friend -accountcode=cc316 -context=default -auth=md5 -host=dynamic -permit=0.0.0.0/0.0.0.0 -secret=test -disallow=all -allow=ulaw -allow=alaw -allow=gsm -qualify=yes - -[cc317] -type=friend -accountcode=cc317 -context=default -auth=md5 -host=dynamic -permit=0.0.0.0/0.0.0.0 -secret=test -disallow=all -allow=ulaw -allow=alaw -allow=gsm -qualify=yes - -[cc318] -type=friend -accountcode=cc318 -context=default -auth=md5 -host=dynamic -permit=0.0.0.0/0.0.0.0 -secret=test -disallow=all -allow=ulaw -allow=alaw -allow=gsm -qualify=yes - -[cc319] -type=friend -accountcode=cc319 -context=default -auth=md5 -host=dynamic -permit=0.0.0.0/0.0.0.0 -secret=test -disallow=all -allow=ulaw -allow=alaw -allow=gsm -qualify=yes - -[cc320] -type=friend -accountcode=cc320 -context=default -auth=md5 -host=dynamic -permit=0.0.0.0/0.0.0.0 -secret=test -disallow=all -allow=ulaw -allow=alaw -allow=gsm -qualify=yes - -[cc321] -type=friend -accountcode=cc321 -context=default -auth=md5 -host=dynamic -permit=0.0.0.0/0.0.0.0 -secret=test -disallow=all -allow=ulaw -allow=alaw -allow=gsm -qualify=yes - -[cc322] -type=friend -accountcode=cc322 -context=default -auth=md5 -host=dynamic -permit=0.0.0.0/0.0.0.0 -secret=test -disallow=all -allow=ulaw -allow=alaw -allow=gsm -qualify=yes - -[cc323] -type=friend -accountcode=cc323 -context=default -auth=md5 -host=dynamic -permit=0.0.0.0/0.0.0.0 -secret=test -disallow=all -allow=ulaw -allow=alaw -allow=gsm -qualify=yes - -[cc324] -type=friend -accountcode=cc324 -context=default -auth=md5 -host=dynamic -permit=0.0.0.0/0.0.0.0 -secret=test -disallow=all -allow=ulaw -allow=alaw -allow=gsm -qualify=yes - -[cc325] -type=friend -accountcode=cc325 -context=default -auth=md5 -host=dynamic -permit=0.0.0.0/0.0.0.0 -secret=test -disallow=all -allow=ulaw -allow=alaw -allow=gsm -qualify=yes - -[cc326] -type=friend -accountcode=cc326 -context=default -auth=md5 -host=dynamic -permit=0.0.0.0/0.0.0.0 -secret=test -disallow=all -allow=ulaw -allow=alaw -allow=gsm -qualify=yes - -[cc327] -type=friend -accountcode=cc327 -context=default -auth=md5 -host=dynamic -permit=0.0.0.0/0.0.0.0 -secret=test -disallow=all -allow=ulaw -allow=alaw -allow=gsm -qualify=yes - -[cc328] -type=friend -accountcode=cc328 -context=default -auth=md5 -host=dynamic -permit=0.0.0.0/0.0.0.0 -secret=test -disallow=all -allow=ulaw -allow=alaw -allow=gsm -qualify=yes - -[cc329] -type=friend -accountcode=cc329 -context=default -auth=md5 -host=dynamic -permit=0.0.0.0/0.0.0.0 -secret=test -disallow=all -allow=ulaw -allow=alaw -allow=gsm -qualify=yes - -[cc330] -type=friend -accountcode=cc330 -context=default -auth=md5 -host=dynamic -permit=0.0.0.0/0.0.0.0 -secret=test -disallow=all -allow=ulaw -allow=alaw -allow=gsm -qualify=yes - -[cc331] -type=friend -accountcode=cc331 -context=default -auth=md5 -host=dynamic -permit=0.0.0.0/0.0.0.0 -secret=test -disallow=all -allow=ulaw -allow=alaw -allow=gsm -qualify=yes - -[cc332] -type=friend -accountcode=cc332 -context=default -auth=md5 -host=dynamic -permit=0.0.0.0/0.0.0.0 -secret=test -disallow=all -allow=ulaw -allow=alaw -allow=gsm -qualify=yes - -[cc333] -type=friend -accountcode=cc333 -context=default -auth=md5 -host=dynamic -permit=0.0.0.0/0.0.0.0 -secret=test -disallow=all -allow=ulaw -allow=alaw -allow=gsm -qualify=yes - -[cc334] -type=friend -accountcode=cc334 -context=default -auth=md5 -host=dynamic -permit=0.0.0.0/0.0.0.0 -secret=test -disallow=all -allow=ulaw -allow=alaw -allow=gsm -qualify=yes - -[cc335] -type=friend -accountcode=cc335 -context=default -auth=md5 -host=dynamic -permit=0.0.0.0/0.0.0.0 -secret=test -disallow=all -allow=ulaw -allow=alaw -allow=gsm -qualify=yes - -[cc336] -type=friend -accountcode=cc336 -context=default -auth=md5 -host=dynamic -permit=0.0.0.0/0.0.0.0 -secret=test -disallow=all -allow=ulaw -allow=alaw -allow=gsm -qualify=yes - -[cc337] -type=friend -accountcode=cc337 -context=default -auth=md5 -host=dynamic -permit=0.0.0.0/0.0.0.0 -secret=test -disallow=all -allow=ulaw -allow=alaw -allow=gsm -qualify=yes - -[cc338] -type=friend -accountcode=cc338 -context=default -auth=md5 -host=dynamic -permit=0.0.0.0/0.0.0.0 -secret=test -disallow=all -allow=ulaw -allow=alaw -allow=gsm -qualify=yes - -[cc339] -type=friend -accountcode=cc339 -context=default -auth=md5 -host=dynamic -permit=0.0.0.0/0.0.0.0 -secret=test -disallow=all -allow=ulaw -allow=alaw -allow=gsm -qualify=yes - -[cc340] -type=friend -accountcode=cc340 -context=default -auth=md5 -host=dynamic -permit=0.0.0.0/0.0.0.0 -secret=test -disallow=all -allow=ulaw -allow=alaw -allow=gsm -qualify=yes - -[cc341] -type=friend -accountcode=cc341 -context=default -auth=md5 -host=dynamic -permit=0.0.0.0/0.0.0.0 -secret=test -disallow=all -allow=ulaw -allow=alaw -allow=gsm -qualify=yes - -[cc342] -type=friend -accountcode=cc342 -context=default -auth=md5 -host=dynamic -permit=0.0.0.0/0.0.0.0 -secret=test -disallow=all -allow=ulaw -allow=alaw -allow=gsm -qualify=yes - -[cc343] -type=friend -accountcode=cc343 -context=default -auth=md5 -host=dynamic -permit=0.0.0.0/0.0.0.0 -secret=test -disallow=all -allow=ulaw -allow=alaw -allow=gsm -qualify=yes - -[cc344] -type=friend -accountcode=cc344 -context=default -auth=md5 -host=dynamic -permit=0.0.0.0/0.0.0.0 -secret=test -disallow=all -allow=ulaw -allow=alaw -allow=gsm -qualify=yes - -[cc345] -type=friend -accountcode=cc345 -context=default -auth=md5 -host=dynamic -permit=0.0.0.0/0.0.0.0 -secret=test -disallow=all -allow=ulaw -allow=alaw -allow=gsm -qualify=yes - -[cc346] -type=friend -accountcode=cc346 -context=default -auth=md5 -host=dynamic -permit=0.0.0.0/0.0.0.0 -secret=test -disallow=all -allow=ulaw -allow=alaw -allow=gsm -qualify=yes - -[cc347] -type=friend -accountcode=cc347 -context=default -auth=md5 -host=dynamic -permit=0.0.0.0/0.0.0.0 -secret=test -disallow=all -allow=ulaw -allow=alaw -allow=gsm -qualify=yes - -[cc348] -type=friend -accountcode=cc348 -context=default -auth=md5 -host=dynamic -permit=0.0.0.0/0.0.0.0 -secret=test -disallow=all -allow=ulaw -allow=alaw -allow=gsm -qualify=yes - -[cc349] -type=friend -accountcode=cc349 -context=default -auth=md5 -host=dynamic -permit=0.0.0.0/0.0.0.0 -secret=test -disallow=all -allow=ulaw -allow=alaw -allow=gsm -qualify=yes - -[cc350] -type=friend -accountcode=cc350 -context=default -auth=md5 -host=dynamic -permit=0.0.0.0/0.0.0.0 -secret=test -disallow=all -allow=ulaw -allow=alaw -allow=gsm -qualify=yes - -[cc351] -type=friend -accountcode=cc351 -context=default -auth=md5 -host=dynamic -permit=0.0.0.0/0.0.0.0 -secret=test -disallow=all -allow=ulaw -allow=alaw -allow=gsm -qualify=yes - diff --git a/docs/conf_examples/sip.conf.sample b/docs/conf_examples/sip.conf.sample index ec26c855..858e1840 100644 --- a/docs/conf_examples/sip.conf.sample +++ b/docs/conf_examples/sip.conf.sample @@ -1,7 +1,69 @@ [general] -port = 5060 -bindaddr = 0.0.0.0 -context = default +context=default ; Default context for incoming calls +;allowguest=no ; Allow or reject guest calls (default is yes, this can also be set to 'osp' +;realm=mydomain.tld ; Realm for digest authentication +bindport=5060 ; UDP Port to bind to (SIP standard port is 5060) +bindaddr=0.0.0.0 ; IP address to bind to (0.0.0.0 binds to all) +srvlookup=yes ; Enable DNS SRV lookups on outbound calls +;domain=mydomain.tld ; Set default domain for this host +;domain=mydomain.tld,mydomain-incoming +;domain=1.2.3.4 ; Add IP address as local domain +;allowexternalinvites=no ; Disable INVITE and REFER to non-local domains +;autodomain=yes ; Turn this on to have Asterisk add local host +;pedantic=yes ; Enable slow, pedantic checking for Pingtel +;tos=184 ; Set IP QoS to either a keyword or numeric val +tos=lowdelay ; lowdelay,throughput,reliability,mincost,none +maxexpiry=3600 ; Max length of incoming registration we allow +defaultexpiry=120 ; Default length of incoming/outgoing registration +;notifymimetype=text/plain ; Allow overriding of mime type in MWI NOTIFY +;checkmwi=10 ; Default time between mailbox checks for peers +;vmexten=voicemail ; dialplan extension to reach mailbox sets the +;videosupport=yes ; Turn on support for SIP video +;recordhistory=yes ; Record SIP history by default +disallow=all ; First disallow all codecs +allow=ulaw ; Allow codecs in order of preference +allow=gsm ; +musicclass=default ; Sets the default music on hold class for all SIP calls +language=en ; Default language setting for all users/peers +relaxdtmf=yes ; Relax dtmf handling +rtptimeout=60 ; Terminate call if 60 seconds of no RTP activity +;rtpholdtimeout=300 ; Terminate call if 300 seconds of no RTP activity +trustrpid = no ; If Remote-Party-ID should be trusted +sendrpid = yes ; If Remote-Party-ID should be sent +progressinband=no ; If we should generate in-band ringing always +;useragent=Asterisk PBX ; Allows you to change the user agent string +promiscredir = no ; If yes, allows 302 or REDIR to non-local SIP address +;usereqphone = no ; If yes, ";user=phone" is added to uri that contains +dtmfmode = rfc2833 ; Set default dtmfmode for sending DTMF. Default: rfc2833 +;compactheaders = yes ; send compact sip headers. +;sipdebug = yes ; Turn on SIP debugging by default, from +;subscribecontext = default ; Set a specific context for SUBSCRIBE requests +;notifyringing = yes ; Notify subscriptions on RINGING state +;alwaysauthreject = yes ; When an incoming INVITE or REGISTER is to be rejected, +;regcontext=sipregistrations +;registertimeout=20 ; retry registration calls every 20 seconds (default) +;registerattempts=10 ; Number of registration attempts before we give up +callevents=no ; generate manager events when sip ua performs events (e.g. hold) +;externip = 192.168.1.1 ; Address that we're going to put in outbound SIP messages +;externhost=foo.dyndns.net ; Alternatively you can specify an +;externrefresh=10 ; How often to refresh externhost if +localnet=192.168.0.0/255.255.0.0; All RFC 1918 addresses are local networks +localnet=10.0.0.0/255.0.0.0 ; Also RFC1918 +localnet=172.16.0.0/12 ; Another RFC1918 with CIDR notation +localnet=169.254.0.0/255.255.0.0 ;Zero conf local network +nat=yes ; Global NAT settings (Affects all peers and users) +canreinvite=no +;rtcachefriends=yes ; Cache realtime friends by adding them to the internal list +;rtupdate=yes ; Send registry updates to database using realtime? (yes|no) +;rtautoclear=yes ; Auto-Expire friends created on the fly on the same schedule +;ignoreregexpire=yes ; Enabling this setting has two functions: +; domain=myasterisk.dom +; domain=customer.com,customer-context +; autodomain=yes +; fromdomain=mydomain.tld ; When making outbound SIP INVITEs to + +#include sip-vicidial.conf + ; register SIP account on remote machine if using SIP trunks ; register => testSIPtrunk:test@10.10.10.16:5060 ; @@ -16,709 +78,3 @@ context = default ; host=10.10.10.16 ; dtmfmode=inband ; qualify=1000 - -[gs102] -disallow=all -allow=ulaw -allow=alaw -type=friend -username=gs102 -secret=test -host=dynamic -dtmfmode=inband -defaultip=10.10.10.16 -qualify=1000 -mailbox=102 - -[spa2000] -disallow=all -allow=ulaw -allow=alaw -type=friend -username=spa2000 -secret=test -host=dynamic -dtmfmode=inband -defaultip=10.10.10.17 -qualify=1000 -mailbox=2000 - -[spa2001] -disallow=all -allow=ulaw -allow=alaw -type=friend -username=spa2001 -secret=test -host=dynamic -dtmfmode=inband -defaultip=10.10.10.17 -qualify=1000 -mailbox=2001 - - - - - -[cc100] -disallow=all -allow=ulaw -allow=alaw -type=friend -username=cc100 -secret=test -host=dynamic -dtmfmode=inband -defaultip=192.168.1.249 -qualify=1000 -mailbox=100 - -[cc101] -disallow=all -allow=ulaw -allow=alaw -type=friend -username=cc101 -secret=test -host=dynamic -dtmfmode=inband -defaultip=192.168.1.249 -qualify=1000 -mailbox=101 - -[cc102] -disallow=all -allow=ulaw -allow=alaw -type=friend -username=cc102 -secret=test -host=dynamic -dtmfmode=inband -defaultip=192.168.1.249 -qualify=1000 -mailbox=102 - -[cc103] -disallow=all -allow=ulaw -allow=alaw -type=friend -username=cc103 -secret=test -host=dynamic -dtmfmode=inband -defaultip=192.168.1.249 -qualify=1000 -mailbox=103 - -[cc104] -disallow=all -allow=ulaw -allow=alaw -type=friend -username=cc104 -secret=test -host=dynamic -dtmfmode=inband -defaultip=192.168.1.249 -qualify=1000 -mailbox=104 - -[cc105] -disallow=all -allow=ulaw -allow=alaw -type=friend -username=cc105 -secret=test -host=dynamic -dtmfmode=inband -defaultip=192.168.1.249 -qualify=1000 -mailbox=105 - -[cc106] -disallow=all -allow=ulaw -allow=alaw -type=friend -username=cc106 -secret=test -host=dynamic -dtmfmode=inband -defaultip=192.168.1.249 -qualify=1000 -mailbox=106 - -[cc107] -disallow=all -allow=ulaw -allow=alaw -type=friend -username=cc107 -secret=test -host=dynamic -dtmfmode=inband -defaultip=192.168.1.249 -qualify=1000 -mailbox=107 - -[cc108] -disallow=all -allow=ulaw -allow=alaw -type=friend -username=cc108 -secret=test -host=dynamic -dtmfmode=inband -defaultip=192.168.1.249 -qualify=1000 -mailbox=108 - -[cc109] -disallow=all -allow=ulaw -allow=alaw -type=friend -username=cc109 -secret=test -host=dynamic -dtmfmode=inband -defaultip=192.168.1.249 -qualify=1000 -mailbox=109 - -[cc110] -disallow=all -allow=ulaw -allow=alaw -type=friend -username=cc110 -secret=test -host=dynamic -dtmfmode=inband -defaultip=192.168.1.249 -qualify=1100 -mailbox=110 - -[cc111] -disallow=all -allow=ulaw -allow=alaw -type=friend -username=cc111 -secret=test -host=dynamic -dtmfmode=inband -defaultip=192.168.1.249 -qualify=1100 -mailbox=111 - -[cc112] -disallow=all -allow=ulaw -allow=alaw -type=friend -username=cc112 -secret=test -host=dynamic -dtmfmode=inband -defaultip=192.168.1.249 -qualify=1100 -mailbox=112 - -[cc113] -disallow=all -allow=ulaw -allow=alaw -type=friend -username=cc113 -secret=test -host=dynamic -dtmfmode=inband -defaultip=192.168.1.249 -qualify=1100 -mailbox=113 - -[cc114] -disallow=all -allow=ulaw -allow=alaw -type=friend -username=cc114 -secret=test -host=dynamic -dtmfmode=inband -defaultip=192.168.1.249 -qualify=1100 -mailbox=114 - -[cc115] -disallow=all -allow=ulaw -allow=alaw -type=friend -username=cc115 -secret=test -host=dynamic -dtmfmode=inband -defaultip=192.168.1.249 -qualify=1100 -mailbox=115 - -[cc116] -disallow=all -allow=ulaw -allow=alaw -type=friend -username=cc116 -secret=test -host=dynamic -dtmfmode=inband -defaultip=192.168.1.249 -qualify=1100 -mailbox=116 - -[cc117] -disallow=all -allow=ulaw -allow=alaw -type=friend -username=cc117 -secret=test -host=dynamic -dtmfmode=inband -defaultip=192.168.1.249 -qualify=1100 -mailbox=117 - -[cc118] -disallow=all -allow=ulaw -allow=alaw -type=friend -username=cc118 -secret=test -host=dynamic -dtmfmode=inband -defaultip=192.168.1.249 -qualify=1100 -mailbox=118 - -[cc119] -disallow=all -allow=ulaw -allow=alaw -type=friend -username=cc119 -secret=test -host=dynamic -dtmfmode=inband -defaultip=192.168.1.249 -qualify=1100 -mailbox=119 - -[cc120] -disallow=all -allow=ulaw -allow=alaw -type=friend -username=cc120 -secret=test -host=dynamic -dtmfmode=inband -defaultip=192.168.1.249 -qualify=1200 -mailbox=120 - -[cc121] -disallow=all -allow=ulaw -allow=alaw -type=friend -username=cc121 -secret=test -host=dynamic -dtmfmode=inband -defaultip=192.168.1.249 -qualify=1200 -mailbox=121 - -[cc122] -disallow=all -allow=ulaw -allow=alaw -type=friend -username=cc122 -secret=test -host=dynamic -dtmfmode=inband -defaultip=192.168.1.249 -qualify=1200 -mailbox=122 - -[cc123] -disallow=all -allow=ulaw -allow=alaw -type=friend -username=cc123 -secret=test -host=dynamic -dtmfmode=inband -defaultip=192.168.1.249 -qualify=1200 -mailbox=123 - -[cc124] -disallow=all -allow=ulaw -allow=alaw -type=friend -username=cc124 -secret=test -host=dynamic -dtmfmode=inband -defaultip=192.168.1.249 -qualify=1200 -mailbox=124 - -[cc125] -disallow=all -allow=ulaw -allow=alaw -type=friend -username=cc125 -secret=test -host=dynamic -dtmfmode=inband -defaultip=192.168.1.249 -qualify=1200 -mailbox=125 - -[cc126] -disallow=all -allow=ulaw -allow=alaw -type=friend -username=cc126 -secret=test -host=dynamic -dtmfmode=inband -defaultip=192.168.1.249 -qualify=1200 -mailbox=126 - -[cc127] -disallow=all -allow=ulaw -allow=alaw -type=friend -username=cc127 -secret=test -host=dynamic -dtmfmode=inband -defaultip=192.168.1.249 -qualify=1200 -mailbox=127 - -[cc128] -disallow=all -allow=ulaw -allow=alaw -type=friend -username=cc128 -secret=test -host=dynamic -dtmfmode=inband -defaultip=192.168.1.249 -qualify=1200 -mailbox=128 - -[cc129] -disallow=all -allow=ulaw -allow=alaw -type=friend -username=cc129 -secret=test -host=dynamic -dtmfmode=inband -defaultip=192.168.1.249 -qualify=1200 -mailbox=129 - -[cc130] -disallow=all -allow=ulaw -allow=alaw -type=friend -username=cc130 -secret=test -host=dynamic -dtmfmode=inband -defaultip=192.168.1.249 -qualify=1300 -mailbox=130 - -[cc131] -disallow=all -allow=ulaw -allow=alaw -type=friend -username=cc131 -secret=test -host=dynamic -dtmfmode=inband -defaultip=192.168.1.249 -qualify=1300 -mailbox=131 - -[cc132] -disallow=all -allow=ulaw -allow=alaw -type=friend -username=cc132 -secret=test -host=dynamic -dtmfmode=inband -defaultip=192.168.1.249 -qualify=1300 -mailbox=132 - -[cc133] -disallow=all -allow=ulaw -allow=alaw -type=friend -username=cc133 -secret=test -host=dynamic -dtmfmode=inband -defaultip=192.168.1.249 -qualify=1300 -mailbox=133 - -[cc134] -disallow=all -allow=ulaw -allow=alaw -type=friend -username=cc134 -secret=test -host=dynamic -dtmfmode=inband -defaultip=192.168.1.249 -qualify=1300 -mailbox=134 - -[cc135] -disallow=all -allow=ulaw -allow=alaw -type=friend -username=cc135 -secret=test -host=dynamic -dtmfmode=inband -defaultip=192.168.1.249 -qualify=1300 -mailbox=135 - -[cc136] -disallow=all -allow=ulaw -allow=alaw -type=friend -username=cc136 -secret=test -host=dynamic -dtmfmode=inband -defaultip=192.168.1.249 -qualify=1300 -mailbox=136 - -[cc137] -disallow=all -allow=ulaw -allow=alaw -type=friend -username=cc137 -secret=test -host=dynamic -dtmfmode=inband -defaultip=192.168.1.249 -qualify=1300 -mailbox=137 - -[cc138] -disallow=all -allow=ulaw -allow=alaw -type=friend -username=cc138 -secret=test -host=dynamic -dtmfmode=inband -defaultip=192.168.1.249 -qualify=1300 -mailbox=138 - -[cc139] -disallow=all -allow=ulaw -allow=alaw -type=friend -username=cc139 -secret=test -host=dynamic -dtmfmode=inband -defaultip=192.168.1.249 -qualify=1300 -mailbox=139 - -[cc140] -disallow=all -allow=ulaw -allow=alaw -type=friend -username=cc140 -secret=test -host=dynamic -dtmfmode=inband -defaultip=192.168.1.249 -qualify=1400 -mailbox=140 - -[cc141] -disallow=all -allow=ulaw -allow=alaw -type=friend -username=cc141 -secret=test -host=dynamic -dtmfmode=inband -defaultip=192.168.1.249 -qualify=1400 -mailbox=141 - -[cc142] -disallow=all -allow=ulaw -allow=alaw -type=friend -username=cc142 -secret=test -host=dynamic -dtmfmode=inband -defaultip=192.168.1.249 -qualify=1400 -mailbox=142 - -[cc143] -disallow=all -allow=ulaw -allow=alaw -type=friend -username=cc143 -secret=test -host=dynamic -dtmfmode=inband -defaultip=192.168.1.249 -qualify=1400 -mailbox=143 - -[cc144] -disallow=all -allow=ulaw -allow=alaw -type=friend -username=cc144 -secret=test -host=dynamic -dtmfmode=inband -defaultip=192.168.1.249 -qualify=1400 -mailbox=144 - -[cc145] -disallow=all -allow=ulaw -allow=alaw -type=friend -username=cc145 -secret=test -host=dynamic -dtmfmode=inband -defaultip=192.168.1.249 -qualify=1400 -mailbox=145 - -[cc146] -disallow=all -allow=ulaw -allow=alaw -type=friend -username=cc146 -secret=test -host=dynamic -dtmfmode=inband -defaultip=192.168.1.249 -qualify=1400 -mailbox=146 - -[cc147] -disallow=all -allow=ulaw -allow=alaw -type=friend -username=cc147 -secret=test -host=dynamic -dtmfmode=inband -defaultip=192.168.1.249 -qualify=1400 -mailbox=147 - -[cc148] -disallow=all -allow=ulaw -allow=alaw -type=friend -username=cc148 -secret=test -host=dynamic -dtmfmode=inband -defaultip=192.168.1.249 -qualify=1400 -mailbox=148 - -[cc149] -disallow=all -allow=ulaw -allow=alaw -type=friend -username=cc149 -secret=test -host=dynamic -dtmfmode=inband -defaultip=192.168.1.249 -qualify=1400 -mailbox=149 - -[cc150] -disallow=all -allow=ulaw -allow=alaw -type=friend -username=cc150 -secret=test -host=dynamic -dtmfmode=inband -defaultip=192.168.1.249 -qualify=1400 -mailbox=150 diff --git a/docs/conf_examples/sip.conf.sample-1.4 b/docs/conf_examples/sip.conf.sample-1.4 new file mode 100644 index 00000000..a9925aa2 --- /dev/null +++ b/docs/conf_examples/sip.conf.sample-1.4 @@ -0,0 +1,104 @@ +[general] +context=default ; Default context for incoming calls +;allowguest=no ; Allow or reject guest calls (default is yes) +allowoverlap=no ; Disable overlap dialing support. (Default is yes) +;allowtransfer=no ; Disable all transfers (unless enabled in peers or users) +;realm=mydomain.tld ; Realm for digest authentication +bindport=5060 ; UDP Port to bind to (SIP standard port is 5060) +bindaddr=0.0.0.0 ; IP address to bind to (0.0.0.0 binds to all) +srvlookup=yes ; Enable DNS SRV lookups on outbound calls +;domain=mydomain.tld ; Set default domain for this host +;pedantic=yes ; Enable checking of tags in headers, +;tos_sip=cs3 ; Sets TOS for SIP packets. +;tos_audio=ef ; Sets TOS for RTP audio packets. +;tos_video=af41 ; Sets TOS for RTP video packets. +;maxexpiry=3600 ; Maximum allowed time of incoming registrations +;minexpiry=60 ; Minimum length of registrations/subscriptions (default 60) +;defaultexpiry=120 ; Default length of incoming/outgoing registration +;t1min=100 ; Minimum roundtrip time for messages to monitored hosts +;notifymimetype=text/plain ; Allow overriding of mime type in MWI NOTIFY +;checkmwi=10 ; Default time between mailbox checks for peers +;buggymwi=no ; Cisco SIP firmware doesn't support the MWI RFC +;vmexten=voicemail ; dialplan extension to reach mailbox sets the +disallow=all ; First disallow all codecs +allow=ulaw ; Allow codecs in order of preference +allow=gsm +mohinterpret=default +mohsuggest=default +language=en ; Default language setting for all users/peers +relaxdtmf=yes ; Relax dtmf handling +trustrpid = no ; If Remote-Party-ID should be trusted +sendrpid = yes ; If Remote-Party-ID should be sent +progressinband=no ; If we should generate in-band ringing always +;useragent=Asterisk PBX ; Allows you to change the user agent string +;promiscredir = no ; If yes, allows 302 or REDIR to non-local SIP address +;usereqphone = no ; If yes, ";user=phone" is added to uri that contains +dtmfmode = rfc2833 ; Set default dtmfmode for sending DTMF. Default: rfc2833 +;compactheaders = yes ; send compact sip headers. +videosupport=no ; Turn on support for SIP video. You need to turn this on +;maxcallbitrate=384 ; Maximum bitrate for video calls (default 384 kb/s) +callevents=yes ; generate manager events when sip ua +;alwaysauthreject = yes ; When an incoming INVITE or REGISTER is to be rejected, +;g726nonstandard = yes ; If the peer negotiates G726-32 audio, use AAL2 packing +;matchexterniplocally = yes ; Only substitute the externip or externhost setting if it matches +;regcontext=sipregistrations +rtptimeout=60 ; Terminate call if 60 seconds of no RTP or RTCP activity +;rtpholdtimeout=300 ; Terminate call if 300 seconds of no RTP or RTCP activity +;rtpkeepalive= ; Send keepalives in the RTP stream to keep NAT open +;sipdebug = yes ; Turn on SIP debugging by default, from +;recordhistory=yes ; Record SIP history by default +;dumphistory=yes ; Dump SIP history at end of SIP dialogue +;allowsubscribe=no ; Disable support for subscriptions. (Default is yes) +;subscribecontext = default ; Set a specific context for SUBSCRIBE requests +notifyringing = yes ; Notify subscriptions on RINGING state (default: no) +notifyhold = yes ; Notify subscriptions on HOLD state (default: no) +limitonpeers = yes ; Apply call limits on peers only. This will improve +;t38pt_udptl = yes ; Default false +;register => 1234:password@mysipprovider.com +;registertimeout=20 ; retry registration calls every 20 seconds (default) +;registerattempts=10 ; Number of registration attempts before we give up +;externip = 192.168.1.1 ; Address that we're going to put in outbound SIP +;externhost=test.test.com ; Alternatively you can specify a domain +;externrefresh=10 ; How often to refresh externhost if +localnet=192.168.0.0/255.255.0.0; All RFC 1918 addresses are local networks +localnet=10.0.0.0/255.0.0.0 ; Also RFC1918 +localnet=172.16.0.0/12 ; Another RFC1918 with CIDR notation +localnet=169.254.0.0/255.255.0.0 ;Zero conf local network +nat=yes ; Global NAT settings (Affects all peers and users) +canreinvite=no ; Asterisk by default tries to redirect the +;directrtpsetup=yes ; Enable the new experimental direct RTP setup. This sets up +;rtcachefriends=yes ; Cache realtime friends by adding them to the internal list +;rtsavesysname=yes ; Save systemname in realtime database at registration +;rtupdate=yes ; Send registry updates to database using realtime? (yes|no) +;rtautoclear=yes ; Auto-Expire friends created on the fly on the same schedule +;ignoreregexpire=yes ; Enabling this setting has two functions: +;domain=mydomain.tld,mydomain-incoming +;domain=1.2.3.4 ; Add IP address as local domain +;allowexternaldomains=no ; Disable INVITE and REFER to non-local domains +;autodomain=yes ; Turn this on to have Asterisk add local host +;fromdomain=mydomain.tld ; When making outbound SIP INVITEs to +jbenable = yes ; Enables the use of a jitterbuffer on the receiving side of a +jbforce = no ; Forces the use of a jitterbuffer on the receive side of a SIP +jbmaxsize = 100 ; Max length of the jitterbuffer in milliseconds. +jbresyncthreshold = 1000 ; Jump in the frame timestamps over which the jitterbuffer is +jbimpl = fixed ; Jitterbuffer implementation, used on the receiving side of a SIP +jblog = no ; Enables jitterbuffer frame logging. Defaults to "no". +qualify=yes ; By default, qualify all peers at 2000ms +limitonpeer = yes ; enable call limit on a per peer basis, different from limitonpeers + +#include sip-vicidial.conf + +; register SIP account on remote machine if using SIP trunks +; register => testSIPtrunk:test@10.10.10.16:5060 +; +; setup account for SIP trunking: +; [SIPtrunk] +; disallow=all +; allow=ulaw +; allow=alaw +; type=friend +; username=testSIPtrunk +; secret=test +; host=10.10.10.16 +; dtmfmode=inband +; qualify=1000 diff --git a/docs/conf_examples/voicemail.conf.sample b/docs/conf_examples/voicemail.conf.sample index e4dbdbfd..84874667 100644 --- a/docs/conf_examples/voicemail.conf.sample +++ b/docs/conf_examples/voicemail.conf.sample @@ -7,116 +7,12 @@ maxsilence=10 silencethreshold=128 maxlogins=3 +#include voicemail-vicidial.conf + [zonemessages] eastern=America/New_York|'vm-received' Q 'digits/at' IMp central=America/Chicago|'vm-received' Q 'digits/at' IMp central24=America/Chicago|'vm-received' q 'digits/at' H 'digits/hundred' M 'hours' [default] -100 => 8100,SIP 101 Phone -101 => 8101,SIP 101 Phone -102 => 8102,SIP 102 Phone -103 => 8103,SIP 103 Phone -104 => 8104,SIP 104 Phone -105 => 8105,SIP 105 Phone -106 => 8106,SIP 106 Phone -107 => 8107,SIP 107 Phone -108 => 8108,SIP 108 Phone -109 => 8109,SIP 109 Phone -110 => 8110,SIP 110 Phone -111 => 8111,SIP 111 Phone -112 => 8112,SIP 112 Phone -113 => 8113,SIP 113 Phone -114 => 8114,SIP 114 Phone -115 => 8115,SIP 115 Phone -116 => 8116,SIP 116 Phone -117 => 8117,SIP 117 Phone -118 => 8118,SIP 118 Phone -119 => 8119,SIP 119 Phone -120 => 8110,SIP 120 Phone -121 => 8121,SIP 121 Phone -122 => 8122,SIP 122 Phone -123 => 8123,SIP 123 Phone -124 => 8124,SIP 124 Phone -125 => 8125,SIP 125 Phone -126 => 8126,SIP 126 Phone -127 => 8127,SIP 127 Phone -128 => 8128,SIP 128 Phone -129 => 8129,SIP 129 Phone -130 => 8130,SIP 130 Phone -131 => 8131,SIP 131 Phone -132 => 8132,SIP 132 Phone -133 => 8133,SIP 133 Phone -134 => 8134,SIP 134 Phone -135 => 8135,SIP 135 Phone -136 => 8136,SIP 136 Phone -137 => 8137,SIP 137 Phone -138 => 8138,SIP 138 Phone -139 => 8139,SIP 139 Phone -140 => 8140,SIP 140 Phone -141 => 8141,SIP 141 Phone -142 => 8142,SIP 142 Phone -143 => 8143,SIP 143 Phone -144 => 8144,SIP 144 Phone -145 => 8145,SIP 145 Phone -146 => 8146,SIP 146 Phone -147 => 8147,SIP 147 Phone -148 => 8148,SIP 148 Phone -149 => 8149,SIP 149 Phone -150 => 8150,SIP 150 Phone - -300 => 8300,IAX 301 Phone -301 => 8301,IAX 301 Phone -302 => 8302,IAX 302 Phone -303 => 8303,IAX 303 Phone -304 => 8304,IAX 304 Phone -305 => 8305,IAX 305 Phone -306 => 8306,IAX 306 Phone -307 => 8307,IAX 307 Phone -308 => 8308,IAX 308 Phone -309 => 8309,IAX 309 Phone -310 => 8310,IAX 310 Phone -311 => 8311,IAX 311 Phone -312 => 8312,IAX 312 Phone -313 => 8313,IAX 313 Phone -314 => 8314,IAX 314 Phone -315 => 8315,IAX 315 Phone -316 => 8316,IAX 316 Phone -317 => 8317,IAX 317 Phone -318 => 8318,IAX 318 Phone -319 => 8319,IAX 319 Phone -320 => 8310,IAX 320 Phone -321 => 8321,IAX 321 Phone -322 => 8322,IAX 322 Phone -323 => 8323,IAX 323 Phone -324 => 8324,IAX 324 Phone -325 => 8325,IAX 325 Phone -326 => 8326,IAX 326 Phone -327 => 8327,IAX 327 Phone -328 => 8328,IAX 328 Phone -329 => 8329,IAX 329 Phone -330 => 8330,IAX 330 Phone -331 => 8331,IAX 331 Phone -332 => 8332,IAX 332 Phone -333 => 8333,IAX 333 Phone -334 => 8334,IAX 334 Phone -335 => 8335,IAX 335 Phone -336 => 8336,IAX 336 Phone -337 => 8337,IAX 337 Phone -338 => 8338,IAX 338 Phone -339 => 8339,IAX 339 Phone -340 => 8340,IAX 340 Phone -341 => 8341,IAX 341 Phone -342 => 8342,IAX 342 Phone -343 => 8343,IAX 343 Phone -344 => 8344,IAX 344 Phone -345 => 8345,IAX 345 Phone -346 => 8346,IAX 346 Phone -347 => 8347,IAX 347 Phone -348 => 8348,IAX 348 Phone -349 => 8349,IAX 349 Phone -350 => 8350,IAX 350 Phone - -2000 => 2000,Sipura Mailbox 1 -2001 => 2001,Sipura Mailbox 2 -3001 => 3001,Firefly Mailbox 1 +include => vicidial-auto diff --git a/extras/MySQL_AST_CREATE_tables.sql b/extras/MySQL_AST_CREATE_tables.sql index ebb0b13e..2dfebd8d 100644 --- a/extras/MySQL_AST_CREATE_tables.sql +++ b/extras/MySQL_AST_CREATE_tables.sql @@ -67,6 +67,8 @@ DBY_port INT(6) default '3306', outbound_cid VARCHAR(20), enable_sipsak_messages ENUM('0','1') default '0', email VARCHAR(100), +template_id VARCHAR(15) NOT NULL, +conf_override TEXT, index (server_ip) ); @@ -94,7 +96,10 @@ agi_output ENUM('NONE','STDERR','FILE','BOTH') default 'FILE', vicidial_balance_active ENUM('Y','N') default 'N', balance_trunks_offlimits SMALLINT(5) UNSIGNED default '0', recording_web_link ENUM('SERVER_IP','ALT_IP') default 'SERVER_IP', -alt_server_ip VARCHAR(100) default '' +alt_server_ip VARCHAR(100) default '', +active_asterisk_server ENUM('Y','N') default 'Y', +generate_vicidial_conf ENUM('Y','N') default 'Y', +rebuild_conf_files ENUM('Y','N') default 'Y' ); CREATE UNIQUE INDEX server_id on servers (server_id); @@ -1369,6 +1374,28 @@ index(callerid), index(lead_id) ); +CREATE TABLE vicidial_conf_templates ( +template_id VARCHAR(15) NOT NULL, +template_name VARCHAR(50) NOT NULL, +template_contents TEXT, +unique index (template_id) +); + +CREATE TABLE vicidial_server_carriers ( +carrier_id VARCHAR(15) NOT NULL, +carrier_name VARCHAR(50) NOT NULL, +registration_string VARCHAR(255), +template_id VARCHAR(15) NOT NULL, +account_entry TEXT, +protocol ENUM('SIP','Zap','IAX2','EXTERNAL') default 'SIP', +globals_string VARCHAR(255), +dialplan_entry TEXT, +server_ip VARCHAR(15) NOT NULL, +active ENUM('Y','N') default 'Y', +unique index(carrier_id), +index (server_ip) +); + ALTER TABLE vicidial_campaign_server_stats ENGINE=HEAP; ALTER TABLE live_channels ENGINE=HEAP; @@ -1435,6 +1462,12 @@ INSERT INTO vicidial_phone_codes (country_code, country, areacode, state, GMT_of INSERT INTO vicidial_phone_codes (country_code, country, areacode, state, GMT_offset, DST, DST_range, geographic_description) VALUES ('1','USA','730','IL','-6','Y','SSM-FSN',''); INSERT INTO vicidial_phone_codes (country_code, country, areacode, state, GMT_offset, DST, DST_range, geographic_description) VALUES ('1','DOM','829','','-4','N','','Dominican Republic'); +INSERT INTO vicidial_conf_templates SET template_id='SIP_generic',template_name='SIP phone generic',template_contents="type=friend\nhost=dynamic\ncanreinvite=no\ncontext=default"; +INSERT INTO vicidial_conf_templates SET template_id='IAX_generic',template_name='IAX phone generic',template_contents="type=friend\nhost=dynamic\nmaxauthreq=10\nauth=md5,plaintext,rsa\ncontext=default"; + +INSERT INTO vicidial_server_carriers SET carrier_id='PARAXIP', carrier_name='TEST ParaXip CPD example',registration_string='', template_id='--NONE--', account_entry="[paraxip]\ndisallow=all\nallow=ulaw\ntype=peer\nusername=paraxip\nfromuser=paraxip\nsecret=test\nfromdomain=10.10.10.16\nhost=10.10.10.15\ninsecure=port,invite\noutboundproxy=10.0.0.7", protocol='SIP', globals_string='TESTSIPTRUNKP = SIP/paraxip', dialplan_entry="exten => _5591999NXXXXXX,1,AGI(agi://127.0.0.1:4577/call_log)\nexten => _5591999NXXXXXX,2,Dial(${TESTSIPTRUNKP}/${EXTEN:4},,tTor)\nexten => _5591999NXXXXXX,3,Hangup", server_ip='10.10.10.15', active='N'; +INSERT INTO vicidial_server_carriers SET carrier_id='SIPEXAMPLE', carrier_name='TEST SIP carrier example',registration_string='register => testcarrier:test@10.10.10.15:5060', template_id='--NONE--', account_entry="[testcarrier]\ndisallow=all\nallow=ulaw\ntype=friend\nusername=testcarrier\nsecret=test\nhost=dynamic\ndtmfmode=rfc2833\n", protocol='SIP', globals_string='TESTSIPTRUNK = SIP/testcarrier', dialplan_entry="exten => _91999NXXXXXX,1,AGI(agi://127.0.0.1:4577/call_log)\nexten => _91999NXXXXXX,2,Dial(${TESTSIPTRUNK}/${EXTEN:2},,tTor)\nexten => _91999NXXXXXX,3,Hangup\n", server_ip='10.10.10.15', active='N'; +INSERT INTO vicidial_server_carriers SET carrier_id='IAXEXAMPLE', carrier_name='TEST IAX carrier example',registration_string='register => testcarrier:test@10.10.10.15:4569', template_id='--NONE--', account_entry="[testcarrier]\ndisallow=all\nallow=ulaw\ntype=friend\naccountcode=testcarrier\nsecret=test\nhost=dynamic\n", protocol='IAX2', globals_string='TESTIAXTRUNK = IAX2/testcarrier', dialplan_entry="exten => _71999NXXXXXX,1,AGI(agi://127.0.0.1:4577/call_log)\nexten => _71999NXXXXXX,2,Dial(${TESTIAXTRUNK}/${EXTEN:2},,tTor)\nexten => _71999NXXXXXX,3,Hangup\n", server_ip='10.10.10.15', active='N'; UPDATE system_settings SET qc_last_pull_time=NOW(); @@ -1456,7 +1489,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='1129'; +UPDATE system_settings SET db_schema_version='1130'; GRANT RELOAD ON *.* TO cron@'%'; GRANT RELOAD ON *.* TO cron@localhost; diff --git a/extras/upgrade_2.0.5.sql b/extras/upgrade_2.0.5.sql index e91b39d9..03a6c1ab 100644 --- a/extras/upgrade_2.0.5.sql +++ b/extras/upgrade_2.0.5.sql @@ -686,3 +686,42 @@ UPDATE system_settings SET db_schema_version='1128'; ALTER TABLE vicidial_users ADD download_lists ENUM('1','0') default '0'; UPDATE system_settings SET db_schema_version='1129'; + +ALTER TABLE servers ADD active_asterisk_server ENUM('Y','N') default 'Y'; +ALTER TABLE servers ADD generate_vicidial_conf ENUM('Y','N') default 'Y'; +ALTER TABLE servers ADD rebuild_conf_files ENUM('Y','N') default 'Y'; + +CREATE TABLE vicidial_conf_templates ( +template_id VARCHAR(15) NOT NULL, +template_name VARCHAR(50) NOT NULL, +template_contents TEXT, +unique index (template_id) +); + +CREATE TABLE vicidial_server_carriers ( +carrier_id VARCHAR(15) NOT NULL, +carrier_name VARCHAR(50) NOT NULL, +registration_string VARCHAR(255), +template_id VARCHAR(15) NOT NULL, +account_entry TEXT, +protocol ENUM('SIP','Zap','IAX2','EXTERNAL') default 'SIP', +globals_string VARCHAR(255), +dialplan_entry TEXT, +server_ip VARCHAR(15) NOT NULL, +active ENUM('Y','N') default 'Y', +unique index(carrier_id), +index (server_ip) +); + +ALTER TABLE phones ADD template_id VARCHAR(15) NOT NULL; +ALTER TABLE phones ADD conf_override TEXT; + +INSERT INTO vicidial_conf_templates SET template_id='SIP_generic',template_name='SIP phone generic',template_contents="type=friend\nhost=dynamic\ncanreinvite=no\ncontext=default"; +INSERT INTO vicidial_conf_templates SET template_id='IAX_generic',template_name='IAX phone generic',template_contents="type=friend\nhost=dynamic\nmaxauthreq=10\nauth=md5,plaintext,rsa\ncontext=default"; + +INSERT INTO vicidial_server_carriers SET carrier_id='PARAXIP', carrier_name='TEST ParaXip CPD example',registration_string='', template_id='--NONE--', account_entry="[paraxip]\ndisallow=all\nallow=ulaw\ntype=peer\nusername=paraxip\nfromuser=paraxip\nsecret=test\nfromdomain=10.10.10.16\nhost=10.10.10.15\ninsecure=port,invite\noutboundproxy=10.0.0.7", protocol='SIP', globals_string='TESTSIPTRUNKP = SIP/paraxip', dialplan_entry="exten => _5591999NXXXXXX,1,AGI(agi://127.0.0.1:4577/call_log)\nexten => _5591999NXXXXXX,2,Dial(${TESTSIPTRUNKP}/${EXTEN:4},,tTor)\nexten => _5591999NXXXXXX,3,Hangup", server_ip='10.10.10.15', active='N'; +INSERT INTO vicidial_server_carriers SET carrier_id='SIPEXAMPLE', carrier_name='TEST SIP carrier example',registration_string='register => testcarrier:test@10.10.10.15:5060', template_id='--NONE--', account_entry="[testcarrier]\ndisallow=all\nallow=ulaw\ntype=friend\nusername=testcarrier\nsecret=test\nhost=dynamic\ndtmfmode=rfc2833\n", protocol='SIP', globals_string='TESTSIPTRUNK = SIP/testcarrier', dialplan_entry="exten => _91999NXXXXXX,1,AGI(agi://127.0.0.1:4577/call_log)\nexten => _91999NXXXXXX,2,Dial(${TESTSIPTRUNK}/${EXTEN:2},,tTor)\nexten => _91999NXXXXXX,3,Hangup\n", server_ip='10.10.10.15', active='N'; +INSERT INTO vicidial_server_carriers SET carrier_id='IAXEXAMPLE', carrier_name='TEST IAX carrier example',registration_string='register => testcarrier:test@10.10.10.15:4569', template_id='--NONE--', account_entry="[testcarrier]\ndisallow=all\nallow=ulaw\ntype=friend\naccountcode=testcarrier\nsecret=test\nhost=dynamic\n", protocol='IAX2', globals_string='TESTIAXTRUNK = IAX2/testcarrier', dialplan_entry="exten => _71999NXXXXXX,1,AGI(agi://127.0.0.1:4577/call_log)\nexten => _71999NXXXXXX,2,Dial(${TESTIAXTRUNK}/${EXTEN:2},,tTor)\nexten => _71999NXXXXXX,3,Hangup\n", server_ip='10.10.10.15', active='N'; + +UPDATE system_settings SET db_schema_version='1130'; + diff --git a/install.pl b/install.pl index 26969fd4..c2c15ee2 100644 --- a/install.pl +++ b/install.pl @@ -15,6 +15,7 @@ # 80227-1536 - Added ip_relay to keepalive list # 80316-2208 - Added $PATHlogs/archive for backups # 80526-1345 - Added Timeclock auto-logout option 9 +# 90210-0319 - Added option to prompt for Asterisk version # ############################################ @@ -48,6 +49,8 @@ $VARDB_pass = '1234'; $VARDB_port = '3306'; # default keepalive processes: $VARactive_keepalives = '1234568'; +# default Asterisk version: +$VARasterisk_version = '1.2'; # default recording FTP archive variables: $VARFTP_host = '10.0.0.4'; $VARFTP_user = 'cron'; @@ -85,6 +88,7 @@ $CLIDB_user=0; $CLIDB_pass=0; $CLIDB_port=0; $CLIVARactive_keepalives=0; +$CLIVARasterisk_version=0; $CLIFTP_host=0; $CLIFTP_user=0; $CLIFTP_pass=0; @@ -165,6 +169,7 @@ if (length($ARGV[0])>1) print " 7 - AST_VDauto_dial_FILL (only for multi-server, this must only be on one server)\n"; print " 8 - ip_relay (used for blind agent monitoring)\n"; print " 9 - Timeclock auto-logout\n"; + print " [--asterisk_version] = set the asterisk version you want to install for\n"; print " [--copy_sample_conf_files] = copies the sample conf files to /etc/asterisk/\n"; print " [--FTP_host=192.168.0.2] = define recording archive server IP address at runtime\n"; print " [--FTP_user=cron] = define archive server name at runtime\n"; @@ -380,6 +385,18 @@ if (length($ARGV[0])>1) print " CLI active keepalive procs: $VARactive_keepalives\n"; } } + if ($args =~ /--asterisk_version=/i) # CLI defined asterisk version + { + @CLIastversionARY = split(/--asterisk_version=/,$args); + @CLIastversionARX = split(/ /,$CLIastversionARY[1]); + if (length($CLIastversionARX[0])>1) + { + $VARasterisk_version = $CLIastversionARX[0]; + $VARasterisk_version =~ s/ |\r|\n|\t//gi; + $CLIasterisk_version=1; + print " CLI asterisk version: $VARasterisk_version\n"; + } + } if ($args =~ /--FTP_host=/i) # CLI defined archive server address { @CLIFTP_hostARY = split(/--FTP_host=/,$args); @@ -942,6 +959,8 @@ if (-e "$PATHconf") {$VARDB_port = $line; $VARDB_port =~ s/.*=//gi;} if ( ($line =~ /^VARactive_keepalives/) && ($CLIactive_keepalives < 1) ) {$VARactive_keepalives = $line; $VARactive_keepalives =~ s/.*=//gi;} + if ( ($line =~ /^VARasterisk_version/) && ($CLIasterisk_version < 1) ) + {$VARasterisk_version = $line; $VARasterisk_version =~ s/.*=//gi;} if ( ($line =~ /^VARFTP_host/) && ($CLIFTP_host < 1) ) {$VARFTP_host = $line; $VARFTP_host =~ s/.*=//gi;} if ( ($line =~ /^VARFTP_user/) && ($CLIFTP_user < 1) ) @@ -1579,6 +1598,30 @@ else } ##### END active_keepalives prompting and check ##### + ##### BEGIN asterisk_version prompting and check ##### + $continue='NO'; + while ($continue =~/NO/) + { + print "\nEnter the Asterisk version that you are installing VICIDIAL for\n"; + print "(value should be listing of characters with no spaces: 123456)\n"; + print " 1.2\n"; + print " 1.4\n"; + print "Enter asterisk version or press enter for default: [$VARasterisk_version] "; + $PROMPTasterisk_version = ; + chomp($PROMPTasterisk_version); + if (length($PROMPTasterisk_version)>0) + { + $PROMPTasterisk_version =~ s/ |\n|\r|\t|\/$//gi; + $VARasterisk_version=$PROMPTasterisk_version; + $continue='YES'; + } + else + { + $continue='YES'; + } + } + ##### END asterisk_version prompting and check ##### + ##### BEGIN copy asterisk sample conf files prompt ##### $continue='NO'; while ($continue =~/NO/) @@ -2001,7 +2044,8 @@ else print " defined DB_user: $VARDB_user\n"; print " defined DB_pass: $VARDB_pass\n"; print " defined DB_port: $VARDB_port\n"; - print " defined active_keepalives $VARactive_keepalives\n"; + print " defined active_keepalives: $VARactive_keepalives\n"; + print " defined asterisk_version: $VARasterisk_version\n"; print " defined copying conf files: $PROMPTcopy_conf_files\n"; print " defined FTP_host: $VARFTP_host\n"; print " defined FTP_user: $VARFTP_user\n"; @@ -2073,6 +2117,9 @@ print conf "# 8 - ip_relay (used for blind agent monitoring)\n"; print conf "# 9 - Timeclock auto logout\n"; print conf "VARactive_keepalives => $VARactive_keepalives\n"; print conf "\n"; +print conf "# Asterisk version VICIDIAL is installed for\n"; +print conf "VARasterisk_version => $VARasterisk_version\n"; +print conf "\n"; print conf "# FTP recording archive connection information\n"; print conf "VARFTP_host => $VARFTP_host\n"; print conf "VARFTP_user => $VARFTP_user\n"; @@ -2193,18 +2240,33 @@ if ($NOWEB < 1) if ($PROMPTcopy_conf_files =~ /y/i) { print "Copying sample conf files to /etc/asterisk/...\n"; - `cp -f ./docs/conf_examples/extensions.conf.sample /etc/asterisk/extensions.conf`; + if ($VARasterisk_version =~ /^1.2/) + { + `cp -f ./docs/conf_examples/extensions.conf.sample /etc/asterisk/extensions.conf`; + `cp -f ./docs/conf_examples/iax.conf.sample /etc/asterisk/iax.conf`; + `cp -f ./docs/conf_examples/sip.conf.sample /etc/asterisk/sip.conf`; + } + else + { + `cp -f ./docs/conf_examples/extensions.conf.sample-1.4 /etc/asterisk/extensions.conf`; + `cp -f ./docs/conf_examples/iax.conf.sample-1.4 /etc/asterisk/iax.conf`; + `cp -f ./docs/conf_examples/sip.conf.sample-1.4 /etc/asterisk/sip.conf`; + } `cp -f ./docs/conf_examples/meetme.conf.sample /etc/asterisk/meetme.conf`; `cp -f ./docs/conf_examples/manager.conf.sample /etc/asterisk/manager.conf`; `cp -f ./docs/conf_examples/musiconhold.conf.sample /etc/asterisk/musiconhold.conf`; `cp -f ./docs/conf_examples/voicemail.conf.sample /etc/asterisk/voicemail.conf`; - `cp -f ./docs/conf_examples/sip.conf.sample /etc/asterisk/sip.conf`; `cp -f ./docs/conf_examples/logger.conf.sample /etc/asterisk/logger.conf`; - `cp -f ./docs/conf_examples/iax.conf.sample /etc/asterisk/iax.conf`; `cp -f ./docs/conf_examples/dnsmgr.conf.sample /etc/asterisk/dnsmgr.conf`; `cp -f ./docs/conf_examples/features.conf.sample /etc/asterisk/features.conf`; } +print "Creating auto-generated placeholder conf files in /etc/asterisk/...\n"; +`echo "[vicidial-auto] ;placeholder for auto-generated extensions conf" > /etc/asterisk/extensions-vicidial.conf`; +`echo "[vicidial-auto] ;placeholder for auto-generated iax conf" > /etc/asterisk/iax-vicidial.conf`; +`echo "[vicidial-auto] ;placeholder for auto-generated sip conf" > /etc/asterisk/sip-vicidial.conf`; +`echo "[vicidial-auto] ;placeholder for auto-generated voicemail conf" > /etc/asterisk/voicemail-vicidial.conf`; + ### format the new server_ip dialstring for example to use with extensions.conf $S='*'; @@ -2217,11 +2279,11 @@ if( $VARserver_ip =~ m/(\S+)\.(\S+)\.(\S+)\.(\S+)/ ) $VARremDIALstr = "$a$S$b$S$c$S$d"; } -print "\nIMPORTANT NOTE!\n"; -print "\nPlease remember to put these lines in your extensions.conf file:\n"; -print "exten => _$VARremDIALstr*.,1,Goto(default,\${EXTEN:16},1)\n"; -print "exten => _8600XXX*.,1,AGI(agi-VDADfixCXFER.agi)\n"; -print "exten => _78600XXX*.,1,AGI(agi-VDADfixCXFER.agi)\n"; +# print "\nIMPORTANT NOTE!\n"; +# print "\nPlease remember to put these lines in your extensions.conf file:\n"; +# print "exten => _$VARremDIALstr*.,1,Goto(default,\${EXTEN:16},1)\n"; +# print "exten => _8600XXX*.,1,AGI(agi-VDADfixCXFER.agi)\n"; +# print "exten => _78600XXX*.,1,AGI(agi-VDADfixCXFER.agi)\n"; print "\nASTGUICLIENT INSTALLATION FINISHED! ENJOY!\n"; diff --git a/translations/raw_translation_files/TO_BE_TRANSLATED_2.0.5.txt b/translations/raw_translation_files/TO_BE_TRANSLATED_2.0.5.txt index 8f531e2e..e365336c 100644 --- a/translations/raw_translation_files/TO_BE_TRANSLATED_2.0.5.txt +++ b/translations/raw_translation_files/TO_BE_TRANSLATED_2.0.5.txt @@ -389,6 +389,76 @@ CPD AMD Action:|| Click here for user multiple day status detail report|| Click here to download this list|| Download Lists:|| +Active Asterisk Server -<\/B> If Asterisk is not running on this server, or if VICIDIAL should not be using this server, or if are only using this server for other scripts like the hopper loading script you would want to set this to N. Default is Y|| +Generate conf files -<\/B> If you would like the system to auto-generate asterisk conf files based upon the phones entries, carrier entries and load balancing setup within VICIDIAL then set this to Y. Default is Y|| +Rebuild conf files -<\/B> If you want to force a rebuilding of the Asterisk conf files or if any of the phones or carrier entries have changed then this should be set to Y. After the conf files have been generated and Asterisk has been reloaded then this will be changed to N. Default is Y|| +Active Asterisk Server:|| +Generate conf files:|| +Rebuild conf files:|| +Show Templates|| +Add A New Template|| +ADD NEW CONF TEMPLATE|| +ADD NEW CARRIER|| +ADDING NEW CONF TEMPLATE|| +ADDING NEW CARRIER|| +MODIFY CONF TEMPLATE|| +MODIFY CARRIER|| +DELETE CONF TEMPLATE|| +DELETE CARRIER|| +CONF TEMPLATE LIST|| +CARRIER LIST|| +Template ID:|| +Template Name:|| +Template Contents:|| +Carrier ID:|| +Carrier Name:|| +Registration String:|| +Account Entry:|| +Protocol:|| +Globals String:|| +Dialplan Entry:|| +CONF TEMPLATE NOT ADDED|| +there is already a template in the system with this ID|| +CONF TEMPLATE ADDED|| +CARRIER NOT ADDED|| +there is already a carrier in the system with this ID|| +CONF TEMPLATE NOT MODIFIED|| +CARRIER NOT MODIFIED|| +CARRIER MODIFIED|| +CONF TEMPLATE NOT DELETED|| +Template ID be at least 2 characters in length|| +CONF TEMPLATE DELETION CONFIRMATION|| +Click here to delete conf template|| +CARRIER NOT DELETED|| +Carrier ID be at least 2 characters in length|| +CARRIER DELETION CONFIRMATION|| +Click here to delete carrier|| +CONF TEMPLATE DELETION COMPLETED|| +CARRIER DELETION COMPLETED|| +MODIFY A CONF TEMPLATE RECORD|| +DELETE THIS CONF TEMPLATE|| +MODIFY A CARRIER RECORD|| +DELETE THIS CARRIER|| +CARRIERS WITHIN THIS SERVER|| +CONF TEMPLATE LISTINGS|| +PHONES USING THIS CONF TEMPLATE|| +CARRIERS USING THIS CONF TEMPLATE|| +Conf Override:|| +Template ID -<\/B> This field needs to be at least 2 characters in length and no more than 15 characters in length, no spaces. This is the ID that will be used to identify the conf template throughout the system|| +Template Name -<\/B> This is the descriptive name of the conf file template entry|| +Template Contents -<\/B> This field is where you can enter in the specific settings to be used by all phones and-or carriers that are set to use this conf template. Fields that should NOT be included in this box are: secret, accountcode, account, username and mailbox|| +Carrier ID -<\/B> This field needs to be at least 2 characters in length and no more than 15 characters in length, no spaces. This is the ID that will be used to identify the carrier for this specific entry throughout the system|| +Carrier Name -<\/B> This is the descriptive name of the carrier entry|| +Registration String -<\/B> This field is where you can enter in the exact string needed in the IAX or SIP configuration file to register to the provider. Optional but highly recommended if your carrier allows registration|| +Template ID -<\/B> This optional field allows you to choose a conf file template for this carrier entry|| +Account Entry -<\/B> This field is used if you have not selected a template to use, and it is where you can enter in the specific account settings to be used for this carrier|| +Protocol -<\/B> This field allows you to define the protocol to use for the carrier entry. Currently only IAX and SIP are supported|| +Globals String -<\/B> This optional field allows you to define a global variable to use for the carrier in the dialplan|| +Dialplan Entry -<\/B> This optional field allows you to define a set of dialplan entries to use for this carrier|| +Server IP -<\/B> This is the server that this specific carrier record is associated with|| +Active -<\/B> This defines whether the carrier will be included in the auto-generated conf files or not|| +Conf Override Settings -<\/B> If populated, and the Template ID is set to --NONE-- then the contents of this field are used as the conf file entries for this phone. generate_vicidial_conf for this phones server must be set to Y for this to work. This field should NOT contain the [extension] line, that will be automatically generated|| +Template ID -<\/B> This is the conf file template ID that this phone entry will use for its Asterisk settings. Default is --NONE--|| ############################################################ CLIENT diff --git a/www/vicidial/admin.php b/www/vicidial/admin.php index df71381e..b8646261 100644 --- a/www/vicidial/admin.php +++ b/www/vicidial/admin.php @@ -889,6 +889,32 @@ if (isset($_GET["cpd_amd_action"])) {$cpd_amd_action=$_GET["cpd_amd_action"]; elseif (isset($_POST["cpd_amd_action"])) {$cpd_amd_action=$_POST["cpd_amd_action"];} if (isset($_GET["download_lists"])) {$download_lists=$_GET["download_lists"];} elseif (isset($_POST["download_lists"])) {$download_lists=$_POST["download_lists"];} +if (isset($_GET["active_asterisk_server"])) {$active_asterisk_server=$_GET["active_asterisk_server"];} + elseif (isset($_POST["active_asterisk_server"])) {$active_asterisk_server=$_POST["active_asterisk_server"];} +if (isset($_GET["generate_vicidial_conf"])) {$generate_vicidial_conf=$_GET["generate_vicidial_conf"];} + elseif (isset($_POST["generate_vicidial_conf"])) {$generate_vicidial_conf=$_POST["generate_vicidial_conf"];} +if (isset($_GET["rebuild_conf_files"])) {$rebuild_conf_files=$_GET["rebuild_conf_files"];} + elseif (isset($_POST["rebuild_conf_files"])) {$rebuild_conf_files=$_POST["rebuild_conf_files"];} +if (isset($_GET["template_id"])) {$template_id=$_GET["template_id"];} + elseif (isset($_POST["template_id"])) {$template_id=$_POST["template_id"];} +if (isset($_GET["conf_override"])) {$conf_override=$_GET["conf_override"];} + elseif (isset($_POST["conf_override"])) {$conf_override=$_POST["conf_override"];} +if (isset($_GET["template_name"])) {$template_name=$_GET["template_name"];} + elseif (isset($_POST["template_name"])) {$template_name=$_POST["template_name"];} +if (isset($_GET["template_contents"])) {$template_contents=$_GET["template_contents"];} + elseif (isset($_POST["template_contents"])) {$template_contents=$_POST["template_contents"];} +if (isset($_GET["carrier_id"])) {$carrier_id=$_GET["carrier_id"];} + elseif (isset($_POST["carrier_id"])) {$carrier_id=$_POST["carrier_id"];} +if (isset($_GET["carrier_name"])) {$carrier_name=$_GET["carrier_name"];} + elseif (isset($_POST["carrier_name"])) {$carrier_name=$_POST["carrier_name"];} +if (isset($_GET["registration_string"])) {$registration_string=$_GET["registration_string"];} + elseif (isset($_POST["registration_string"])) {$registration_string=$_POST["registration_string"];} +if (isset($_GET["account_entry"])) {$account_entry=$_GET["account_entry"];} + elseif (isset($_POST["account_entry"])) {$account_entry=$_POST["account_entry"];} +if (isset($_GET["globals_string"])) {$globals_string=$_GET["globals_string"];} + elseif (isset($_POST["globals_string"])) {$globals_string=$_POST["globals_string"];} +if (isset($_GET["dialplan_entry"])) {$dialplan_entry=$_GET["dialplan_entry"];} + elseif (isset($_POST["dialplan_entry"])) {$dialplan_entry=$_POST["dialplan_entry"];} if (isset($script_id)) {$script_id= strtoupper($script_id);} if (isset($lead_filter_id)) {$lead_filter_id = strtoupper($lead_filter_id);} @@ -1116,6 +1142,9 @@ $play_place_in_line = ereg_replace("[^NY]","",$play_place_in_line); $play_estimate_hold_time = ereg_replace("[^NY]","",$play_estimate_hold_time); $no_delay_call_route = ereg_replace("[^NY]","",$no_delay_call_route); $did_active = ereg_replace("[^NY]","",$did_active); +$active_asterisk_server = ereg_replace("[^NY]","",$active_asterisk_server); +$generate_vicidial_conf = ereg_replace("[^NY]","",$generate_vicidial_conf); +$rebuild_conf_files = ereg_replace("[^NY]","",$rebuild_conf_files); $qc_enabled = ereg_replace("[^0-9NY]","",$qc_enabled); @@ -1267,6 +1296,8 @@ $vtiger_create_call_record = ereg_replace("[^-\_0-9a-zA-Z]","",$vtiger_create_ca $vtiger_create_lead_record = ereg_replace("[^-\_0-9a-zA-Z]","",$vtiger_create_lead_record); $vtiger_screen_login = ereg_replace("[^-\_0-9a-zA-Z]","",$vtiger_screen_login); $cpd_amd_action = ereg_replace("[^-\_0-9a-zA-Z]","",$cpd_amd_action); +$template_id = ereg_replace("[^-\_0-9a-zA-Z]","",$template_id); +$carrier_id = ereg_replace("[^-\_0-9a-zA-Z]","",$carrier_id); ### ALPHA-NUMERIC and underscore and dash and comma $logins_list = ereg_replace("[^-\,\_0-9a-zA-Z]","",$logins_list); @@ -1320,6 +1351,8 @@ $alias_name = ereg_replace("[^ \.\,-\_0-9a-zA-Z]","",$alias_name); $shift_name = ereg_replace("[^ \.\,-\_0-9a-zA-Z]","",$shift_name); $did_description = ereg_replace("[^ \.\,-\_0-9a-zA-Z]","",$did_description); $alt_server_ip = ereg_replace("[^ \.\,-\_0-9a-zA-Z]","",$alt_server_ip); +$template_name = ereg_replace("[^ \.\,-\_0-9a-zA-Z]","",$template_name); +$carrier_name = ereg_replace("[^ \.\,-\_0-9a-zA-Z]","",$carrier_name); ### ALPHA-NUMERIC and underscore and dash and slash and at and dot $call_out_number_group = ereg_replace("[^-\.\:\/\@\_0-9a-zA-Z]","",$call_out_number_group); @@ -1354,6 +1387,12 @@ $lead_filter_sql = ereg_replace(";","",$lead_filter_sql); $list_mix_container = ereg_replace(";","",$list_mix_container); $survey_response_digit_map = ereg_replace(";","",$survey_response_digit_map); $survey_camp_record_dir = ereg_replace(";","",$survey_camp_record_dir); +$conf_override = ereg_replace(";","",$conf_override); +$template_contents = ereg_replace(";","",$template_contents); +$registration_string = ereg_replace(";","",$registration_string); +$account_entry = ereg_replace(";","",$account_entry); +$globals_string = ereg_replace(";","",$globals_string); +$dialplan_entry = ereg_replace(";","",$dialplan_entry); ### VARIABLES TO BE mysql_real_escape_string ### # $web_form_address @@ -1545,11 +1584,12 @@ $survey_camp_record_dir = ereg_replace(";","",$survey_camp_record_dir); # 90202-0112 - Added option to disable outbound autodialing(or list dialing) # 90202-0444 - Added cpd_amd_action option for processing of AMD messages # 90209-1339 - Added download_lists option to allow downloading of lists +# 90210-1042 - Added options for auto-generation of asterisk conf files # # 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.0.5-163'; -$build = '90209-1339'; +$admin_version = '2.0.5-164'; +$build = '90210-1042'; $STARTtime = date("U"); $SQLdate = date("Y-m-d H:i:s"); @@ -1709,6 +1749,8 @@ if ($ADD==1111111111) {$hh='admin'; $sh='times'; echo "Add New State Call Time"; if ($ADD==11111111111) {$hh='admin'; $sh='phones'; echo "ADD NEW PHONE";} if ($ADD==12111111111) {$hh='admin'; $sh='phones'; echo "ADD NEW PHONE ALIAS";} if ($ADD==111111111111) {$hh='admin'; $sh='server'; echo "ADD NEW SERVER";} +if ($ADD==131111111111) {$hh='admin'; $sh='server'; echo "ADD NEW CONF TEMPLATE";} +if ($ADD==141111111111) {$hh='admin'; $sh='server'; echo "ADD NEW CARRIER";} if ($ADD==1111111111111) {$hh='admin'; $sh='conference'; echo "ADD NEW CONFERENCE";} if ($ADD==11111111111111) {$hh='admin'; $sh='conference'; echo "ADD NEW VICIDIAL CONFERENCE";} if ($ADD=='2') {$hh='users'; echo "New User Addition";} @@ -1738,6 +1780,8 @@ if ($ADD==21111111111) {$hh='admin'; $sh='phones'; echo "ADDING NEW PHONE";} if ($ADD==22111111111) {$hh='admin'; $sh='phones'; echo "ADDING NEW PHONE ALIAS";} if ($ADD==211111111111) {$hh='admin'; $sh='server'; echo "ADDING NEW SERVER";} if ($ADD==221111111111) {$hh='admin'; $sh='server'; echo "ADDING NEW SERVER VICIDIAL TRUNK RECORD";} +if ($ADD==231111111111) {$hh='admin'; $sh='server'; echo "ADDING NEW CONF TEMPLATE";} +if ($ADD==241111111111) {$hh='admin'; $sh='server'; echo "ADDING NEW CARRIER";} if ($ADD==2111111111111) {$hh='admin'; $sh='conference'; echo "ADDING NEW CONFERENCE";} if ($ADD==21111111111111) {$hh='admin'; $sh='conference'; echo "ADDING NEW VICIDIAL CONFERENCE";} if ($ADD==221111111111111) {$hh='admin'; $sh='status'; echo "ADDING VICIDIAL SYSTEM STATUSES";} @@ -1790,6 +1834,8 @@ if ($ADD==3111111111) {$hh='admin'; $sh='times'; echo "Modify State Call Time";} if ($ADD==31111111111) {$hh='admin'; $sh='phones'; echo "MODIFY PHONE";} if ($ADD==32111111111) {$hh='admin'; $sh='phones'; echo "MODIFY PHONE ALIAS";} if ($ADD==311111111111) {$hh='admin'; $sh='server'; echo "MODIFY SERVER";} +if ($ADD==331111111111) {$hh='admin'; $sh='server'; echo "MODIFY CONF TEMPLATE";} +if ($ADD==341111111111) {$hh='admin'; $sh='server'; echo "MODIFY CARRIER";} if ($ADD==3111111111111) {$hh='admin'; $sh='conference'; echo "MODIFY CONFERENCE";} if ($ADD==31111111111111) {$hh='admin'; $sh='conference'; echo "MODIFY VICIDIAL CONFERENCE";} if ($ADD==311111111111111) {$hh='admin'; $sh='settings'; echo "MODIFY VICIDIAL SYSTEM SETTINGS";} @@ -1822,6 +1868,8 @@ if ($ADD==41111111111) {$hh='admin'; $sh='phones'; echo "MODIFY PHONE";} if ($ADD==42111111111) {$hh='admin'; $sh='phones'; echo "MODIFY PHONE ALIAS";} if ($ADD==411111111111) {$hh='admin'; $sh='server'; echo "MODIFY SERVER";} if ($ADD==421111111111) {$hh='admin'; $sh='server'; echo "MODIFY SERVER VICIDIAL TRUNK RECORD";} +if ($ADD==431111111111) {$hh='admin'; $sh='server'; echo "MODIFY CONF TEMPLATE";} +if ($ADD==441111111111) {$hh='admin'; $sh='server'; echo "MODIFY CARRIER";} if ($ADD==4111111111111) {$hh='admin'; $sh='conference'; echo "MODIFY CONFERENCE";} if ($ADD==41111111111111) {$hh='admin'; $sh='conference'; echo "MODIFY VICIDIAL CONFERENCE";} if ($ADD==411111111111111) {$hh='admin'; $sh='settings'; echo "MODIFY VICIDIAL SYSTEM SETTINGS";} @@ -1845,6 +1893,8 @@ if ($ADD==5111111111) {$hh='admin'; $sh='times'; echo "Delete State Call Time";} if ($ADD==51111111111) {$hh='admin'; $sh='phones'; echo "DELETE PHONE";} if ($ADD==52111111111) {$hh='admin'; $sh='phones'; echo "DELETE PHONE ALIAS";} if ($ADD==511111111111) {$hh='admin'; $sh='server'; echo "DELETE SERVER";} +if ($ADD==531111111111) {$hh='admin'; $sh='server'; echo "DELETE CONF TEMPLATE";} +if ($ADD==541111111111) {$hh='admin'; $sh='server'; echo "DELETE CARRIER";} if ($ADD==5111111111111) {$hh='admin'; $sh='conference'; echo "DELETE CONFERENCE";} if ($ADD==51111111111111) {$hh='admin'; $sh='conference'; echo "DELETE VICIDIAL CONFERENCE";} if ($ADD==6) {$hh='users'; echo "Delete User";} @@ -1870,6 +1920,8 @@ if ($ADD==61111111111) {$hh='admin'; $sh='phones'; echo "DELETE PHONE";} if ($ADD==62111111111) {$hh='admin'; $sh='phones'; echo "DELETE PHONE ALIAS";} if ($ADD==611111111111) {$hh='admin'; $sh='server'; echo "DELETE SERVER";} if ($ADD==621111111111) {$hh='admin'; $sh='server'; echo "DELETE SERVER VICIDIAL TRUNK RECORD";} +if ($ADD==621111111111) {$hh='admin'; $sh='server'; echo "DELETE CONF TEMPLATE";} +if ($ADD==621111111111) {$hh='admin'; $sh='server'; echo "DELETE CARRIER";} if ($ADD==6111111111111) {$hh='admin'; $sh='conference'; echo "DELETE CONFERENCE";} if ($ADD==61111111111111) {$hh='admin'; $sh='conference'; echo "DELETE VICIDIAL CONFERENCE";} if ($ADD==73) {$hh='campaigns'; echo "Dialable Lead Count";} @@ -1893,6 +1945,8 @@ if ($ADD==1000000000) {$hh='admin'; $sh='times'; echo "State Call Times";} if ($ADD==10000000000) {$hh='admin'; $sh='phones'; echo "PHONE LIST";} if ($ADD==12000000000) {$hh='admin'; $sh='phones'; echo "PHONE ALIAS LIST";} if ($ADD==100000000000) {$hh='admin'; $sh='server'; echo "SERVER LIST";} +if ($ADD==130000000000) {$hh='admin'; $sh='server'; echo "CONF TEMPLATE LIST";} +if ($ADD==140000000000) {$hh='admin'; $sh='server'; echo "CARRIER LIST";} if ($ADD==1000000000000) {$hh='admin'; $sh='conference'; echo "CONFERENCE LIST";} if ($ADD==10000000000000) {$hh='admin'; $sh='conference'; echo "VICIDIAL CONFERENCE LIST";} if ($ADD==550) {$hh='users'; echo "Search Form";} @@ -2075,7 +2129,7 @@ if ( ( (strlen($ADD)>4) && ($ADD < 99998) ) or ($ADD==3) or (($ADD>20) and ($ADD ##### BEGIN get inbound groups listing for checkboxes ##### $xfer_groupsSQL=''; - if ( (($ADD>20) and ($ADD<70)) and ($ADD!=41) ) + if ( (($ADD>20) and ($ADD<70)) and ($ADD!=41) or ( ($ADD==41) and (eregi('list_activation', $stage))) ) { $stmt="SELECT closer_campaigns,xfer_groups from vicidial_campaigns where campaign_id='$campaign_id';"; $rslt=mysql_query($stmt, $link); @@ -4311,6 +4365,18 @@ if ($SSoutbound_autodial_active > 0)
Phones Email - The email address associated with this phone entry. This is used for voicemail settings. +
+ +
+Template ID - This is the conf file template ID that this phone entry will use for its Asterisk settings. Default is --NONE--. + +
+
+
+Conf Override Settings - If populated, and the Template ID is set to --NONE-- then the contents of this field are used as the conf file entries for this phone. generate_vicidial_conf for this phones server must be set to Y for this to work. This field should NOT contain the [extension] line, that will be automatically generated. + + +



@@ -4435,6 +4501,99 @@ if ($SSoutbound_autodial_active > 0)
Alternate Recording Server IP - This setting is where you can put a server IP or other machine name that can be used in place of the server_ip in the links to recordings within the admin web pages. Default is empty. +
+
+
+Active Asterisk Server - If Asterisk is not running on this server, or if VICIDIAL should not be using this server, or if are only using this server for other scripts like the hopper loading script you would want to set this to N. Default is Y. + +
+
+
+Generate conf files - If you would like the system to auto-generate asterisk conf files based upon the phones entries, carrier entries and load balancing setup within VICIDIAL then set this to Y. Default is Y. + +
+
+
+Rebuild conf files - If you want to force a rebuilding of the Asterisk conf files or if any of the phones or carrier entries have changed then this should be set to Y. After the conf files have been generated and Asterisk has been reloaded then this will be changed to N. Default is Y. + + + + + +



+ +vicidial_conf_templates TABLE

+
+
+Template ID - This field needs to be at least 2 characters in length and no more than 15 characters in length, no spaces. This is the ID that will be used to identify the conf template throughout the system. + +
+
+
+Template Name - This is the descriptive name of the conf file template entry. + +
+
+
+Template Contents - This field is where you can enter in the specific settings to be used by all phones and-or carriers that are set to use this conf template. Fields that should NOT be included in this box are: secret, accountcode, account, username and mailbox. + + + + + +



+ +vicidial_server_carriers TABLE

+
+
+Carrier ID - This field needs to be at least 2 characters in length and no more than 15 characters in length, no spaces. This is the ID that will be used to identify the carrier for this specific entry throughout the system. + +
+
+
+Carrier Name - This is the descriptive name of the carrier entry. + +
+
+
+Registration String - This field is where you can enter in the exact string needed in the IAX or SIP configuration file to register to the provider. Optional but highly recommended if your carrier allows registration. + +
+
+
+Template ID - This optional field allows you to choose a conf file template for this carrier entry. + +
+
+
+Account Entry - This field is used if you have not selected a template to use, and it is where you can enter in the specific account settings to be used for this carrier. + +
+
+
+Protocol - This field allows you to define the protocol to use for the carrier entry. Currently only IAX and SIP are supported. + +
+
+
+Globals String - This optional field allows you to define a global variable to use for the carrier in the dialplan. + +
+
+
+Dialplan Entry - This optional field allows you to define a set of dialplan entries to use for this carrier. + +
+
+
+Server IP - This is the server that this specific carrier record is associated with. + +
+
+
+Active - This defines whether the carrier will be included in the auto-generated conf files or not. + + @@ -5361,7 +5520,7 @@ if (strlen($admin_hh) > 1) { 1) { ?> - >
> Show Servers   |   > Add A New Server + >> Show Servers   |   > Add A New Server   |   > Show Templates   |   > Add A New Template   |   > Show Carriers   |   > Add A New Carrier 1) { ?> @@ -5408,28 +5567,28 @@ if (strlen($reports_hh) > 1) { ###################### if ($ADD=="1") -{ - if ($LOGmodify_users==1) { - echo "
\n"; - echo ""; - - echo "
ADD A NEW USER
\n"; - echo "\n"; - echo "\n"; - echo "
\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "
User Number: $NWB#vicidial_users-user$NWE
Password: $NWB#vicidial_users-pass$NWE
Full Name: $NWB#vicidial_users-full_name$NWE
User Level: $NWB#vicidial_users-user_level$NWE
User Group: \n"; - echo "\n"; - echo "$NWB#vicidial_users-user_group$NWE\n"; - echo "\n"; - echo "
\n"; + echo ""; + + echo "
ADD A NEW USER\n"; + echo "\n"; + echo "\n"; + echo "
\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "$NWB#vicidial_users-user_group$NWE\n"; + echo "\n"; + echo "
User Number: $NWB#vicidial_users-user$NWE
Password: $NWB#vicidial_users-pass$NWE
Full Name: $NWB#vicidial_users-full_name$NWE
User Level: $NWB#vicidial_users-user_level$NWE
User Group:
Phone Login: $NWB#vicidial_users-phone_login$NWE
Phone Pass: $NWB#vicidial_users-phone_pass$NWE
\n"; } - echo "$Ugroups_list"; - echo "\n"; - echo "
Phone Login: $NWB#vicidial_users-phone_login$NWE
Phone Pass: $NWB#vicidial_users-phone_pass$NWE
\n"; - } else - { - echo "You do not have permission to view this page\n"; - exit; + { + echo "You do not have permission to view this page\n"; + exit; + } } -} ###################### @@ -5463,24 +5623,24 @@ if ($ADD=="1") ###################### if ($ADD=="1A") -{ - if ($LOGmodify_users==1) { - echo "
\n"; - echo ""; + if ($LOGmodify_users==1) + { + echo "\n"; - echo "\n"; - echo "
\n"; + echo ""; - echo "
COPY USER\n"; - echo "\n"; - echo "\n"; - echo "
\n"; - echo "\n"; - echo "\n"; - echo "\n"; + echo "
COPY USER\n"; + echo "\n"; + echo "\n"; + echo "
User Number: $NWB#vicidial_users-user$NWE
Password: $NWB#vicidial_users-pass$NWE
Full Name: $NWB#vicidial_users-full_name$NWE
\n"; + echo "\n"; + echo "\n"; + echo "\n"; - if ($LOGuser_level==9) {$levelMAX=10;} - else {$levelMAX=$LOGuser_level;} + if ($LOGuser_level==9) {$levelMAX=10;} + else {$levelMAX=$LOGuser_level;} - echo "\n"; + echo "\n"; + echo "
User Number: $NWB#vicidial_users-user$NWE
Password: $NWB#vicidial_users-pass$NWE
Full Name: $NWB#vicidial_users-full_name$NWE
Source User:
Source User: $NWB#vicidial_users-user$NWE
\n"; } - echo "$Uusers_list"; - echo "$NWB#vicidial_users-user$NWE
\n"; - } else - { - echo "You do not have permission to view this page\n"; - exit; + { + echo "You do not have permission to view this page\n"; + exit; + } } -} ###################### @@ -5511,49 +5672,49 @@ if ($ADD=="1A") ###################### if ($ADD==11) -{ + { if ($LOGmodify_campaigns==1) - { - echo "
\n"; - echo ""; + { + echo "\n"; - echo "\n"; - if ($SSoutbound_autodial_active > 0) - { - echo "\n"; - } - echo "\n"; - echo "\n"; - echo "\n"; - echo "
\n"; + echo ""; - echo "
ADD A NEW CAMPAIGN\n"; - echo "\n"; - echo "
\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - if ($SSoutbound_autodial_active > 0) - { - echo "\n"; - echo "\n"; - echo "\n"; + echo "
ADD A NEW CAMPAIGN\n"; + echo "\n"; + echo "
Campaign ID: $NWB#vicidial_campaigns-campaign_id$NWE
Campaign Name: $NWB#vicidial_campaigns-campaign_name$NWE
Campaign Description: $NWB#vicidial_campaigns-campaign_description$NWE
Active: $NWB#vicidial_campaigns-active$NWE
Park Extension: $NWB#vicidial_campaigns-park_ext$NWE
Park Filename: $NWB#vicidial_campaigns-park_file_name$NWE
Web Form: $NWB#vicidial_campaigns-web_form_address$NWE
Allow Closers: $NWB#vicidial_campaigns-allow_closers$NWE
Hopper Level: $NWB#vicidial_campaigns-hopper_level$NWE
Auto Dial Level: (0 = off)$NWB#vicidial_campaigns-auto_dial_level$NWE
\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + if ($SSoutbound_autodial_active > 0) + { + echo "\n"; + echo "\n"; + echo "\n"; + } + echo "\n"; + echo "\n"; + if ($SSoutbound_autodial_active > 0) + { + echo "\n"; + } + echo "\n"; + echo "\n"; + echo "\n"; + echo "
Campaign ID: $NWB#vicidial_campaigns-campaign_id$NWE
Campaign Name: $NWB#vicidial_campaigns-campaign_name$NWE
Campaign Description: $NWB#vicidial_campaigns-campaign_description$NWE
Active: $NWB#vicidial_campaigns-active$NWE
Park Extension: $NWB#vicidial_campaigns-park_ext$NWE
Park Filename: $NWB#vicidial_campaigns-park_file_name$NWE
Web Form: $NWB#vicidial_campaigns-web_form_address$NWE
Allow Closers: $NWB#vicidial_campaigns-allow_closers$NWE
Hopper Level: $NWB#vicidial_campaigns-hopper_level$NWE
Auto Dial Level: (0 = off)$NWB#vicidial_campaigns-auto_dial_level$NWE
Next Agent Call: $NWB#vicidial_campaigns-next_agent_call$NWE
Local Call Time: $NWB#vicidial_campaigns-local_call_time$NWE
Voicemail: $NWB#vicidial_campaigns-voicemail_ext$NWE
Script: $NWB#vicidial_campaigns-campaign_script$NWE
Get Call Launch: $NWB#vicidial_campaigns-get_call_launch$NWE
\n"; } - echo "
Next Agent Call: $NWB#vicidial_campaigns-next_agent_call$NWE
Local Call Time: $NWB#vicidial_campaigns-local_call_time$NWE
Voicemail: $NWB#vicidial_campaigns-voicemail_ext$NWE
Script: $NWB#vicidial_campaigns-campaign_script$NWE
Get Call Launch: $NWB#vicidial_campaigns-get_call_launch$NWE
\n"; - } else - { - echo "You do not have permission to view this page\n"; - exit; + { + echo "You do not have permission to view this page\n"; + exit; + } } -} ###################### @@ -5561,64 +5722,19 @@ if ($ADD==11) ###################### if ($ADD==12) -{ + { if ($LOGmodify_campaigns==1) - { - echo "
\n"; - echo ""; + { + echo "
\n"; + echo ""; - echo "
COPY A CAMPAIGN\n"; - echo "\n"; - echo "
\n"; - echo "\n"; - echo "\n"; + echo "
COPY A CAMPAIGN\n"; + echo "\n"; + echo "
Campaign ID: $NWB#vicidial_campaigns-campaign_id$NWE
Campaign Name: $NWB#vicidial_campaigns-campaign_name$NWE
\n"; + echo "\n"; + echo "\n"; - echo "\n"; - - echo "\n"; - echo "\n"; - echo "
Campaign ID: $NWB#vicidial_campaigns-campaign_id$NWE
Campaign Name: $NWB#vicidial_campaigns-campaign_name$NWE
Source Campaign: $NWB#vicidial_campaigns-campaign_id$NWE
NOTE: Copying a campaign will copy all settings from the master campaign you select, but it will not copy a campaign-specific DNC list if there was one on the selected master campaign.
\n"; - } - else - { - echo "You do not have permission to view this page\n"; - exit; - } -} - - -###################### -# ADD=111 display the ADD NEW LIST FORM SCREEN -###################### - -if ($ADD==111) -{ - if ($LOGmodify_lists==1) - { - echo "\n"; + + echo "\n"; + echo "\n"; + echo "
\n"; - echo ""; - - echo "
ADD A NEW LIST\n"; - echo "\n"; - echo "
\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "
List ID: (digits only)$NWB#vicidial_lists-list_id$NWE
List Name: $NWB#vicidial_lists-list_name$NWE
List Description: $NWB#vicidial_lists-list_description$NWE
Campaign:
Source Campaign: $NWB#vicidial_lists-campaign_id$NWE
Active: $NWB#vicidial_lists-active$NWE
\n"; - } + echo "$campaigns_list"; + echo "$NWB#vicidial_campaigns-campaign_id$NWE
NOTE: Copying a campaign will copy all settings from the master campaign you select, but it will not copy a campaign-specific DNC list if there was one on the selected master campaign.
\n"; + } else - { - echo "You do not have permission to view this page\n"; - exit; + { + echo "You do not have permission to view this page\n"; + exit; + } + } + + +###################### +# ADD=111 display the ADD NEW LIST FORM SCREEN +###################### + +if ($ADD==111) + { + if ($LOGmodify_lists==1) + { + echo "
\n"; + echo ""; + + echo "
ADD A NEW LIST\n"; + echo "\n"; + echo "
\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "
List ID: (digits only)$NWB#vicidial_lists-list_id$NWE
List Name: $NWB#vicidial_lists-list_name$NWE
List Description: $NWB#vicidial_lists-list_description$NWE
Campaign: $NWB#vicidial_lists-campaign_id$NWE
Active: $NWB#vicidial_lists-active$NWE
\n"; + } + else + { + echo "You do not have permission to view this page\n"; + exit; + } } -} ###################### @@ -5652,121 +5814,120 @@ if ($ADD==111) ###################### if ($ADD==121) -{ -echo "
\n"; -echo ""; - -$campaigns_list = "\n"; - -$stmt="SELECT campaign_id,campaign_name from vicidial_campaigns where use_campaign_dnc='Y' order by campaign_id"; -$rslt=mysql_query($stmt, $link); -$campaigns_to_print = mysql_num_rows($rslt); - -$o=0; -while ($campaigns_to_print > $o) { - $rowx=mysql_fetch_row($rslt); - $campaigns_list .= "\n"; - $o++; - } + echo "
\n"; + echo ""; -if (strlen($phone_numbers) > 2) - { - $PN = explode("\n",$phone_numbers); - $PNct = count($PN); - $p=0; - while ($p < $PNct) + $campaigns_list = "\n"; + + $stmt="SELECT campaign_id,campaign_name from vicidial_campaigns where use_campaign_dnc='Y' order by campaign_id"; + $rslt=mysql_query($stmt, $link); + $campaigns_to_print = mysql_num_rows($rslt); + + $o=0; + while ($campaigns_to_print > $o) { - if (ereg('SYSTEM_INTERNAL',$campaign_id)) - { - $stmt="SELECT count(*) from vicidial_dnc where phone_number='$PN[$p]';"; - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - if ($row[0] > 0) - {echo "
DNC NOT ADDED - This phone number is already in the Do Not Call List: $PN[$p]\n";} - else - { - $stmt="INSERT INTO vicidial_dnc (phone_number) values('$PN[$p]');"; - $rslt=mysql_query($stmt, $link); - - echo "
DNC ADDED: $PN[$p]\n"; - } - } - else - { - $stmt="SELECT count(*) from vicidial_campaign_dnc where phone_number='$PN[$p]' and campaign_id='$campaign_id';"; - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - if ($row[0] > 0) - {echo "
DNC NOT ADDED - This phone number is already in the Do Not Call List: $PN[$p] $campaign_id\n";} - else - { - $stmt="INSERT INTO vicidial_campaign_dnc (phone_number,campaign_id) values('$PN[$p]','$campaign_id');"; - $rslt=mysql_query($stmt, $link); - - echo "
DNC ADDED: $PN[$p] $campaign_id\n"; - } - } - $p++; + $rowx=mysql_fetch_row($rslt); + $campaigns_list .= "\n"; + $o++; } - ### LOG INSERTION TO LOG FILE ### - if ($WeBRooTWritablE > 0) + if (strlen($phone_numbers) > 2) { - $fp = fopen ("./admin_changes_log.txt", "a"); - fwrite ($fp, "$date|ADD A NEW DNC NUMBER|$PHP_AUTH_USER|$ip|'$phone_number','$campaign_id'|\n"); - fclose($fp); + $PN = explode("\n",$phone_numbers); + $PNct = count($PN); + $p=0; + while ($p < $PNct) + { + if (ereg('SYSTEM_INTERNAL',$campaign_id)) + { + $stmt="SELECT count(*) from vicidial_dnc where phone_number='$PN[$p]';"; + $rslt=mysql_query($stmt, $link); + $row=mysql_fetch_row($rslt); + if ($row[0] > 0) + {echo "
DNC NOT ADDED - This phone number is already in the Do Not Call List: $PN[$p]\n";} + else + { + $stmt="INSERT INTO vicidial_dnc (phone_number) values('$PN[$p]');"; + $rslt=mysql_query($stmt, $link); + + echo "
DNC ADDED: $PN[$p]\n"; + } + } + else + { + $stmt="SELECT count(*) from vicidial_campaign_dnc where phone_number='$PN[$p]' and campaign_id='$campaign_id';"; + $rslt=mysql_query($stmt, $link); + $row=mysql_fetch_row($rslt); + if ($row[0] > 0) + {echo "
DNC NOT ADDED - This phone number is already in the Do Not Call List: $PN[$p] $campaign_id\n";} + else + { + $stmt="INSERT INTO vicidial_campaign_dnc (phone_number,campaign_id) values('$PN[$p]','$campaign_id');"; + $rslt=mysql_query($stmt, $link); + + echo "
DNC ADDED: $PN[$p] $campaign_id\n"; + } + } + $p++; + } + + ### LOG INSERTION TO LOG FILE ### + if ($WeBRooTWritablE > 0) + { + $fp = fopen ("./admin_changes_log.txt", "a"); + fwrite ($fp, "$date|ADD A NEW DNC NUMBER|$PHP_AUTH_USER|$ip|'$phone_number','$campaign_id'|\n"); + fclose($fp); + } } + + echo "
ADD NUMBERS TO THE DNC LIST\n"; + echo "\n"; + echo "
\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "
List:
Phone Numbers:

(one phone number per line only)
$NWB#vicidial_list-dnc$NWE
\n"; } -echo "
ADD NUMBERS TO THE DNC LIST\n"; -echo "\n"; -echo "
\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "
List:
Phone Numbers:

(one phone number per line only)
$NWB#vicidial_list-dnc$NWE
\n"; - -} - ###################### # ADD=1111 display the ADD NEW INBOUND GROUP SCREEN ###################### if ($ADD==1111) -{ + { if ($LOGmodify_ingroups==1) - { - echo "
\n"; - echo ""; + { + echo "
\n"; + echo ""; - echo "
ADD A NEW INBOUND GROUP\n"; - echo "\n"; - echo "
\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "
Group ID: (no spaces)$NWB#vicidial_inbound_groups-group_id$NWE
Group Name: $NWB#vicidial_inbound_groups-group_name$NWE
Group Color: $NWB#vicidial_inbound_groups-group_color$NWE
Active: $NWB#vicidial_inbound_groups-active$NWE
Web Form: $NWB#vicidial_inbound_groups-web_form_address$NWE
Voicemail: $NWB#vicidial_inbound_groups-voicemail_ext$NWE
Next Agent Call: $NWB#vicidial_inbound_groups-next_agent_call$NWE
Fronter Display: $NWB#vicidial_inbound_groups-fronter_display$NWE
Script: $NWB#vicidial_inbound_groups-ingroup_script$NWE
Get Call Launch: $NWB#vicidial_inbound_groups-get_call_launch$NWE
\n"; - } + echo "
ADD A NEW INBOUND GROUP\n"; + echo "\n"; + echo "
\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "
Group ID: (no spaces)$NWB#vicidial_inbound_groups-group_id$NWE
Group Name: $NWB#vicidial_inbound_groups-group_name$NWE
Group Color: $NWB#vicidial_inbound_groups-group_color$NWE
Active: $NWB#vicidial_inbound_groups-active$NWE
Web Form: $NWB#vicidial_inbound_groups-web_form_address$NWE
Voicemail: $NWB#vicidial_inbound_groups-voicemail_ext$NWE
Next Agent Call: $NWB#vicidial_inbound_groups-next_agent_call$NWE
Fronter Display: $NWB#vicidial_inbound_groups-fronter_display$NWE
Script: $NWB#vicidial_inbound_groups-ingroup_script$NWE
Get Call Launch: $NWB#vicidial_inbound_groups-get_call_launch$NWE
\n"; + } else - { - echo "You do not have permission to view this page\n"; - exit; + { + echo "You do not have permission to view this page\n"; + exit; + } } -} ###################### @@ -5774,44 +5935,44 @@ if ($ADD==1111) ###################### if ($ADD==1211) -{ - if ($LOGmodify_ingroups==1) { - echo "
\n"; - echo ""; + if ($LOGmodify_ingroups==1) + { + echo "\n"; + echo "
\n"; + echo ""; - echo "
COPY INBOUND GROUP\n"; - echo "\n"; - echo "
\n"; - echo "\n"; - echo "\n"; + echo "
COPY INBOUND GROUP\n"; + echo "\n"; + echo "
Group ID: (no spaces)$NWB#vicidial_inbound_groups-group_id$NWE
Group Name: $NWB#vicidial_inbound_groups-group_name$NWE
\n"; + echo "\n"; + echo "\n"; - echo "\n"; + } + echo "$groups_list"; + echo "$NWB#vicidial_inbound_groups-group_id$NWE\n"; - echo "\n"; - echo "
Group ID: (no spaces)$NWB#vicidial_inbound_groups-group_id$NWE
Group Name: $NWB#vicidial_inbound_groups-group_name$NWE
Source Group ID:
Source Group ID: $NWB#vicidial_inbound_groups-group_id$NWE
\n"; - } + echo "
\n"; + } else - { - echo "You do not have permission to view this page\n"; - exit; + { + echo "You do not have permission to view this page\n"; + exit; + } } -} ###################### @@ -5819,7 +5980,7 @@ if ($ADD==1211) ###################### if ($ADD==1311) -{ + { if ($LOGmodify_dids==1) { echo "
\n"; @@ -5838,7 +5999,7 @@ if ($ADD==1311) echo "You do not have permission to view this page\n"; exit; } -} + } ###################### @@ -5846,19 +6007,19 @@ if ($ADD==1311) ###################### if ($ADD==1411) -{ - if ($LOGmodify_dids==1) { - echo "
\n"; - echo ""; + if ($LOGmodify_dids==1) + { + echo "\n"; + echo "
\n"; + echo ""; - echo "
COPY DID\n"; - echo "\n"; - echo "
\n"; - echo "\n"; - echo "\n"; + echo "
COPY DID\n"; + echo "\n"; + echo "
DID Extension: (no spaces or dashes)$NWB#vicidial_inbound_dids-did_pattern$NWE
DID Description: $NWB#vicidial_inbound_dids-did_description$NWE
\n"; + echo "\n"; + echo "\n"; - echo "\n"; + } + echo "$dids_list"; + echo "$NWB#vicidial_inbound_dids-did_pattern$NWE\n"; - echo "\n"; - echo "
DID Extension: (no spaces or dashes)$NWB#vicidial_inbound_dids-did_pattern$NWE
DID Description: $NWB#vicidial_inbound_dids-did_description$NWE
Source DID:
Source DID: $NWB#vicidial_inbound_dids-did_pattern$NWE
\n"; - } + echo "
\n"; + } else - { - echo "You do not have permission to view this page\n"; - exit; + { + echo "You do not have permission to view this page\n"; + exit; + } } -} ###################### @@ -5890,38 +6052,38 @@ if ($ADD==1411) ###################### if ($ADD==11111) -{ + { if ($LOGmodify_remoteagents==1) - { - echo "
\n"; - echo ""; + { + echo "
\n"; + echo ""; - echo "
ADD NEW REMOTE AGENTS\n"; - echo "\n"; - echo "
\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "
User ID Start: (numbers only, incremented)$NWB#vicidial_remote_agents-user_start$NWE
Number of Lines: (numbers only)$NWB#vicidial_remote_agents-number_of_lines$NWE
Server IP: $NWB#vicidial_remote_agents-server_ip$NWE
External Extension: (dial plan number dialed to reach agents)$NWB#vicidial_remote_agents-conf_exten$NWE
Status: $NWB#vicidial_remote_agents-status$NWE
Campaign: $NWB#vicidial_remote_agents-campaign_id$NWE
Inbound Groups: \n"; - echo "$groups_list"; - echo "$NWB#vicidial_remote_agents-closer_campaigns$NWE
\n"; - echo "NOTE: It can take up to 30 seconds for changes submitted on this screen to go live\n"; - } + echo "
ADD NEW REMOTE AGENTS\n"; + echo "\n"; + echo "
\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "
User ID Start: (numbers only, incremented)$NWB#vicidial_remote_agents-user_start$NWE
Number of Lines: (numbers only)$NWB#vicidial_remote_agents-number_of_lines$NWE
Server IP: $NWB#vicidial_remote_agents-server_ip$NWE
External Extension: (dial plan number dialed to reach agents)$NWB#vicidial_remote_agents-conf_exten$NWE
Status: $NWB#vicidial_remote_agents-status$NWE
Campaign: $NWB#vicidial_remote_agents-campaign_id$NWE
Inbound Groups: \n"; + echo "$groups_list"; + echo "$NWB#vicidial_remote_agents-closer_campaigns$NWE
\n"; + echo "NOTE: It can take up to 30 seconds for changes submitted on this screen to go live\n"; + } else - { - echo "You do not have permission to view this page\n"; - exit; + { + echo "You do not have permission to view this page\n"; + exit; + } } -} ###################### @@ -5929,26 +6091,26 @@ if ($ADD==11111) ###################### if ($ADD==111111) -{ + { if ($LOGmodify_usergroups==1) - { - echo "
\n"; - echo ""; + { + echo "
\n"; + echo ""; - echo "
ADD NEW USERS GROUP\n"; - echo "\n"; - echo "
\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "
Group: (no spaces or punctuation)$NWB#vicidial_user_groups-user_group$NWE
Description: (description of group)$NWB#vicidial_user_groups-group_name$NWE
\n"; - } + echo "
ADD NEW USERS GROUP\n"; + echo "\n"; + echo "
\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "
Group: (no spaces or punctuation)$NWB#vicidial_user_groups-user_group$NWE
Description: (description of group)$NWB#vicidial_user_groups-group_name$NWE
\n"; + } else - { - echo "You do not have permission to view this page\n"; - exit; + { + echo "You do not have permission to view this page\n"; + exit; + } } -} ###################### @@ -5956,72 +6118,72 @@ if ($ADD==111111) ###################### if ($ADD==1111111) -{ + { if ($LOGmodify_scripts==1) - { - echo "
\n"; - echo ""; + { + echo "
\n"; + echo ""; - echo "
ADD NEW SCRIPT\n"; - echo "\n"; - echo "
\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "
Script ID: (no spaces or punctuation)$NWB#vicidial_scripts-script_id$NWE
Script Name: (title of the script)$NWB#vicidial_scripts-script_name$NWE
Script Comments: $NWB#vicidial_scripts-script_comments$NWE
Active: $NWB#vicidial_scripts-active$NWE
Script Text: "; - # BEGIN Insert Field - echo ""; - echo "
"; - # END Insert Field - echo " $NWB#vicidial_scripts-script_text$NWE
\n"; - } + echo "
ADD NEW SCRIPT\n"; + echo "\n"; + echo "
\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "
Script ID: (no spaces or punctuation)$NWB#vicidial_scripts-script_id$NWE
Script Name: (title of the script)$NWB#vicidial_scripts-script_name$NWE
Script Comments: $NWB#vicidial_scripts-script_comments$NWE
Active: $NWB#vicidial_scripts-active$NWE
Script Text: "; + # BEGIN Insert Field + echo ""; + echo "
"; + # END Insert Field + echo " $NWB#vicidial_scripts-script_text$NWE
\n"; + } else - { - echo "You do not have permission to view this page\n"; - exit; + { + echo "You do not have permission to view this page\n"; + exit; + } } -} ###################### @@ -6029,28 +6191,28 @@ if ($ADD==1111111) ###################### if ($ADD==11111111) -{ + { if ($LOGmodify_filters==1) - { - echo "
\n"; - echo ""; + { + echo "
\n"; + echo ""; - echo "
ADD NEW FILTER\n"; - echo "\n"; - echo "
\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "
Filter ID: (no spaces or punctuation)$NWB#vicidial_lead_filters-lead_filter_id$NWE
Filter Name: (short description of the filter)$NWB#vicidial_lead_filters-lead_filter_name$NWE
Filter Comments: $NWB#vicidial_lead_filters-lead_filter_comments$NWE
Filter SQL: $NWB#vicidial_lead_filters-lead_filter_sql$NWE
\n"; - } + echo "
ADD NEW FILTER\n"; + echo "\n"; + echo "
\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "
Filter ID: (no spaces or punctuation)$NWB#vicidial_lead_filters-lead_filter_id$NWE
Filter Name: (short description of the filter)$NWB#vicidial_lead_filters-lead_filter_name$NWE
Filter Comments: $NWB#vicidial_lead_filters-lead_filter_comments$NWE
Filter SQL: $NWB#vicidial_lead_filters-lead_filter_sql$NWE
\n"; + } else - { - echo "You do not have permission to view this page\n"; - exit; + { + echo "You do not have permission to view this page\n"; + exit; + } } -} ###################### @@ -6058,29 +6220,29 @@ if ($ADD==11111111) ###################### if ($ADD==111111111) -{ + { if ($LOGmodify_call_times==1) - { - echo "
\n"; - echo ""; + { + echo "\n"; + echo "\n"; + echo "
\n"; + echo ""; - echo "
ADD NEW CALL TIME\n"; - echo "\n"; - echo "
\n"; - echo "\n"; - echo "\n"; - echo "\n"; + echo "
ADD NEW CALL TIME\n"; + echo "\n"; + echo "
Call Time ID: (no spaces or punctuation)$NWB#vicidial_call_times-call_time_id$NWE
Call Time Name: (short description of the call time)$NWB#vicidial_call_times-call_time_name$NWE
Call Time Comments: $NWB#vicidial_call_times-call_time_comments$NWE
\n"; + echo "\n"; + echo "\n"; + echo "\n"; - echo "\n"; - echo "\n"; - echo "
Call Time ID: (no spaces or punctuation)$NWB#vicidial_call_times-call_time_id$NWE
Call Time Name: (short description of the call time)$NWB#vicidial_call_times-call_time_name$NWE
Call Time Comments: $NWB#vicidial_call_times-call_time_comments$NWE
Day and time options will appear once you have created the Call Time Definition
\n"; - } + echo "
Day and time options will appear once you have created the Call Time Definition
\n"; + } else - { - echo "You do not have permission to view this page\n"; - exit; + { + echo "You do not have permission to view this page\n"; + exit; + } } -} ###################### @@ -6088,30 +6250,30 @@ if ($ADD==111111111) ###################### if ($ADD==1111111111) -{ + { if ($LOGmodify_call_times==1) - { - echo "
\n"; - echo ""; + { + echo "\n"; + echo "\n"; + echo "
\n"; + echo ""; - echo "
ADD NEW STATE CALL TIME\n"; - echo "\n"; - echo "
\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; + echo "
ADD NEW STATE CALL TIME\n"; + echo "\n"; + echo "
State Call Time ID: (no spaces or punctuation)$NWB#vicidial_call_times-call_time_id$NWE
State Call Time State: (no spaces or punctuation)$NWB#vicidial_call_times-state_call_time_state$NWE
State Call Time Name: (short description of the call time)$NWB#vicidial_call_times-call_time_name$NWE
State Call Time Comments: $NWB#vicidial_call_times-call_time_comments$NWE
\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; - echo "\n"; - echo "\n"; - echo "
State Call Time ID: (no spaces or punctuation)$NWB#vicidial_call_times-call_time_id$NWE
State Call Time State: (no spaces or punctuation)$NWB#vicidial_call_times-state_call_time_state$NWE
State Call Time Name: (short description of the call time)$NWB#vicidial_call_times-call_time_name$NWE
State Call Time Comments: $NWB#vicidial_call_times-call_time_comments$NWE
Day and time options will appear once you have created the Call Time Definition
\n"; - } + echo "
Day and time options will appear once you have created the Call Time Definition
\n"; + } else - { - echo "You do not have permission to view this page\n"; - exit; + { + echo "You do not have permission to view this page\n"; + exit; + } } -} ###################### @@ -6119,39 +6281,39 @@ if ($ADD==1111111111) ###################### if ($ADD==131111111) -{ + { if ($LOGmodify_call_times==1) - { - echo "
\n"; - echo ""; + { + echo "
\n"; + echo ""; - echo "
ADD NEW SHIFT\n"; - echo "\n"; - echo "
\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "
Shift ID: (no spaces or punctuation)$NWB#vicidial_shifts-shift_id$NWE
Shift Name: (short description of the shift)$NWB#vicidial_shifts-shift_name$NWE
Shift Start Time: \n"; - echo "   Shift End Time: \n"; - echo " $NWB#vicidial_shifts-shift_start_time$NWE
Shift Length: $NWB#vicidial_shifts-shift_length$NWE
Shift Weekdays:
$NWB#vicidial_shifts-shift_weekdays$NWE
\n"; - echo "Sunday
\n"; - echo "Monday
\n"; - echo "Tuesday
\n"; - echo "Wednesday
\n"; - echo "Thursday
\n"; - echo "Friday
\n"; - echo "Saturday
\n"; - echo "
\n"; - } + echo "
ADD NEW SHIFT\n"; + echo "\n"; + echo "
\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "
Shift ID: (no spaces or punctuation)$NWB#vicidial_shifts-shift_id$NWE
Shift Name: (short description of the shift)$NWB#vicidial_shifts-shift_name$NWE
Shift Start Time: \n"; + echo "   Shift End Time: \n"; + echo " $NWB#vicidial_shifts-shift_start_time$NWE
Shift Length: $NWB#vicidial_shifts-shift_length$NWE
Shift Weekdays:
$NWB#vicidial_shifts-shift_weekdays$NWE
\n"; + echo "Sunday
\n"; + echo "Monday
\n"; + echo "Tuesday
\n"; + echo "Wednesday
\n"; + echo "Thursday
\n"; + echo "Friday
\n"; + echo "Saturday
\n"; + echo "
\n"; + } else - { - echo "You do not have permission to view this page\n"; - exit; + { + echo "You do not have permission to view this page\n"; + exit; + } } -} ###################### @@ -6159,47 +6321,47 @@ if ($ADD==131111111) ###################### if ($ADD==11111111111) -{ + { if ($LOGast_admin_access==1) - { - echo "
\n"; - echo ""; + { + echo "
\n"; + echo ""; - echo "
ADD A NEW PHONE\n"; - echo "\n"; - echo "
\n"; + echo "
ADD A NEW PHONE\n"; + echo "\n"; + echo "
\n"; - echo "
\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "
Phone extension: $NWB#phones-extension$NWE
Dial Plan Number: (digits only)$NWB#phones-dialplan_number$NWE
Voicemail Box: (digits only)$NWB#phones-voicemail_id$NWE
Outbound CallerID: (digits only)$NWB#phones-outbound_cid$NWE
Phone IP address: (optional)$NWB#phones-phone_ip$NWE
Computer IP address: (optional)$NWB#phones-computer_ip$NWE
Server IP: \n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "
Phone extension: $NWB#phones-extension$NWE
Dial Plan Number: (digits only)$NWB#phones-dialplan_number$NWE
Voicemail Box: (digits only)$NWB#phones-voicemail_id$NWE
Outbound CallerID: (digits only)$NWB#phones-outbound_cid$NWE
Phone IP address: (optional)$NWB#phones-phone_ip$NWE
Computer IP address: (optional)$NWB#phones-computer_ip$NWE
Server IP: $NWB#phones-server_ip$NWE
Login: $NWB#phones-login$NWE
Password: $NWB#phones-pass$NWE
Status: $NWB#phones-status$NWE
Active Account: $NWB#phones-active$NWE
Phone Type: $NWB#phones-phone_type$NWE
Full Name: $NWB#phones-fullname$NWE
Company: $NWB#phones-company$NWE
Picture: $NWB#phones-picture$NWE
Client Protocol: $NWB#phones-protocol$NWE
Local GMT: (Do NOT Adjust for DST)$NWB#phones-local_gmt$NWE
\n"; - } + echo "$servers_list"; + echo "\n"; + echo "$NWB#phones-server_ip$NWE
Login: $NWB#phones-login$NWE
Password: $NWB#phones-pass$NWE
Status: $NWB#phones-status$NWE
Active Account: $NWB#phones-active$NWE
Phone Type: $NWB#phones-phone_type$NWE
Full Name: $NWB#phones-fullname$NWE
Company: $NWB#phones-company$NWE
Picture: $NWB#phones-picture$NWE
Client Protocol: $NWB#phones-protocol$NWE
Local GMT: (Do NOT Adjust for DST)$NWB#phones-local_gmt$NWE
\n"; + } else - { - echo "You do not have permission to view this page\n"; - exit; + { + echo "You do not have permission to view this page\n"; + exit; + } } -} ###################### @@ -6207,30 +6369,30 @@ if ($ADD==11111111111) ###################### if ($ADD==12111111111) -{ + { if ($LOGast_admin_access==1) - { - echo "
\n"; - echo ""; + { + echo "\n"; + echo "
\n"; + echo ""; - echo "
ADD A NEW PHONE ALIAS\n"; - echo "\n"; - echo "
\n"; + echo "
ADD A NEW PHONE ALIAS\n"; + echo "\n"; + echo "
\n"; - echo "
\n"; - echo "\n"; - echo "\n"; - echo "\n"; + echo "
Alias ID: $NWB#phones-alias_id$NWE
Alias Name: $NWB#phones-alias_name$NWE
Phone Logins List: (comma separated)$NWB#phones-logins_list$NWE
\n"; + echo "\n"; + echo "\n"; + echo "\n"; - echo "\n"; - echo "
Alias ID: $NWB#phones-alias_id$NWE
Alias Name: $NWB#phones-alias_name$NWE
Phone Logins List: (comma separated)$NWB#phones-logins_list$NWE
\n"; - } + echo "
\n"; + } else - { - echo "You do not have permission to view this page\n"; - exit; + { + echo "You do not have permission to view this page\n"; + exit; + } } -} ###################### @@ -6238,29 +6400,127 @@ if ($ADD==12111111111) ###################### if ($ADD==111111111111) -{ + { if ($LOGmodify_servers==1) - { - echo "
\n"; - echo ""; + { + echo "
\n"; + echo ""; - echo "
ADD A NEW SERVER\n"; - echo "\n"; - echo "
\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "
Server ID: $NWB#servers-server_id$NWE
Server Description: $NWB#servers-server_description$NWE
Server IP Address: $NWB#servers-server_ip$NWE
Active: $NWB#servers-active$NWE
Asterisk Version: $NWB#servers-asterisk_version$NWE
\n"; - } + echo "
ADD A NEW SERVER\n"; + echo "\n"; + echo "
\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "
Server ID: $NWB#servers-server_id$NWE
Server Description: $NWB#servers-server_description$NWE
Server IP Address: $NWB#servers-server_ip$NWE
Active: $NWB#servers-active$NWE
Asterisk Version: $NWB#servers-asterisk_version$NWE
\n"; + } else - { - echo "You do not have permission to view this page\n"; - exit; + { + echo "You do not have permission to view this page\n"; + exit; + } + } + + +###################### +# ADD=131111111111 display the ADD NEW CONF TEMPLATE SCREEN +###################### + +if ($ADD==131111111111) + { + if ($LOGmodify_servers==1) + { + echo "
\n"; + echo ""; + + echo "
ADD NEW CONF TEMPLATE\n"; + echo "\n"; + echo "
\n"; + + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "
Template ID: $NWB#vicidial_conf_templates-template_id$NWE
Template Name: $NWB#vicidial_conf_templates-template_name$NWE
Template Contents: $NWB#vicidial_conf_templates-template_contents$NWE
\n"; + } + else + { + echo "You do not have permission to view this page\n"; + exit; + } + } + + +###################### +# ADD=141111111111 display the ADD NEW CARRIER SCREEN +###################### + +if ($ADD==141111111111) + { + if ($LOGmodify_servers==1) + { + echo "
\n"; + echo ""; + + echo "
ADD NEW CARRIER\n"; + echo "\n"; + echo "
\n"; + + echo "\n"; + echo "\n"; + echo "\n"; + + echo "\n"; + + echo "\n"; + echo "\n"; + echo "\n"; + + echo "\n"; + + echo "\n"; + + echo "\n"; + echo "
Carrier ID: $NWB#vicidial_server_carriers-carrier_id$NWE
Carrier Name: $NWB#vicidial_server_carriers-carrier_name$NWE
Registration String: $NWB#vicidial_server_carriers-registration_string$NWE
Template ID: $NWB#vicidial_server_carriers-template_id$NWE
Account Entry: $NWB#vicidial_server_carriers-account_entry$NWE
Protocol: $NWB#vicidial_server_carriers-protocol$NWE
Globals String: $NWB#vicidial_server_carriers-globals_string$NWE
Dialplan Entry: $NWB#vicidial_server_carriers-dialplan_entry$NWE
Server IP: $NWB#vicidial_server_carriers-server_ip$NWE
\n"; + } + else + { + echo "You do not have permission to view this page\n"; + exit; + } } -} ###################### @@ -6268,30 +6528,30 @@ if ($ADD==111111111111) ###################### if ($ADD==1111111111111) -{ + { if ($LOGast_admin_access==1) - { - echo "
\n"; - echo ""; + { + echo "
\n"; + echo ""; - echo "
ADD A NEW CONFERENCE\n"; - echo "\n"; - echo "
\n"; - echo "\n"; - echo "\n"; + echo "\n"; + echo "
Conference Number: (digits only)$NWB#conferences-conf_exten$NWE
Server IP: \n"; + echo "
\n"; + echo "\n"; + echo "\n"; - echo "\n"; - echo "
Conference Number: (digits only)$NWB#conferences-conf_exten$NWE
Server IP: $NWB#conferences-server_ip$NWE
\n"; - } + echo "$servers_list"; + echo "\n"; + echo "$NWB#conferences-server_ip$NWE
\n"; + } else - { - echo "You do not have permission to view this page\n"; - exit; + { + echo "You do not have permission to view this page\n"; + exit; + } } -} ###################### @@ -6299,30 +6559,30 @@ if ($ADD==1111111111111) ###################### if ($ADD==11111111111111) -{ + { if ($LOGast_admin_access==1) - { - echo "
\n"; - echo ""; + { + echo "
\n"; + echo ""; - echo "
ADD A NEW VICIDIAL CONFERENCE\n"; - echo "\n"; - echo "
\n"; - echo "\n"; - echo "\n"; + echo "\n"; + echo "
Conference Number: (digits only)$NWB#conferences-conf_exten$NWE
Server IP: \n"; + echo "
\n"; + echo "\n"; + echo "\n"; - echo "\n"; - echo "
Conference Number: (digits only)$NWB#conferences-conf_exten$NWE
Server IP: $NWB#conferences-server_ip$NWE
\n"; - } + echo "$servers_list"; + echo "\n"; + echo "$NWB#conferences-server_ip$NWE
\n"; + } else - { - echo "You do not have permission to view this page\n"; - exit; + { + echo "You do not have permission to view this page\n"; + exit; + } } -} @@ -7799,6 +8059,80 @@ $ADD=311111111111; } +###################### +# ADD=231111111111 adds new conf template to the system +###################### + +if ($ADD==231111111111) +{ +echo "\n"; echo "\n"; echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + + echo "\n"; echo "
\n"; + echo ""; + $stmt="SELECT count(*) from vicidial_conf_templates where template_id='$template_id';"; + $rslt=mysql_query($stmt, $link); + $row=mysql_fetch_row($rslt); + if ($row[0] > 0) + {echo "
CONF TEMPLATE NOT ADDED - there is already a template in the system with this ID\n";} + else + { + if (strlen($template_id) < 2) + {echo "
CONF TEMPLATE NOT ADDED - Please go back and look at the data you entered\n";} + else + { + echo "
CONF TEMPLATE ADDED\n"; + + $stmt="INSERT INTO vicidial_conf_templates (template_id,template_name,template_contents) values('$template_id','$template_name','$template_contents');"; + $rslt=mysql_query($stmt, $link); + + ### LOG CHANGES TO LOG FILE ### + if ($WeBRooTWritablE > 0) + { + $fp = fopen ("./admin_changes_log.txt", "a"); + fwrite ($fp, "$date|ADD A NEW CONF TEMPLATE |$stmt|\n"); + fclose($fp); + } + } + } +$ADD=331111111111; +} + + +###################### +# ADD=241111111111 adds new server carrier to the system +###################### + +if ($ADD==241111111111) +{ +echo "\n"; echo "\n"; echo "\n"; + + echo "\n"; + + echo "\n"; + echo "\n"; echo "
\n"; + echo ""; + $stmt="SELECT count(*) from vicidial_server_carriers where carrier_id='$carrier_id';"; + $rslt=mysql_query($stmt, $link); + $row=mysql_fetch_row($rslt); + if ($row[0] > 0) + {echo "
CARRIER NOT ADDED - there is already a carrier in the system with this ID\n";} + else + { + if ( (strlen($carrier_id) < 2) or (strlen($server_ip) < 7) ) + {echo "
CARRIER NOT ADDED - Please go back and look at the data you entered\n";} + else + { + echo "
CARRIER ADDED\n"; + + $stmt="INSERT INTO vicidial_server_carriers (carrier_id,carrier_name,registration_string,template_id,account_entry,protocol,globals_string,dialplan_entry,server_ip,active) values('$carrier_id','$carrier_name','$registration_string','$template_id','$account_entry','$protocol','$globals_string','$dialplan_entry','$server_ip','N');"; + $rslt=mysql_query($stmt, $link); + + ### LOG CHANGES TO LOG FILE ### + if ($WeBRooTWritablE > 0) + { + $fp = fopen ("./admin_changes_log.txt", "a"); + fwrite ($fp, "$date|ADD A NEW CARRIER |$stmt|\n"); + fclose($fp); + } + } + } +$ADD=341111111111; +} + + ###################### # ADD=2111111111111 adds new conference to the system ###################### @@ -9816,7 +10150,10 @@ if ($ADD==41111111111) { echo "
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' 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' where extension='$old_extension' and server_ip='$old_server_ip';"; + $rslt=mysql_query($stmt, $link); + + $stmt="UPDATE servers SET rebuild_conf_files='Y' where generate_vicidial_conf='Y' and active_asterisk_server='Y' and server_ip='$server_ip';"; $rslt=mysql_query($stmt, $link); ### LOG CHANGES TO LOG FILE ### @@ -9908,7 +10245,10 @@ if ($ADD==411111111111) { echo "
SERVER MODIFIED: $server_ip\n"; - $stmt="UPDATE servers set server_id='$server_id',server_description='$server_description',server_ip='$server_ip',active='$active',asterisk_version='$asterisk_version', max_vicidial_trunks='$max_vicidial_trunks', telnet_host='$telnet_host', telnet_port='$telnet_port', ASTmgrUSERNAME='$ASTmgrUSERNAME', ASTmgrSECRET='$ASTmgrSECRET', ASTmgrUSERNAMEupdate='$ASTmgrUSERNAMEupdate', ASTmgrUSERNAMElisten='$ASTmgrUSERNAMElisten', ASTmgrUSERNAMEsend='$ASTmgrUSERNAMEsend', local_gmt='$local_gmt', voicemail_dump_exten='$voicemail_dump_exten', answer_transfer_agent='$answer_transfer_agent', ext_context='$ext_context', sys_perf_log='$sys_perf_log', vd_server_logs='$vd_server_logs', agi_output='$agi_output', vicidial_balance_active='$vicidial_balance_active', balance_trunks_offlimits='$balance_trunks_offlimits',recording_web_link='$recording_web_link',alt_server_ip='$alt_server_ip' where server_id='$old_server_id';"; + $stmt="UPDATE servers set server_id='$server_id',server_description='$server_description',server_ip='$server_ip',active='$active',asterisk_version='$asterisk_version', max_vicidial_trunks='$max_vicidial_trunks', telnet_host='$telnet_host', telnet_port='$telnet_port', ASTmgrUSERNAME='$ASTmgrUSERNAME', ASTmgrSECRET='$ASTmgrSECRET', ASTmgrUSERNAMEupdate='$ASTmgrUSERNAMEupdate', ASTmgrUSERNAMElisten='$ASTmgrUSERNAMElisten', ASTmgrUSERNAMEsend='$ASTmgrUSERNAMEsend', local_gmt='$local_gmt', voicemail_dump_exten='$voicemail_dump_exten', answer_transfer_agent='$answer_transfer_agent', ext_context='$ext_context', sys_perf_log='$sys_perf_log', vd_server_logs='$vd_server_logs', agi_output='$agi_output', vicidial_balance_active='$vicidial_balance_active',balance_trunks_offlimits='$balance_trunks_offlimits',recording_web_link='$recording_web_link',alt_server_ip='$alt_server_ip',active_asterisk_server='$active_asterisk_server',generate_vicidial_conf='$generate_vicidial_conf',rebuild_conf_files='$rebuild_conf_files' where server_id='$old_server_id';"; + $rslt=mysql_query($stmt, $link); + + $stmt="UPDATE servers SET rebuild_conf_files='Y' where generate_vicidial_conf='Y' and active_asterisk_server='Y' and server_ip='$server_ip';"; $rslt=mysql_query($stmt, $link); ### LOG CHANGES TO LOG FILE ### @@ -9989,6 +10329,86 @@ $ADD=311111111111; # go to server modification form below } +###################### +# ADD=431111111111 modify conf template record in the system +###################### '$template_id','$template_name','$template_contents' + +if ($ADD==431111111111) +{ + if ($LOGmodify_servers==1) + { + echo ""; + + if (strlen($template_name) < 1) + {echo "
CONF TEMPLATE NOT MODIFIED - Please go back and look at the data you entered\n";} + else + { + echo "
CONF TEMPLATE MODIFIED: $template_id\n"; + + $stmt="UPDATE vicidial_conf_templates set template_name='$template_name',template_contents='$template_contents' where template_id='$template_id';"; + $rslt=mysql_query($stmt, $link); + + $stmt="UPDATE servers SET rebuild_conf_files='Y' where generate_vicidial_conf='Y' and active_asterisk_server='Y';"; + $rslt=mysql_query($stmt, $link); + + ### LOG CHANGES TO LOG FILE ### + if ($WeBRooTWritablE > 0) + { + $fp = fopen ("./admin_changes_log.txt", "a"); + fwrite ($fp, "$date|MODIFY CONF TEMPLATE |$PHP_AUTH_USER|$ip|$stmt|\n"); + fclose($fp); + } + } + } + else + { + echo "You do not have permission to view this page\n"; + exit; + } +$ADD=331111111111; # go to conf template modification form below +} + + +###################### +# ADD=441111111111 modify carrier record in the system +###################### + +if ($ADD==441111111111) +{ + if ($LOGmodify_servers==1) + { + echo ""; + + if ( (strlen($carrier_id) < 1) or (strlen($server_ip) < 7) or (strlen($protocol) < 1) or (strlen($dialplan_entry) < 1) ) + {echo "
CARRIER NOT MODIFIED - Please go back and look at the data you entered\n";} + else + { + echo "
CARRIER MODIFIED: $carrier_id\n"; + + $stmt="UPDATE vicidial_server_carriers set carrier_name='$carrier_name',registration_string='$registration_string',template_id='$template_id',account_entry='$account_entry',protocol='$protocol',globals_string='$globals_string',dialplan_entry='$dialplan_entry',server_ip='$server_ip',active='$active' where carrier_id='$carrier_id';"; + $rslt=mysql_query($stmt, $link); + + $stmt="UPDATE servers SET rebuild_conf_files='Y' where generate_vicidial_conf='Y' and active_asterisk_server='Y' and server_ip='$server_ip';"; + $rslt=mysql_query($stmt, $link); + + ### LOG CHANGES TO LOG FILE ### + if ($WeBRooTWritablE > 0) + { + $fp = fopen ("./admin_changes_log.txt", "a"); + fwrite ($fp, "$date|MODIFY CARRIER |$PHP_AUTH_USER|$ip|$stmt|\n"); + fclose($fp); + } + } + } + else + { + echo "You do not have permission to view this page\n"; + exit; + } +$ADD=341111111111; # go to carrier modification form below +} + + ###################### # ADD=4111111111111 modify conference record in the system ###################### @@ -10695,6 +11115,50 @@ $ADD='311111111111'; # go to server modification below } +###################### +# ADD=531111111111 confirmation before deletion of conf template record +###################### + +if ($ADD==531111111111) +{ + echo ""; + + if (strlen($template_id) < 2) + { + echo "
CONF TEMPLATE NOT DELETED - Please go back and look at the data you entered\n"; + echo "
Template ID be at least 2 characters in length\n"; + } + else + { + echo "
CONF TEMPLATE DELETION CONFIRMATION: $template_id - $template_name\n"; + echo "

Click here to delete conf template $template_id - $template_name


\n"; + } +$ADD='331111111111'; # go to conf template modification below +} + + +###################### +# ADD=541111111111 confirmation before deletion of carrier record +###################### + +if ($ADD==541111111111) +{ + echo ""; + + if (strlen($carrier_id) < 2) + { + echo "
CARRIER NOT DELETED - Please go back and look at the data you entered\n"; + echo "
Carrier ID be at least 2 characters in length\n"; + } + else + { + echo "
CARRIER DELETION CONFIRMATION: $carrier_id - $carrier_name\n"; + echo "

Click here to delete carrier $carrier_id - $carrier_name


\n"; + } +$ADD='341111111111'; # go to carrier modification below +} + + ###################### # ADD=5111111111111 confirmation before deletion of conference record ###################### @@ -11634,6 +12098,87 @@ $ADD=311111111111; # go to server modification form below } +###################### +# ADD=631111111111 delete conf template record +###################### + +if ($ADD==631111111111) +{ + echo ""; + + if ( (strlen($template_id) < 2) or ($CoNfIrM != 'YES') ) + { + echo "
CONF TEMPLATE NOT DELETED - Please go back and look at the data you entered\n"; + echo "
Template ID be at least 2 characters in length\n"; + } + else + { + $stmt="UPDATE phones SET template_id='' where template_id='$template_id';"; + $rslt=mysql_query($stmt, $link); + + $stmt="UPDATE vicidial_server_carriers SET template_id='' where template_id='$template_id';"; + $rslt=mysql_query($stmt, $link); + + $stmt="UPDATE servers SET rebuild_conf_files='Y' where generate_vicidial_conf='Y' and active_asterisk_server='Y';"; + $rslt=mysql_query($stmt, $link); + + $stmt="DELETE from vicidial_conf_templates where template_id='$template_id';"; + $rslt=mysql_query($stmt, $link); + + ### LOG CHANGES TO LOG FILE ### + if ($WeBRooTWritablE > 0) + { + $fp = fopen ("./admin_changes_log.txt", "a"); + fwrite ($fp, "$date|!DELETING conf temp!|$PHP_AUTH_USER|$ip|$stmt|\n"); + fclose($fp); + } + echo "
CONF TEMPLATE DELETION COMPLETED: $server_id - $server_ip\n"; + echo "

\n"; + } +$ADD='130000000000'; # go to conf template list +} + + +###################### +# ADD=641111111111 delete carrier record +###################### + +if ($ADD==641111111111) +{ + echo ""; + + if ( (strlen($carrier_id) < 2) or ($CoNfIrM != 'YES') ) + { + echo "
CARRIER NOT DELETED - Please go back and look at the data you entered\n"; + echo "
Carrier ID be at least 2 characters in length\n"; + } + else + { + $stmt="SELECT server_ip from vicidial_server_carriers where carrier_id='$carrier_id';"; + $rslt=mysql_query($stmt, $link); + $row=mysql_fetch_row($rslt); + $CARRIERserver_ip = $row[0]; + + $stmt="DELETE from vicidial_server_carriers where carrier_id='$carrier_id';"; + $rslt=mysql_query($stmt, $link); + + $stmt="UPDATE servers SET rebuild_conf_files='Y' where generate_vicidial_conf='Y' and active_asterisk_server='Y' and server_ip='$CARRIERserver_ip';"; + $rslt=mysql_query($stmt, $link); + + ### LOG CHANGES TO LOG FILE ### + if ($WeBRooTWritablE > 0) + { + $fp = fopen ("./admin_changes_log.txt", "a"); + fwrite ($fp, "$date|!!DELETING CARRIER!!|$PHP_AUTH_USER|$ip|$stmt|\n"); + fclose($fp); + } + echo "
CARRIER DELETION COMPLETED: $carrier_id\n"; + echo "

\n"; + } +$ADD='140000000000'; # go to carrier list +} + + ###################### # ADD=6111111111111 delete conference record ###################### @@ -15909,6 +16454,25 @@ if ($ADD==31111111111) echo "
DBY User: (Secondary DB Login)$NWB#phones-DBY_user$NWE
DBY Pass: (Secondary DB Secret)$NWB#phones-DBY_pass$NWE
DBY Port: (Secondary DB Port)$NWB#phones-DBY_port$NWE
Template ID: $NWB#phones-template_id$NWE
Conf Override: $NWB#phones-conf_override$NWE
\n"; @@ -16047,6 +16611,11 @@ if ($ADD==311111111111) echo "
AGI Output: $NWB#servers-agi_output$NWE
Recording Web Link: $NWB#servers-recording_web_link$NWE
Alternate Recording Server IP: $NWB#servers-alt_server_ip$NWE
Active Asterisk Server: $NWB#servers-active_asterisk_server$NWE
Generate conf files: $NWB#servers-generate_vicidial_conf$NWE
Rebuild conf files: $NWB#servers-rebuild_conf_files$NWE
\n"; @@ -16094,23 +16663,56 @@ if ($ADD==311111111111) echo "
\n"; + ### list of carriers on this server + echo "
\n"; + echo "
CARRIERS WITHIN THIS SERVER:
\n"; + echo "\n"; + echo "\n"; + + $active_carriers = 0; + $inactive_carriers = 0; + $stmt="SELECT carrier_id,carrier_name,registration_string,active from vicidial_server_carriers where server_ip='$row[2]'"; + $rsltx=mysql_query($stmt, $link); + $carriers_to_print = mysql_num_rows($rsltx); + $camp_lists=''; + + $o=0; + while ($carriers_to_print > $o) + { + $rowx=mysql_fetch_row($rsltx); + $o++; + if (ereg("Y", $rowx[3])) {$active_carriers++;} + if (ereg("N", $rowx[3])) {$inactive_carriers++;} + + if (eregi("1$|3$|5$|7$|9$", $o)) + {$bgcolor='bgcolor="#B9CBFD"';} + else + {$bgcolor='bgcolor="#9BB9FB"';} + + echo "\n"; + } + + echo "
CARRIER IDNAMEREGISTRATIONACTIVE
$rowx[0]$rowx[1]$rowx[2]$rowx[3]

\n"; + + ### list of phones on this server echo "
\n"; echo "
PHONES WITHIN THIS SERVER:
\n"; echo "\n"; echo "\n"; - $active_phones = 0; - $inactive_phones = 0; - $stmt="SELECT extension,active,fullname from phones where server_ip='$row[2]'"; - $rsltx=mysql_query($stmt, $link); - $lists_to_print = mysql_num_rows($rsltx); - $camp_lists=''; + $active_phones = 0; + $inactive_phones = 0; + $stmt="SELECT extension,active,fullname from phones where server_ip='$row[2]'"; + $rsltx=mysql_query($stmt, $link); + $lists_to_print = mysql_num_rows($rsltx); + $camp_lists=''; - $o=0; - while ($lists_to_print > $o) { - $rowx=mysql_fetch_row($rsltx); - $o++; + $o=0; + while ($lists_to_print > $o) + { + $rowx=mysql_fetch_row($rsltx); + $o++; if (ereg("Y", $rowx[1])) {$active_phones++; $camp_lists .= "'$rowx[0]',";} if (ereg("N", $rowx[1])) {$inactive_phones++;} @@ -16131,17 +16733,18 @@ if ($ADD==311111111111) echo "
EXTENSIONNAMEACTIVE
\n"; echo "\n"; - $active_confs = 0; - $stmt="SELECT conf_exten,extension from conferences where server_ip='$row[2]'"; - $rsltx=mysql_query($stmt, $link); - $lists_to_print = mysql_num_rows($rsltx); - $camp_lists=''; + $active_confs = 0; + $stmt="SELECT conf_exten,extension from conferences where server_ip='$row[2]'"; + $rsltx=mysql_query($stmt, $link); + $lists_to_print = mysql_num_rows($rsltx); + $camp_lists=''; - $o=0; - while ($lists_to_print > $o) { - $rowx=mysql_fetch_row($rsltx); - $o++; - $active_confs++; + $o=0; + while ($lists_to_print > $o) + { + $rowx=mysql_fetch_row($rsltx); + $o++; + $active_confs++; if (eregi("1$|3$|5$|7$|9$", $o)) {$bgcolor='bgcolor="#B9CBFD"';} @@ -16160,17 +16763,18 @@ if ($ADD==311111111111) echo "
CONFERENCEEXTENSION
\n"; echo "\n"; - $active_vdconfs = 0; - $stmt="SELECT conf_exten,extension from vicidial_conferences where server_ip='$row[2]'"; - $rsltx=mysql_query($stmt, $link); - $lists_to_print = mysql_num_rows($rsltx); - $camp_lists=''; + $active_vdconfs = 0; + $stmt="SELECT conf_exten,extension from vicidial_conferences where server_ip='$row[2]'"; + $rsltx=mysql_query($stmt, $link); + $lists_to_print = mysql_num_rows($rsltx); + $camp_lists=''; - $o=0; - while ($lists_to_print > $o) { - $rowx=mysql_fetch_row($rsltx); - $o++; - $active_vdconfs++; + $o=0; + while ($lists_to_print > $o) + { + $rowx=mysql_fetch_row($rsltx); + $o++; + $active_vdconfs++; if (eregi("1$|3$|5$|7$|9$", $o)) {$bgcolor='bgcolor="#B9CBFD"';} @@ -16186,6 +16790,7 @@ if ($ADD==311111111111) echo "
\n"; $camp_lists = eregi_replace(".$","",$camp_lists); + echo "This server has $active_carriers active carriers and $inactive_carriers inactive carriers

\n"; echo "This server has $active_phones active phones and $inactive_phones inactive phones

\n"; echo "This server has $active_confs active conferences

\n"; echo "This server has $active_vdconfs active vicidial conferences

\n"; @@ -16203,6 +16808,206 @@ if ($ADD==311111111111) } +###################### +# ADD=331111111111 modify conf template record in the system +###################### + +if ($ADD==331111111111) +{ + if ($LOGast_admin_access==1) + { + echo "
VD CONFERENCEEXTENSION
\n"; + echo ""; + + $stmt="SELECT template_id,template_name,template_contents from vicidial_conf_templates where template_id='$template_id';"; + $rslt=mysql_query($stmt, $link); + $row=mysql_fetch_row($rslt); + $template_id = $row[0]; + $template_name = $row[1]; + $template_contents = $row[2]; + + echo "
MODIFY A CONF TEMPLATE RECORD: $row[0]
\n"; + echo "\n"; + echo "\n"; + + echo "
\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "
Template ID: $template_id
Template Name: $NWB#vicidial_conf_templates-template_name$NWE
Template Contents: $NWB#vicidial_conf_templates-template_contents$NWE
\n"; + + echo "
\n"; + + ### list of phones using this conf template + echo "
\n"; + echo "
PHONES USING THIS CONF TEMPLATE:
\n"; + echo "\n"; + echo "\n"; + + $active_phones = 0; + $inactive_phones = 0; + $stmt="SELECT extension,active,fullname,server_ip from phones where template_id='$template_id'"; + $rsltx=mysql_query($stmt, $link); + $lists_to_print = mysql_num_rows($rsltx); + $camp_lists=''; + + $o=0; + while ($lists_to_print > $o) + { + $rowx=mysql_fetch_row($rsltx); + $o++; + if (ereg("Y", $rowx[1])) {$active_phones++; $camp_lists .= "'$rowx[0]',";} + if (ereg("N", $rowx[1])) {$inactive_phones++;} + + if (eregi("1$|3$|5$|7$|9$", $o)) + {$bgcolor='bgcolor="#B9CBFD"';} + else + {$bgcolor='bgcolor="#9BB9FB"';} + + echo "\n"; + } + + echo "
EXTENSIONNAMESERVERACTIVE
$rowx[0]$rowx[2]$rowx[3]$rowx[1]

\n"; + + ### list of carriers using this conf template + echo "
\n"; + echo "
CARRIERS USING THIS CONF TEMPLATE:
\n"; + echo "\n"; + echo "\n"; + + $active_phones = 0; + $inactive_phones = 0; + $stmt="SELECT carrier_id,active,carrier_name,server_ip from vicidial_server_carriers where template_id='$template_id'"; + $rsltx=mysql_query($stmt, $link); + $lists_to_print = mysql_num_rows($rsltx); + $camp_lists=''; + + $o=0; + while ($lists_to_print > $o) + { + $rowx=mysql_fetch_row($rsltx); + $o++; + if (ereg("Y", $rowx[1])) {$active_phones++; $camp_lists .= "'$rowx[0]',";} + if (ereg("N", $rowx[1])) {$inactive_phones++;} + + if (eregi("1$|3$|5$|7$|9$", $o)) + {$bgcolor='bgcolor="#B9CBFD"';} + else + {$bgcolor='bgcolor="#9BB9FB"';} + + echo "\n"; + } + + echo "
CARRIERNAMESERVERACTIVE
$rowx[0]$rowx[2]$rowx[3]$rowx[1]

\n"; + + + + if ($LOGast_delete_phones > 0) + { + echo "

DELETE THIS CONF TEMPLATE\n"; + } + } + else + { + echo "You do not have permission to view this page\n"; + exit; + } +} + + +###################### +# ADD=341111111111 modify carrier record in the system +###################### + +if ($ADD==341111111111) +{ + if ($LOGast_admin_access==1) + { + echo "
\n"; + echo ""; + + $stmt="SELECT carrier_id,carrier_name,registration_string,template_id,account_entry,protocol,globals_string,dialplan_entry,server_ip,active from vicidial_server_carriers where carrier_id='$carrier_id';"; + $rslt=mysql_query($stmt, $link); + $row=mysql_fetch_row($rslt); + $carrier_id = $row[0]; + $carrier_name = $row[1]; + $registration_string = $row[2]; + $template_id = $row[3]; + $account_entry = $row[4]; + $protocol = $row[5]; + $globals_string = $row[6]; + $dialplan_entry = $row[7]; + $server_ip = $row[8]; + $active = $row[9]; + + echo "
MODIFY A CARRIER RECORD: $row[0]\n"; + echo "\n"; + echo "\n"; + + echo "
\n"; + echo "\n"; + echo "\n"; + echo "\n"; + + echo "\n"; + + echo "\n"; + echo "\n"; + echo "\n"; + + echo "\n"; + + echo "\n"; + echo "\n"; + echo "\n"; + echo "
Carrier ID: $carrier_id
Carrier Name: $NWB#vicidial_server_carriers-carrier_name$NWE
Registration String: $NWB#vicidial_server_carriers-registration_string$NWE
Template ID: $NWB#vicidial_server_carriers-template_id$NWE
Account Entry: $NWB#vicidial_server_carriers-account_entry$NWE
Protocol: $NWB#vicidial_server_carriers-protocol$NWE
Globals String: $NWB#vicidial_server_carriers-globals_string$NWE
Dialplan Entry: $NWB#vicidial_server_carriers-dialplan_entry$NWE
Server IP: $NWB#vicidial_server_carriers-server_ip$NWE
Active: $NWB#vicidial_server_carriers-active$NWE
\n"; + + echo "
\n"; + if ($LOGast_delete_phones > 0) + { + echo "

DELETE THIS CARRIER\n"; + } + } + else + { + echo "You do not have permission to view this page\n"; + exit; + } +} + + ###################### # ADD=3111111111111 modify conference record in the system ###################### @@ -17732,6 +18537,86 @@ if ($ADD==100000000000) echo "
\n"; } +###################### +# ADD=130000000000 display all conf templates +###################### +if ($ADD==130000000000) + { + echo "
\n"; + echo ""; + + $stmt="SELECT template_id,template_name from vicidial_conf_templates order by template_id"; + $rslt=mysql_query($stmt, $link); + $templates_to_print = mysql_num_rows($rslt); + + echo "
CONF TEMPLATE LISTINGS:\n"; + echo "
\n"; + echo ""; + echo ""; + echo ""; + echo "\n"; + + $o=0; + while ($templates_to_print > $o) + { + $row=mysql_fetch_row($rslt); + if (eregi("1$|3$|5$|7$|9$", $o)) + {$bgcolor='bgcolor="#B9CBFD"';} + else + {$bgcolor='bgcolor="#9BB9FB"';} + echo ""; + echo ""; + echo "\n"; + $o++; + } + + echo "
Template IDTemplate NameMODIFY
$row[0]$row[1]MODIFY
\n"; + } + +###################### +# ADD=140000000000 display all conf templates +###################### +if ($ADD==140000000000) + { + echo "\n"; echo "\n"; echo "\n"; - echo "\n"; + echo "\n"; echo "\n"; } echo "
\n"; + echo ""; + + $stmt="SELECT carrier_id,carrier_name,server_ip,protocol,registration_string,active from vicidial_server_carriers order by carrier_id"; + $rslt=mysql_query($stmt, $link); + $carriers_to_print = mysql_num_rows($rslt); + + echo "
CONF TEMPLATE LISTINGS:\n"; + echo "
\n"; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo "\n"; + + $o=0; + while ($carriers_to_print > $o) + { + $row=mysql_fetch_row($rslt); + if (eregi("1$|3$|5$|7$|9$", $o)) + {$bgcolor='bgcolor="#B9CBFD"';} + else + {$bgcolor='bgcolor="#9BB9FB"';} + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo "\n"; + $o++; + } + + echo "
Template IDTemplate NameServer IPProtocolRegistrationActiveMODIFY
$row[0]$row[1]$row[2]$row[3]$row[4]$row[5]MODIFY
\n"; + } + ###################### # ADD=1000000000000 display all conferences ###################### diff --git a/www/vicidial/admin_search_lead.php b/www/vicidial/admin_search_lead.php index ecf371dc..e57d531c 100644 --- a/www/vicidial/admin_search_lead.php +++ b/www/vicidial/admin_search_lead.php @@ -235,7 +235,7 @@ else echo "
$row[13] $row[15]$row[19]$row[28]$row[2]$row[31]
\n";