[OpenSIPS-Users] calling opensipsctl fifo lb_status 2 1 by xmlrpc

bluerain frank21118 at yahoo.com
Mon Mar 9 23:28:53 CET 2015


Nevermind, I finally get it.  So is NOT PHP, I know I may sound stupid, but
to linux rookie, is very hard.

So just for future reference, or anybody would like to know:

1. Install make sure you have python install in your OS
2. Make a file with extension of .py (e.g. the following):

#!/usr/bin/python
import xmlrpclib
opensips = xmlrpclib.ServerProxy('http://192.168.1.1:8000/RPC2')
print opensips.lb_status(1,0);

and then on the CLI of the OS which the compute you would like to send the
command to opensips, just type "python test.py"

lb_status(1,0) will turn off node #1 where
lb_status(1,1) will turn on node #1

This maybe simple for linux guru, but is hard to figure out for rookie...
hope this is of use to someone!





--
View this message in context: http://opensips-open-sip-server.1449251.n2.nabble.com/calling-opensipsctl-fifo-lb-status-2-1-by-xmlrpc-tp7595718p7595722.html
Sent from the OpenSIPS - Users mailing list archive at Nabble.com.



More information about the Users mailing list