[Astpp-commit] SF.net SVN: astpp:[2218] trunk
Brought to you by:
darrenkw
|
From: <dar...@us...> - 2008-12-07 01:07:00
|
Revision: 2218
http://astpp.svn.sourceforge.net/astpp/?rev=2218&view=rev
Author: darrenkw
Date: 2008-12-07 01:06:53 +0000 (Sun, 07 Dec 2008)
Log Message:
-----------
Corrected Freeswitch max call length support.
Modified Paths:
--------------
trunk/astpp-common.pl
trunk/freeswitch/astpp-fs-xml.pl
trunk/sql/astpp-2008-12-06.sql
Modified: trunk/astpp-common.pl
===================================================================
--- trunk/astpp-common.pl 2008-12-06 22:37:02 UTC (rev 2217)
+++ trunk/astpp-common.pl 2008-12-07 01:06:53 UTC (rev 2218)
@@ -3677,12 +3677,18 @@
}
if ( $numdata->{cost} > 0 ) {
$maxlength = ( ( $credit - $numdata->{connectcost} ) / $numdata->{cost} );
+ if ($config->{call_max_length} && $maxlength < $config->{call_max_length} / 1000){
+ $maxlength = $config->{call_max_length} / 1000 / 60;
+ }
}
else {
$maxlength = $config->{max_free_length}; # If the call is set to be free then assign a max length.
}
if ( $numdata->{cost} > 0 ) {
$maxlength = ( ( $credit - $numdata->{connectcost} ) / $numdata->{cost} );
+ if ($config->{call_max_length} && $maxlength < $config->{call_max_length} / 1000){
+ $maxlength = $config->{call_max_length} / 1000 / 60;
+ }
}
else {
$maxlength = $config->{max_free_length}; # If the call is set to be free then assign a max length.
Modified: trunk/freeswitch/astpp-fs-xml.pl
===================================================================
--- trunk/freeswitch/astpp-fs-xml.pl 2008-12-06 22:37:02 UTC (rev 2217)
+++ trunk/freeswitch/astpp-fs-xml.pl 2008-12-07 01:06:53 UTC (rev 2218)
@@ -190,6 +190,8 @@
$xml = $ASTPP->fs_dialplan_xml_footer( xml => $xml );
print $xml;
exit(0);
+ } elsif ($config->{call_max_length} && $maxlength < $config->{call_max_length} / 1000){
+ $maxlength = $config->{call_max_length} / 1000;
}
$xml = $ASTPP->fs_dialplan_xml_timelimit(
@@ -229,6 +231,8 @@
}
}
$xml = $ASTPP->fs_dialplan_xml_footer( xml => $xml );
+ $ASTPP->debug( debug => $xml );
+ print $xml;
}
elsif ( $params->{section} eq "directory" ) {
@@ -264,7 +268,7 @@
);
$xml = $ASTPP->fs_directory_xml_footer( xml => $xml );
}
+ $ASTPP->debug( debug => $xml );
+ print $xml;
}
-$ASTPP->debug( debug => $xml );
-print $xml;
exit(0);
Modified: trunk/sql/astpp-2008-12-06.sql
===================================================================
--- trunk/sql/astpp-2008-12-06.sql 2008-12-06 22:37:02 UTC (rev 2217)
+++ trunk/sql/astpp-2008-12-06.sql 2008-12-07 01:06:53 UTC (rev 2218)
@@ -782,6 +782,9 @@
INSERT INTO system (name, value, comment, timestamp) VALUES (
'astman_secret', 'amp111','Asterisk(tm) Manager Interface Secret', '');
+INSERT INTO system (name, value, comment, timestamp) VALUES (
+'call_max_length','1440000','What is the maximum length (in ms) of a LCR call?','');
+
------ 3rd Party PBX Mods
INSERT INTO system (name, value, comment, timestamp) VALUES (
'thirdlane_mods','0','Provides a few different modifications across the rating code to work better with Thirdlane(tm) cdrs.','');
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|