[Serusers] Fw: problem with sip-jabber gateway

张色珍 zhangsezhen at sict.ac.cn
Fri Sep 24 04:23:44 CEST 2004


serusers, hello!

>     I installed sip-jabber gateway,IP of sip server is 192.168.0.227,sip client is message 4.6.And IP of jabber server is 192.168.0.210,sip client is psi.Both of servers have no DNS . I have some question:
>	I have been able to chat with presence between jabberd and MSN, and
>also I could chat between SER and jabberd with presence.
>
>   psi <-> jabberd (msn-transport) <-> MSN <-> MSN Messenger
>    Windows Messenger <-> SER (jabber.so) <-> jabberd <->psi
>
>When I try to connect other MSN user, I can login to MSN for my account,
>
>    Windows Messenger -> SER (jabber.so) -> jabberd (msn-transport)
>        -> MSN (my account)
>
>But I can't connect to other MSN user.
>
>    Windows Messenger -> SER (jabber.so) -> jabberd (msn-transport)
>        -> MSN (my account) - X -> other MSN user
>
>At the same time I can connect to other ICQ,AIM users. But the other  ICQ,AIM user cann't connect to me.
>
>my ser.cfg is:
>/* Uncomment these lines to enter debugging mode */
>debug=9
>fork=no
>log_stderror=yes
>
>
>check_via=no	# (cmd. line: -v)
>dns=no           # (cmd. line: -r)
>rev_dns=no      # (cmd. line: -R)
>port=5060
>children=4
>listen=192.168.0.227
>fifo="/tmp/ser_fifo"
>
># ------------------ module loading ----------------------------------
>
># Uncomment this if you want to use SQL database
>loadmodule "/usr/lib/ser/modules/mysql.so"
>
>loadmodule "/usr/lib/ser/modules/print.so"
>loadmodule "/usr/lib/ser/modules/textops.so"
>loadmodule "/usr/lib/ser/modules/sl.so"
>#loadmodule "/usr/lib/ser/modules/im.so"
>loadmodule "/usr/lib/ser/modules/tm.so"
>loadmodule "/usr/lib/ser/modules/rr.so"
>loadmodule "/usr/lib/ser/modules/maxfwd.so"
>loadmodule "/usr/lib/ser/modules/usrloc.so"
>loadmodule "/usr/lib/ser/modules/registrar.so"
>loadmodule "/usr/lib/ser/modules/pa.so"
>loadmodule "/usr/lib/ser/modules/jabber.so"
>
># Uncomment this if you want digest authentication
># mysql.so must be loaded !
>#loadmodule "/usr/lib/ser/modules/auth.so"
>#loadmodule "/usr/lib/ser/modules/auth_db.so"
>
># ----------------- setting module-specific parameters ---------------
>
># -- usrloc params --
>
>modparam("usrloc", "db_mode",   0)
>modparam("usrloc", "use_domain", 1)
>
># 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)
>
>
># -- registrar params --
>
>modparam("registrar", "default_expires", 120)
>modparam("registrar", "use_domain", 1)
>
>#  --pa params--
>modparam("pa","default_expires",3600) 
>
>
># -- jabber params --
>
>modparam("jabber","db_url","mysql://sipjab:secret@localhost/sip_jab")
>modparam("jabber","jaddress","192.168.0.210")
>modparam("jabber","jport",5222)
>modparam("jabber","workers",2)
>modparam("jabber","max_jobs",10)
>modparam("jabber","cache_time",200)
>modparam("jabber","delay_time",60)
>modparam("jabber","sleep_time",60)
>#modparam("jabber","registrar","jabber_gateway at 127.0.0.1")
>modparam("jabber","jdomain","192.168.0.210=*")
>modparam("jabber","aliases","3;aim.192.168.0.210;icq.192.168.0.210;msn.192.168.0.210=%;")
>
>
># -------------------------  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");
>		break;
>	};
>	if ( msg:len > max_len ) {
>		sl_send_reply("513", "Message too big");
>		break;
>	};
>
>	# 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
>	record_route();	
>	# loose-route processing
>	#if (loose_route()) {
>	#	t_relay();
>	#	break;
>	#};
>
>	# 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("192.168.0.227", "subscriber")) {
>#				www_challenge("192.168.0.227", "0");
>#				break;
>#			};
>
>			save("location");
>			break;
>		};
>
>		# native SIP destinations are handled using our USRLOC DB
>		if (!lookup("location")) {
>			sl_send_reply("404", "Not Found");
>			break;
>		};
>	};
>	# forward to current uri now; use stateful forwarding; that
>	# works reliably even if we forward from TCP to UDP
>	if (!t_relay()) {
>		sl_reply_error();
>	};
>*/
>if (uri=~"[@:]192\.168\.0\.227([;:].*)*")
>	{
>		# for testing purposes, simply okay all REGISTERs
>		if (method=="REGISTER")
>		{
>			if (t_newtran()) 
>			{
>				save("location");
>				log("REGISTER received -> reply okay\n");
>			};
>			if(search("egistration"))
>			{
>				log("XJAB: Going Online in Jabber network!!!\n");
>				if(jab_go_online())
>				{
>					sl_send_reply("200", "Accepted");
>				}
>				else
>				{
>					sl_send_reply("404","Not found");
>				};
>			}
>			else
>			{
>				log("XJAB: Going Offline in Jabber network!!!\n");
>				if(jab_go_offline())
>				{
>					sl_send_reply("200", "Accepted");
>				}
>				else
>				{
>					sl_send_reply("404","Not found");
>				};
>			};
>			break;
>		};
>		if (method=="SUBSCRIBE") 
>		{
>			if (t_newtran()) 
>			{
>				handle_subscription("registrar");
>			};
>			break;
>		};
>		if(!lookup("location"))
>		{
>			sl_send_reply("404","Not found");
>			break;
>		};
>	};							
>    
>	if ((search("To:.*@192\.168\.0\.210"))
>        || (search("To:.*@icq\.192\.168\.0\.210"))
>         || (search("To:.*@aim\.192\.168\.0\.210"))
>        || (search("To:.*@msn\.192\.168\.0\.210")))
>    {
>	    if (! t_newtran())
>    	{
>			sl_reply_error();
>			break;
>	    };
>		if (method=="MESSAGE")
>		{
>	    	log("MESSAGE received -> manage it with XJAB\n");
>		    if(search("\n:on"))
>			{
>				if (jab_go_online())
>			    {
>					sl_send_reply("200","Accepted");
>			    }else{
>					sl_send_reply("404","Not found");
>		    	};
>				break;
>			};
>		    if(search("\n:off"))
>			{
>				if (jab_go_offline())
>			    {
>					sl_send_reply("200","Accepted");
>			    }else{
>					sl_send_reply("404","Not found");
>		    	};
>				break;
>			};
>			
>		    if(search("\n:join"))
>			{
>				if (jab_join_jconf())
>			    {
>					sl_send_reply("200","Accepted");
>			    }else{
>					sl_send_reply("404","Not Found");
>		    	};
>				break;
>			};
>		    
>			if(search("\n:exit"))
>			{
>				if (jab_exit_jconf())
>			    {
>					sl_send_reply("200","Accepted");
>			    }else{
>					sl_send_reply("404","Not Found");
>		    	};
>				break;
>			};
>			
>			if (jab_send_message())
>		    {
>				sl_send_reply("200","Accepted");
>		    }else{
>				sl_send_reply("503","Service Unavailable");
>	    	};
>			break;
>		};
>		if (method=="SUBSCRIBE") {
>			handle_subscription("jabber");
>			break;
>		};
>	    log("NON_Message request received for JABBER gateway->dropt!\n");
>    	sl_send_reply("202","Accepted");
>		break;
>    };
>	if (!t_relay()) 
>	{
>		sl_reply_error();
>	};
>
>   # forward(uri:host,uri:port);
> 
>
>
>}
>
>The error is:
>XJAB: xj_jcon_update [sip:test at 192.168.0.227] 200
> 0(4434) XJAB:xj_worker:4442: SENDING the message to Jabber network ...
> 0(4434) XJAB:xj_address_translation:4442: - checking aliases
> 0(4434) XJAB:xj_address_translation:4442: - domain is [msn.192.168.0.210]
> 0(4434) XJAB:xj_jcon_send_msg: jabber msg:
><message to='' type='chat'><body>xsd</body></message>
> 0(4434) XJAB:xj_worker:4442: checking socket <7> ...
> 0(4434) XJAB:xj_worker:4442: something is coming
> 0(4434) XJAB:xj_worker:4442: checking socket <7> ...
> 0(4434) XJAB:xj_worker:4442: received: 99bytes Err:0/EA:11
> 0(4434) XJAB: xj_jcon_update [sip:test at 192.168.0.227] 200
> 0(4434) XJAB:xj_worker: JMSG START ----------
><message to='' type='error' from=''><body>xsd</body><error code='400'>Bad Request</error></message>
> JABBER: JMSGL:99 END ----------
> 0(4434) XJAB:xj_parse_jab: XODE ret:0 pos:99
> 0(4434) XJAB:xj_manage_jab: jabber [message] received
> 0(4434) XJAB:xj_address_translation:4442: - checking aliases
> 0(4434) XJAB:xj_manage_jab: ERROR SIP MESSAGE was not sent ...
> 0(4434) XJAB:xj_worker:4442: msgs from socket <7> parsed ... 
>
>

= = = = = = = = = = = = = = = = = = = = 
  
        致
礼!

  
        张色珍
        zhangsezhen at sict.ac.cn
          2004-09-24 


More information about the sr-users mailing list