diff --git a/agc_2-X/trunk/bin/AST_conf_update.pl b/agc_2-X/trunk/bin/AST_conf_update.pl index 6087ba30..a7f5aa3c 100644 --- a/agc_2-X/trunk/bin/AST_conf_update.pl +++ b/agc_2-X/trunk/bin/AST_conf_update.pl @@ -1,10 +1,10 @@ #!/usr/bin/perl # -# AST_conf_update.pl version 2.0.5 *DBI-version* +# AST_conf_update.pl version 2.4 # # This script checks if there are channels in reserved conferences # -# Copyright (C) 2008 Matt Florell LICENSE: AGPLv2 +# Copyright (C) 2010 Matt Florell LICENSE: AGPLv2 # # 50810-1532 - Added database server variable definitions lookup # 50823-1456 - Added commandline arguments for debug at runtime @@ -13,6 +13,7 @@ # 80506-1055 - Added check for vicidial_conferences in 3WAY # 80914-1533 - Added kickall for leave-3way calls after one hour # 81008-0937 - Added kickall from vicidial_conferences if only one participant +# 100625-1220 - Added waitfors after logout to fix broken pipe errors in asterisk # # constants @@ -313,6 +314,7 @@ foreach(@PTextensions) $t->buffer_empty; @hangup = $t->cmd(String => "Action: Logoff\n\n", Prompt => "/.*/"); $t->buffer_empty; +$t->waitfor(Match => '/Message:.*\n\n/', Timeout => 10); $ok = $t->close; @@ -421,6 +423,7 @@ foreach(@PTextensions) $t->buffer_empty; @hangup = $t->cmd(String => "Action: Logoff\n\n", Prompt => "/.*/"); $t->buffer_empty; +$t->waitfor(Match => '/Message:.*\n\n/', Timeout => 10); $ok = $t->close; $dbhA->disconnect(); diff --git a/agc_2-X/trunk/bin/AST_manager_listen.pl b/agc_2-X/trunk/bin/AST_manager_listen.pl index c327dfd6..6bc14bf7 100644 --- a/agc_2-X/trunk/bin/AST_manager_listen.pl +++ b/agc_2-X/trunk/bin/AST_manager_listen.pl @@ -33,6 +33,7 @@ # 60906-1714 - added updating for special vicidial conference calls # 71129-2004 - Fixed SQL error # 100416-0635 - Added fix for extension append feature +# 100625-1220 - Added waitfors after logout to fix broken pipe errors in asterisk # # constants @@ -661,6 +662,8 @@ while($one_day_interval > 0) @hangup = $tn->cmd(String => "Action: Logoff\n\n", Prompt => "/.*/", Errmode => Return, Timeout => 1); + $tn->buffer_empty; + $tn->waitfor(Match => '/Message:.*\n\n/', Timeout => 10); $ok = $tn->close; $one_day_interval--; diff --git a/agc_2-X/trunk/bin/AST_phone_update.pl b/agc_2-X/trunk/bin/AST_phone_update.pl index cb8f84cd..97c7b066 100644 --- a/agc_2-X/trunk/bin/AST_phone_update.pl +++ b/agc_2-X/trunk/bin/AST_phone_update.pl @@ -1,13 +1,14 @@ #!/usr/bin/perl # -# AST_phone_update.pl version 2.0.5 *DBI-version* +# AST_phone_update.pl version 2.4 # # DESCRIPTION: # checks the registered IP address of the phone and updates the phones table # -# Copyright (C) 2008 Matt Florell LICENSE: AGPLv2 +# Copyright (C) 2010 Matt Florell LICENSE: AGPLv2 # # 70521-1529 - first build +# 100625-1220 - Added waitfors after logout to fix broken pipe errors in asterisk # # constants @@ -217,6 +218,7 @@ foreach(@PTextensions) $t->buffer_empty; @hangup = $t->cmd(String => "Action: Logoff\n\n", Prompt => "/.*/"); $t->buffer_empty; +$t->waitfor(Match => '/Message:.*\n\n/', Timeout => 10); $ok = $t->close; ############# END SIP SECTION ################################################ @@ -304,6 +306,7 @@ foreach(@PTextensions) $t->buffer_empty; @hangup = $t->cmd(String => "Action: Logoff\n\n", Prompt => "/.*/"); $t->buffer_empty; +$t->waitfor(Match => '/Message:.*\n\n/', Timeout => 10); $ok = $t->close; ############# END IAX2 SECTION ################################################ diff --git a/agc_2-X/trunk/bin/AST_send_action_child.pl b/agc_2-X/trunk/bin/AST_send_action_child.pl index 25b233c9..92f52b95 100644 --- a/agc_2-X/trunk/bin/AST_send_action_child.pl +++ b/agc_2-X/trunk/bin/AST_send_action_child.pl @@ -1,6 +1,6 @@ #!/usr/bin/perl # -# AST_send_action_child.pl version 2.0.5 *DBI-version +# AST_send_action_child.pl version 2.4 # # Part of the Asterisk Central Queue System (ACQS) # @@ -14,24 +14,30 @@ # to be executed. connect to the manager interface, send the action and logoff # then exit. # -# Copyright (C) 2008 Matt Florell LICENSE: AGPLv2 +# Copyright (C) 2010 Matt Florell LICENSE: AGPLv2 # # CHANGES # 50810-1547 - Added database server variable definitions lookup # 50823-1527 - Altered commandline debug options with debug printouts # 50902-1032 - Changed default logging to fulllog -# 60718-0909 - changed to DBI by Marin Blu -# 60718-1024 - changed to use /etc/astguiclient.conf for configs -# 60814-1720 - added option for no logging to file -# 60817-1244 - removed all DB calls and config file open to reduce footprint -# 61004-1728 - added ability to parse volume control and lookup meetme IDs -# 61220-1720 - optimize and clean code, lc. -# 61221-1942 - additional modification to structure, lc. -# 80418-0927 - added man_id to logging output for better tracking, raised sleep times +# 60718-0909 - Changed to DBI by Marin Blu +# 60718-1024 - Changed to use /etc/astguiclient.conf for configs +# 60814-1720 - Added option for no logging to file +# 60817-1244 - Removed all DB calls and config file open to reduce footprint +# 61004-1728 - Added ability to parse volume control and lookup meetme IDs +# 61220-1720 - Optimize and clean code +# 61221-1942 - Additional modification to structure +# 80418-0927 - Added man_id to logging output for better tracking, raised sleep times +# 100625-1141 - Added waitfors after orginate and logout to fix broken pipe errors in asterisk +# 100625-1206 - Use strict is a performance hit and should only be uncommented for debugging # $|++; -use strict; + +# use strict is a performance hit and should only be uncommented for debugging +#use strict; +# + use Getopt::Long; use Net::Telnet; @@ -223,8 +229,9 @@ if ($action) { my @list_channels = $tn->cmd(String => $originate_command, Prompt => '/.*/'); - sleep(4); - + $tn->waitfor(Match => '/Response:.*\n/', Timeout => 10); + $tn->waitfor(Match => '/Message:.*\n\n/', Timeout => 10); + my $data1; # ? Useless ? if ($FULL_LOG and $SYSLOG) { my $event_string = $man_id . "|1|" . $data1 . "|"; @@ -239,8 +246,10 @@ if ($action) { $tn->buffer_empty; #@hangup = $tn->cmd(String => "Action: Logoff\n\n", Prompt => "/.*/"); - $tn->cmd(String => "Action: Logoff\n\n", Prompt => "/.*/"); - sleep(3); + $tn->cmd(String => "Action: Logoff\n\n", Prompt => "/.*/"); + $tn->buffer_empty; + + $tn->waitfor(Match => '/Message:.*\n\n/', Timeout => 10); if ($FULL_LOG and $SYSLOG) { my $event_string = $man_id . "|2|" . $data1 . "|"; diff --git a/agc_2-X/trunk/bin/AST_update.pl b/agc_2-X/trunk/bin/AST_update.pl index 734e27f4..811b1162 100644 --- a/agc_2-X/trunk/bin/AST_update.pl +++ b/agc_2-X/trunk/bin/AST_update.pl @@ -1,6 +1,6 @@ #!/usr/bin/perl # -# AST_update.pl version 2.0.5 *DBI-version* +# AST_update.pl version 2.4 # # DESCRIPTION: # uses the Asterisk Manager interface and Net::MySQL to update the live_channels @@ -30,7 +30,7 @@ # # It is recommended that you run this program on the local Asterisk machine # -# Copyright (C) 2009 Matt Florell LICENSE: AGPLv2 +# Copyright (C) 2010 Matt Florell LICENSE: AGPLv2 # # version changes: # 41228-1659 - modified to compensate for manager output response hiccups @@ -58,9 +58,10 @@ # 80111-1850 - fixed server_updater record missing bug # 90307-1932 - Added servers table stats updating, reformatted code to match standard # 90604-1127 - Added support for DAHDI channels +# 100625-1220 - Added waitfors after logout to fix broken pipe errors in asterisk # -$build = '90604-1127'; +$build = '100625-1220'; # constants $SYSPERF=0; # system performance logging to MySQL server_performance table every 5 seconds @@ -1044,6 +1045,8 @@ while($one_day_interval > 0) @hangup = $t->cmd(String => "Action: Logoff\n\n", Prompt => "/.*/"); + $t->buffer_empty; + $t->waitfor(Match => '/Message:.*\n\n/', Timeout => 10); $ok = $t->close; $one_day_interval--; diff --git a/agc_2-X/trunk/bin/AST_vm_update.pl b/agc_2-X/trunk/bin/AST_vm_update.pl index e1df04fb..ee2dc3a2 100644 --- a/agc_2-X/trunk/bin/AST_vm_update.pl +++ b/agc_2-X/trunk/bin/AST_vm_update.pl @@ -1,6 +1,6 @@ #!/usr/bin/perl # -# AST_vm_update.pl version 2.2.0 *DBI-version* +# AST_vm_update.pl version 2.4 # # DESCRIPTION: # uses the Asterisk Manager interface to update the count of voicemail messages @@ -12,13 +12,14 @@ # more than this either change the cron when this script is run or change the # wait interval below # -# Copyright (C) 2009 Matt Florell LICENSE: AGPLv2 +# Copyright (C) 2010 Matt Florell LICENSE: AGPLv2 # # 50823-1422 - Added database server variable definitions lookup # 50823-1452 - Added commandline arguments for debug at runtime # 60717-1204 - Changed to DBI by Marin Blu # 60715-2301 - Changed to use /etc/astguiclient.conf for configs # 90919-1739 - Added other voicemail checking from vicidial_voicemail table +# 100625-1220 - Added waitfors after logout to fix broken pipe errors in asterisk # # constants @@ -299,6 +300,7 @@ if ($active_voicemail_server > 0) $t->buffer_empty; @hangup = $t->cmd(String => "Action: Logoff\n\n", Prompt => "/.*/"); $t->buffer_empty; +$t->waitfor(Match => '/Message:.*\n\n/', Timeout => 10); $ok = $t->close;