3gpp2 parameter starts with '\0'

lamersons m at baltia.net
Mon Jan 12 08:59:47 CET 2009


(debug listed below)
Freeradius 2.x
with Postgre database

I need to store ESN value to my database, but it comes in format[3GPP2-ESN =
"\000\000\000\000\000\000\00000BBF636"]. Freeradius counts '\0' as the end
of the line and puts blank instead of actual parameter value. Not only ESN
comes in that format but [Acct-Session-Id = "0000000\000"] does too. 

Does any1 have any ideas about this ?

Thank You,
Michael Zotov

---------------------------------------------------------------------------------------------
main {
        prefix = "/usr"
        localstatedir = "/var"
        logdir = "/var/log/radius"
        libdir = "/usr/lib"
        radacctdir = "/var/log/radius/radacct"
        hostname_lookups = no
        max_request_time = 30
        cleanup_delay = 5
        max_requests = 8192
        allow_core_dumps = no
        pidfile = "/var/run/radiusd/radiusd.pid"
        checkrad = "/usr/sbin/checkrad"
        debug_level = 0
        proxy_requests = yes
 security {
        max_attributes = 200
        reject_delay = 1
        status_server = yes
 }
}
 client PDSN {
        ipaddr = 192.168.145.1
        netmask = 32
        require_message_authenticator = no
        secret = "pdsn-key"
        shortname = ""
        nastype = "other"
 }
 client ltk1 {
        ipaddr = 80.232.227.87
        require_message_authenticator = no
        secret = "cdma"
        shortname = ""
        nastype = "other"
 }
 client ltk2 {
        ipaddr = 80.232.227.88
        require_message_authenticator = no
        secret = "cdma"
        shortname = ""
        nastype = "other"
 }
 client localhost {
        ipaddr = 127.0.0.1
        require_message_authenticator = no
        secret = ""
        shortname = "localhost"
        nastype = "other"
 }
radiusd: #### Loading Realms and Home Servers ####
 proxy server {
        retry_delay = 5
        retry_count = 3
        default_fallback = no
        dead_time = 120
        wake_all_if_all_dead = no
 }
 home_server ltk1 {
        ipaddr = 80.232.227.87
        port = 1813
        type = "acct"
        secret = "cdma"
        response_window = 30
        max_outstanding = 65536
        zombie_period = 40
        status_check = "request"
        ping_check = "none"
        ping_interval = 30
        check_interval = 30
        num_answers_to_alive = 3
        num_pings_to_alive = 3
        revive_interval = 300
        status_check_timeout = 4
 }
 home_server ltk2 {
        ipaddr = 80.232.227.88
        port = 1813
        type = "acct"
        secret = "cdma"
        response_window = 30
        max_outstanding = 65536
        zombie_period = 40
        status_check = "request"
        ping_check = "none"
        ping_interval = 30
        check_interval = 30
        num_answers_to_alive = 3
        num_pings_to_alive = 3
        revive_interval = 300
        status_check_timeout = 4
 }
 home_server_pool ltk {
        type = fail-over
        home_server = ltk1
        home_server = ltk2
 }
 realm evdo.lattelecom {
        acct_pool = ltk
        nostrip
 }
 realm cdma.ltk.lv {
        acct_pool = ltk
        nostrip
 }
 realm lattelecom {
        acct_pool = ltk
        nostrip
 }
radiusd: #### Instantiating modules ####
 instantiate {
 }
