Skip to content

eliasbaixas/openser-xmlrpc

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

This is the XML-RPC User Location module for OpenSER 1.3.

All files are exactly the same as openser version 1.3, *BUT* the directory
modules/xmlrpc_usrloc where the new module resides.

This module in an XML-RPC interface to a Bamboo-based P2P overlay network.

To make the module and openser, try:
make
make modules="modules/mysql modules/xmlrpc_usrloc modules/tm modules/rr modules/sl modules/maxfwd modules/registrar modules/uri modules/presence modules/presence_xml modules/textops" modules

then you can use as OpenSER configuration file something like this: <<END_OF_CONFIG
debug=6
children=4
fork=yes
log_stderror=yes
port=5060
listen=udp:127.0.0.1:5060
listen=tcp:127.0.0.1:5060
loadmodule "modules/xmlrpc_usrloc/xmlrpc_usrloc.so"
loadmodule "modules/tm/tm.so"
loadmodule "modules/sl/sl.so"
loadmodule "modules/mysql/mysql.so"
loadmodule "modules/rr/rr.so"
loadmodule "modules/textops/textops.so"
loadmodule "modules/maxfwd/maxfwd.so"
loadmodule "modules/registrar/registrar.so"
loadmodule "modules/uri/uri.so"
loadmodule "modules/presence/presence.so"
loadmodule "modules/presence_xml/presence_xml.so"
modparam("xmlrpc_usrloc", "gateway_url", "http://127.0.0.1:5851/RPC2")
modparam("xmlrpc_usrloc", "secret", "hola")
modparam("xmlrpc_usrloc", "matching_mode", 0)
modparam("rr", "enable_full_lr", 1)
modparam("rr", "append_fromtag", 0)
modparam("presence|presence_xml", "db_url", "mysql://openser:openserrw@localhost/openser")
modparam("presence_xml", "force_active", 1)
modparam("presence", "server_address", "sip:127.0.0.1:5060")

route{
        if (!mf_process_maxfwd_header("10")) {
                sl_send_reply("483","Too Many Hops");
                exit;
        }
	if(has_totag())
	{
		if(!loose_route())
		{
			if (is_method("SUBSCRIBE")) {
				route(2);
				exit;
			}
		}
	}
        t_check_trans();
	if( is_method("PUBLISH|SUBSCRIBE"))
		route(2);
	if (is_method("REGISTER"))
        {
		if (!save("location"))
			sl_reply_error();
		exit;
	}
	if (!lookup("location")) {
		switch ($retcode) {
			case -1:
			case -3:
				t_newtran();
				t_reply("404", "Not Found");
				exit;
			case -2:
				sl_send_reply("405", "Method Not Allowed");
				exit;
		}
	}
	route(1);
}
/*INVITE's and MESSAGE's*/
route[1] {
	if (!t_relay()) {
		sl_reply_error();
	};
	exit;
}
/* Presence route*/
route[2]
{
        if (!t_newtran())
        {
                sl_reply_error();
                exit;
        };
        if(is_method("PUBLISH"))
        {
                handle_publish();
                t_release();
        }
        else
		if( is_method("SUBSCRIBE"))
                {
                        handle_subscribe();
                        t_release();
                }
        exit;
}

END_OF_CONFIG

for the Bamboo project, you will need berkeley Database 4.2.52 compiled for your system
that is you need libdb-4.2.dylib and libdb_java-4.2.jnilib

Then continue to checkout the project from github

git clone git@github.com:eliasbaixas/bamboo.git
cd bamboo
#import project bamboo to your Eclipse Workspace to get it compiled
conf/run-it

run ps -A|grep java to see if the instances are running

to stop the instances, you could do

for i in conf/tmp/pid-*; do kill $(cat $i); done

then go get a UserAgent and register your username to OpenSER (username@host).

This will insert username@host into the DHT, you can now connect to Bamboo's GUI (web page)
in http://127.0.0.1:5869/ (or some other odd port, try doing 'netstat -naptu' or 'lsof -i -P' if you're a freeBSD'er)
and you should see how the DHT gets populated with records.

From python/opendht you could also do a ./get.py -g http://localhost:5851/RPC2 username@host
and you will see all the records registered for the given user. 

we're also trying to get nist's SIP InstantMessenger to work with openser, without success at the moment, but we're getting there.
to start it, go to your chat-p2p-sip directory (where the code resides) and launch:

java -Dlog4j.configuration=file://${project_loc:chat-p2p-sip}/conf/log4j.properties gov.nist.sip.instantmessaging.InstantMessagingGUI -cf conf/elias.properties

with conf/elias.properties being:
examples.im.outboundProxyAddress=127.0.0.1
examples.im.outboundProxyPort=5060
examples.im.registrarAddress=127.0.0.1
examples.im.registrarPort=5060
examples.im.imAddress=127.0.0.1
examples.im.imPort=5070
examples.im.imProtocol=udp
examples.im.outputFile=./debug/output.txt
examples.im.buddiesFile=./conf/buddies_elias.xml
examples.im.authenticationFile=./conf/auth_elias.xml
examples.im.defaultRouter=gov.nist.sip.instantmessaging.presence.IMRouter
examples.im.localSipURL=sip:elias@localhost

conf/buddies_elias.xml:
<?xml version='1.0' encoding='us-ascii'?> 
<BUDDIES> 
<buddy uri="sip:kripton@localhost" />
</BUDDIES> 

and conf/auth_elias.xml:
<?xml version='1.0' encoding='us-ascii'?> 
<AUTHENTICATION>
<User name="elias" realm="localhost" password="hola" />
</AUTHENTICATION> 


About

XmlRpc UsrLoc module for openser 1.3

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages