[Spce-user] Peer billing?

Daniel Tiefnig dtiefnig at sipwise.com
Tue Sep 27 07:26:32 EDT 2011


On 09/27/2011 12:39 PM, Skyler wrote:
> Hi Daniel,

Hi,

> I have an idea about doing calculations from cdr to determine the
> concurrent inbound call usage per upstream peer and having this
> available via API. How can I learn more or where can I look at
> existing code to learn about the way get_voip_account_fees is done in
> ngcp API?

The API is implemented in Perl, and installed on our systems via Debian
packages to /usr/share/perl5/Sipwise. You'll be interested in the
Sipwise::Provisioning::Billing and Sipwise::Provisioning::Billing::DB
modules to see how get_voip_account_fees() works. The interesting part
is in the "~DB" module, where you can find the SQL which retrieves the data.

In destination_provider_id in the cdr table you will find the contract
ID of the peering contract which you can use to filter the results. (It
will be 0 for calls to the application server (voicebox, conference) and
1 for calls to local subscribers.) The destination_domain column will
contain the peering server IP for calls leaving the system. Both could
be an appropriate identifier for the function, the contract ID would
make more sense from a billing perspective.

> My goal is not really about fees, its about grouping and reporting
> numbers that can be used to compare upstream billing; BUT if I can
> create this using get_voip_account_fees structure as a reference, it
> may be useful for others too.

Sure it will. Think I thought about this myself, but never found the
time to get it implemented.

br,
daniel
-- 
Geschäftsführer                                    Sipwise GmbH
e: dtiefnig at sipwise.com                          Europaring F15
t: +43 699 1129 1017                          A-2345 Brunn a.G.
w: www.sipwise.com        FN: 305595f    FG: LG Wiener Neustadt




More information about the Spce-user mailing list