Module: sems
Branch: sayer/1.4-spce2.4
Commit: 87569ffae36bbfc884e5367f85288021ad8931bf
URL:    
http://git.sip-router.org/cgi-bin/gitweb.cgi/sems/?a=commit;h=87569ffae36bbfc884e5367f85288021ad8931bf

Author: Stefan Sayer <[email protected]>
Committer: Stefan Sayer <[email protected]>
Date:   Thu Mar  8 15:22:25 2012 +0100

monitoring: simple tools for listing calls

---

 apps/monitoring/CMakeLists.txt                 |    8 ++++++++
 apps/monitoring/Makefile                       |    5 +++++
 apps/monitoring/tools/Makefile                 |   15 +++++++++++++++
 apps/monitoring/tools/sems-get-callproperties  |   12 ++++++++++++
 apps/monitoring/tools/sems-list-active-calls   |    7 +++++++
 apps/monitoring/tools/sems-list-calls          |    7 +++++++
 apps/monitoring/tools/sems-list-finished-calls |    7 +++++++
 7 files changed, 61 insertions(+), 0 deletions(-)

diff --git a/apps/monitoring/CMakeLists.txt b/apps/monitoring/CMakeLists.txt
index 50438b2..c60c3f4 100644
--- a/apps/monitoring/CMakeLists.txt
+++ b/apps/monitoring/CMakeLists.txt
@@ -2,5 +2,13 @@ set (monitoring_SRCS
 Monitoring.cpp
 )
 
+INSTALL(PROGRAMS
+tools/sems-list-calls
+tools/sems-list-active-calls
+tools/sems-list-finished-calls
+tools/sems-get-callproperties
+       DESTINATION ${SEMS_EXEC_PREFIX}/sbin
+       )
+
 SET(sems_module_name monitoring)
 INCLUDE(${CMAKE_SOURCE_DIR}/cmake/module.rules.txt)
diff --git a/apps/monitoring/Makefile b/apps/monitoring/Makefile
index 6045c00..161ae41 100644
--- a/apps/monitoring/Makefile
+++ b/apps/monitoring/Makefile
@@ -3,5 +3,10 @@ plug_in_name = monitoring
 module_ldflags =
 module_cflags  = -DMOD_NAME=\"$(plug_in_name)\"
 
+extra_install = install_tools
+
 COREPATH ?=../../core
 include $(COREPATH)/plug-in/Makefile.app_module
+
+install_tools:
+       -@$(MAKE) -C tools/ install
diff --git a/apps/monitoring/tools/Makefile b/apps/monitoring/tools/Makefile
new file mode 100644
index 0000000..a22b624
--- /dev/null
+++ b/apps/monitoring/tools/Makefile
@@ -0,0 +1,15 @@
+COREPATH_TOOLS ?= ../../../core
+include $(COREPATH_TOOLS)/../Makefile.defs
+
+monitoring_scripts = $(wildcard sems-*)
+
+all: install_tools
+install: install_tools
+
+install_tools: $(DESTDIR)$(bin-prefix)/$(bin-dir)
+       -@for r in $(monitoring_scripts)  ; do \
+               $(INSTALL-TOUCH) $(DESTDIR)$(bin-prefix)/$(bin-dir)/$$r ; \
+               $(INSTALL-BIN) $$r $(DESTDIR)$(bin-prefix)/$(bin-dir) ; \
+       done
+
+
diff --git a/apps/monitoring/tools/sems-get-callproperties 
b/apps/monitoring/tools/sems-get-callproperties
new file mode 100755
index 0000000..4daa629
--- /dev/null
+++ b/apps/monitoring/tools/sems-get-callproperties
@@ -0,0 +1,12 @@
+#!/usr/bin/python
+# -*- coding: utf-8 -*-
+from xmlrpclib import *
+import sys
+
+if len(sys.argv) != 2:
+        print "usage: %s <ltag/ID of call to list>" % sys.argv[0]
+        sys.exit(1)
+
+s = ServerProxy('http://localhost:8090')
+print "Active calls: %d" % s.calls()
+print s.di('monitoring','get', sys.argv[1])
diff --git a/apps/monitoring/tools/sems-list-active-calls 
b/apps/monitoring/tools/sems-list-active-calls
new file mode 100755
index 0000000..b144745
--- /dev/null
+++ b/apps/monitoring/tools/sems-list-active-calls
@@ -0,0 +1,7 @@
+#!/usr/bin/python
+# -*- coding: utf-8 -*-
+
+from xmlrpclib import *
+s = ServerProxy('http://localhost:8090')
+print "Active calls: %d" % s.calls()
+print s.di('monitoring','listActive')
diff --git a/apps/monitoring/tools/sems-list-calls 
b/apps/monitoring/tools/sems-list-calls
new file mode 100755
index 0000000..ce752da
--- /dev/null
+++ b/apps/monitoring/tools/sems-list-calls
@@ -0,0 +1,7 @@
+#!/usr/bin/python
+# -*- coding: utf-8 -*-
+
+from xmlrpclib import *
+s = ServerProxy('http://localhost:8090')
+print "Active calls: %d" % s.calls()
+print s.di('monitoring','list')
diff --git a/apps/monitoring/tools/sems-list-finished-calls 
b/apps/monitoring/tools/sems-list-finished-calls
new file mode 100755
index 0000000..2a254eb
--- /dev/null
+++ b/apps/monitoring/tools/sems-list-finished-calls
@@ -0,0 +1,7 @@
+#!/usr/bin/python
+# -*- coding: utf-8 -*-
+
+from xmlrpclib import *
+s = ServerProxy('http://localhost:8090')
+print "Active calls: %d" % s.calls()
+print s.di('monitoring','listFinished')

_______________________________________________
Semsdev mailing list
[email protected]
http://lists.iptel.org/mailman/listinfo/semsdev

Reply via email to