Changed park call MoH run time to use servers.vicidial_recording_limit setting

git-svn-id: svn://192.168.202.10@3992 3d104415-ff17-0410-8863-d5cf3c621b8a
This commit is contained in:
mattf
2026-05-15 14:41:39 +00:00
parent 57972f94bf
commit 2f0e65d493
2 changed files with 11 additions and 7 deletions
+9 -5
View File
@@ -12,7 +12,7 @@
# exten => 8301,3,Playback(park) # exten => 8301,3,Playback(park)
# exten => 8301,4,Hangup # exten => 8301,4,Hangup
# #
# Copyright (C) 2018 Matt Florell <vicidial@gmail.com> LICENSE: AGPLv2 # Copyright (C) 2026 Matt Florell <vicidial@gmail.com> LICENSE: AGPLv2
# #
# changes: # changes:
# 60731-1423 - changed to use DBI-DBD::mysql # 60731-1423 - changed to use DBI-DBD::mysql
@@ -22,6 +22,7 @@
# 101004-1012 - Changed park to Music On Hold, added option for park on AGI # 101004-1012 - Changed park to Music On Hold, added option for park on AGI
# 130108-1817 - Changes for Asterisk 1.8 compatibility # 130108-1817 - Changes for Asterisk 1.8 compatibility
# 180430-1842 - Added inbound_groups-park_ext option # 180430-1842 - Added inbound_groups-park_ext option
# 260515-0937 - Changed run time to use servers.vicidial_recording_limit setting
# #
$script = 'park_CID.agi'; $script = 'park_CID.agi';
@@ -36,6 +37,7 @@ if ($min < 10) {$min = "0$min";}
if ($sec < 10) {$sec = "0$sec";} if ($sec < 10) {$sec = "0$sec";}
$now_date_epoch = time(); $now_date_epoch = time();
$now_date = "$year-$mon-$mday $hour:$min:$sec"; $now_date = "$year-$mon-$mday $hour:$min:$sec";
$DBvicidial_recording_limit=6;
# default path to astguiclient configuration file: # default path to astguiclient configuration file:
$PATHconf = '/etc/astguiclient.conf'; $PATHconf = '/etc/astguiclient.conf';
@@ -87,7 +89,7 @@ $dbhA = DBI->connect("DBI:mysql:$VARDB_database:$VARDB_server:$VARDB_port", "$VA
or die "Couldn't connect to database: " . DBI->errstr; or die "Couldn't connect to database: " . DBI->errstr;
### Grab Server values from the database ### Grab Server values from the database
$stmtA = "SELECT agi_output FROM servers where server_ip = '$VARserver_ip';"; $stmtA = "SELECT agi_output,vicidial_recording_limit FROM servers where server_ip = '$VARserver_ip';";
$sthA = $dbhA->prepare($stmtA) or die "preparing: ",$dbhA->errstr; $sthA = $dbhA->prepare($stmtA) or die "preparing: ",$dbhA->errstr;
$sthA->execute or die "executing: $stmtA ", $dbhA->errstr; $sthA->execute or die "executing: $stmtA ", $dbhA->errstr;
$sthArows=$sthA->rows; $sthArows=$sthA->rows;
@@ -96,7 +98,8 @@ while ($sthArows > $rec_count)
{ {
$AGILOG = '0'; $AGILOG = '0';
@aryA = $sthA->fetchrow_array; @aryA = $sthA->fetchrow_array;
$DBagi_output = $aryA[0]; $DBagi_output = $aryA[0];
$DBvicidial_recording_limit = $aryA[1];
if ($DBagi_output =~ /STDERR/) {$AGILOG = '1';} if ($DBagi_output =~ /STDERR/) {$AGILOG = '1';}
if ($DBagi_output =~ /FILE/) {$AGILOG = '2';} if ($DBagi_output =~ /FILE/) {$AGILOG = '2';}
if ($DBagi_output =~ /BOTH/) {$AGILOG = '3';} if ($DBagi_output =~ /BOTH/) {$AGILOG = '3';}
@@ -104,6 +107,7 @@ while ($sthArows > $rec_count)
} }
$sthA->finish(); $sthA->finish();
$DBvicidial_recording_limit_seconds = ($DBvicidial_recording_limit * 60);
### begin parsing run-time options ### ### begin parsing run-time options ###
if (length($ARGV[0])>1) if (length($ARGV[0])>1)
@@ -338,13 +342,13 @@ $AGI->stream_file('sip-silence');
$AGI->stream_file('sip-silence'); $AGI->stream_file('sip-silence');
$AGI->stream_file('sip-silence'); $AGI->stream_file('sip-silence');
if ($AGILOG) {$agi_string = "-- Starting MoH: |$park_context| |$callerid|"; &agi_output;} if ($AGILOG) {$agi_string = "-- Starting MoH: |$park_context| |$callerid| |Run limit seconds: $DBvicidial_recording_limit_seconds"; &agi_output;}
print "SET MUSIC ON $park_context\n"; print "SET MUSIC ON $park_context\n";
$result = <STDIN>; $result = <STDIN>;
checkresult($result); checkresult($result);
sleep(360); sleep($DBvicidial_recording_limit_seconds);
if ($AGILOG) {$agi_string = "-- MoH Done: |$callerid|"; &agi_output;} if ($AGILOG) {$agi_string = "-- MoH Done: |$callerid|"; &agi_output;}
@@ -1,4 +1,4 @@
# version: 20260514155501 # version: 20260515103901
users-user User ID <QXZ>This field is where you put the users ID number, can be up to 20 digits in length, Must be at least 2 characters in length. We strongly recommend not reusing user accounts for different users, for reporting accuracy. To disable a user account, set the Active option to -N-.</QXZ> users-user User ID <QXZ>This field is where you put the users ID number, can be up to 20 digits in length, Must be at least 2 characters in length. We strongly recommend not reusing user accounts for different users, for reporting accuracy. To disable a user account, set the Active option to -N-.</QXZ>
users-pass Password <QXZ>This field is where you put the users password. Must be at least 2 characters in length, unless the User Password Minimum Length system setting is enabled, which will require a longer password. Only letters and numbers are allowed in user passwords. A medium strength user password will be at least 10 characters in length, and a strong user password will be at least 20 characters in length and have letters as well as at least one number. It is recommended that you use a longer password if possible, stringing together several unrelated words with no spaces, and a number somewhere in the string. The maximum size of a password is 100 characters.</QXZ> users-pass Password <QXZ>This field is where you put the users password. Must be at least 2 characters in length, unless the User Password Minimum Length system setting is enabled, which will require a longer password. Only letters and numbers are allowed in user passwords. A medium strength user password will be at least 10 characters in length, and a strong user password will be at least 20 characters in length and have letters as well as at least one number. It is recommended that you use a longer password if possible, stringing together several unrelated words with no spaces, and a number somewhere in the string. The maximum size of a password is 100 characters.</QXZ>
users-force_change_password Force Change Password <QXZ>If this option is set to Y then the user will be prompted to change their password the next time they log in to the administration webpage or the agent screen. Default is N.</QXZ> users-force_change_password Force Change Password <QXZ>If this option is set to Y then the user will be prompted to change their password the next time they log in to the administration webpage or the agent screen. Default is N.</QXZ>
@@ -1096,7 +1096,7 @@ servers-generate_conf Generate conf files <QXZ>If you would like the system to a
servers-rebuild_conf_files Rebuild conf files <QXZ>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.</QXZ> servers-rebuild_conf_files Rebuild conf files <QXZ>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.</QXZ>
servers-rebuild_music_on_hold Rebuild Music On Hold <QXZ>If you want to force a rebuilding of the music on hold files or if the music on hold entries or server entries have changed then this should be set to Y. After the music on hold files have been synchronized and reloaded then this will be changed to N. Default is Y.</QXZ> servers-rebuild_music_on_hold Rebuild Music On Hold <QXZ>If you want to force a rebuilding of the music on hold files or if the music on hold entries or server entries have changed then this should be set to Y. After the music on hold files have been synchronized and reloaded then this will be changed to N. Default is Y.</QXZ>
servers-sounds_update Sounds Update <QXZ>If you want to force a check of the sound files on this server, and the central audio store is enabled as a system setting, then this field will allow the sounds updater to run at the next top of the minute. Any time an audio file is uploaded from the web interface this is automatically set to Y for all servers that have Asterisk active. Default is N.</QXZ> servers-sounds_update Sounds Update <QXZ>If you want to force a check of the sound files on this server, and the central audio store is enabled as a system setting, then this field will allow the sounds updater to run at the next top of the minute. Any time an audio file is uploaded from the web interface this is automatically set to Y for all servers that have Asterisk active. Default is N.</QXZ>
servers-recording_limit Recording Limit <QXZ>This field is where you set the maximum number of minutes that a call recording initiated by the system can be. Default is 60 minutes. This setting also limits the amount of time a 3-way call that has been left by an agent will stay up before it is terminated.</QXZ> servers-recording_limit Recording Limit <QXZ>This field is where you set the maximum number of minutes that a call recording initiated by the system can be. Default is 60 minutes. This setting also limits the amount of time a 3-way call that has been left by an agent will stay up before it is terminated. This setting is also used to determine the amount of time the defined Parked Call Music-on-Hold will play to customer calls parked by an agent in the Agent Screen.</QXZ>
servers-carrier_logging_active Carrier Logging Active <QXZ>This setting allows you to log all hangup return codes for any outbound list dialing calls that you are placing. Default is N.</QXZ> servers-carrier_logging_active Carrier Logging Active <QXZ>This setting allows you to log all hangup return codes for any outbound list dialing calls that you are placing. Default is N.</QXZ>
servers-gather_asterisk_output Gather Asterisk Output <QXZ>This setting allows you to activate a process that can run every 5 minutes on an active asterisk server and log the SIP/IAX peers and registry output along with the last 1000 lines of Asterisk CLI output. This output is then available to be displayed in the Asterisk Output Report on the Admin Utilities page. Default is N for inactive.</QXZ> servers-gather_asterisk_output Gather Asterisk Output <QXZ>This setting allows you to activate a process that can run every 5 minutes on an active asterisk server and log the SIP/IAX peers and registry output along with the last 1000 lines of Asterisk CLI output. This output is then available to be displayed in the Asterisk Output Report on the Admin Utilities page. Default is N for inactive.</QXZ>
servers-conf_qualify Conf Qualify <QXZ>This setting allows you to add or remove the qualify entries in the Asterisk conf files. Default is Y for active.</QXZ> servers-conf_qualify Conf Qualify <QXZ>This setting allows you to add or remove the qualify entries in the Asterisk conf files. Default is Y for active.</QXZ>