Rating Engine Problem

classic Classic list List threaded Threaded
16 messages Options
Reply | Threaded
Open this post in threaded view
|

Rating Engine Problem

bay2x1
I am wondering on why my rating engine is not generating price for each call. I have found out that the username on my radacct table is blank.  I have checked the radius detail log and the User-Name is not empty.  Any idea on how to resolve this problem would be highly appreciated.
Reply | Threaded
Open this post in threaded view
|

Re: Rating Engine Problem

Iñaki Baz Castillo
El Martes, 24 de Febrero de 2009, bay2x1 escribió:
> I am wondering on why my rating engine is not generating price for each
> call. I have found out that the username on my radacct table is blank.  I
> have checked the radius detail log and the User-Name is not empty.  Any
> idea on how to resolve this problem would be highly appreciated.

This must be a configuration problem in your Radius server. Look in
radiusd.conf for UserName field.

--
Iñaki Baz Castillo

_______________________________________________
Users mailing list
[hidden email]
http://lists.opensips.org/cgi-bin/mailman/listinfo/users
Reply | Threaded
Open this post in threaded view
|

Re: Rating Engine Problem

bay2x1
The radiusd.conf file or the sql.conf file.  Anyway I check the sql.conf file the username = billing_party, together with the Realm.  I check the radius detail log the billing party is not empty.  Am I correct if I assume that the data present in the radius detail log would be saved on the radacct table?

    accounting_start_query = "\
          INSERT INTO ${acct_table} \
                (RadAcctId, AcctSessionId, AcctUniqueId, UserName, Realm, NASIPAddress, NASPortId, AcctStartTime, AcctStopTime, AcctSessionTime, \
                AcctInputOctets, AcctOutputOctets, CalledStationId, CallingStationId, AcctTerminateCause, ServiceType, ENUMtld, \
                FramedIPAddress, AcctStartDelay, AcctStopDelay, SipResponseCode, SipMethod, SipTranslatedRequestURI, SipToTag, SipFromTag, \
                SipRPID, SourceIP, SourcePort, CanonicalURI) \
          VALUES \
                (NULL, '%{Acct-Session-Id}', '%{Acct-Unique-Session-Id}', '%{Billing-Party}', SUBSTRING_INDEX('%{Billing-Party}', '@',-1), \
                '%{SIP-Proxy-IP}', '%{NAS-Port}', '%S', '0', '0', '0', '0', \
                trim(leading 'sip:' from trim(leading 'sips:' from '%{Called-Station-Id}')), \
                trim(leading 'sip:' from trim(leading 'sips:' from '%{Calling-Station-Id}')), \
                '%{Sip-Response-Code}', '%{Service-Type}', '%{ENUM-TLD}', '%{Framed-IP-Address}', '%{Acct-Delay-Time}', '0', \
                '%{Sip-Response-Code}', '%{Sip-Method}', \
                trim(leading 'sip:' from trim(leading 'sips:' from '%{Sip-Translated-Request-URI}')), \
                '%{Sip-To-Tag}', '%{Sip-From-Tag}', '%{Sip-RPId}', \
                '%{Source-IP}', '%{Source-Port}', \
                trim(leading 'sip:' from trim(leading 'sips:' from '%{Canonical-URI}')) \
                )"




Iñaki Baz Castillo wrote
El Martes, 24 de Febrero de 2009, bay2x1 escribió:
> I am wondering on why my rating engine is not generating price for each
> call. I have found out that the username on my radacct table is blank.  I
> have checked the radius detail log and the User-Name is not empty.  Any
> idea on how to resolve this problem would be highly appreciated.

This must be a configuration problem in your Radius server. Look in
radiusd.conf for UserName field.

--
Iñaki Baz Castillo

_______________________________________________
Users mailing list
Users@lists.opensips.org
http://lists.opensips.org/cgi-bin/mailman/listinfo/users
Reply | Threaded
Open this post in threaded view
|

Re: Rating Engine Problem

Iñaki Baz Castillo
2009/2/24 bay2x1 <[hidden email]>:
>
> The radiusd.conf file or the sql.conf file.  Anyway I check the sql.conf file
> the username = billing_party, together with the Realm.  I check the radius
> detail log the billing party is not empty.  Am I correct if I assume that
> the data present in the radius detail log would be saved on the radacct
> table?

Are you using the sql.conf provided by CDRTool? I don't think so.


--
Iñaki Baz Castillo
<[hidden email]>

