Call Control integration on OpenSIPS

July 17, 2009

I have finished integrating the codes for call control in the opensips.cfg. At initial testings call control was working fine. However, I had a hard time accounting using radius, the call control generated BYE when account balance reaches zero. Since the BYE which was generated by internally, should be accounted using the local_route. Unfortunately, I was not aware that this was the proper way to account the BYE. After reading some articles on the mailing list I was able to realize that my accounting script for an internally generated BYE should not be located at the main route. Please note that the main route and local_route are not the same (I guess I still need to read more documentation).

Here is the code for accounting internally generated BYE:
local_route {

if (is_method(“BYE”) ) {
acc_db_request(“Internally generated BYE”, “acc”);
acc_rad_request(“Internally generated BYE”); #// This is sending an Bye to the radius server to create the stop time.
}
}


OpenSIPS Webinar Schedule

June 30, 2009

Guys the AG-Projects Team is organizing another webinar!!!

Hi,

The next free webinar is scheduled for Wednesday 8th of July 2009. The
topic is "Routing in SIP"

This webinar will help you to understand SIP routing concepts. SIP
routing is very often a misunderstood concept. It is essential for
anyone trying to script OpenSIPS to fully understand these concepts.

Registration form : https://www2.gotomeeting.com/register/429289130

Also see http://www.opensips.org/Training/Webinars for future updates.

Best regards,
Bogdan

Hope you can set a time to listen to this webinar. This would be a great opportunity to listen to the experts and ask some questions.


OpenSIPS: Case Study Overview

June 27, 2009
Started:

January 2009

Operating System:
Fedora Core 10

Billing and Accounting:

CDRTool Version 6.8

FreeRadius 1.1.7

Presence:

OpenXcap

Chat
MSRPRelay

Status:

June 2009

Everything is working using a modified version of the original opensips.cfg configuration. Accounting and billing using CDRTool and FreeRadius is functional. After the difficulties in figuring out why each call has been classified as a Free Call, which can be pointed to the dial plan configuration in the opensips.cfg file.
A very simple NAT traversal support has been created in the routing logic using the nathelper module.
The next focus of the study is the dial plan and create an advance nat traversal routing logic which will determine NAT situation on register request,

CDRTool Rating computation problem.

June 26, 2009

After installing everything (OpenSIPS, FreeRadius, Mediaproxy, and CDRTool) and it seems that all the installed applications are running properly I was wondering why all the calls where Identified as free call. Using the testing instruction posted on the ag-projects wiki I tested my rating engine and it works fine.
Using this command
ShowPrice From=sip:123@example.com To=sip:0031650222333@example.com Gateway=10.0.0.1 Duration=59

Result
0.2173
Duration: 59 s
App: audio
Destination: 31650
Customer: domain=example.com
Connect: 0.0000
StartTime: 2009-06-26 04:47:41

Span: 1
Duration: 59 s
ProfileId: grn_premium / weekday
RateId: grn_premium / 0-24h
Rate: 0.2210 / 60 s
Price: 0.2173

But when I tried to substitute values using my own users
ShowPrice From=sip:1000@mydomain.com To=sip:1001@mydomain.com Gateway=10.0.0.1 Duration=59
the result was always zero.
As advised in the mailing list to read the rating.txt documentation for information I can not still resolve the issue. The documentation fails to explain how to set the canonical uri value properly. I checked if I was able to properly placed this statement $avp(s:can_uri) = $ru;. By the way, this statement assigns the value for the canonical URI for the radius accounting. I have tested my opensips.cfg configuration, both the clients hear each other and the accounting records contains all fields except for the price field which was either empty or 0.

This was a puzzle for me for many many weeks, but I stumbled on a mailing list article that discusses the E164 class on the cdr_generic.php. Upon studying the code I realized that my opensips.cfg configuration was not handling any dial plan, infact, I realized that I did not set any dial plan. Having this idea I again tested my rating engine using the command below

ShowPrice From=sip:1000@mydomain.com To=sip:001001@mydomain.com Gateway=10.0.0.1 Duration=59

Voila!!! the rating engine price computation works!!!

If you notice on the To=sip:001001@mydomain.com I have prefix 00. If the canonical URI does not have a prefix the rating engine would not be able to compute the price of the call because it will fail to determine the destination id. As documented in rating.txt the canonical URI is used in the determination of the destination id.

I have created a custom E164 class in cdr_generic.php according to the dial plan I have right now. Currently I am still working on configuring my dial plan and integrate it in the opensips.cfg config file.

In short, the canonical URI value is affected how you set your dial plan. Lets say for example you dialled 1001@mydomain.com. If you are going to examine CDR record for this call you will notice that the canonical uri is 1001@mydomain.com. If this is the case the rating engine will not be able to compute the price for the call because it will fail to determine the destination id. As I have said that I am still working on my dial plan, I have hard coded the 00 prefix on my opensips.cfg.
if (uri=~”^sip:[1-9][0-9]*”)
{
prefix(“00”);
$avp(s:can_uri) = $ru;
strip(2);
};
After assigning it to AVP variable for the canonical uri the prefix ’00’ was remove/strip.
WARNING:
I am not 100% sure if this procedure is correct, all I can say that my CDRTool Web application is working, specially the price computation.


What is OpenSIPS?

June 8, 2009

What is OpenSIPS?

OpenSIPS is a mature implementation of a SIP server.


Intro

June 7, 2009

At last I was able to finish installing all the necessary applications for VOIP project. Althought there still some problems. I was able to install opensips 1.5, OpenXcap, CDRTool, Mediaproxy, Radius Server, MSRPRelay.

I have created this blog to document all the problems that I will encounter and if possible post the solutions to the problem.

Currenlty, our project is encountering on the billing part of the CDRTool. The price for each call is not computed.