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.
}
}