[Astpp-commit] SF.net SVN: astpp:[2193] trunk/modules/ASTPP/lib/ASTPP.pm
Brought to you by:
darrenkw
|
From: <dar...@us...> - 2008-09-02 05:09:39
|
Revision: 2193
http://astpp.svn.sourceforge.net/astpp/?rev=2193&view=rev
Author: darrenkw
Date: 2008-09-02 05:09:49 +0000 (Tue, 02 Sep 2008)
Log Message:
-----------
Added Freeswitch LCR call time limiting based on available credit.
Modified Paths:
--------------
trunk/modules/ASTPP/lib/ASTPP.pm
Modified: trunk/modules/ASTPP/lib/ASTPP.pm
===================================================================
--- trunk/modules/ASTPP/lib/ASTPP.pm 2008-09-02 05:04:59 UTC (rev 2192)
+++ trunk/modules/ASTPP/lib/ASTPP.pm 2008-09-02 05:09:49 UTC (rev 2193)
@@ -101,11 +101,20 @@
$arg{xml} .= "<document type=\"freeswitch/xml\">\n";
$arg{xml} .= "<section name=\"dialplan\" description=\"ASTPP Dynamic Routing\">\n";
$arg{xml} .= "<context name=\"default\">\n";
- $arg{xml} .= "<extension name=\"$arg{destination_number}\">\n";
- $arg{xml} .= "<condition field=\"destination_number\" expression=\"$arg{destination_number}\">\n";
+ $arg{xml} .= "<extension name=\"" . $arg{destination_number} . "\">\n";
+ $arg{xml} .= "<condition field=\"destination_number\" expression=\"" . $arg{destination_number} . "\">\n";
+ $arg{xml} .= "<action application=\"sched_hangup\" data=\"+" . $arg{max_length} . " /">\n";
return $arg{xml};
}
+sub fs_dialplan_xml_timelimit
+#Return the opening lines of the Freeswitch(TM) xml dialplan
+{
+ my ($self, %arg) = @_;
+ $arg{xml} .= "<action application=\"sched_hangup\" data=\"+" . $arg{max_length} * 60 . " /">\n";
+ return $arg{xml};
+}
+
sub fs_dialplan_xml_bridge
#Return the bridge command along with details. This is only called if a call is approved.
# Requires the following variables:
@@ -142,9 +151,9 @@
$profile =~ s/"//g; #Strip off quotation marks
$dest =~ s/"//g; #Strip off quotation marks
if ($profile eq "gateway") {
- $dialstring = "<action application=\"bridge\" data=\"sofia/gateway/" . $dest . "/" . $arg{route_prepend} . $arg{destination_number} . "\"/>\n";
+ $dialstring = "<action application=\"bridge\" data=\"sofia/gateway/" . $dest . "/" . $arg{route_prepend} . $arg{destination_number} . "\"/>\n";
} else {
- $dialstring = "<action application=\"bridge\" data=\"sofia/" . $profile . "/" . $arg{route_prepend} . $arg{destination_number} . "\@" . $dest . "\"/>\n";
+ $dialstring = "<action application=\"bridge\" data=\"sofia/" . $profile . "/" . $arg{route_prepend} . $arg{destination_number} . "\@" . $dest . "\"/>\n";
}
return $dialstring;
}
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|