reworked screen starting of asterisk and reloading of conf settings
trunk- new VICIDIAL_IN_new_lead files format and vtiger import changes git-svn-id: svn://192.168.202.10@1084 3d104415-ff17-0410-8863-d5cf3c621b8a
This commit is contained in:
@@ -15,6 +15,7 @@
|
||||
# 80526-1350 - Added option 9 for timeclock auto-logout
|
||||
# 90211-1236 - Added auto-generation of conf files functions
|
||||
# 90213-0625 - Separated the reloading of Asterisk into 4 separate steps
|
||||
# 90325-2239 - Rewrote sending of reload commands to Asterisk
|
||||
#
|
||||
|
||||
$DB=0; # Debug flag
|
||||
@@ -506,11 +507,8 @@ if ( ($active_asterisk_server =~ /Y/) && ($generate_vicidial_conf =~ /Y/) && ($r
|
||||
{
|
||||
if ($DB) {print "generating new auto-gen conf files\n";}
|
||||
|
||||
if (-e "/root/asterisk_command_reload_iax2")
|
||||
{
|
||||
$stmtA="UPDATE servers SET rebuild_conf_files='N' where server_ip='$server_ip';";
|
||||
$affected_rows = $dbhA->do($stmtA);
|
||||
}
|
||||
$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='*';
|
||||
@@ -883,34 +881,27 @@ if ( ($active_asterisk_server =~ /Y/) && ($generate_vicidial_conf =~ /Y/) && ($r
|
||||
if ($DB) {print "reloading asterisk\n";}
|
||||
if ($asterisk_version =~ /^1.2/)
|
||||
{
|
||||
`echo iax2\ reload > /root/asterisk_command_reload_iax2`;
|
||||
`echo sip\ reload > /root/asterisk_command_reload_sip`;
|
||||
`echo extensions\ reload > /root/asterisk_command_reload_extensions`;
|
||||
`echo reload\ app_voicemail.so > /root/asterisk_command_reload_voicemail`;
|
||||
`screen -XS asterisk eval 'stuff "sip reload\015"'`;
|
||||
sleep(1);
|
||||
`screen -XS asterisk eval 'stuff "iax2 reload\015"'`;
|
||||
sleep(1);
|
||||
`screen -XS asterisk eval 'stuff "extensions reload\015"'`;
|
||||
sleep(1);
|
||||
`screen -XS asterisk eval 'stuff "reload app_voicemail.so\015"'`;
|
||||
sleep(1);
|
||||
}
|
||||
else
|
||||
{
|
||||
`echo iax2\ reload > /root/asterisk_command_reload_iax2`;
|
||||
`echo sip\ reload > /root/asterisk_command_reload_sip`;
|
||||
`echo dialplan\ reload > /root/asterisk_command_reload_extensions`;
|
||||
`echo reload\ app_voicemail.so > /root/asterisk_command_reload_voicemail`;
|
||||
`screen -XS asterisk eval 'stuff "sip reload\015"'`;
|
||||
sleep(1);
|
||||
`screen -XS asterisk eval 'stuff "iax2 reload\015"'`;
|
||||
sleep(1);
|
||||
`screen -XS asterisk eval 'stuff "dialplan reload\015"'`;
|
||||
sleep(1);
|
||||
`screen -XS asterisk eval 'stuff "module reload app_voicemail.so\015"'`;
|
||||
sleep(1);
|
||||
}
|
||||
`screen -XS asterisk readbuf /root/asterisk_command_reload_iax2`;
|
||||
sleep(1);
|
||||
`screen -XS asterisk paste .`;
|
||||
sleep(3);
|
||||
`screen -XS asterisk readbuf /root/asterisk_command_reload_sip`;
|
||||
sleep(1);
|
||||
`screen -XS asterisk paste .`;
|
||||
sleep(3);
|
||||
`screen -XS asterisk readbuf /root/asterisk_command_reload_extensions`;
|
||||
sleep(1);
|
||||
`screen -XS asterisk paste .`;
|
||||
sleep(3);
|
||||
`screen -XS asterisk readbuf /root/asterisk_command_reload_voicemail`;
|
||||
sleep(1);
|
||||
`screen -XS asterisk paste .`;
|
||||
sleep(10);
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -6,8 +6,9 @@
|
||||
#
|
||||
# CHANGES
|
||||
#
|
||||
# 60814-1658 - added option to start without logging through servers table setting
|
||||
# 60814-1658 - Added option to start without logging through servers table setting
|
||||
# 90309-0905 - Added deleting of asterisk command files
|
||||
# 90325-2238 - Rewrote launching of Asterisk, removed command files
|
||||
#
|
||||
|
||||
# default path to astguiclient configuration file:
|
||||
@@ -61,46 +62,48 @@ $dbhA = DBI->connect("DBI:mysql:$VARDB_database:$VARDB_server:$VARDB_port", "$VA
|
||||
}
|
||||
$sthA->finish();
|
||||
|
||||
if (-e "/root/asterisk_command_reload_iax2")
|
||||
{
|
||||
### find the find binary
|
||||
$findbin = '';
|
||||
if ( -e ('/bin/find')) {$findbin = '/bin/find';}
|
||||
else
|
||||
{
|
||||
if ( -e ('/sbin/find')) {$findbin = '/sbin/find';}
|
||||
else
|
||||
{
|
||||
if ( -e ('/usr/bin/find')) {$findbin = '/usr/bin/find';}
|
||||
else
|
||||
{
|
||||
if ( -e ('/usr/local/bin/find')) {$findbin = '/usr/local/bin/find';}
|
||||
else
|
||||
{
|
||||
print "Can't find find binary! Exiting...\n";
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
`$findbin /root/ -maxdepth 1 -name "asterisk_command*" -print | xargs rm -f`;
|
||||
|
||||
`ulimit -n 65536`;
|
||||
|
||||
}
|
||||
`ulimit -n 65536`;
|
||||
|
||||
if ($SYSLOG)
|
||||
{
|
||||
print "\nStarting Asterisk... screen logging on\n";
|
||||
`/usr/bin/screen -L -d -m -S asterisk /usr/sbin/asterisk -vvvvvvvvvvvvvvvvvvvvvgc`;
|
||||
`/usr/bin/screen -d -m -S astershell /usr/bin/screen -S astshell`;
|
||||
print "started screen\n";
|
||||
|
||||
sleep(1);
|
||||
`screen -XS astshell eval 'stuff "cd /var/log/astguiclient\015"'`;
|
||||
print "changed directory\n";
|
||||
|
||||
sleep(1);
|
||||
`screen -XS astshell eval 'stuff "screen -L -S asterisk\015"'`;
|
||||
print "started new screen session\n";
|
||||
|
||||
sleep(1);
|
||||
`screen -d astshell`;
|
||||
`screen -d asterisk`;
|
||||
print "detached screens\n";
|
||||
|
||||
sleep(1);
|
||||
`screen -XS asterisk eval 'stuff "ulimit -n 65536\015"'`;
|
||||
print "raised ulimit open files\n";
|
||||
|
||||
sleep(1);
|
||||
`screen -XS asterisk eval 'stuff "/usr/sbin/asterisk -vvvvvvvvvvvvvvvvvvvvvgc\015"'`;
|
||||
print "Asterisk started... screen logging on\n";
|
||||
}
|
||||
else
|
||||
{
|
||||
print "\nStarting Asterisk... screen logging off\n";
|
||||
`/usr/bin/screen -d -m -S asterisk /usr/sbin/asterisk -vvvvgc`;
|
||||
`/usr/bin/screen -d -m -S astershell /usr/bin/screen -S asterisk`;
|
||||
print "started screen\n";
|
||||
|
||||
sleep(1);
|
||||
`screen -d asterisk`;
|
||||
print "detached screen\n";
|
||||
|
||||
sleep(1);
|
||||
`screen -XS asterisk eval 'stuff "ulimit -n 65536\015"'`;
|
||||
print "raised ulimit open files\n";
|
||||
|
||||
sleep(1);
|
||||
`screen -XS asterisk eval 'stuff "/usr/sbin/asterisk -vvvvgc\015"'`;
|
||||
print "Asterisk started... screen logging off\n";
|
||||
}
|
||||
|
||||
print "Asterisk started\n";
|
||||
|
||||
sleep(10);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user