Unlang Configuration Problem on Missing Attributes

StreitLeak streitleak at gmail.com
Sat Feb 13 06:44:42 CET 2021


I have problem on unlang when I want to build SQL Query.
The Request packet is missing some attributes on VSA.
The Dictionary which I custom it have 150 attributes. But the Request only
sent 120 or 130.
So if I set all attributes in my sql query, the query will fail with
lacking some attributes in Request Packet.
-----SQL Schema---
  Ex:   The table Schema Example
create table radacct {
                 attr1   int not null default 0.
                 attr2  varchar(255) not null default '',
                 attr3  int not null default 0.
                 attr4  int not null default 0
}
--- SQL Query in sql/main/mysql/querier.conf ---
 The Query = "insert into radacct ( attr1.attr2.attr3,attr4) values
('%{attr1}', '%{attr2}','%{attr3}','%{attr4}' );"
---  Request Packet Example ---
        Acct-Delay-Time = 437
        Attr1-Log-Time = "Mon Feb  8 15:15:11 2021\n"
        Acct-Status-Type = Stop
        Acct-Session-Id = "15934598980000000296"
        Attr2-Session-Ingress-CallId = 65535
        Attr3-Session-Egress-CallId = 1
        Attr5-Session-Generic-Id = 157
        Acct-Multi-Session-Id = "1612768062157"
----
     so the real query is "insert into radacct ( attr1.attr2.attr3,attr4)
values (' Mon Feb  8 15:15:11 2021\n ', '65535','1','' )
      As you can see . the Attr4 is missing in Request Packet. And it cause
the query failed. So I need to set some rules to avoid it. But I can't
understand the foreach how to check each VSA attributes. Or any easily way
to avoid the missing attributes.
      Have any configuration Example can help me to understand it?



              星たちよ
              汝の命短き眷族の望みな聞くがよい
              我らの望み  それほ
              汝の本將ちゆく末な看取るニと
                 -------------《アーヴによる人類帝國》國歌の一節よリ


More information about the Freeradius-Users mailing list