ejabberd_service problem

Hi!

I'm developing an ejabberd_service. It must catch all messages sent to the specific user name and reply on them. I implemeted it using Java Yaja or Perl Net::Jabber::Component libraries. But all they have simular problem: some chat messages do not come to the service.

I also made a bot for the user and it receives all messages. But service does not get them. I cannot detect any rule here. Some messages comes to the service. Other do not come.

Or maybe you can recommend how to make the task I need.

I think I cannot use bot because we have a cluster configuration (3 servers). A message must be processed on the same sarver the sender is connected to.

For example: on Perl I use:

...
my $cmp = new Net::Jabber::Component();
$cmp->SetCallBacks(message=>\&handleMessage);
$cmp->Execute(...);

sub handleMessage() {
my $mid = shift || return;
my $message = shift || return;
my $to = new Net::XMPP::JID($message->GetTo())->GetJID("base");

if ($to eq 'myid') {
$cmp->MessageSend(
from => $config{component}->{name},
to => $from,
type => "chat",
body => "RESULT" );
}
}

Crossposted in

Syndicate content