_______________________________________________
Users mailing list
[hidden email]
http://lists.opensips.org/cgi-bin/mailman/listinfo/users
Reply | Threaded
Open this post in threaded view
|

Re: Rating Engine Problem

bay2x1
Are there other version of sql.conf? How would I know which one I am using?

Iñaki Baz Castillo wrote
2009/2/24 bay2x1 <rod@racequeen.ph>:
>
> The radiusd.conf file or the sql.conf file.  Anyway I check the sql.conf file
> the username = billing_party, together with the Realm.  I check the radius
> detail log the billing party is not empty.  Am I correct if I assume that
> the data present in the radius detail log would be saved on the radacct
> table?

Are you using the sql.conf provided by CDRTool? I don't think so.


--
Iñaki Baz Castillo
<ibc@aliax.net>

_______________________________________________
Users mailing list
Users@lists.opensips.org
http://lists.opensips.org/cgi-bin/mailman/listinfo/users
Reply | Threaded
Open this post in threaded view
|

Re: Rating Engine Problem

Iñaki Baz Castillo
El Miércoles, 25 de Febrero de 2009, bay2x1 escribió:
> Are there other version of sql.conf? How would I know which one I am using?

Have you really read the Installation document of CDRTool?:
  http://cdrtool.ag-projects.com/wiki/Install

It appears very clear:
  cp /var/www/CDRTool/setup/radius/OpenSIPS/sql.conf /etc/freeradius/sql.conf

--
Iñaki Baz Castillo

_______________________________________________
Users mailing list
[hidden email]
http://lists.opensips.org/cgi-bin/mailman/listinfo/users
Reply | Threaded
Open this post in threaded view
|

Re: Rating Engine Problem

bay2x1
I did that exactly, I copied the sql.conf cp /var/www/CDRTool/setup/radius/OpenSIPS/ to /etc/freeradius/sql.conf as per the manual instructed.
I am still wondering why my rating engine is not generating price of call computations.
I really appreciate your effort in helping.

Iñaki Baz Castillo wrote
El Miércoles, 25 de Febrero de 2009, bay2x1 escribió:
> Are there other version of sql.conf? How would I know which one I am using?

Have you really read the Installation document of CDRTool?:
  http://cdrtool.ag-projects.com/wiki/Install

It appears very clear:
  cp /var/www/CDRTool/setup/radius/OpenSIPS/sql.conf /etc/freeradius/sql.conf

--
Iñaki Baz Castillo

_______________________________________________
Users mailing list
Users@lists.opensips.org
http://lists.opensips.org/cgi-bin/mailman/listinfo/users
Reply | Threaded
Open this post in threaded view
|

Re: Rating Engine Problem

Iñaki Baz Castillo
El Miércoles, 25 de Febrero de 2009, bay2x1 escribió:
> I did that exactly, I copied the sql.conf cp
> /var/www/CDRTool/setup/radius/OpenSIPS/ to /etc/freeradius/sql.conf as per
> the manual instructed.
> I am still wondering why my rating engine is not generating price of call
> computations.
> I really appreciate your effort in helping.

I've just used an older version of CDRTool and the sql.conf file was
different.

In your sql.conf I see that the value inserted in radacct UserName column is
'%{Billing-Party}, so be sure that "Billing-Party" is set via Radius.

--
Iñaki Baz Castillo

_______________________________________________
Users mailing list
[hidden email]
http://lists.opensips.org/cgi-bin/mailman/listinfo/users
Reply | Threaded
Open this post in threaded view
|

Re: Rating Engine Problem

bay2x1
To set it in radius I have to add this in my opensips.cfg file

modparam("acc", "radius_extra", "User-Name=$Au; \
                                 Calling-Station-Id=$from; \
                                 Called-Station-Id=$to; \
                                 Sip-Translated-Request-URI=$ru; \
                                 Sip-RPid=$avp(s:rpid); \
                                 Source-IP=$avp(s:source_ip); \
                                 Source-Port=$avp(s:source_port); \
                                 SIP-Proxy-IP=$avp(s:sip_proxy_ip); \
                                 Canonical-URI=$avp(s:can_uri); \
                                 Billing-Party=$avp(s:billing_party); \
                                 Divert-Reason=$avp(s:divert_reason); \
                                 User-Agent=$hdr(user-agent); \
                                 Contact=$hdr(contact); \
                                 Event=$hdr(event); \
                                 ENUM-TLD=$avp(s:enum_tld)")
Am I correct?



