[OpenSIPS-Users] CDRTool 9.1.1

Willian Mazzardo - SYSSVOIP willian at syssvoip.com.br
Mon Mar 25 12:52:29 CET 2013


Hi ... it was like this ... but the date what the script was getting
"2013-04-24 00:33 BRT blablabla" and this is wrong ...

Yesterday I tried another sql.conf from other CDRTool version I had in my
server, wich is:

    accounting_start_query      = "\
          CALL insert_radacct_record( \
                'radius', \
                '%{Acct-Session-Id}', \
                '%{Acct-Unique-Session-Id}', \
                '%{Billing-Party}', \
                '%{Billing-Party}', \
                '%{SIP-Proxy-IP}', \
                '%{NAS-Port}', \
*                '%S', \*
                '0', \
                '0', \
                '0', \
                '0', \
                '%{Called-Station-Id}', \
                '%{Calling-Station-Id}', \
                '%{Sip-Response-Code}', \
                '%{Service-Type}', \
                '%{ENUM-TLD}', \
                '%{Framed-IP-Address}', \
                '%{Acct-Delay-Time}', \
                '0', \
                '%{Sip-Response-Code}', \
                '%{Sip-Method}', \
                '%{Sip-Translated-Request-URI}', \
                '%{Sip-To-Tag}', \
                '%{Sip-From-Tag}', \
                '%{Sip-RPId}', \
                '%{Source-IP}', \
                '%{Source-Port}', \
                '%{Canonical-URI}', \
                '', \
                '', \
                'audio', \
                '%{User-Agent}', \
                '%{From-Header}' \
                )"

    accounting_stop_query       = "\
          CALL update_radacct_record( \
                'radius', \
*                '%S', \*
                '%{Acct-Delay-Time}', \
                '%{Connect-Info}', \
                '%{X-RTP-Stat}', \
                 '%{Acct-Session-Id}', \
                '%{Sip-To-Tag}', \
                '%{Sip-From-Tag}' \
                )"

    accounting_update_query       = "\
          CALL update_raddact_record_mediaproxy( \
                'radius', \
                '%{Acct-Session-Time}', \
                '%{Acct-Input-Octets}', \
                '%{Acct-Output-Octets}', \
                '%{Sip-User-Agents}', \
                '%{Media-Codecs}', \
                '%{Sip-Application-Type}', \
                '%{Media-Info}', \
                '0', \
                '%{Acct-Session-Id}', \
                '%{Sip-To-Tag}', \
                '%{Sip-From-Tag}' \
                )"

    accounting_failed_query     = "\
          CALL insert_radacct_record( \
                'radius', \
                '%{Acct-Session-Id}', \
                '%{Acct-Unique-Session-Id}', \
                '%{Billing-Party}', \
                '%{Billing-Party}', \
                '%{SIP-Proxy-IP}', \
                '%{NAS-Port}', \
               * '%S', \*
*                '%S', \*
                '0', \
                '0', \
                '0', \
                '%{Called-Station-Id}', \
                '%{Calling-Station-Id}', \
                '%{Sip-Response-Code}', \
                '%{Service-Type}', \
                '%{ENUM-TLD}', \
                '%{Framed-IP-Address}', \
                '%{Acct-Delay-Time}', \
                '0', \
                '%{Sip-Response-Code}', \
                '%{Sip-Method}', \
                '%{Sip-Translated-Request-URI}', \
                MD5(RAND()), \
                '%{Sip-From-Tag}', \
                '%{Sip-RPId}', \
                '%{Source-IP}', \
                '%{Source-Port}', \
                '%{Canonical-URI}', \
                '', \
                '', \
                'audio', \
                '%{User-Agent}', \
                '%{From-Header}' \
                )"
}

See the field wich have DATE-TIME, in this sql.conf file, have only '%S',
where the original sql.conf file has
FROM_UNIXTIME(%{Event-Timestamp}), \
FROM_UNIXTIME(%{Event-Timestamp}), \

