[freeside-commits] freeside/httemplate/misc phonenums.cgi,1.1,1.2
Erik Levinson
levinse at wavetail.420.am
Mon Jan 10 11:45:00 PST 2011
Update of /home/cvs/cvsroot/freeside/httemplate/misc
In directory wavetail.420.am:/tmp/cvs-serv19789/httemplate/misc
Modified Files:
phonenums.cgi
Log Message:
vitelity API improvements for toll-free and fax, RT11009
Index: phonenums.cgi
===================================================================
RCS file: /home/cvs/cvsroot/freeside/httemplate/misc/phonenums.cgi,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -w -d -r1.1 -r1.2
--- phonenums.cgi 28 Jun 2008 23:03:09 -0000 1.1
+++ phonenums.cgi 10 Jan 2011 19:44:43 -0000 1.2
@@ -1,12 +1,8 @@
-%# [ <% join(', ', map { qq("$_") } @exchanges) %> ]
<% objToJson(\@exchanges) %>
<%init>
my( $exchangestring, $svcpart ) = $cgi->param('arg');
-$exchangestring =~ /\((\d{3})-(\d{3})-XXXX\)\s*$/i
- or die "unparsable exchange: $exchangestring";
-my( $areacode, $exchange ) = ( $1, $2 );
my $part_svc = qsearchs('part_svc', { 'svcpart'=>$svcpart } );
die "unknown svcpart $svcpart" unless $part_svc;
@@ -18,12 +14,19 @@
}
my $export = $exports[0];
-my $something = $export->get_dids('areacode'=>$areacode,
- 'exchange'=>$exchange,
- );
-
-#warn Dumper($something);
+my %opts = ();
+if ( $exchangestring eq 'tollfree' ) {
+ $opts{'tollfree'} = 1;
+}
+else {
+ $exchangestring =~ /\((\d{3})-(\d{3})-XXXX\)\s*$/i
+ or die "unparsable exchange: $exchangestring";
+ my( $areacode, $exchange ) = ( $1, $2 );
+ $opts{'areacode'} = $areacode;
+ $opts{'exchange'} = $exchange;
+}
+my $something = $export->get_dids(%opts);
my @exchanges = @{ $something };
</%init>
More information about the freeside-commits
mailing list