Iñaki Baz Castillo wrote
El Miércoles, 25 de Febrero de 2009, bay2x1 escribió:
> I did that exactly, I copied the sql.conf cp
> /var/www/CDRTool/setup/radius/OpenSIPS/ to /etc/freeradius/sql.conf as per
> the manual instructed.
> I am still wondering why my rating engine is not generating price of call
> computations.
> I really appreciate your effort in helping.

I've just used an older version of CDRTool and the sql.conf file was
different.

In your sql.conf I see that the value inserted in radacct UserName column is
'%{Billing-Party}, so be sure that "Billing-Party" is set via Radius.

--
Iñaki Baz Castillo

_______________________________________________
Users mailing list
Users@lists.opensips.org
http://lists.opensips.org/cgi-bin/mailman/listinfo/users
Reply | Threaded
Open this post in threaded view
|

Re: Rating Engine Problem

Iñaki Baz Castillo
El Miércoles, 25 de Febrero de 2009, bay2x1 escribió:

> To set it in radius I have to add this in my opensips.cfg file
>
> modparam("acc", "radius_extra", "User-Name=$Au; \
>                                  Calling-Station-Id=$from; \
>                                  Called-Station-Id=$to; \
>                                  Sip-Translated-Request-URI=$ru; \
>                                  Sip-RPid=$avp(s:rpid); \
>                                  Source-IP=$avp(s:source_ip); \
>                                  Source-Port=$avp(s:source_port); \
>                                  SIP-Proxy-IP=$avp(s:sip_proxy_ip); \
>                                  Canonical-URI=$avp(s:can_uri); \
>                                  Billing-Party=$avp(s:billing_party); \
>                                  Divert-Reason=$avp(s:divert_reason); \
>                                  User-Agent=$hdr(user-agent); \
>                                  Contact=$hdr(contact); \
>                                  Event=$hdr(event); \
>                                  ENUM-TLD=$avp(s:enum_tld)")
> Am I correct?

Are you setting $avp(s:billing_party) in the script? Check it by inspecting
the Radius data arriving to FreeRadius (look for "Billing-Party").

--
Iñaki Baz Castillo

_______________________________________________
Users mailing list
[hidden email]
http://lists.opensips.org/cgi-bin/mailman/listinfo/users
Reply | Threaded
Open this post in threaded view
|

Re: Rating Engine Problem

bay2x1
I have check the radius log details and I was not able to find  Billing-Party.
This means that $avp(s:billing_party);  is misconfigured in the opensips.cfg file?
I am really confuse on how each record in the radacct table is created. I know that it is using the sql.conf stored procedure to insert record into the table but I dont know where the data is coming from.


Iñaki Baz Castillo wrote
El Miércoles, 25 de Febrero de 2009, bay2x1 escribió:
> To set it in radius I have to add this in my opensips.cfg file
>
> modparam("acc", "radius_extra", "User-Name=$Au; \
>                                  Calling-Station-Id=$from; \
>                                  Called-Station-Id=$to; \
>                                  Sip-Translated-Request-URI=$ru; \
>                                  Sip-RPid=$avp(s:rpid); \
>                                  Source-IP=$avp(s:source_ip); \
>                                  Source-Port=$avp(s:source_port); \
>                                  SIP-Proxy-IP=$avp(s:sip_proxy_ip); \
>                                  Canonical-URI=$avp(s:can_uri); \
>                                  Billing-Party=$avp(s:billing_party); \
>                                  Divert-Reason=$avp(s:divert_reason); \
>                                  User-Agent=$hdr(user-agent); \
>                                  Contact=$hdr(contact); \
>                                  Event=$hdr(event); \
>                                  ENUM-TLD=$avp(s:enum_tld)")
> Am I correct?

Are you setting $avp(s:billing_party) in the script? Check it by inspecting
the Radius data arriving to FreeRadius (look for "Billing-Party").

--
Iñaki Baz Castillo

_______________________________________________
Users mailing list
Users@lists.opensips.org
http://lists.opensips.org/cgi-bin/mailman/listinfo/users
Reply | Threaded
Open this post in threaded view
|

Re: Rating Engine Problem

Iñaki Baz Castillo
El Miércoles, 25 de Febrero de 2009, bay2x1 escribió:
> I have check the radius log details and I was not able to find
> Billing-Party.
> This means that $avp(s:billing_party);  is misconfigured in the
> opensips.cfg file?

Can you check if that AVP has really a value by printing it with "xlog"?


