using mod_pubsub in other modules

I'm writing http module for ejabberd that subscribes specific user to given node and creates it when it dosn't exit.
Currently I have following problem whit create_node function.

Server = Request#request.host,
Result = mod_pubsub:create_node(Host, Server, mod_pubsub:string_to_node("test"), string:concat("ala@", Server), "flat"),
?INFO_MSG("node creation", [Result]),

and i've got

mod_nodes_management,
  45,
  {error,
   {xmlelement,
    "error",
    [{"code",
      "500"},
      {"type",
      "wait"}],
    [{xmlelement,
    "internal-server-error",
    [{"xmlns",
    "urn:ietf:params:xml:ns:xmpp-stanzas"}],
[]}]}}]

thanks for help

mod_pubsub:create_node(

mod_pubsub:create_node(
"pubsub.localhost",
"localhost",
mod_pubsub:string_to_node("node123"),
jlib:string_to_jid("user1@localhost"),
"flat").

Syndicate content