Capture rules - reload

From VoIPmonitor.org
Jump to navigation Jump to search


adding capture rule manually to db(no need for GUI)

adding IP based rule

This will add rule with SAVE RTP=ON for net 1.2.3.4/24:

INSERT INTO `voipmonitor`.`filter_ip` (`ip`, `mask`, `direction`, `rtp`, `rtcp`, `sip`, `register`, `graph`, `wav`, `skip`, `script`, `mos_lqo`, `hide_message`,  `note`, `remove_at`, `spool_2`) VALUES (INET_ATON('1.2.3.4'),24,0,1,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL);

adding telnum based rule

This will add rule with SAVE RTP=ON for telnum prefix 12345 for both directions (direction=0):

INSERT INTO `filter_telnum` (`prefix`, `fixed_len`, `direction`, `rtp`, `sip`, `register`, `graph`, `wav`, `skip`, `script`, `mos_lqo`, `hide_message`, `note`, `remove_at`, `rtcp`, `spool_2`) VALUES ('12345',0,0,1,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL);

This will add rule with SAVE RTP=ON for telnum prefix 98765 for direction destination(direction=2), for source use direction=1 instead:

INSERT INTO `filter_telnum` (`prefix`, `fixed_len`, `direction`, `rtp`, `sip`, `register`, `graph`, `wav`, `skip`, `script`, `mos_lqo`, `hide_message`, `note`, `remove_at`, `rtcp`, `spool_2`) VALUES ('98765',0,2,1,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL);


reload rules using manager api

For sniffer instances where is manager api accessible from your location, you can use manager api command for reloading rules:

echo 'reload' | nc 192.168.88.234:5029

reload rules with server api

For sniffers which are running in client/server mode (with packet_buffer_sender=no) and its manager api is not accessible, you can use server API on master voipmonitor instance for reloading remotes First you need to get sensors IDs using manager api of master (or you need to know the ids - its under GUI->settings->sensors):

echo "list_active_clients"|nc 127.0.0.1 5029
{"count":1,"services":[{"ip":"127.0.0.1","port":54137,"sensor_id":114}]}

Then you can reload each sniffer using server API example is for id=114

echo '{"type_connection":"gui_command","sensor_id":114,"command":"reload"}' | nc 127.0.0.1 60024