radiusd: #### Loading Virtual Servers ####
server {
 modules {
 Module: Checking preacct {...} for more modules to load
 Module: Linked to module rlm_realm
 Module: Instantiating suffix
  realm suffix {
        format = "suffix"
        delimiter = "@"
        ignore_default = no
        ignore_null = no
  }
 Module: Checking accounting {...} for more modules to load
 Module: Linked to module rlm_acct_unique
 Module: Instantiating acct_unique
  acct_unique {
        key = "Calling-Station-Id, Acct-Session-Id, 3GPP2-Correlation-Id"
  }
 Module: Linked to module rlm_sql
 Module: Instantiating sql
  sql {
        driver = "rlm_sql_postgresql"
        server = "localhost"
        port = ""
        login = ""
        password = ""
        radius_db = "radius"
        read_groups = yes
        sqltrace = no
        sqltracefile = "/var/log/radius/sqltrace.sql"
        readclients = no
        deletestalesessions = yes
        num_sql_socks = 48
        sql_user_name = "%{User-Name}"
        default_user_profile = ""
        nas_query = "SELECT id,nasname,shortname,type,secret FROM nas"
        authorize_check_query = ""
        authorize_reply_query = ""
        authorize_group_check_query = ""
        authorize_group_reply_query = ""
        accounting_onoff_query = ""
        accounting_update_query = ""
        accounting_update_query_alt = ""
        accounting_start_query = "INSERT into radacct (AcctSessionId,
AcctUniqueId, CallingStationId, AcctStartTime, AcctStopTime,  
CDMAActiveTime, AcctInputOctets, AcctOutputOctets, FramedIPAddress,
UserName,  ReleaseIndicator, CDMABadPPPFrameCount, CDMACorrelationId,
AcctSessionTime, NASIPAddress, esn) values('%{Acct-Session-Id}',
'%{Acct-Unique-Session-Id}', '%{Calling-Station-Id}', '%{Event-Timestamp}',
NULL,'0', '0', '0', '%{Framed-IP-Address}', trim('%{SQL-User-Name}'), '0',
'0', '%{3GPP2-Correlation-Id}', '0', '%{NAS-IP-Address}', '      es      es     
es      est')"
        accounting_start_query_alt = ""
        accounting_stop_query = "UPDATE radacct SET AcctStopTime =
'%{Event-Timestamp}', AcctSessionTime = '%{Acct-Session-Time}',
AcctInputOctets = '%{Acct-Input-Octets}', OutputPacket =
'%{Acct-Output-Packets}', InputPacket = '%{Acct-Input-Packets}',
AcctOutputOctets = '%{Acct-Output-Octets}', ReleaseIndicator =
'%{Acct-Terminate-Cause}', CDMABadPPPFrameCount =
'%{3GPP2-Bad-PPP-Frame-Count}', CDMACorrelationId =
'%{3GPP2-Correlation-Id}', CDMAActiveTime = '%{3GPP2-Active-Time}' WHERE
AcctUniqueId = '%{Acct-Unique-Session-Id}'"
        accounting_stop_query_alt = ""
        connect_failure_retry_delay = 60
        simul_count_query = ""
        simul_verify_query = ""
        postauth_query = ""
        safe-characters =
"@abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789.-_: /\"
  }
rlm_sql (sql): Driver rlm_sql_postgresql (module rlm_sql_postgresql) loaded
and linked
rlm_sql (sql): Attempting to connect to radacc at localhost:/radius
rlm_sql (sql): starting 0
rlm_sql (sql): Attempting to connect rlm_sql_postgresql #0
rlm_sql (sql): Connected new DB handle, #0
rlm_sql (sql): starting 1
rlm_sql (sql): Attempting to connect rlm_sql_postgresql #1
rlm_sql (sql): Connected new DB handle, #1
rlm_sql (sql): starting 2
rlm_sql (sql): Attempting to connect rlm_sql_postgresql #2
rlm_sql (sql): Connected new DB handle, #2
rlm_sql (sql): starting 3
rlm_sql (sql): Attempting to connect rlm_sql_postgresql #3
rlm_sql (sql): Connected new DB handle, #3
rlm_sql (sql): starting 4
rlm_sql (sql): Attempting to connect rlm_sql_postgresql #4
rlm_sql (sql): Connected new DB handle, #4
rlm_sql (sql): starting 5
rlm_sql (sql): Attempting to connect rlm_sql_postgresql #5
rlm_sql (sql): Connected new DB handle, #5
rlm_sql (sql): starting 6
rlm_sql (sql): Attempting to connect rlm_sql_postgresql #6
rlm_sql (sql): Connected new DB handle, #6
rlm_sql (sql): starting 7
rlm_sql (sql): Attempting to connect rlm_sql_postgresql #7
rlm_sql (sql): Connected new DB handle, #7
rlm_sql (sql): starting 8
rlm_sql (sql): Attempting to connect rlm_sql_postgresql #8
rlm_sql (sql): Connected new DB handle, #8
rlm_sql (sql): starting 9
rlm_sql (sql): Attempting to connect rlm_sql_postgresql #9
rlm_sql (sql): Connected new DB handle, #9
rlm_sql (sql): starting 10
rlm_sql (sql): Attempting to connect rlm_sql_postgresql #10
rlm_sql (sql): Connected new DB handle, #10
rlm_sql (sql): starting 11
rlm_sql (sql): Attempting to connect rlm_sql_postgresql #11
rlm_sql (sql): Connected new DB handle, #11
rlm_sql (sql): starting 12
rlm_sql (sql): Attempting to connect rlm_sql_postgresql #12
rlm_sql (sql): Connected new DB handle, #12
rlm_sql (sql): starting 13
rlm_sql (sql): Attempting to connect rlm_sql_postgresql #13
rlm_sql (sql): Connected new DB handle, #13
rlm_sql (sql): starting 14
rlm_sql (sql): Attempting to connect rlm_sql_postgresql #14
rlm_sql (sql): Connected new DB handle, #14
rlm_sql (sql): starting 15
rlm_sql (sql): Attempting to connect rlm_sql_postgresql #15
rlm_sql (sql): Connected new DB handle, #15
rlm_sql (sql): starting 16
rlm_sql (sql): Attempting to connect rlm_sql_postgresql #16
rlm_sql (sql): Connected new DB handle, #16
rlm_sql (sql): starting 17
rlm_sql (sql): Attempting to connect rlm_sql_postgresql #17
rlm_sql (sql): Connected new DB handle, #17
rlm_sql (sql): starting 18
rlm_sql (sql): Attempting to connect rlm_sql_postgresql #18
rlm_sql (sql): Connected new DB handle, #18
rlm_sql (sql): starting 19
rlm_sql (sql): Attempting to connect rlm_sql_postgresql #19
rlm_sql (sql): Connected new DB handle, #19
rlm_sql (sql): starting 20
rlm_sql (sql): Attempting to connect rlm_sql_postgresql #20
rlm_sql (sql): Connected new DB handle, #20
rlm_sql (sql): starting 21
rlm_sql (sql): Attempting to connect rlm_sql_postgresql #21
rlm_sql (sql): Connected new DB handle, #21
rlm_sql (sql): starting 22
rlm_sql (sql): Attempting to connect rlm_sql_postgresql #22
rlm_sql (sql): Connected new DB handle, #22
rlm_sql (sql): starting 23
rlm_sql (sql): Attempting to connect rlm_sql_postgresql #23
rlm_sql (sql): Connected new DB handle, #23
rlm_sql (sql): starting 24
rlm_sql (sql): Attempting to connect rlm_sql_postgresql #24
rlm_sql (sql): Connected new DB handle, #24
rlm_sql (sql): starting 25
rlm_sql (sql): Attempting to connect rlm_sql_postgresql #25
rlm_sql (sql): Connected new DB handle, #25
rlm_sql (sql): starting 26
rlm_sql (sql): Attempting to connect rlm_sql_postgresql #26
rlm_sql (sql): Connected new DB handle, #26
rlm_sql (sql): starting 27
rlm_sql (sql): Attempting to connect rlm_sql_postgresql #27
rlm_sql (sql): Connected new DB handle, #27
rlm_sql (sql): starting 28
rlm_sql (sql): Attempting to connect rlm_sql_postgresql #28
rlm_sql (sql): Connected new DB handle, #28
rlm_sql (sql): starting 29
rlm_sql (sql): Attempting to connect rlm_sql_postgresql #29
rlm_sql (sql): Connected new DB handle, #29
rlm_sql (sql): starting 30
rlm_sql (sql): Attempting to connect rlm_sql_postgresql #30
rlm_sql (sql): Connected new DB handle, #30
rlm_sql (sql): starting 31
rlm_sql (sql): Attempting to connect rlm_sql_postgresql #31
rlm_sql (sql): Connected new DB handle, #31
rlm_sql (sql): starting 32
rlm_sql (sql): Attempting to connect rlm_sql_postgresql #32
rlm_sql (sql): Connected new DB handle, #32
rlm_sql (sql): starting 33
rlm_sql (sql): Attempting to connect rlm_sql_postgresql #33
rlm_sql (sql): Connected new DB handle, #33
rlm_sql (sql): starting 34
rlm_sql (sql): Attempting to connect rlm_sql_postgresql #34
rlm_sql (sql): Connected new DB handle, #34
rlm_sql (sql): starting 35
rlm_sql (sql): Attempting to connect rlm_sql_postgresql #35
rlm_sql (sql): Connected new DB handle, #35
rlm_sql (sql): starting 36
rlm_sql (sql): Attempting to connect rlm_sql_postgresql #36
rlm_sql (sql): Connected new DB handle, #36
rlm_sql (sql): starting 37
rlm_sql (sql): Attempting to connect rlm_sql_postgresql #37
rlm_sql (sql): Connected new DB handle, #37
rlm_sql (sql): starting 38
rlm_sql (sql): Attempting to connect rlm_sql_postgresql #38
rlm_sql (sql): Connected new DB handle, #38
rlm_sql (sql): starting 39
rlm_sql (sql): Attempting to connect rlm_sql_postgresql #39
rlm_sql (sql): Connected new DB handle, #39
rlm_sql (sql): starting 40
rlm_sql (sql): Attempting to connect rlm_sql_postgresql #40
rlm_sql (sql): Connected new DB handle, #40
rlm_sql (sql): starting 41
rlm_sql (sql): Attempting to connect rlm_sql_postgresql #41
rlm_sql (sql): Connected new DB handle, #41
rlm_sql (sql): starting 42
rlm_sql (sql): Attempting to connect rlm_sql_postgresql #42
rlm_sql (sql): Connected new DB handle, #42
rlm_sql (sql): starting 43
rlm_sql (sql): Attempting to connect rlm_sql_postgresql #43
rlm_sql (sql): Connected new DB handle, #43
rlm_sql (sql): starting 44
rlm_sql (sql): Attempting to connect rlm_sql_postgresql #44
rlm_sql (sql): Connected new DB handle, #44
rlm_sql (sql): starting 45
rlm_sql (sql): Attempting to connect rlm_sql_postgresql #45
rlm_sql (sql): Connected new DB handle, #45
rlm_sql (sql): starting 46
rlm_sql (sql): Attempting to connect rlm_sql_postgresql #46
rlm_sql (sql): Connected new DB handle, #46
rlm_sql (sql): starting 47
rlm_sql (sql): Attempting to connect rlm_sql_postgresql #47
rlm_sql (sql): Connected new DB handle, #47
 }
}
radiusd: #### Opening IP addresses and Ports ####
listen {
        type = "acct"
        ipaddr = 192.168.104.5
        port = 1813
}
Listening on accounting address 192.168.104.5 port 1813
Listening on proxy address * port 1489
Ready to process requests.
        Acct-Status-Type = Start
        User-Name = "triatel at triatel.lv"
        Calling-Station-Id = "247033715823967"
        Framed-IP-Address = 192.168.173.4
        NAS-IP-Address = 192.168.145.1
        Event-Timestamp = "Jan  9 2009 10:58:30 EET"
        Acct-Session-Id = "0000000\000"
        NAS-Port-Type = Virtual
        NAS-Port = 1813
        Acct-Delay-Time = 0
        Service-Type = Framed-User
        Acct-Authentic = RADIUS
        3GPP2-ESN = "\000\000\000\000\000\000\00000BBF636"
        3GPP2-Attr-116 = 0x0000000000000000000000000000
        3GPP2-Correlation-Id = "35067449"
        3GPP2-Service-Reference-Id = 0x0104000102040001
        3GPP2-Home-Agent-IP-Address = 0.0.0.0
        3GPP2-PCF-IP-Address = 129.11.17.230
        3GPP2-BSID = "2A2100021102"
        3GPP2-User-Id = 0
        3GPP2-Forward-FCH-Mux-Option = 0
        3GPP2-Reverse-FCH-Mux-Option = 0
        3GPP2-Service-Option = 59
        3GPP2-Forward-Traffic-Type = 0
        3GPP2-Reverse-Traffic-Type = 0
        3GPP2-FCH-Frame-Size = 0
        3GPP2-Forward-FCH-RC = 0
        3GPP2-Reverse-FCH-RC = 0
        3GPP2-IP-Technology = 1
        3GPP2-Compulsory-Tunnel-Indicator = 0
        3GPP2-DCCH-Frame-Size = 0
        3GPP2-Attr-78 = 0x00000000
        3GPP2-Forward-PDCH-RC = 0
        3GPP2-Forward-DCCH-Mux-Option = 0
        3GPP2-Reverse-DCCH-Mux-Option = 0
        3GPP2-Forward-DCCH-RC = 0
        3GPP2-Reverse-DHHC-RC = 0
        3GPP2-Attr-114 = 0x00000000
        3GPP2-IP-QoS = 10
        3GPP2-Airlink-Priority = 0