> I am really confuse on how each record in the radacct table is created. I
> know that it is using the sql.conf stored procedure to insert record into
> the table but I dont know where the data is coming from.

The data comes via Radius protocol, no more.

--
Iñaki Baz Castillo

_______________________________________________
Users mailing list
[hidden email]
http://lists.opensips.org/cgi-bin/mailman/listinfo/users
Reply | Threaded
Open this post in threaded view
|

Re: Rating Engine Problem

bay2x1
I apologize for reposting my topic. Well, I have check it and its now working fine, the username in the radacct table is no longer empty.  However, the rating engine is still not computing for the cost of call.
Iñaki Baz Castillo wrote
El Miércoles, 25 de Febrero de 2009, bay2x1 escribió:
> I have check the radius log details and I was not able to find
> Billing-Party.
> This means that $avp(s:billing_party);  is misconfigured in the
> opensips.cfg file?

Can you check if that AVP has really a value by printing it with "xlog"?


> I am really confuse on how each record in the radacct table is created. I
> know that it is using the sql.conf stored procedure to insert record into
> the table but I dont know where the data is coming from.

The data comes via Radius protocol, no more.

--
Iñaki Baz Castillo

_______________________________________________
Users mailing list
Users@lists.opensips.org
http://lists.opensips.org/cgi-bin/mailman/listinfo/users
Reply | Threaded
Open this post in threaded view
|

Re: Rating Engine Problem

Iñaki Baz Castillo
2009/2/26 bay2x1 <[hidden email]>:
>
> I apologize for reposting my topic. Well, I have check it and its now working
> fine, the username in the radacct table is no longer empty.  However, the
> rating engine is still not computing for the cost of call.

Read and re-read the rating.txt file. It's hard to understand in a
single reading :)
Your profile, rating...  tables are not well configured (the most
probable reason).

--
Iñaki Baz Castillo
<[hidden email]>

_______________________________________________
Users mailing list
[hidden email]
http://lists.opensips.org/cgi-bin/mailman/listinfo/users
Reply | Threaded
Open this post in threaded view
|

Re: Rating Engine Problem

bay2x1
Thanx for your help. I really appreciate it.  I will do what you told me... re-read the rating.txt many many times. In regards to my rating, destination, profiles, customers settings any suggestion on what seems to be misconfigured or any other documentation that discusses this subject.  I know that this matter is  discussed on the rating.txt.
Iñaki Baz Castillo wrote
2009/2/26 bay2x1 <rod@racequeen.ph>:
>
> I apologize for reposting my topic. Well, I have check it and its now working
> fine, the username in the radacct table is no longer empty.  However, the
> rating engine is still not computing for the cost of call.

Read and re-read the rating.txt file. It's hard to understand in a
single reading :)
Your profile, rating...  tables are not well configured (the most
probable reason).

--
Iñaki Baz Castillo
<ibc@aliax.net>

_______________________________________________
Users mailing list
Users@lists.opensips.org
http://lists.opensips.org/cgi-bin/mailman/listinfo/users
Reply | Threaded
Open this post in threaded view
|

Re: Rating Engine Problem

john99
Hi,

