[Spce-user] Strange rate-o-mat behaviour v2.8

Marc Storck mstorck at voipgate.com
Wed Sep 3 05:40:08 EDT 2014


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Hello Geaorge

Destination: The destination pattern. This is a POSIX regular expression matching the complete destination URI (e.g. someone at sip\.example\.org or ^43). This field must be set.

You should write the destination as ^44.*.

Under your current setup with destination 44 and 73900, this mtaches

*44* and *73900*

where 73900 is the most specific.

See https://www.sipwise.com/doc/mr3.4.1/spce/ar01s09.html#_creating_billing_fees for complete explanations

Regards,

Marc

On Sep 3, 2014, at 11:32 AM, George Mason <george.mason at xoomtalk.com> wrote:


Hi Daniel

Thanks that's very helpful. So I can see the following in the cdr table:

+------------------+-------------------------------+--------------------------------+--------------------------------+
| destination_user | source_carrier_billing_fee_id |
source_reseller_billing_fee_id | source_customer_billing_fee_id |
+------------------+-------------------------------+--------------------------------+--------------------------------+
| +441273900741    |                         46921
|                           NULL |                          46921 |
+------------------+-------------------------------+--------------------------------+--------------------------------+

And this relates to the following fee:

+-------+-------+--------------------+--------------------------+--------+-------------+-----------+------+------------------+----------------------+--------------------+------------------------+-------------------+-----------------------+---------------------+-------------------------+---------------+
| id    | bf_id | billing_profile_id | billing_zones_history_id | source
| destination | direction | type | onpeak_init_rate |
onpeak_init_interval | onpeak_follow_rate | onpeak_follow_interval |
offpeak_init_rate | offpeak_init_interval | offpeak_follow_rate |
offpeak_follow_interval | use_free_time |
+-------+-------+--------------------+--------------------------+--------+-------------+-----------+------+------------------+----------------------+--------------------+------------------------+-------------------+-----------------------+---------------------+-------------------------+---------------+
| 46921 | 46921 |                  2 |                     1147 | .     
| 73900       | out       | call |           0.0008 |                   
1 |             0.0008 |                      1 |            0.0008
|                     1 |              0.0008 |                       1
|             0 |
+-------+-------+--------------------+--------------------------+--------+-------------+-----------+------+------------------+----------------------+--------------------+------------------------+-------------------+-----------------------+---------------------+-------------------------+---------------+

What I do not understand is why rate-o-mat matched this fee? The prefix
that I expected it to match was this one:

+-------+-------+--------------------+--------------------------+--------+-------------+-----------+------+------------------+----------------------+--------------------+------------------------+-------------------+-----------------------+---------------------+-------------------------+---------------+
| id    | bf_id | billing_profile_id | billing_zones_history_id | source
| destination | direction | type | onpeak_init_rate |
onpeak_init_interval | onpeak_follow_rate | onpeak_follow_interval |
offpeak_init_rate | offpeak_init_interval | offpeak_follow_rate |
offpeak_follow_interval | use_free_time |
+-------+-------+--------------------+--------------------------+--------+-------------+-----------+------+------------------+----------------------+--------------------+------------------------+-------------------+-----------------------+---------------------+-------------------------+---------------+
| 49404 | 49404 |                  2 |                     1407 | .     
| 44          | out       | call |                1 |                   
1 |                  1 |                      1 |                 1
|                     1 |                   1 |                       1
|             0 |
+-------+-------+--------------------+--------------------------+--------+-------------+-----------+------+------------------+----------------------+--------------------+------------------------+-------------------+-----------------------+---------------------+-------------------------+---------------+

I have clearly misunderstood how to express dialled destinations in
billing fees - can you explain?

Thanks again

George

On 03/09/14 08:49, Daniel Grotti wrote:
Hi,
in order to check which fees are used by rate-o-mat to caclutate your
cost, you have to check the CDR:

select * from accounting.cdr where id="YOUR_CDR_ID"\G

Then check the "_fees_id" lines:

source_carrier_billing_fee_id: NULL
source_reseller_billing_fee_id: 1
source_customer_billing_fee_id: 1

then check the billing database:

select * from billing_fees_history where id="YOUR_FEES_ID";

that's the fee matched by your destination number called, and the cost
is calculated by using that fees.

Daniel





