Monitoring active sessions on a gateway

Status
Not open for further replies.

tfernandez

Member
Oct 31, 2019
35
10
8
31
Hi All,

I am wondering if anyone has found a way to monitor active calls on a gateway. I have multiple SIP trunks to my upstream carriers and want to know what my usage is like so that I can know when to increase my channels.

Up until now, I have gotten the total channels via fs_cli and divided it by 2 which isn't ideal, obviously. It gave me a rough amount.

Ever since adding more carriers, my numbers are less accurate.

I did read on some Freeswitch mailing lists that I can add limits and then monitor that. It seems a bit hacky.




Code:
sofia status gateways
command gets me sort of what I need, except that InBound calls do not move.

1704213823367.png



Anyone have any suggestions?
 

whut

Member
Dec 23, 2022
170
15
18
I am not certain if this is going in the direction you are wanting, but try this

Code:
fs_cli -x "show calls as xml" | grep "<direction>" | awk -F'[<>]' '{print $3}' | sort | uniq -c
 
  • Like
Reactions: tfernandez

tfernandez

Member
Oct 31, 2019
35
10
8
31
thank you @whut .

I ended up giving up on their being a built-in way to do this.

I think I was able to extract the per gateway active sessions by parsing the following:

Bash:
fs_cli -x "show detailed_calls"

I have stats that seems to be accurate populating in my zabbix server.

For anyone reading this in the future, here my repo
 
Status
Not open for further replies.