<html><head><meta http-equiv="Content-Type" content="text/html charset=windows-1252"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; ">Hi, I need some help with inserting custom attributes to MySQL server. It seems that version 2.2 broke it, at least on my server… When I revert back to 2.1 it immediately starts to work with same config files.<div><br></div><div>Below are config files and traces for both versions.</div><div><br></div><div>Any idea?</div><div><br></div><div>thanks,</div><div>brm</div><div>----------------------</div><div><div><br></div><div>Relevant part of dialup.conf (modified to include custom attributes):</div><div><div><font face="Courier New"> accounting_start_query = " \</font></div><div><font face="Courier New"> INSERT INTO ${acct_table1} \</font></div><div><font face="Courier New"> (acctsessionid, acctuniqueid, username, \</font></div><div><font face="Courier New"> <b>imsi, imei, ms_timezone, \</b></font></div><div><font face="Courier New"><b> rat_type, user_location_info</b></font><span style="font-family: 'Courier New'; "><b>,</b> realm, \</span></div><div><font face="Courier New"> nasipaddress, nasportid, \</font></div><div><font face="Courier New"> nasporttype, acctstarttime, acctstoptime, \</font></div><div><font face="Courier New"> acctsessiontime, acctauthentic, connectinfo_start, \</font></div><div><font face="Courier New"> connectinfo_stop, acctinputoctets, acctoutputoctets, \</font></div><div><font face="Courier New"> calledstationid, callingstationid, acctterminatecause, \</font></div><div><font face="Courier New"> servicetype, framedprotocol, framedipaddress, \</font></div><div><font face="Courier New"> acctstartdelay, acctstopdelay) \</font></div><div><font face="Courier New"> VALUES \</font></div><div><font face="Courier New"> ('%{Acct-Session-Id}', '%{Acct-Unique-Session-Id}', \</font></div><div><font face="Courier New"> '%{SQL-User-Name}', \</font></div><div><font face="Courier New"> <b>'%{3GPP-IMSI}', '%{3GGP-IMEISV}', '%{3GPP-MS-TimeZone}', \</b></font></div><div><font face="Courier New"><b> '%{3GPP-RAT-type}', '%{3GPP-User-Location-Info}',</b></font><span style="font-family: 'Courier New'; "> '%{Realm}', \</span></div><div><font face="Courier New"> '%{NAS-IP-Address}', '%{NAS-Port}', \</font></div><div><font face="Courier New"> '%{NAS-Port-Type}', '%S', NULL, \</font></div><div><font face="Courier New"> '0', '%{Acct-Authentic}', '%{Connect-Info}', \</font></div><div><font face="Courier New"> '', '0', '0', \</font></div><div><font face="Courier New"> '%{Called-Station-Id}', '%{Calling-Station-Id}', '', \</font></div><div><font face="Courier New"> '%{Service-Type}', '%{Framed-Protocol}', '%{Framed-IP-Address}', \</font></div><div><font face="Courier New"> '%{%{Acct-Delay-Time}:-0}', '0')"</font></div></div><div><br></div><div>Slightly modified dictionary.3gpp file to include custom attributes:</div><div><div><font face="Courier New"># new attributes</font></div><div><font face="Courier New">ATTRIBUTE 3GGP-IMEISV 20 string</font></div><div><font face="Courier New">ATTRIBUTE 3GPP-RAT-type 21 byte</font></div></div><div><font face="Courier New"><div>ATTRIBUTE 3GPP-User-Location-Info 22 octets</div><div>ATTRIBUTE 3GPP-MS-TimeZone 23 integer has_tag</div></font></div><div><font face="Courier New"><br></font></div><div><div><font face="Courier New"># set RAT-TYPE</font></div><div><font face="Courier New">VALUE 3GPP-RAT-Type Reserved 0</font></div><div><font face="Courier New">VALUE 3GPP-RAT-Type UTRAN 1</font></div><div><font face="Courier New">VALUE 3GPP-RAT-Type GERAN 2</font></div><div><font face="Courier New">VALUE 3GPP-RAT-Type WLAN 3</font></div><div><font face="Courier New">VALUE 3GPP-RAT-Type GAN 4</font></div><div><font face="Courier New">VALUE 3GPP-RAT-Type HSPA-Evolution 5</font></div><div><font face="Courier New">VALUE 3GPP-RAT-Type IEEE-802-16e 101</font></div><div><font face="Courier New">VALUE 3GPP-RAT-Type 3GPP2-eHRPD 102</font></div><div><font face="Courier New">VALUE 3GPP-RAT-Type 3GPP2-HRPD 103</font></div><div><font face="Courier New">VALUE 3GPP-RAT-Type 3GPP2-1xRTT 104</font></div><div><font face="Courier New">VALUE 3GPP-RAT-Type 3GPP-EPS 105</font></div></div><div><br></div><div>This is the accounting start record from debug mode:</div><div><font face="Courier New">rad_recv: Accounting-Request packet from host xxxxxxxx port 54002, id=50, length=375<br><span class="Apple-tab-span" style="white-space:pre"> </span>Acct-Status-Type = Start<br><span class="Apple-tab-span" style="white-space:pre"> </span>Event-Timestamp = "Jan 26 2013 18:20:08 CET"<br><span class="Apple-tab-span" style="white-space:pre"> </span>Framed-IP-Address = xxxxxxx<br><span class="Apple-tab-span" style="white-space:pre"> </span>Called-Station-Id = "xxxxxx"<br><span class="Apple-tab-span" style="white-space:pre"> </span>Calling-Station-Id = "xxxxxxx"<br><span class="Apple-tab-span" style="white-space:pre"> </span>NAS-IP-Address = xxxxxxx<br><span class="Apple-tab-span" style="white-space:pre"> </span>NAS-Identifier = "xxxxxxx"<br><span class="Apple-tab-span" style="white-space:pre"> </span>Service-Type = Framed-User<br><span class="Apple-tab-span" style="white-space:pre"> </span>NAS-Port-Type = Virtual<br><span class="Apple-tab-span" style="white-space:pre"> </span>Acct-Session-Id = "5BB9DD25a7846fd9"<br><span class="Apple-tab-span" style="white-space:pre"> </span>3GPP-IMSI = "xxxxxxx"<br><span class="Apple-tab-span" style="white-space:pre"> </span>3GPP-IMSI-MCC-MNC = "xxxxxxx"<br><span class="Apple-tab-span" style="white-space:pre"> </span>3GPP-NSAPI = "5"<br><span class="Apple-tab-span" style="white-space:pre"> </span>3GGP-IMEISV = "xxxxxxx"<br><span class="Apple-tab-span" style="white-space:pre"> </span>3GPP-RAT-type = UTRAN<br><span class="Apple-tab-span" style="white-space:pre"> </span>3GPP-User-Location-Info = 0x0192f307000a79be<br><span class="Apple-tab-span" style="white-space:pre"> </span>3GPP-Charging-ID = 2810474457<br><span class="Apple-tab-span" style="white-space:pre"> </span>3GPP-PDP-Type = IP<br><span class="Apple-tab-span" style="white-space:pre"> </span>3GPP-Selection-Mode = "0"</font></div><div><font face="Courier New"><br></font></div><div>Error on version 2.2:</div><div><div><font face="Courier New">...</font></div><div><div><font face="Courier New">+- entering group accounting {...}</font></div><div><font face="Courier New">[sql] <span class="Apple-tab-span" style="white-space:pre"> </span>expand: %{Calling-Station-Id} -> xxxxxxxx</font></div><div><font face="Courier New">[sql] sql_set_user escaped user --> 'xxxxxxxxx'</font></div><div><font face="Courier New">[sql] <b><u>WARNING: Unknown module "3GPP-IMSI" in string expansion "%'</u></b>, '%{3GGP-IMEISV}', '%{3GPP-MS-TimeZone}', <span class="Apple-tab-span" style="white-space:pre"> </span> '%{3GPP-RAT-type}', '%{3GPP-User-Location-Info}', <span class="Apple-tab-span" style="white-space:pre"> </span> '%{Realm}', '%{NAS-IP-Address}', '%{NAS-Port}', '%{NAS-Port-Type}', '%S', NULL, '0', '%{Acct-Authentic}', '%{Connect-Info}', '', '0', '0', '%{Called-Station-Id}', '%{Calling-Station-Id}', '', '%{Service-Type}', '%{Framed-Protocol}', '%{Framed-IP-Address}', '%{%{Acct-Delay-Time}:-0}', '0')"</font></div><div><font face="Courier New">[sql] <span class="Apple-tab-span" style="white-space:pre"> </span>expand: /var/log/radius/sqltrace.sql -> /var/log/radius/sqltrace.sql</font></div><div><font face="Courier New">rlm_sql (sql): Reserving sql socket id: 24</font></div><div><font face="Courier New">rlm_sql_mysql: query: INSERT INTO radacct (acctsessionid, acctuniqueid, username, imsi,<span class="Apple-tab-span" style="white-space:pre"> </span> imei, ms_timezone, <span class="Apple-tab-span" style="white-space:pre"> </span> rat_type,<span class="Apple-tab-span" style="white-space:pre"> </span> user_location_info, <span class="Apple-tab-span" style="white-space:pre"> </span> realm, nasipaddress, nasportid, nasporttype, acctstarttime, acctstoptime, acctsessiontime, acctauthentic, connectinfo_start, connectinfo_stop, acctinputoctets, acctoutputoctets, calledstationid, callingstationid, acctterminatecause, servicetype, framedprotocol, framedipaddress, acctstartdelay, acctstopdelay) VALUES ('5BB9DD25a7846393', 'b158b29df3a9d9e4', 'xxxxxxxxx', <span class="Apple-tab-span" style="white-space:pre"> </span> '</font></div><div><font face="Courier New">rlm_sql_mysql: MYSQL check_error: 1064 received</font></div><div><font face="Courier New">[sql] Couldn't insert SQL accounting START record - You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ''' at line 1</font></div></div></div><div><br></div><div><font face="Courier New"><br></font></div><div>Success on version 2.1:</div><div><font face="Courier New">…</font></div><div><div><font face="Courier New">+- entering group accounting {...}</font></div><div><font face="Courier New">[sql] <span class="Apple-tab-span" style="white-space:pre"> </span>expand: %{Calling-Station-Id} -> </font><span style="font-family: 'Courier New'; ">XXXXXXXXXXX</span></div><div><font face="Courier New">[sql] sql_set_user escaped user --> '</font><span style="font-family: 'Courier New'; ">XXXXXXXXXXX</span><font face="Courier New">'</font></div><div><font face="Courier New">[sql] <span class="Apple-tab-span" style="white-space:pre"> </span>expand: %{Acct-Delay-Time} -> </font></div><div><font face="Courier New">[sql] <span class="Apple-tab-span" style="white-space:pre"> </span>... expanding second conditional</font></div><div><font face="Courier New">[sql] <span class="Apple-tab-span" style="white-space:pre"> </span>expand: INSERT INTO radacct (acctsessionid, acctuniqueid, username, imsi,<span class="Apple-tab-span" style="white-space:pre"> </span> imei, ms_timezone, <span class="Apple-tab-span" style="white-space:pre"> </span> rat_type,<span class="Apple-tab-span" style="white-space:pre"> </span> user_location_info, <span class="Apple-tab-span" style="white-space:pre"> </span> realm, nasipaddress, nasportid, nasporttype, acctstarttime, acctstoptime, acctsessiontime, acctauthentic, connectinfo_start, connectinfo_stop, acctinputoctets, acctoutputoctets, calledstationid, callingstationid, acctterminatecause, servicetype, framedprotocol, framedipaddress, acctstartdelay, acctstopdelay) VALUES ('%{Acct-Session-Id}', '%{Acct-Unique-Session-Id}', '%{SQL-User-Name}', <span class="Apple-tab-span" style="white-space:pre"> </span> '%{3GPP-IMSI}', '%{3GGP-IMEISV}', '%{3GPP-MS-TimeZone}', <span class="Apple-tab-span" style="white-space:pre"> </span> '%{3GPP-RAT-type}', '%{3GPP-User-Location-Info}', <span class="Apple-tab-span" style="white-space:pre"> </span> '%{Realm}', '%{NAS-IP-Address}', '%{NAS-Port}', '%{NAS-Port-Type}', '%S', NU</font></div><div><font face="Courier New">[sql] <span class="Apple-tab-span" style="white-space:pre"> </span>expand: /var/log/radius/sqltrace.sql -> /var/log/radius/sqltrace.sql</font></div><div><font face="Courier New">rlm_sql (sql): Reserving sql socket id: 24</font></div><div><font face="Courier New">rlm_sql_mysql: query: INSERT INTO radacct (acctsessionid, acctuniqueid, username, imsi,<span class="Apple-tab-span" style="white-space:pre"> </span> imei, ms_timezone, <span class="Apple-tab-span" style="white-space:pre"> </span> rat_type,<span class="Apple-tab-span" style="white-space:pre"> </span> user_location_info, <span class="Apple-tab-span" style="white-space:pre"> </span> sgsnipaddress, realm, nasipaddress, nasportid, nasporttype, acctstarttime, acctstoptime, acctsessiontime, acctauthentic, connectinfo_start, connectinfo_stop, acctinputoctets, acctoutputoctets, calledstationid, callingstationid, acctterminatecause, servicetype, framedprotocol, framedipaddress, acctstartdelay, acctstopdelay) VALUES ('5BB9DD25a7846fd9', '03de33c93bd3a02b', '</font><span style="font-family: 'Courier New'; ">XXXXXXXXXXX</span><font face="Courier New">', <span class="Apple-tab-span" style="white-space:pre"> </span> '</font><span style="font-family: 'Courier New'; ">XXXXXXXXXXX</span><font face="Courier New">', '</font><span style="font-family: 'Courier New'; ">XXXXXXXXXXX</span><font face="Courier New">', '0x04fc', <span class="Apple-tab-span" style="white-space:pre"> </span> 'UTRAN', '0x0192f307000a79be', <span class="Apple-tab-span" style="white-space:pre"> </span> '', '</font><span style="font-family: 'Courier New'; ">XXXXXXXXXXX</span><font face="Courier New">', '', 'Virtual', '2013-01-26 18:20:06', NULL, '0', '', '', '', '0', '0', '</font><span style="font-family: 'Courier New'; ">XXXXXXXXXXX</span><font face="Courier New">', '</font><span style="font-family: 'Courier New'; ">XXXXXXXXXXX</span><font face="Courier New">', '', 'Framed-User', 'GPRS-PDP-Context', '</font><span style="font-family: 'Courier New'; ">XXXXXXXXXXX</span><font face="Courier New">', '0', '0')</font></div><div><font face="Courier New">rlm_sql (sql): Released sql socket id: 24</font></div><div><font face="Courier New">++[sql] returns ok</font></div><div><font face="Courier New">[attr_filter.accounting_response] <span class="Apple-tab-span" style="white-space:pre"> </span>expand: %{User-Name} -> </font></div><div><font face="Courier New">++[attr_filter.accounting_response] returns noop</font></div><div><font face="Courier New">Sending Accounting-Response of id 50 to </font><span style="font-family: 'Courier New'; ">XXXXXXXXXXX</span><font face="Courier New"> port 54002</font></div><div><font face="Courier New">Finished request 0.</font></div></div><div><font face="Courier New"><br></font></div><div><br></div></div></body></html>