[Users] WeSIP setup problem

ventilo35 at free.fr ventilo35 at free.fr
Thu Apr 26 12:55:41 CEST 2007


Hi Gines, thanks for your support


> Your servlet named "neo" is being executed and looks like it is
> proxying but what from what I see in the packet it is proxying to
> itself. Could you try to proxy to another address and see if this
> still happens ? Aside, could you send me your configuration files and
> your servlet code ?

The serlvet code is the following

protected void doInvite(SipServletRequest callerInvite) throws ServletException,
IOException {


      //Get a proxy for this request
      Proxy callerProxy = callerInvite.getProxy();

	System.out.println("doInvite within neos servlet: requestURI is " +
callerInvite.getRequestURI() );


	callerProxy.proxyTo(callerInvite.getRequestURI());


    }


This code causes the "no route" exception. The println above gives :

doInvite within neos servlet: requestURI is sip:5002 at 192.168.1.11

where 5002 is the called SIP phone and 192.168.1.11 is the address of my OpenSER
+ WeSIP box (i.e. the managed SIP domain)


Following your advice I have tried to change the proxyTo to a different address:


	SipURI dest = sipFactory.createSipURI("5002","192.168.1.16");
      callerProxy.proxyTo(dest);

It that case, the called phone (5002, IP address 192.168.1.16) gets the INVITE
correctly. However, something puzzles me here: the serlvet is not supposed to
know the IP address of the called phone. In my understanding, the AS processes
the INVITE, then it must send it back to the proxy server which is supposed to
forward it to the next hop, is that right ?

Could you please give me an example of a doInvite which basically does nothing
and which lets the INVITE be forwarded to the called party ?


Finally here are my config files:

<<<<<<<<< Server.xml >>>>>>>>>

<Server port="5005" shutdown="SHUTDOWN" debug="1">
	<Service name="NEOS-Standalone">
     		<Connector className="org.apache.catalina.connector.http.HttpConnector"
	 		port="7080" minProcessors="5" maxProcessors="5"
	 		enableLookups="true" acceptCount="10" debug="0" />

		<Connector className="com.voztele.sipservlet.connector.SipConnector"
	 		minProcessors="5" maxProcessors="5"
	 		enableLookups="true" acceptCount="10" debug="1"
	 		addresses="192.168.1.11:5060" pathName="com.voztele" protocol="udp" >
		 		<ExtraProperties>
			 		<Property key="com.voztele.javax.sip.SER_ADDRESS" value="127.0.0.1" />
			 		<Property key="com.voztele.javax.sip.SER_PORT" value="5080" />
			 		<Property key="com.voztele.STATISTICS" value="false" />
					<Property key="javax.sip.STACK_NAME" value="neos_as" />
					<Property key="javax.sip.THREAD_POOL_SIZE" value="10" />
					<Property key="com.voztele.javax.sip.THREAD_POOL_SIZE" value="10" />
					<Property key="com.voztele.javax.sip.SPIRAL_HDR" value="true" />
					<Property key="com.voztele.javax.sip.REENTRANT_LISTENER" value="true" />
					<Property key="javax.sip.AUTOMATIC_DIALOG_SUPPORT" value="false" />
					<Property key="com.voztele.javax.sip.TRACE_LEVEL" value="3" />
		 		</ExtraProperties>
	 	</Connector>

     	<Engine name="Standalone" defaultHost="localhost" debug="1"
className="com.voztele.sipservlet.core.ConvergedEngine">

			<Mapper className="org.apache.catalina.core.StandardEngineMapper"
protocol="HTTP/1.1"/>
			<Mapper className="org.apache.catalina.core.StandardEngineMapper"
protocol="HTTP/1.0"/>
	 		<Mapper className="com.voztele.sipservlet.core.EngineSipMapper"
protocol="SIP/2.0"/>
			<Logger className="org.apache.catalina.logger.FileLogger" timestamp="true"/>
			<Realm className="org.apache.catalina.realm.MemoryRealm" />

			<Host name="localhost" nameSip="192.168.1.11_5060" debug="1" 
appBase="wesipapps" className="com.voztele.sipservlet.core.ConvergedHost">

				<Logger className="org.apache.catalina.logger.FileLogger" timestamp="true"/>
				<Mapper className="com.voztele.sipservlet.core.SipHostMapper"
protocol="SIP/2.0"/>
				<Mapper className="org.apache.catalina.core.HttpHostMapper"
