« Previous - Version 4/19 (diff) - Next » - Current version
Adrian Georgescu, 12/17/2008 11:09 am


Installation

You need to setup the following components:

  • OpenSIPS callcontrol module, version >=1.5
  • Call Control application (this project)
  • CDRTool rating engine, version >=6.7.0

=== OpenSIPS configuration === {{{
loadmodule "mi_fifo.so"
loadmodule "mi_datagram.so"
loadmodule "sl.so"
loadmodule "tm.so"
loadmodule "dialog.so"
loadmodule "call_control.so"

modparam("call_control", "disable", 0)

route {
...
if ((method=="INVITE" && !has_totag())) { # you need to call this function at the first INVITE
call_control();
switch ($retcode) {
case 2: # Call with no limit
case 1: # Call with a limit under callcontrol management (either prepaid or postpaid)
break;
case -1: # Not enough credit (prepaid call)
xlog("L_INFO", "Call control: not enough credit for prepaid call\n");
acc_rad_request("402");
sl_send_reply("402", "Not enough credit");
exit;
break;
case -2: # Locked by call in progress (prepaid call)
xlog("L_INFO", "Call control: prepaid call locked by another call in progress\n");
acc_rad_request("403");
sl_send_reply("403", "Call locked by another call in progress");
exit;
break;
default: # Internal error (message parsing, communication, ...)
xlog("L_INFO", "Call control: internal server error\n");
acc_rad_request("500");
sl_send_reply("500", "Internal server error");
exit;
}
}
...
}
}}}

=== Call Control configuration ===

For all configuration options and their description see [source:config.ini.sample config.ini.sample]

{{{
[CallControl]
; how to detect sessions that have media timeout without BYE
timeout_detection=dialog

[CDRTool]
; connection to cdrtool rating engine for MaxSessionTime() and DebitBalance()
address = cdrtool.hostname:9024

[OpenSIPS]
; connection to OpenSIPS call_control module
; socket_path = /var/run/opensips/socket
; max_connections = 10
}}}

=== CDRTool rating engine configuration ===

{{{
$RatingEngine=array( "socketIP" => "0",
"socketPort" => "9024",
"cdr_source" => "opensips_radius",
"allow" => array('10.')
);
}}}

See the documentation of CDRTool project for how to setup the rating tables.

=== Prepaid engine API ===

http://download.ag-projects.com/CDRTool/doc/PREPAID.txt

Overview of ongoing sessions, generation of prepaid cards and prepaid
accounts can be managed from CDRTool rating tables web interface.

=== Monitoring active sessions === {{{
/etc/init.d/callcontrol sessions
}}}

=== Display details about an active sessions === {{{
/etc/init.d/callcontrol session id
}}}

=== Terminating a session === {{{
/etc/init.d/callcontrol terminate id
}}}