unable to send stanza using ejabberdctl

Hi,

I'm using ejabberdctl send_stanza_c2s to send a stanza. I see an error when trying to do this.

Problem 'error badarg' occurred executing the command.
Stacktrace: [{p1_fsm,send_event,2,[{file,"src/p1_fsm.erl"},{line,222}]},
{ejabberd_commands,execute_command2,2,
[{file,"src/ejabberd_commands.erl"},
{line,378}]},
{ejabberd_ctl,call_command,3,
[{file,"src/ejabberd_ctl.erl"},{line,292}]},
{ejabberd_ctl,try_call_command,3,
[{file,"src/ejabberd_ctl.erl"},{line,268}]},
{ejabberd_ctl,process2,3,
[{file,"src/ejabberd_ctl.erl"},{line,217}]},
{ejabberd_ctl,process,1,
[{file,"src/ejabberd_ctl.erl"},{line,202}]},
{rpc,'-handle_call_call/6-fun-0-',5,
[{file,"rpc.erl"},{line,205}]}]

I think it's because there is no active session for the user. Isn't it possible to send a stanza without an active session? If it's not, please help me in knowing how to establish a session.

Here's my usecase:

I want to be able to send messages on behalf of any user.

Any thoughts on this?

Any thoughts on this?

Right, that command needs

Right, that command needs arguments of an existing client session. And that cannot be created using other ejabberdctl commands; you need to have a Jabber client logged in in the server. Maybe you can setup and start a Jabber bot program just for that.

There's now another command,

There's now another command, more simple, called send_stanza. See this comment: https://github.com/processone/ejabberd-contrib/issues/142#issuecomment-1...

Syndicate content