LiveHelperChat / xmpp-chat

This is repository for full XMPP chat support. Standalone and automated hosting environment is supported.
https://livehelperchat.com/full-xmpp-chat-support-for-ejabberd-423a.html
37 stars 18 forks source link

How send a invitation to chatroom users in xmpp #6

Closed varunjoshi12 closed 7 years ago

varunjoshi12 commented 8 years ago

I am able to create the new room for the group chat.

But i am unable to invite the friends to that group using php code.

if somebody has sample code that would be great..

I write below code for sending invitation to user for that group but it is not working for sending invitation to user and it also not throw any kind of Exception.As above i have describe i am working on chat application in which i have to send invitation so that device side developer can used this invitation and call the web api for refreshing the list automatically.

<?php

$url = "http://host:port/plugins/mucservice/message?servicename=conference"; $data =

; $username = "xxxx"; $password = "xxxxx"; $ch = curl_init(); curl_setopt($ch, CURLOPT_URL, $url); curl_setopt($ch, CURLOPT_PORT, "9090"); curl_setopt($ch, CURLOPT_POST, 1); curl_setopt($ch, CURLOPT_POSTFIELDS, $data); curl_setopt($ch, CURLOPT_HTTPAUTH, CURLAUTH_ANY); curl_setopt($ch, CURLOPT_HTTPHEADER, array('Content-Type: application/xml', 'Authorization: Basic ' . base64_encode("$username:$password"))); $code = curl_getinfo($ch, CURLINFO_HTTP_CODE); curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); echo $code; $res = curl_exec($ch); //echo "code " . $code;

remdex commented 7 years ago

Sorry, but this request is invalid.