Im having a similar issue, and could use some help.
MySQL error: 1146 (Table 'radius.radacct200903' doesn't exist) 63Session halted.
i dont have a 200903 table

On INSERT the monthly table is created automatically when necessary.  

when i complete a call, radiius_xlat is calling "CALL update_raddact_record_mediaproxy"
it is not calling the INSERT first.  So no tables are being created.   I think this has something to do with the data opensips
is sending to radius but thats why im asking for help.

any and all help is greatly needed and appreciated.  thanks.

hers is my radius -X readout

Listening on authentication *:1812
Listening on accounting *:1813
Ready to process requests.
rad_recv: Accounting-Request packet from host 192.168.0.105:37715, id=178, length=230
        User-Name = "mediaproxy@default"
        Acct-Output-Octets = 0
        NAS-IP-Address = 192.168.0.106
        Sip-To-Tag = "as3676c243"
        Media-Codecs = "Unknown, GSM"
        Media-Info = ""
        Sip-User-Agents = "Ekiga/2.0.12+Asterisk PBX"
        Sip-Applications = "audio, video"
        Acct-Session-Time = 50
        Acct-Session-Id = "dc83c947-2511-de11-9903-00c09f9a2b32@command1"
        Acct-Status-Type = Update
        Sip-From-Tag = "5489c947-2511-de11-9903-00c09f9a2b32"
        Acct-Delay-Time = 3
        Acct-Input-Octets = 0
  Processing the preacct section of radiusd.conf
modcall: entering group preacct for request 0
  modcall[preacct]: module "preprocess" returns noop for request 0
rlm_acct_unique: WARNING: Attribute NAS-Port was not found in request, unique ID MAY be inconsistent
rlm_acct_unique: Hashing ',Client-IP-Address = 192.168.0.105,NAS-IP-Address = 192.168.0.106,Acct-Session-Id = "dc83c947-2511-de11-9903-00c09f9a2b32@command1",User-Name = "mediaproxy@default"'
rlm_acct_unique: Acct-Unique-Session-ID = "f105ba032e958c94".
  modcall[preacct]: module "acct_unique" returns ok for request 0
    rlm_realm: Looking up realm "default" for User-Name = "mediaproxy@default"
    rlm_realm: No such realm "default"
  modcall[preacct]: module "suffix" returns noop for request 0
  modcall[preacct]: module "files" returns noop for request 0
modcall: leaving group preacct (returns ok) for request 0
  Processing the accounting section of radiusd.conf
modcall: entering group accounting for request 0
radius_xlat:  '/usr/local/var/log/radius/radacct/192.168.0.105/detail-20090316'
rlm_detail: /usr/local/var/log/radius/radacct/%{Client-IP-Address}/detail-%Y%m%d expands to /usr/local/var/log/radius/radacct/192.168.0.105/detail-20090316
  modcall[accounting]: module "detail" returns ok for request 0
  modcall[accounting]: module "unix" returns noop for request 0
radius_xlat:  '/usr/local/var/log/radius/radutmp'
radius_xlat:  'mediaproxy@default'
  rlm_radutmp: No NAS-Port seen.  Cannot do anything.
  rlm_radumtp: WARNING: checkrad will probably not work!
  modcall[accounting]: module "radutmp" returns noop for request 0
radius_xlat:  '          CALL update_raddact_record_mediaproxy(                 'radius',                 '50',                 '0',                 '0',                 'Ekiga/2.0.12=2BAsterisk PBX',                 'Unknown=2C GSM',                 'audio=2C video',                 '',                 '0',                 'dc83c947-2511-de11-9903-00c09f9a2b32@command1',                 'as3676c243',                 '5489c947-2511-de11-9903-00c09f9a2b32'                 )'
radius_xlat:  '/usr/local/var/log/radius/sqltrace-20090316.log'
rlm_sql (sql): Reserving sql socket id: 24
rlm_sql_mysql: query:            CALL update_raddact_record_mediaproxy(                 'radius',                 '50',                 '0',                 '0',                 'Ekiga/2.0.12=2BAsterisk PBX',                 'Unknown=2C GSM',                 'audio=2C video',                 '',                 '0',                 'dc83c947-2511-de11-9903-00c09f9a2b32@command1',                 'as3676c243',                 '5489c947-2511-de11-9903-00c09f9a2b32'                 )
radius_xlat:  ''
radius_xlat:  '/usr/local/var/log/radius/sqltrace-20090316.log'
rlm_sql (sql): Released sql socket id: 24
  modcall[accounting]: module "sql" returns ok for request 0
modcall: leaving group accounting (returns ok) for request 0
Sending Accounting-Response of id 178 to 192.168.0.105 port 37715
Finished request 0
Going to the next request
--- Walking the entire request list ---
Waking up in 6 seconds...
--- Walking the entire request list ---
Cleaning up request 0 ID 178 with timestamp 49be730a
Nothing to do.  Sleeping until we see a request.



bay2x1 wrote
Thanx for your help. I really appreciate it.  I will do what you told me... re-read the rating.txt many many times. In regards to my rating, destination, profiles, customers settings any suggestion on what seems to be misconfigured or any other documentation that discusses this subject.  I know that this matter is  discussed on the rating.txt.
Iñaki Baz Castillo wrote
2009/2/26 bay2x1 <rod@racequeen.ph>:
>
> I apologize for reposting my topic. Well, I have check it and its now working
> fine, the username in the radacct table is no longer empty.  However, the
> rating engine is still not computing for the cost of call.

Read and re-read the rating.txt file. It's hard to understand in a
single reading :)
Your profile, rating...  tables are not well configured (the most
probable reason).

--
Iñaki Baz Castillo
<ibc@aliax.net>

_______________________________________________
Users mailing list
Users@lists.opensips.org
http://lists.opensips.org/cgi-bin/mailman/listinfo/users