On 09/02/2014 10:45 PM, George Mason wrote:
Hi,

Sorry to re-post but really struggling with this. Cannot find out where
rate-o-mat appears to be getting its costs from. Is there any way I can
increase logging? Run the process in interactive mode perhaps?

Really grateful of any assistance or advice

Thanks

George


On 01/09/14 16:23, George Mason wrote:
Hi,

Having some trouble understanding carrier rating and interested to
understand what's going on. I have created contracts for my SIP peerings
with costs for destinations. I have then assigned these to the peering
groups and made some test calls.

I can see that rate-o-mat is rating the calls and I can see in the cdr
table that the calls have a source_carrier_cost assigned after it has
run. However I cannot understand how it is calculating the costs, they
appear to have no relation to the costs in the billing fees.

An example as follows:

I set a contract with calls to 44 to have a 1 cent per second billing
fee. I then made a 20 secs call. The entry in the cdr table is as follows:

+----+-------------+--------------+------------------+---------------------+----------+-----------+---------------------+---------------------+---------------+
| id | source_user | source_cli   | destination_user |
update_time         | duration | call_type | source_carrier_cost |
rated_at            | rating_status |
+----+-------------+--------------+------------------+---------------------+----------+-----------+---------------------+---------------------+---------------+
|  8 | 225544      | +12127450200 | +441273900741    | 2014-09-01
11:02:01 |   26.170 | call      |                0.02 | 2014-09-01
11:02:01 | ok            |
+----+-------------+--------------+------------------+---------------------+----------+-----------+---------------------+---------------------+---------------+
1 row in set (0.00 sec)

I cannot see where the system is getting this cost from - it appears to
be using a cost of 5c per minute, which I don't have anywhere. I have
also tried to change the fee in the billing fee for the contract but
this had no effect.

Can I increase rate-o-mat's logging to see what it is doing? Or is there
some other diagnostic steps I can take?

Thanks in advance

George
_______________________________________________
Spce-user mailing list
Spce-user at lists.sipwise.com
https://lists.sipwise.com/listinfo/spce-user
_______________________________________________
Spce-user mailing list
Spce-user at lists.sipwise.com
https://lists.sipwise.com/listinfo/spce-user

_______________________________________________
Spce-user mailing list
Spce-user at lists.sipwise.com
https://lists.sipwise.com/listinfo/spce-user

-----BEGIN PGP SIGNATURE-----
Comment: GPGTools - http://gpgtools.org

iQIcBAEBAgAGBQJUBuJmAAoJEBqZdpQUXtTC74AP/1qV+CYrT5sJYG2aVWrGJrWU
98mKthqieeETc6ILgF55EWtmIHe011TnfeMXs3evWQBqwrkX6fdhYoz5V2S7iIKc
Sv/l/ahBrKsAPvnlcSZQ86mpTxP/qB3qkuKMSrAmgXZ81+/d5jwYAjcUq+hGy0r/
9MucpdFuqnV/1flQh7P8JM6BtWefE0iyyYa6YYjYnXobYOKcmTNz+sMNSwjmR4ig
R8qq3/mGA5xZAb+AB7r9bVrH64cMzWFrviB53aGhrTz8d15RISYv8dnHfqsD0okk
ZhUXUK4JQUpiGTtKrttr3XtTMtoEHbiZfO933cHRPddWY0vCkM2WMYoMQo/Ux029
HnFouTjdHk66i8xHOBB1GlIU4jdJW6gPT6cGd9XyBL9VCc7uJrPgnHkTf+KSFeiV
uYY9xdblSwFH68ph5UwYyrn9N8iLFS1RAz88T+R8xGbIzifw9nCYrBE/DdXFEExF
jFr84y4GMxAp5FFIj3rK612Jb0H0BjiCyJplfNh0cVG9a+J+FXTlwHzIhcDWjdPz
qRnKa7yosoBqTKQxzEa6tXJ12IuM/OAifJzMnlzjIsUe0L8SK+QT+zY8FI3rdmPT
MxNgXpX9+1ESLwg+P/hbDk/V1Q6h0DFLmsyv++BMS628g0Vrgv+iFnsrOoSBmbOS
t//CTKZ1DIAfpEDfAfef
=Hy2A
-----END PGP SIGNATURE-----


More information about the Spce-user mailing list