Hi,
How to take call counts from the kamailio?
Thanks & Kind Regards, Logeshwaran G
On Mon, Aug 21, 2017 at 11:43:31AM +0530, Logeshwaran G wrote:
How to take call counts from the kamailio?
Kamailio is not inherently aware of "calls", but the dialog module adds the necessary state:
https://kamailio.org/docs/modules/5.0.x/modules/dialog.html
If you just want call counts globally across the system, you can add dialog state by calling dlg_manage() before t_relay() / initial dialog-forming transaction creation. Then you can issue an RPC command to get the global call count.
If you want to segregate calls by inbound/outbound, or by customer account or whatever, you need to organise them into "dialog profiles" and use the identifier as a "key":
https://kamailio.org/docs/modules/5.0.x/modules/dialog.html#dialog.p.profile...
https://kamailio.org/docs/modules/5.0.x/modules/dialog.html#dialog.f.set_dlg...
There are RPC commands to get the call count within a particular profile, optionally by value.
-- Alex
Thank you
Thanks & Kind Regards, Logeshwaran G
On Mon, Aug 21, 2017 at 11:46 AM, Alex Balashov abalashov@evaristesys.com wrote:
Hi,
I have added the
modparam("dialog", "profiles_with_value", "caller ; my_profile")
and executed the below RPC command, I am getting an below output, but What I needed is exact call count (For example if there are two calls placed, then it should shows the call count as "2"), is it possible?
[root@123 kamailio]# kamcmd dlg.list { h_entry: 287 h_id: 3328 call-id: e14ee2382d6e9d19 from_uri: sip:8888@209.95.52.97 to_uri: sip:8888@209.95.52.97 state: 4 start_ts: 1503302997 init_ts: 1503302996 timeout: 1503306598 lifetime: 3600 dflags: 643 sflags: 0 iflags: 0 caller: { tag: 8e680f5d contact: sip:8888@192.168.3.5:6092;alias=45.249.123.97~6092~1 cseq: 1 route_set: socket: udp:209.95.52.97:15060 } callee: { tag: 13322723 contact: sip:8888@192.168.3.5:6092;alias=45.249.123.97~6092~1 cseq: 0 route_set: socket: udp:209.95.52.97:15060 } profiles: { } variables: { { duration: 0 } { end_time: 1503302998.020 } { start_time: 1503302998.020 } } } [root@zeodialer kamailio]#
Thanks & Kind Regards, Logeshwaran G
On Mon, Aug 21, 2017 at 11:46 AM, Alex Balashov abalashov@evaristesys.com wrote:
On Mon, Aug 21, 2017 at 01:43:05PM +0530, Logeshwaran G wrote:
What you really want is to use profiles and get profile counts:
https://kamailio.org/docs/modules/5.0.x/modules/dialog.html#dlg.r.profile_ge...
Yes Thanks, Also I have checked that command as well :
kamcmd dlg.profile_get_size outbound
I am getting the below output as 0 calls. [root@zeodialer kamailio]# kamcmd dlg.profile_get_size outbound_calls error: 404 - Profile not found: outbound_calls
[root@zeodialer kamailio]# kamcmd dlg.profile_get_size outbound 0
But There is 1 outgoing call is placed and continued.
Thanks & Kind Regards, Logeshwaran G
On Mon, Aug 21, 2017 at 1:50 PM, Alex Balashov abalashov@evaristesys.com wrote:
On Mon, Aug 21, 2017 at 01:55:26PM +0530, Logeshwaran G wrote:
That's because it doesn't know what an "outbound" call is.
You need to:
1) Define the profile:
https://kamailio.org/docs/modules/5.0.x/modules/dialog.html#dialog.p.profile...
2) Add the call to the profile:
https://kamailio.org/docs/modules/5.0.x/modules/dialog.html#dialog.f.set_dlg...
-- Alex
Thanks, I have added like this
if(is_method("INVITE")){ set_dlg_profile("outbound_call"); set_dlg_profile("caller","$fu"); }
I need to add something to this. Correct me if I am wrong Because while executing it is saying the error as: 0(10636) CRITICAL: dialog [dialog.c:365]: fixup_profile(): profile <outbound_call> not defined 0(10636) ERROR: <core> [core/route.c:1154]: fix_actions(): fixing failed (code=-6) at cfg:/usr/local/etc/kamailio/config/kamailio_final.cfg:559 0(10636) ERROR: <core> [core/route.c:1154]: fix_actions(): fixing failed (code=-6) at cfg:/usr/local/etc/kamailio/config/kamailio_final.cfg:564
Thanks & Kind Regards, Logeshwaran G
On Mon, Aug 21, 2017 at 1:57 PM, Alex Balashov abalashov@evaristesys.com wrote:
On Mon, Aug 21, 2017 at 02:09:01PM +0530, Logeshwaran G wrote:
0(10636) CRITICAL: dialog [dialog.c:365]: fixup_profile(): profile <outbound_call> not defined
I think that pretty well answers the question. Again, you need to define all profiles referenced explicitly using modparams:
https://kamailio.org/docs/modules/5.0.x/modules/dialog.html#dialog.p.profile... https://kamailio.org/docs/modules/5.0.x/modules/dialog.html#dialog.p.profile...
-- Alex
Yes Those two modparams are already there in my config.
Thanks & Kind Regards, Logeshwaran G
On Mon, Aug 21, 2017 at 2:11 PM, Alex Balashov abalashov@evaristesys.com wrote:
Do I need to add this dlg_manage(); anywhere?
Thanks & Kind Regards, Logeshwaran G
On Mon, Aug 21, 2017 at 2:14 PM, Logeshwaran G logeshwarangs@gmail.com wrote:
You do - any time before t_relay() - but that won't fix the problem of the profile not being defined.
If I remember correctly, underscores are not allowed in profile names.
-- Alex
-- Principal, Evariste Systems LLC (www.evaristesys.com)
Sent from my Google Nexus.
Yes ...It Works...
Thanks a lot Alex for your Valuable Time.
Thanks & Kind Regards, Logeshwaran G
On Mon, Aug 21, 2017 at 2:22 PM, Alex Balashov abalashov@evaristesys.com wrote: