需要一个解决方案来实现xmpp在群聊中添加朋友,并在php中一次性向他们发送消息

需要一个解决方案来实现xmpp在群聊中添加朋友,并在php中一次性向他们发送消息,xmpp,Xmpp,我正在从服务器端开发聊天应用程序,其中一对一和群聊是模块 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 us

我正在从服务器端开发聊天应用程序,其中一对一和群聊是模块

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 = "
<message from='9879870000spalchat@canopus-pc(e.g.senderjid)' to='3698000000spalchat@canopus-pc(e.g.receiverjid)'>
   <x xmlns='http://jabber.org/protocol/muc#user'>
     <invite from='yorkvillecommunityschoolspalchat@conference.canopus-pc(e.g.groupjid)'/>

   </x>
 </message>

";
$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;
echo $res;
print_r($res);

curl_close($ch);

我已经为此做了研发,然后我发现它是由muc服务插件完成的。

展示您迄今为止所做的工作。如果您可以上传您迄今为止所做的代码,那么回答问题将更容易。如果不是,那就更像是在黑暗中拍摄。除非有人碰巧做了这件事。是的,我上传了代码