On Apr 19, 2024, at 1:02 PM, Ghulam Mustafa via
sr-users <sr-users(a)lists.kamailio.org> wrote:
Hello,
I'm new to Kamailio and considering its use for our inbound/outbound proxy, call
rating, and billing system.
Hello, thank you for flying Kamailio.
I'd like to get your feedback on my current
approach and understand the best practices for this scenario.
Currently, I'm using SQL queries within my Kamailio configuration to handle
authorization and rating. Here's a simplified example:
[snip]
My questions are:
• Is this a sustainable approach for a Kamailio billing/rating setup? Are there
performance or scalability concerns?
• Would it be better to handle rating and billing directly on our FreeSWITCH B2BUA?
What are the advantages and disadvantages of each approach?
• Are there best practices or alternative solutions I should consider?
Thank you in advance for sharing your experience and insights!
I’ll be pleasantly surprised if Alex hasn’t responded by the time I’ve written this and
I’m sure that should he respond, he will provide an excellent, verbose opinion different
than mine.
I say that to say this:
One of the wonderful things about Kamailio is your ability to do things in the way that
fits your needs. One size doesn’t fit all here… there are many different approaches and
choosing what’s best for you will be different than what may be best for someone else.
This said, I’d first caution you that if you want to run sql from Kamailio, I’d highly
recommend using SQL transformations
(
https://www.kamailio.org/wikidocs/cookbooks/5.8.x/transformations/#sql-tran…)
among other considerations when running raw queries.
With that out of the way, there’s many different approaches to billing that really become
business decisions. It also needs to take into consideration taxes, fees, and other pass
through or assessments for your local area (as well as the local area of the origination
and termination locations). Good idea to work with accountants and lawyers before locking
yourself into a model.
Kamailio has several outgoing rating engines (see Kamailio Modules) and many use sql
lookups against their carrier rates to determine the least coat.
You may want to look at these as well as CGRATES before reinventing the wheel here.
But, using a complex sql query does have concerns when there’s high call rates and
sometimes is best to instead use an API / cache / etc system. If you do run sql, I’d
recommend the sanitization discussed above.
Sorry for the non-answer, but there’s really not a “this is what to do” answer.
—Fred Posner
qxork.com <http://qxork.com/>
Regards,
Fred Posner
p: +1 (352) 664-3733
https://qxork.com