+- entering group preacct
    rlm_realm: Looking up realm "triatel.lv" for User-Name =
"triatel at triatel.lv"
    rlm_realm: No such realm "triatel.lv"
++[suffix] returns noop
+- entering group accounting
rlm_acct_unique: Hashing '3GPP2-Correlation-Id = "35067449",Acct-Session-Id
= "0000000\000",Calling-Station-Id = "247033715823967"'
rlm_acct_unique: Acct-Unique-Session-ID = "44d6e7436e38e449".
++[acct_unique] returns ok
        expand: %{User-Name} -> triatel at triatel.lv
rlm_sql (sql): sql_set_user escaped user --> 'triatel at triatel.lv'
        expand: INSERT into radacct (AcctSessionId, AcctUniqueId,
CallingStationId, AcctStartTime, AcctStopTime,   CDMAActiveTime,
AcctInputOctets, AcctOutputOctets, FramedIPAddress, UserName, 
ReleaseIndicator, CDMABadPPPFrameCount, CDMACorrelationId, AcctSessionTime,
NASIPAddress, esn) values('%{Acct-Session-Id}', '%{Acct-Unique-Session-Id}',
'%{Calling-Station-Id}', '%{Event-Timestamp}', NULL,'0', '0', '0',
'%{Framed-IP-Address}', trim('%{SQL-User-Name}'), '0', '0',
'%{3GPP2-Correlation-Id}', '0', '%{NAS-IP-Address}','%{3GPP2-ESN}') ->
INSERT into radacct (AcctSessionId, AcctUniqueId, CallingStationId,
AcctStartTime, AcctStopTime,   CDMAActiveTime, AcctInputOctets,
AcctOutputOctets, FramedIPAddress, UserName,  ReleaseIndicator,
CDMABadPPPFrameCount, CDMACorrelationId, AcctSessionTime, NASIPAddress, esn)
values('0000000', '44d6e7436e38e449', '247033715823967', 'Jan  9 2009
10:58:30 EET', NULL,'0', '0', '0', '192.168.173.4',
trim('triatel at triatel.lv'), '0', '0', '35067449', '0', '192.168.145.1', '')
rlm_sql (sql): Reserving sql socket id: 47
rlm_sql_postgresql: Status: PGRES_COMMAND_OK
rlm_sql_postgresql: query affected rows = 1
rlm_sql (sql): Released sql socket id: 47
++[sql] returns ok

--------------------------------------------------------------------------------------------------





-- 
View this message in context: http://www.nabble.com/3gpp2-parameter-starts-with-%27%5C0%27-tp21409780p21409780.html
Sent from the FreeRadius - User mailing list archive at Nabble.com.




More information about the Freeradius-Users mailing list