[Spce-user] Can't count active calls for a given peer using kamctl

Joel S. | VOZELIA joel at vozelia.com
Fri Mar 13 15:56:08 EDT 2015


Ok found the problem!

I was looking in the wrong table for the peer ID.

Searching through the list I found a post with a different but related problem.

The solution here is to get the peer ID from the provisioning.voip_peer_hosts table.


mysql> select * from voip_peer_hosts where ip ='212.31.198.23';
+----+----------+------------+---------------+------+------+-----------+--------+-----------+--------+
| id | group_id | name       | ip            | host | port | transport | weight | via_route | via_lb |
+----+----------+------------+---------------+------+------+-----------+--------+-----------+--------+
| 91 |        5 | Inbound    | 212.31.198.23 | NULL | 5060 |         1 |      1 | NULL      |      0 |
+----+----------+------------+---------------+------+------+-----------+--------+-----------+--------+
1 row in set (0.00 sec)

mysql> quit
Bye
root at xion:~# /usr/sbin/ngcp-kamctl proxy fifo profile_get_size peer 91
profile::  name=peer value=91 count=14
root at xion:~#



Cheers, 
Joel.

----- Original Message -----
> From: "Joel S. | VOZELIA" <joel at vozelia.com>
> To: "spce-user" <spce-user at lists.sipwise.com>
> Sent: Friday, March 13, 2015 5:53:39 PM
> Subject: Can't count active calls for a given peer using kamctl

> Hi,
> 
> We are using fifo "profile_get_size" command to graph simultaneous calls in
> mr3.4.2.
> 
> For some reason it is not working for some peers, and I don't know where to
> start looking...
> 
> I need to graph calls that come from a peer with IP 212.31.198.23.
> 
> Current total:
> 
> root at xion:~# /usr/sbin/ngcp-kamctl proxy fifo profile_get_size total
> profile::  name=total value= count=53
> root at xion:~#
> 
> Current from that peer:
> 
> root at xion:~# /usr/sbin/ngcp-kamctl proxy fifo profile_list_dlgs total | grep
> to_uri | grep 212.31.198.23 | wc -l
> 48
> root at xion:~#
> 
> Current from the rest:
> 
> root at xion:~# /usr/sbin/ngcp-kamctl proxy fifo profile_list_dlgs total | grep
> to_uri | grep -v 212.31.198.23 | wc -l
> 5
> root at xion:~#
> 
> 
> So 48 + 5 = 53 ---> All OK so far.
> 
> 
> The above commands are not what we usually use, what we do is:
> 
> 
> root at xion:~# mysql kamailio -e'SELECT * FROM lcr_gw where ip_addr =
> "212.31.198.23";'
> +----+--------+------------+---------------+----------+------+--------+------------+-----------+-------+------+-------+---------+----------+--------+
>| id | lcr_id | gw_name    | ip_addr       | hostname | port | params | uri_scheme
>| | transport | strip | tag  | flags | defunct | group_id | prefix |
> +----+--------+------------+---------------+----------+------+--------+------------+-----------+-------+------+-------+---------+----------+--------+
>| 90 |      1 | Inbound1   | 212.31.198.23 | NULL     | 5060 | NULL   |          1
>| |         1 |     0 | NULL |    91 |    NULL |        5 | NULL   |
> +----+--------+------------+---------------+----------+------+--------+------------+-----------+-------+------+-------+---------+----------+--------+
> root at xion:~#
> 
> So, the peer ID for 212.31.198.23 would be "90":
> 
> root at xion:~# /usr/sbin/ngcp-kamctl proxy fifo profile_get_size peer 90
> profile::  name=peer value=90 count=0
> root at xion:~#
> 
> The strange this is, the count=0 is not correct, there are in fact 48 as you can
> see earlier.
> 
> Where can I start to look into this problem?
> 
> If I try with a different peer:
> 
> root at xion:~# /usr/sbin/ngcp-kamctl proxy fifo profile_list_dlgs total | grep
> to_uri | grep 217.15.95.45 | wc -l
> 1
> root at xion:~#
> 
> root at xion:~# mysql kamailio -e'SELECT * FROM lcr_gw where ip_addr =
> "217.15.95.45";'
> +----+--------+-----------+--------------+----------+------+--------+------------+-----------+-------+------+-------+---------+----------+--------+
>| id | lcr_id | gw_name   | ip_addr      | hostname | port | params | uri_scheme |
>| transport | strip | tag  | flags | defunct | group_id | prefix |
> +----+--------+-----------+--------------+----------+------+--------+------------+-----------+-------+------+-------+---------+----------+--------+
>| 36 |      1 | Inbound2  | 217.15.95.45 | NULL     | 5060 | NULL   |          1 |
>|         1 |     0 | NULL |    36 |    NULL |       17 | NULL   |
> +----+--------+-----------+--------------+----------+------+--------+------------+-----------+-------+------+-------+---------+----------+--------+
> root at xion:~#
> 
> root at xion:~# /usr/sbin/ngcp-kamctl proxy fifo profile_get_size peer 36
> profile::  name=peer value=36 count=1
> root at xion:~#
> 
> 
> Maybe a kamailio restart is necessary? The peers that don't work have been added
> recently.
> 
> 
> Any ideas?
> 
> 
> Thank you in advanced.
> 
> Best regards,
> Joel.



More information about the Spce-user mailing list