Abdul Lateef wrote:
hmmHi,
I have one mySQL table contains
Code, Country Name
I want to get the code using Called-Station-ID matching with mySQL country list table using the perl file.
If anyone can give me a little example really it will be great for me.
Thank You
__________________________________ Celebrate Yahoo!'s 10th Birthday! Yahoo! Netrospective: 100 Moments of the Web http://birthday.yahoo.com/netrospective/
- List info/subscribe/unsubscribe? See http://www.freeradius.org/list/users.html
radius's CalledStationId is the MAC address of the network device over which the radius login was done. In my case (I am using wlan routers with chillispot) it is the MAC of the wlan router to which to user who logged in was connected when logging in.
Now I dunno if u can figure a country code outta a MAC Address but I suppose u can't since MAC is not country dependent. Its a unique hardware address.
Now if u know where your login devices are (in wich countries) u could creade a table containing the MAC and a country code.
And then use some inner join to select the CalledStationId and the Country.
I'm doing something similar.
I have a table that contains info on every wlan router that uses my radius server. It contains the MAC, ESSID and Name.
Now for statistical listings I use the CalledStationId in the table radacct to select the Name of the router outta that table.
U could something similar with countries.
As I said: make a table containig MAC and Countrycode and use it.
SQL Syntax is something like this:
SELECT radacct.CalledStationId,Country.Country FROM radacct,Country,CountryMac WHERE (radacct.CalledStationId = CountryMac.MAC) AND (CountryMAC.Code = Country.Code)
Country is your country list table CountryMac is the table that contains datasets with MAC and Countrycode raddacct is radius's accounting table (usually radacct)
The table Country of course has to be in the radius DB!
If u use that in a perl or php script or sth like that u could of course do this in several steps.
e.g.
1. select the country code out of CountryMac via radacct.CalledStationId
2. select the country out of Country by that country code
Hope it helps you...
Greets from snowy germany Sebastian
- List info/subscribe/unsubscribe? See http://www.freeradius.org/list/users.html