In field ${Sip-Application-Type}, I had to put "audio" manually to work too
...

Now CDRTool is working good, getting Date-Time correctly.


Willian Mazzardo
Depto TI - SYSSVOIP
www.syssvoip.com.br
55 3537 2030


2013/3/25 Tijmen de Mes <tijmen at ag-projects.com>

>  Hi,
>
> Please check sql.conf in freeradius. The event timestamp should be a
> timeststamp not a datetime.
>
> What do you have configured there? It should be like
> FROM_UNIXTIME(%{Event-Timestamp}), \
>
> --
> Tijmen de Mes
> AG Projects
>
> On 03/24/2013 06:34 AM, Willian Mazzardo - SYSSVOIP wrote:
>
> I think I have found the problem....
>
>  see the log:
>
>  Going to the next request
> Ready to process requests.
> rad_recv: Accounting-Request packet from host 127.0.0.1 port 45662,
> id=207, length=327
>  Acct-Status-Type = Failed
>  Service-Type = Sip-Session
>  Sip-Response-Code = 487
>  Sip-Method = Invite
>  Event-Timestamp = "Mar 24 2013 02:26:30 BRT"
>  Sip-From-Tag = "2008462333"
>  Sip-To-Tag = "as4a8dfb83"
>  Acct-Session-Id = "411815482"
>  User-Name = "559101999 at 187.53.208.109"
>  Calling-Station-Id = "sip:559101999 at 187.53.208.109"
>  Called-Station-Id = "sip:05596412757 at 187.53.208.109"
>  Sip-Translated-Request-URI = "sip:555596412757 at 177.126.178.106"
>  Canonical-URI = "sip:555596412757 at 187.53.208.109"
>  User-Agent = "Linphone/3.5.2 (eXosip2/3.6.0)"
>  Contact = "<sip:559101999 at 192.168.10.110:5066>"
>  NAS-Port = 5060
>  Acct-Delay-Time = 0
>  NAS-IP-Address = 127.0.0.1
> # Executing section preacct from file /etc/freeradius/radiusd.conf
> +- entering group preacct {...}
> ++[preprocess] returns ok
> [suffix] Looking up realm "187.53.208.109" for User-Name = "
> 559101999 at 187.53.208.109"
> [suffix] No such realm "187.53.208.109"
> ++[suffix] returns noop
> ++[files] returns noop
> # Executing section accounting from file /etc/freeradius/radiusd.conf
> +- entering group accounting {...}
> [detail] expand:
> /var/log/freeradius/radacct/%{Client-IP-Address}/detail-%Y%m%d ->
> /var/log/freeradius/radacct/127.0.0.1/detail-20130324
> [detail] /var/log/freeradius/radacct/%{Client-IP-Address}/detail-%Y%m%d
> expands to /var/log/freeradius/radacct/127.0.0.1/detail-20130324
> [detail] expand: %t -> Sun Mar 24 02:26:50 2013
> ++[detail] returns ok
> [sql] WARNING: Unknown module "Sip-Application-Type" in string expansion
> "%',                 '%{User-Agent}',                 '%{From-Header}'
>             )"
> [sql] expand: /var/log/freeradius/sqltrace-%Y%m%d.log ->
> /var/log/freeradius/sqltrace-20130324.log
> rlm_sql (sql): Reserving sql socket id: 22
> rlm_sql_mysql: MYSQL check_error: 1064 received
> rlm_sql (sql): Couldn't insert SQL accounting FAILED 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 '24 2013 02:26:30 BRT),
>             FROM_UNIXTIME(Mar 24 2013 02:26:30 BRT), ' at line 1
> rlm_sql_mysql: MYSQL check_error: 1064 received
> rlm_sql_mysql: Cannot store result
> rlm_sql_mysql: MySQL error '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 '24 2013 02:26:30 BRT),
> FROM_UNIXTIME(Mar 24 2013 02:26:30 BRT), ' at line 1'
> rlm_sql (sql): Released sql socket id: 22
> ++[sql] returns fail
> Finished request 2.
> Cleaning up request 2 ID 207 with timestamp +29
> Going to the next request
> Ready to process requests.
>
>
>  I think is a DATE/TIME problem ...
>
>  Am I right?
>
>
> Willian Mazzardo
> Depto TI - SYSSVOIP
> www.syssvoip.com.br
> 55 3537 2030
>
>
> 2013/3/23 Willian Mazzardo - SYSSVOIP <willian at syssvoip.com.br>
>
>> Hi Tijmen... thanks for your help... I have installed, but in mysql, the
>> table radacct.201303 is not creating automatically.
>>
>>  How can I debug this?
>>
>> Willian Mazzardo
>> Depto TI - SYSSVOIP
>> www.syssvoip.com.br
>> 55 3537 2030
>>
>>
>> 2013/3/23 Tijmen de Mes <tijmen at ag-projects.com>
>>
>>> Hi,
>>>
>>>  I believe you can find everything you need in the install guide:
>>> http://cdrtool.ag-projects.com/projects/cdrtool/wiki/Installation_Guide
>>>
>>>  Best regards,
>>>
>>>  --
>>> Tijmen de Mes
>>> AG Projects
>>>
>>>  Op 24 mrt. 2013, om 02:38 heeft Willian Mazzardo - SYSSVOIP <
>>> willian at syssvoip.com.br> het volgende geschreven:
>>>
>>>  Hi... im sorry intruding this topic to talk about different, but, have
>>> anyone some tutorial to install cdrtool in debian with opensips?
>>>
>>> Thanks
>>> On Mar 23, 2013 10:31 PM, "Tijmen de Mes" <tijmen at ag-projects.com>
>>> wrote:
>>>
>>>> Hi,
>>>>
>>>> We had a bug which sneaked in due to another change and this is already
>>>> fixed in trunk and will be part of the new release.
>>>>
>>>> The patch is here:
>>>>
>>>> http://cdrtool.ag-projects.com/projects/cdrtool/repository/revisions/2421
>>>>
>>>> Best regards,
>>>>
>>>> --
>>>> Tijmen de Mes
>>>> AG Projects
>>>>
>>>> Op 24 mrt. 2013, om 00:26 heeft dotnetdub <dotnetdub at gmail.com> het
>>>> volgende geschreven:
>>>>
>>>> > On 23 March 2013 20:52, Laszlo <laszlo at voipfreak.net> wrote:
>>>> >> +1 on this
>>>> >>
>>>> >
>>>> > We will do our best to contribute a patch..
>>>> >
>>>> > _______________________________________________
>>>> > Users mailing list
>>>> > Users at lists.opensips.org
>>>> > http://lists.opensips.org/cgi-bin/mailman/listinfo/users
>>>>
>>>>
>>>> _______________________________________________
>>>> Users mailing list
>>>> Users at lists.opensips.org
>>>> http://lists.opensips.org/cgi-bin/mailman/listinfo/users
>>>>
>>>  _______________________________________________
>>> Users mailing list
>>> Users at lists.opensips.org
>>> http://lists.opensips.org/cgi-bin/mailman/listinfo/users
>>>
>>>
>>>
>>> _______________________________________________
>>> Users mailing list
>>> Users at lists.opensips.org
>>> http://lists.opensips.org/cgi-bin/mailman/listinfo/users
>>>
>>>
>>
>
>
> _______________________________________________
> Users mailing listUsers at lists.opensips.orghttp://lists.opensips.org/cgi-bin/mailman/listinfo/users
>
>
> _______________________________________________
> Users mailing list
> Users at lists.opensips.org
> http://lists.opensips.org/cgi-bin/mailman/listinfo/users
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.opensips.org/pipermail/users/attachments/20130325/cd52c29b/attachment-0001.htm>


More information about the Users mailing list