[JDEV] Question about xdb_auth_cpile

Joe Breeden jbreeden at ena.com
Mon Sep 16 12:46:23 CDT 2002


I am in the process of modifying xdb_auth_cpile.pl to work with some special in-house stuff we need and wanted to add support for jabber:iq:register name space to allow users to register with database. For some reason, my modified version of the code is not seeing the jabber:iq:register requests. 

Here is the xdb tag from my jabber.xml:

  <xdb id="xdb_ena">
    <host>xdb_ena.shrieker.ena.com</host>
    <ns>jabber:iq:roster</ns>
    <ns>jabber:x:offline</ns>
    <ns>jabber:iq:filter</ns>
    <ns>jabber:iq:last</ns>
    <ns>jabber:iq:auth</ns>
    <ns>jabber:iq:auth:0k</ns>
    <ns>jabber:iq:register</ns>
    <accept>
      <ip>localhost</ip>
      <port>5999</port>
      <secret>g00g0ne</secret>
    </accept>
  </xdb>

Here is a snippet of my perl code that creates a Jabber::Connection object and registers a handler sub routine:

###create jabber object
my $j = new Jabber::Connection (
	server => $jserver->{ip} . ':' . $jserver->{port},
	localname => $jserver->{id},
	ns => 'jabber:component:accept',
	);

###connect to the server
log_msg ( MSG => 'Connecting to the server [' . $jserver->{ip} . ':' . $jserver->{port} . '] [' . $jserver->{id} . ']' ) if $debug;
log_msg ( MSG => "Failed to connect to the server - [" . $j->lastError . "]", DIE => 1) unless $j->connect();

###register the handlers
log_msg ( MSG => 'Registering handlers.') if $debug;
$j->register_handler( 'xdb', \&xdb_handler );

Looking at the POD for Jabber::Connection and the example code in xdb_auth_cpile.pl is a little confusing. The POD for Jabber::Connection says that the first argument to register_handler should be a node type - 'message', 'presence', or 'iq' - but the example code has 'xdb'. Using 'xdb' as a node type seems to work for most of the namespaces in the <xdb> tag of my jabber.xml, for some reason or other I am not seeing jabber:iq:register requests. 

Any help would be appreciated and if more information is needed, please let me know what and I'll pass it on. 

Thanks in advance,

--Joe Breeden

>From Murphy's Laws of Computing:
9. A complex system that does not work is invariably found to have evolved from a simpler system that worked just fine.




More information about the JDev mailing list