[Astpp-commit] SF.net SVN: astpp:[2243] trunk
Brought to you by:
darrenkw
|
From: <dar...@us...> - 2009-03-18 23:25:19
|
Revision: 2243
http://astpp.svn.sourceforge.net/astpp/?rev=2243&view=rev
Author: darrenkw
Date: 2009-03-18 23:25:11 +0000 (Wed, 18 Mar 2009)
Log Message:
-----------
Update code to allow authentication by ip address.
Modified Paths:
--------------
trunk/Makefile
trunk/freeswitch/astpp-fs-xml.pl
trunk/modules/ASTPP/lib/ASTPP.pm
Modified: trunk/Makefile
===================================================================
--- trunk/Makefile 2009-03-11 02:46:52 UTC (rev 2242)
+++ trunk/Makefile 2009-03-18 23:25:11 UTC (rev 2243)
@@ -18,7 +18,7 @@
FS_SCRIPTS=/usr/local/freeswitch/scripts
OWNER=root
-GROUP=wheel
+GROUP=root
WWWDIR=/var/www
all: install
Modified: trunk/freeswitch/astpp-fs-xml.pl
===================================================================
--- trunk/freeswitch/astpp-fs-xml.pl 2009-03-11 02:46:52 UTC (rev 2242)
+++ trunk/freeswitch/astpp-fs-xml.pl 2009-03-18 23:25:11 UTC (rev 2243)
@@ -89,9 +89,9 @@
}
if ( !$params->{variable_accountcode} ) {
$ASTPP->debug(
- debug => "Checking IP Address:" . $params->{network_addr} );
+ debug => "Checking IP Address:" . $params->{'Hunt-Network-Addr'} );
my $ip_data = $ASTPP->ip_address_authenticate(
- ip_address => $params->{network_addr},
+ ip_address => $params->{'Hunt-Network-Addr'},
destination => $params->{'Caller-Destination-Number'}
);
if ($ip_data) {
@@ -218,7 +218,8 @@
$xml = $ASTPP->fs_dialplan_xml_timelimit(
xml => $xml,
- max_length => $maxlength
+ max_length => $maxlength,
+ accountcode => $carddata->{number}
);
# Set the timelimit as well as other variables which are needed in the dialplan.
Modified: trunk/modules/ASTPP/lib/ASTPP.pm
===================================================================
--- trunk/modules/ASTPP/lib/ASTPP.pm 2009-03-11 02:46:52 UTC (rev 2242)
+++ trunk/modules/ASTPP/lib/ASTPP.pm 2009-03-18 23:25:11 UTC (rev 2243)
@@ -95,6 +95,7 @@
. " AND prefix IN (NULL,'') OR ip = " . $self->{_astpp_db}->quote($arg{ip_address});
$tmp .= " AND " . $self->{_astpp_db}->quote($arg{destination}) . " RLIKE prefix" if $arg{destination};
$tmp .= " ORDER BY LENGTH(prefix) DESC LIMIT 1";
+ print STDERR $tmp;
$sql = $self->{_astpp_db}->prepare($tmp);
$sql->execute;
my $anidata = $sql->fetchrow_hashref;
@@ -124,6 +125,7 @@
{
my ($self, %arg) = @_;
$arg{xml} .= "<action application=\"sched_hangup\" data=\"+" . $arg{max_length} * 60 . "\"/>\n";
+ $arg{xml} .= "<action application=\"set\" data=\"accountcode=" . $arg{accountcode} . "\"/>\n";
return $arg{xml};
}
@@ -258,11 +260,11 @@
$tmp .= " AND domain = "
. $self->{_freeswitch_db}->quote($arg{domain});
}
- } else {
- if ($arg{domain}) {
- $tmp .= " WHERE domain = "
- . $self->{_freeswitch_db}->quote($arg{domain});
- }
+# } else {
+# if ($arg{domain}) {
+# $tmp .= " WHERE domain = "
+# . $self->{_freeswitch_db}->quote($arg{domain});
+# }
}
}
print STDERR $tmp;
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|