[Spce-user] Billing (rate-o-mat)

Andrew Pogrebennyk apogrebennyk at sipwise.com
Thu Oct 27 08:50:28 EDT 2011


Hello Michael,
At a glance the log and cdr look fine. We will check this and get back
to you.
P.S. the mailing list address must stay in cc: , so we may track the
issue properly and someone may eventually find it useful.

On 10/26/2011 12:06 AM, Michael Molina wrote:
> I got the information you asked me to get. It took me a little while
> since I had to go to the hospital to see a friend of mine.
>  
> The first thing you told me to get:
> 
> mysql> select * from cdr where rating_status!='ok' order by start_time
> limit 1\G
> *************************** 1. row ***************************
>                       id: 1
>              update_time: 2011-10-22 14:04:52
>           source_user_id: 7269b66f-f5aa-48bd-9730-bcdf81b7beaf
>       source_provider_id: 1
>              source_user: ma123456
>            source_domain: 192.168.15.2
>               source_cli: 13105025252
>              source_clir: 0
>      destination_user_id: 0
>  destination_provider_id: 0
>         destination_user: abc13105025252
>       destination_domain: 127.0.0.1
>  destination_user_dialed: 2000
>      destination_user_in: abc13105025252
>    destination_domain_in: voicebox.local
>                call_type: call
>              call_status: ok
>                call_code: 200
>               start_time: 2011-10-22 14:04:34
>                 duration: 9
>                  call_id:
> 51774a1df6353a32M2IwZWI3NDY5YmE5Yzk1ZjNhMDVjNGNlZjFmNmFhYzQ.
>             carrier_cost: 0.00
>            reseller_cost: 0.00
>            customer_cost: 0.00
>   carrier_billing_fee_id: NULL
>  reseller_billing_fee_id: NULL
>  customer_billing_fee_id: NULL
>  carrier_billing_zone_id: NULL
> reseller_billing_zone_id: NULL
> customer_billing_zone_id: NULL
>      frag_carrier_onpeak: NULL
>     frag_reseller_onpeak: NULL
>     frag_customer_onpeak: NULL
>            is_fragmented: NULL
>                 rated_at: NULL
>            rating_status: unrated
> 1 row in set (0.01 sec)
> -----------------------------------
> 
> mysql> select * from cdr where duration<0\G
> Empty set (0.00 sec)
> 
> -----------------------------------
> This is a virual machine for testing only. It is the oracle machine. I
> installed it
> it is not the premade one.
> ---------------------------------------
> The file does exist in /etc/default/ngcp-rate-o-mat
> This is the content of this file:
> 
> # Options for the NGCP rate-o-mat
> # how long we shall sleep before looking for unrated CDRs again
> RATEOMAT_LOOP_INTERVAL=10
> # whether we should split CDRs on peaktime borders
> RATEOMAT_SPLIT_PEAK_PARTS=0
> # db reconnect options
> RATEOMAT_DB_RECONNECT_RETRIES=9999
> RATEOMAT_DB_RECONNECT_INTERVAL=5
> RATEOMAT_DB_RECONNECT_TIMEOUT=3
> RATEOMAT_DB_TXN_RETRIES=100
> RATEOMAT_DB_PRINT_ERROR=0
> # billing database
> RATEOMAT_BILLING_DB_HOST='localhost'
> RATEOMAT_BILLING_DB_PORT='3306'
> RATEOMAT_BILLING_DB_NAME='billing'
> RATEOMAT_BILLING_DB_USER='rateomat'
> RATEOMAT_BILLING_DB_PASS='es7EujFahYirCN7kxsuE'
> # accounting database
> RATEOMAT_ACCOUNTING_DB_HOST='localhost'
> RATEOMAT_ACCOUNTING_DB_PORT='3306'
> RATEOMAT_ACCOUNTING_DB_NAME='accounting'
> RATEOMAT_ACCOUNTING_DB_USER='rateomat'
> RATEOMAT_ACCOUNTING_DB_PASS='es7EujFahYirCN7kxsuE'
> # export all settings to rate-o-mat's environment
> export RATEOMAT_LOOP_INTERVAL RATEOMAT_SPLIT_PEAK_PARTS
> RATEOMAT_BILLING_DB_NAME RATEOMAT_BILLING_DB_HOST
> RATEOMAT_BILLING_DB_PORT RATEOMAT_BILLING_DB_USER
> RATEOMAT_BILLING_DB_PASS RATEOMAT_ACCOUNTING_DB_NAME
> RATEOMAT_ACCOUNTING_DB_HOST RATEOMAT_ACCOUNTING_DB_PORT
> RATEOMAT_ACCOUNTING_DB_USER RATEOMAT_ACCOUNTING_DB_PASS
> RATEOMAT_DB_RECONNECT_RETRIES RATEOMAT_DB_RECONNECT_INTERVAL
> RATEOMAT_DB_RECONNECT_TIMEOUT RATEOMAT_DB_TXN_RETRIES
> RATEOMAT_DB_PRINT_ERROR
> 
> ------------------------------------------------------------
> Content of var/log/ngcp.cdr.log:
>  
> Oct 22 13:23:18 debian mediator[25199]: Locking process.
> Oct 22 13:23:18 debian mediator[25199]: Daemonizing process.
> Oct 22 13:23:18 debian mediator[25200]: Writing pid file.
> Oct 22 13:23:18 debian mediator[25200]: ACC acc database
> host='localhost', port='3306', user='kamailio', name='kamailio'
> Oct 22 13:23:18 debian mediator[25200]: CDR acc database
> host='localhost', port='3306', user='mediator', name='accounting'
> Oct 22 13:23:18 debian mediator[25200]: Setting up mysql connections.
> Oct 22 13:23:18 debian mediator[25200]: Up and running, daemonized=1,
> pid-path='/var/run/mediator.pid', interval=10
> Oct 22 13:29:59 debian mediator[25200]: Lost connection to SQL server
> during query, retrying...
> Oct 22 13:32:45 debian mediator[25200]: Shutting down.
> Oct 22 13:32:45 debian mediator[25200]: Successfully shut down.
> Oct 22 13:32:45 debian mediator[25200]: Unlocking mediator.
> Oct 22 13:33:31 debian mediator[1855]: Locking process.
> Oct 22 13:33:31 debian mediator[1855]: Daemonizing process.
> Oct 22 13:33:31 debian mediator[1859]: Writing pid file.
> Oct 22 13:33:31 debian mediator[1859]: ACC acc database
> host='localhost', port='3306', user='kamailio', name='kamailio'
> Oct 22 13:33:31 debian mediator[1859]: CDR acc database
> host='localhost', port='3306', user='mediator', name='accounting'
> Oct 22 13:33:31 debian mediator[1859]: Setting up mysql connections.
> Oct 22 13:33:31 debian mediator[1859]: Up and running, daemonized=1,
> pid-path='/var/run/mediator.pid', interval=10
> Oct 22 14:04:52 debian mediator[1859]: Overall 1 CDRs created so far.
> Oct 22 14:12:05 debian mediator[1859]: Overall 2 CDRs created so far.
> Oct 22 15:11:11 debian mediator[1859]: Overall 3 CDRs created so far.
> Oct 22 15:11:24 debian mediator[1859]: Shutting down.
> Oct 22 15:11:24 debian mediator[1859]: Successfully shut down.
> Oct 22 15:11:24 debian mediator[1859]: Unlocking mediator.
> Oct 22 15:12:13 debian mediator[1884]: Locking process.
> Oct 22 15:12:13 debian mediator[1884]: Daemonizing process.
> Oct 22 15:12:13 debian mediator[1886]: Writing pid file.
> Oct 22 15:12:13 debian mediator[1886]: ACC acc database
> host='localhost', port='3306', user='kamailio', name='kamailio'
> Oct 22 15:12:13 debian mediator[1886]: CDR acc database
> host='localhost', port='3306', user='mediator', name='accounting'
> Oct 22 15:12:13 debian mediator[1886]: Setting up mysql connections.
> Oct 22 15:12:13 debian mediator[1886]: Up and running, daemonized=1,
> pid-path='/var/run/mediator.pid', interval=10
> Oct 22 15:17:14 debian mediator[1886]: Overall 1 CDRs created so far.
> Oct 22 15:20:07 debian mediator[1886]: Overall 2 CDRs created so far.
> Oct 22 15:28:29 debian mediator[1886]: Shutting down.
> Oct 22 15:28:29 debian mediator[1886]: Successfully shut down.
> Oct 22 15:28:29 debian mediator[1886]: Unlocking mediator.
> Oct 22 15:29:47 debian mediator[1867]: Locking process.
> Oct 22 15:29:47 debian mediator[1867]: Daemonizing process.
> Oct 22 15:29:47 debian mediator[1869]: Writing pid file.
> Oct 22 15:29:47 debian mediator[1869]: ACC acc database
> host='localhost', port='3306', user='kamailio', name='kamailio'
> Oct 22 15:29:47 debian mediator[1869]: CDR acc database
> host='localhost', port='3306', user='mediator', name='accounting'
> Oct 22 15:29:47 debian mediator[1869]: Setting up mysql connections.
> Oct 22 15:29:47 debian mediator[1869]: Up and running, daemonized=1,
> pid-path='/var/run/mediator.pid', interval=10
> Oct 22 15:35:57 debian mediator[1869]: Overall 1 CDRs created so far.
> Oct 22 15:39:00 debian mediator[1869]: Overall 2 CDRs created so far.
> Oct 22 15:51:53 debian mediator[1869]: Overall 3 CDRs created so far.
> Oct 22 15:56:27 debian mediator[1869]: Overall 4 CDRs created so far.
> Oct 22 16:00:20 debian mediator[1869]: Overall 5 CDRs created so far.
> Oct 22 16:02:22 debian mediator[1869]: Overall 6 CDRs created so far.
> Oct 22 16:09:26 debian mediator[1869]: Overall 7 CDRs created so far.
> Oct 22 16:22:29 debian mediator[1869]: Overall 9 CDRs created so far.
> Oct 22 16:25:52 debian mediator[1869]: Overall 11 CDRs created so far.
> Oct 22 16:26:25 debian mediator[1869]: Overall 13 CDRs created so far.
> Oct 22 16:29:18 debian mediator[1869]: Overall 14 CDRs created so far.
> Oct 22 16:29:41 debian mediator[1869]: Overall 15 CDRs created so far.
> Oct 22 16:30:44 debian mediator[1869]: Overall 16 CDRs created so far.
> Oct 22 16:40:17 debian mediator[1869]: Overall 17 CDRs created so far.
> Oct 22 16:43:00 debian mediator[1869]: Overall 18 CDRs created so far.
> Oct 22 16:46:13 debian mediator[1869]: Overall 19 CDRs created so far.
> Oct 22 16:52:26 debian mediator[1869]: Overall 20 CDRs created so far.
> Oct 22 17:19:05 debian mediator[1869]: Shutting down.
> Oct 22 17:19:05 debian mediator[1869]: Successfully shut down.
> Oct 22 17:19:05 debian mediator[1869]: Unlocking mediator.
> Oct 22 17:19:53 debian mediator[1859]: Locking process.
> Oct 22 17:19:53 debian mediator[1859]: Daemonizing process.
> Oct 22 17:19:53 debian mediator[1861]: Writing pid file.
> Oct 22 17:19:53 debian mediator[1861]: ACC acc database
> host='localhost', port='3306', user='kamailio', name='kamailio'
> Oct 22 17:19:53 debian mediator[1861]: CDR acc database
> host='localhost', port='3306', user='mediator', name='accounting'
> Oct 22 17:19:53 debian mediator[1861]: Setting up mysql connections.
> Oct 22 17:19:53 debian mediator[1861]: Up and running, daemonized=1,
> pid-path='/var/run/mediator.pid', interval=10
> Oct 22 17:47:35 debian mediator[1861]: Overall 1 CDRs created so far.
> Oct 22 17:48:58 debian mediator[1861]: Overall 3 CDRs created so far.
> Oct 22 17:49:01 debian mediator[1861]: Overall 4 CDRs created so far.
> Oct 22 17:52:04 debian mediator[1861]: Overall 5 CDRs created so far.
> Oct 23 01:21:21 debian mediator[1861]: Shutting down.
> Oct 23 01:21:21 debian mediator[1861]: Successfully shut down.
> Oct 23 01:21:21 debian mediator[1861]: Unlocking mediator.
> Oct 25 13:50:04 debian mediator[1962]: Locking process.
> Oct 25 13:50:04 debian mediator[1962]: Daemonizing process.
> Oct 25 13:50:04 debian mediator[1984]: Writing pid file.
> Oct 25 13:50:04 debian mediator[1984]: ACC acc database
> host='localhost', port='3306', user='kamailio', name='kamailio'
> Oct 25 13:50:04 debian mediator[1984]: CDR acc database
> host='localhost', port='3306', user='mediator', name='accounting'
> Oct 25 13:50:04 debian mediator[1984]: Setting up mysql connections.
> Oct 25 13:50:
>  
> I hope we can fix this so it can be implemented on a real machine. I
> would appreciate some light so I can learn how to program the rates and
> make it beautiful Thanks my friend.
>  
> Michael Molina.
> Ladera Communications.





More information about the Spce-user mailing list