Revision: 2338
http://astpp.svn.sourceforge.net/astpp/?rev=2338&view=rev
Author: darrenkw
Date: 2011-05-07 03:19:33 +0000 (Sat, 07 May 2011)
Log Message:
-----------
Remove tailing | from FreeSWITCH bridge command.
Modified Paths:
--------------
trunk/freeswitch/astpp-fs-xml.pl
trunk/modules/ASTPP/lib/ASTPP.pm
Modified: trunk/freeswitch/astpp-fs-xml.pl
===================================================================
--- trunk/freeswitch/astpp-fs-xml.pl 2011-05-07 03:09:36 UTC (rev 2337)
+++ trunk/freeswitch/astpp-fs-xml.pl 2011-05-07 03:19:33 UTC (rev 2338)
@@ -267,20 +267,22 @@
my @outboundroutes = &get_outbound_routes( $astpp_db, $params->{'Caller-Destination-Number'},
$carddata, $routeinfo, @reseller_list );
$xml .= $ASTPP->fs_dialplan_xml_bridge_start() if @outboundroutes;
+ my $count = 0;
foreach my $route (@outboundroutes) {
$ASTPP->debug( debug => "$route->{trunk}: cost $route->{cost}\t $route->{pattern}" );
if ( $route->{cost} > $routeinfo->{cost} ) {
$ASTPP->debug( debug => "$route->{trunk}: $route->{cost} > $routeinfo->{cost}, skipping" );
}
else {
- my ($returned_data,$junk) = $ASTPP->fs_dialplan_xml_bridge(
+ $xml .= $ASTPP->fs_dialplan_xml_bridge(
destination_number => $params->{'Caller-Destination-Number'},
route_prepend => $route->{prepend},
trunk_name => $route->{trunk},
- route_id => $route->{id}
+ route_id => $route->{id},
+ count => $count
);
- $xml .= $returned_data;
}
+ $count++;
}
$xml .= $ASTPP->fs_dialplan_xml_bridge_end() if @outboundroutes;
}
Modified: trunk/modules/ASTPP/lib/ASTPP.pm
===================================================================
--- trunk/modules/ASTPP/lib/ASTPP.pm 2011-05-07 03:09:36 UTC (rev 2337)
+++ trunk/modules/ASTPP/lib/ASTPP.pm 2011-05-07 03:19:33 UTC (rev 2338)
@@ -416,14 +416,17 @@
print STDERR "Phone After: $arg{destination_number}\n";
}
}
+ if ($arg{count} > 0) {
+ $dialstring = "|";
+ } else {
+ }
if ( $trunkdata->{tech} eq "Zap" ) {
- $dialstring .= "openzap/" . $trunkdata->{path} . "/1/" . $arg{route_prepend} . $arg{destination_number} ."|";
- return ($dialstring,$data);
+ $dialstring .= "openzap/" . $trunkdata->{path} . "/1/" . $arg{route_prepend} . $arg{destination_number};
+ return ($dialstring);
}
elsif ( $trunkdata->{tech} eq "SIP" ) {
- $data = "sofia/gateway/" . $trunkdata->{path} . "/" . $arg{route_prepend} . $arg{destination_number};
- $dialstring .= $data . "|";
- return ($dialstring,$data);
+ $dialstring .= "sofia/gateway/" . $trunkdata->{path} . "/" . $arg{route_prepend} . $arg{destination_number};
+ return ($dialstring);
}
else {
print STDERR "CANNOT ROUTE THIS CALL!!!!!\n";
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|