protocol="HTTP/1.1"/>
				<Mapper className="org.apache.catalina.core.HttpHostMapper"
protocol="HTTP/1.0"/>
		    	</Host>
   		</Engine>
	</Service>
</Server>


<<<<<<<<<<openser.cfg>>>>>>>>>>>>>>
#
# $Id: openser.cfg 1827 2007-03-12 15:22:53Z bogdan_iancu $
#
# simple quick-start config script
# Please refer to the Core CookBook at http://www.openser.org/dokuwiki/doku.php
# for a explanation of possible statements, functions and parameters.
#

# ----------- global configuration parameters ------------------------

debug=3            # debug level (cmd line: -dddddddddd)
fork=yes
#log_stderror=no    # (cmd line: -E)
children=4

# Uncomment these lines to enter debugging mode
#fork=no
log_stderror=yes
#


listen = tcp:192.168.1.11:5060
listen = udp:192.168.1.11:5060


# ------------------ module loading ----------------------------------

#set module path
mpath="/usr/local/lib/openser/modules/"

# Uncomment this if you want to use SQL database
#loadmodule "mysql.so"

loadmodule "sl.so"
loadmodule "tm.so"
loadmodule "rr.so"
loadmodule "maxfwd.so"
loadmodule "usrloc.so"
loadmodule "registrar.so"
loadmodule "textops.so"
loadmodule "mi_fifo.so"

# added for WeSIP
loadmodule "seas.so"
modparam("seas","listen_sockets","127.0.0.1:5080")
# end added for WeSIP

# Uncomment this if you want digest authentication
# mysql.so must be loaded !
#loadmodule "auth.so"
#loadmodule "auth_db.so"

# ----------------- setting module-specific parameters ---------------

# -- mi_fifo params --

modparam("mi_fifo", "fifo_name", "/tmp/openser_fifo")

# -- usrloc params --

modparam("usrloc", "db_mode",   0)

# Uncomment this if you want to use SQL database
# for persistent storage and comment the previous line
#modparam("usrloc", "db_mode", 2)

# -- auth params --
# Uncomment if you are using auth module
#
#modparam("auth_db", "calculate_ha1", yes)
#
# If you set "calculate_ha1" parameter to yes (which true in this config),
# uncomment also the following parameter)
#
#modparam("auth_db", "password_column", "password")

# -- rr params --
# add value to ;lr param to make some broken UAs happy
modparam("rr", "enable_full_lr", 1)

# -------------------------  request routing logic -------------------

# main routing logic

route{

	# initial sanity checks -- messages with
	# max_forwards==0, or excessively long requests
	if (!mf_process_maxfwd_header("10")) {
		sl_send_reply("483","Too Many Hops");
		exit;
	};

	if (msg:len >=  2048 ) {
		sl_send_reply("513", "Message too big");
		exit;
	};

	# we record-route all messages -- to make sure that
	# subsequent messages will go through our proxy; that's
	# particularly good if upstream and downstream entities
	# use different transport protocol
	if (!method=="REGISTER")
		record_route();	# ftoutain essai de supprimer ça ? ne change rien

	# subsequent messages withing a dialog should take the
	# path determined by record-routing
	if (loose_route()) {
		# mark routing logic in request
		append_hf("P-hint: rr-enforced\r\n");
		route(1);
	};

	if (!uri==myself) {
		# mark routing logic in request
		append_hf("P-hint: outbound\r\n");

		route(1);
	};

	# if the request is for other domain use UsrLoc
	# (in case, it does not work, use the following command
	# with proper names and addresses in it)
	if (uri==myself) {

		if (method=="REGISTER") {

			# Uncomment this if you want to use digest authentication
			#if (!www_authorize("openser.org", "subscriber")) {
			#	www_challenge("openser.org", "0");
			#	exit;
			#};

			save("location");
			exit;
		};

		lookup("aliases");
		if (!uri==myself) {
			append_hf("P-hint: outbound alias\r\n");
			route(1);
		};

		# native SIP destinations are handled using our USRLOC DB
		if (!lookup("location")) {
			sl_send_reply("404", "Not Found");
			exit;
		};
		append_hf("P-hint: usrloc applied\r\n");
	};

	route(1);
}


route[1] {

	if (is_present_hf("X-WeSIP-SPIRAL")) {
		if (!t_relay()) {
			sl_reply_error();
		};
		exit;
	};

	if (! as_relay_t("neos_as") ){
		t_reply("500", "NEOS service not found");
	};

	exit;
}





More information about the Users mailing list