ejabberd - Comments for "set_vcard multiple" https://www.ejabberd.im/node/4918 en Is there another way? I want https://www.ejabberd.im/node/4918#comment-57808 <p>Is there another way?</p> <p>I want to control it using XMLRPC, so user may be not logged in.</p> <p>At the first reply you wrote, that I can write my own command. Where can I find more detailed information how to do it?</p> <p>Thank you.</p> Mon, 05 Sep 2011 11:13:41 +0000 star_ comment 57808 at https://www.ejabberd.im You must login with a Jabber https://www.ejabberd.im/node/4918#comment-57802 <p>You must login with a Jabber client to the JID admin@localhost/XMLRPC and then run the command.</p> Mon, 29 Aug 2011 11:06:23 +0000 mfoss comment 57802 at https://www.ejabberd.im And there is an error in log https://www.ejabberd.im/node/4918#comment-57796 <p>And there is an error in log file</p> <div class="codeblock"><code>=INFO REPORT==== 2011-08-26 22:55:42 ===<br />D(&lt;0.428.0&gt;:ejabberd_commands:314) : Executing command mod_admin_extra:send_stanza_c2s with Args=[&quot;admin&quot;,<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nb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p;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &quot;&lt;iq type=&#039;set&#039;&gt;&lt;vCard xmlns=&#039;vcard-temp&#039;&gt;&lt;FN /&gt;&lt;N&gt;&lt;GIVEN&gt;NAME&lt;GIVEN /&gt;&lt;MIDDLE /&gt;&lt;FAMILY /&gt;&lt;/N&gt;&lt;NICKNAME&gt;admin&lt;/NICKNAME&gt;&lt;BDAY /&gt;&lt;GENDER /&gt;&lt;ADR&gt;&lt;HOME /&gt;&lt;STREET /&gt;&lt;EXTADR /&gt;&lt;EXTADD /&gt;&lt;LOCALITY /&gt;&lt;REGION /&gt;&lt;PCODE /&gt;&lt;CTRY /&gt;&lt;COUNTRY /&gt;&lt;/ADR&gt;&lt;ADR&gt;&lt;WORK /&gt;&lt;STREET /&gt;&lt;EXTADR /&gt;&lt;EXTADD /&gt;&lt;LOCALITY /&gt;&lt;REGION /&gt;&lt;PCODE /&gt;&lt;CTRY /&gt;&lt;COUNTRY /&gt;&lt;/ADR&gt;&lt;ORG&gt;&lt;ORGNAME /&gt;&lt;ORGUNIT /&gt;&lt;/ORG&gt;&lt;TITLE /&gt;&lt;ROLE /&gt;&lt;URL /&gt;&lt;DESC /&gt;&lt;TEL&gt;&lt;NUMBER&gt;12345&lt;/NUMBER&gt;&lt;HOME /&gt;&lt;/TEL&gt;&lt;/vCard&gt;&lt;/iq&gt;&quot;] <p>=ERROR REPORT==== 2011-08-26 22:55:42 ===<br />{xmlrpc_http,153,<br />&nbsp;&nbsp;&nbsp; {ejabberd_xmlrpc,handler,<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; {&#039;EXIT&#039;,<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; {badarg,<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; [{p1_fsm,send_event,2},<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; {ejabberd_xmlrpc,do_command,6},<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; {ejabberd_xmlrpc,try_do_command,6},<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; {xmlrpc_http,eval_payload,6},<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; {tcp_serv,start_session,3},<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; {proc_lib,init_p_do_apply,3}]}}}}</p></code></div> Fri, 26 Aug 2011 20:45:49 +0000 star_ comment 57796 at https://www.ejabberd.im When I try to use XMLRPC call https://www.ejabberd.im/node/4918#comment-57785 <p>When I try to use XMLRPC call with this command, there is an error too.</p> <div class="codeblock"><code>file_get_contents(<noindex><a href="http://localhost:4560/" title="http://localhost:4560/" rel="nofollow" >http://localhost:4560/</a></noindex>): failed to open stream: HTTP request failed! HTTP/1.1 500 Internal Server Error </code></div> <p>the request for XMLRPC call</p> <div class="codeblock"><code>&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot;?&gt;<br />&lt;methodCall&gt;<br />&lt;methodName&gt;send_stanza_c2s&lt;/methodName&gt;<br />&lt;params&gt;<br /> &lt;param&gt;<br />&nbsp; &lt;value&gt;<br />&nbsp;&nbsp; &lt;struct&gt;<br />&nbsp;&nbsp;&nbsp; &lt;member&gt;<br />&nbsp;&nbsp;&nbsp;&nbsp; &lt;name&gt;user&lt;/name&gt;<br />&nbsp;&nbsp;&nbsp;&nbsp; &lt;value&gt; <p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;string&gt;admin&lt;/string&gt;<br />&nbsp;&nbsp;&nbsp;&nbsp; &lt;/value&gt;<br />&nbsp;&nbsp;&nbsp; &lt;/member&gt;<br />&nbsp;&nbsp;&nbsp; &lt;member&gt;<br />&nbsp;&nbsp;&nbsp;&nbsp; &lt;name&gt;server&lt;/name&gt;<br />&nbsp;&nbsp;&nbsp;&nbsp; &lt;value&gt;<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;string&gt;localhost&lt;/string&gt;</p> <p>&nbsp;&nbsp;&nbsp;&nbsp; &lt;/value&gt;<br />&nbsp;&nbsp;&nbsp; &lt;/member&gt;<br />&nbsp;&nbsp;&nbsp; &lt;member&gt;<br />&nbsp;&nbsp;&nbsp;&nbsp; &lt;name&gt;password&lt;/name&gt;<br />&nbsp;&nbsp;&nbsp;&nbsp; &lt;value&gt;<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;string&gt;password&lt;/string&gt;<br />&nbsp;&nbsp;&nbsp;&nbsp; &lt;/value&gt;<br />&nbsp;&nbsp;&nbsp; &lt;/member&gt;</p> <p>&nbsp;&nbsp; &lt;/struct&gt;<br />&nbsp; &lt;/value&gt;<br /> &lt;/param&gt;<br /> &lt;param&gt;<br />&nbsp; &lt;value&gt;<br />&nbsp;&nbsp; &lt;struct&gt;<br />&nbsp;&nbsp;&nbsp; &lt;member&gt;<br />&nbsp;&nbsp;&nbsp;&nbsp; &lt;name&gt;user&lt;/name&gt;</p> <p>&nbsp;&nbsp;&nbsp;&nbsp; &lt;value&gt;<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;string&gt;admin&lt;/string&gt;<br />&nbsp;&nbsp;&nbsp;&nbsp; &lt;/value&gt;<br />&nbsp;&nbsp;&nbsp; &lt;/member&gt;<br />&nbsp;&nbsp;&nbsp; &lt;member&gt;<br />&nbsp;&nbsp;&nbsp;&nbsp; &lt;name&gt;host&lt;/name&gt;<br />&nbsp;&nbsp;&nbsp;&nbsp; &lt;value&gt;<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;string&gt;localhost&lt;/string&gt;</p> <p>&nbsp;&nbsp;&nbsp;&nbsp; &lt;/value&gt;<br />&nbsp;&nbsp;&nbsp; &lt;/member&gt;<br />&nbsp;&nbsp;&nbsp; &lt;member&gt;<br />&nbsp;&nbsp;&nbsp;&nbsp; &lt;name&gt;resource&lt;/name&gt;<br />&nbsp;&nbsp;&nbsp;&nbsp; &lt;value&gt;<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;string&gt;XMLRPC&lt;/string&gt;<br />&nbsp;&nbsp;&nbsp;&nbsp; &lt;/value&gt;<br />&nbsp;&nbsp;&nbsp; &lt;/member&gt;</p> <p>&nbsp;&nbsp;&nbsp; &lt;member&gt;<br />&nbsp;&nbsp;&nbsp;&nbsp; &lt;name&gt;stanza&lt;/name&gt;<br />&nbsp;&nbsp;&nbsp;&nbsp; &lt;value&gt;<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;string&gt;&amp;#60;iq id=&amp;#34;v2&amp;#34; type=&amp;#34;set&amp;#34;&amp;#62;&amp;#13;&amp;#10;&nbsp; &amp;#60;vCard xmlns=&amp;#34;vcard-temp&amp;#34;&amp;#62;&amp;#13;&amp;#10;&nbsp;&nbsp;&nbsp; &amp;#60;FN&amp;#62;Peter Saint-Andre&amp;#60;/FN&amp;#62;&amp;#13;&amp;#10; &amp;#60;/vCard&amp;#62;&amp;#60;/iq&amp;#62;&lt;/string&gt;</p> <p>&nbsp;&nbsp;&nbsp;&nbsp; &lt;/value&gt;<br />&nbsp;&nbsp;&nbsp; &lt;/member&gt;<br />&nbsp;&nbsp; &lt;/struct&gt;<br />&nbsp; &lt;/value&gt;<br /> &lt;/param&gt;<br />&lt;/params&gt;<br />&lt;/methodCall&gt;</p></code></div> <p>With other commands, such as set_vcard it works good.</p> <p>I think that problem is with stanza format.<br /> How can I fix it?</p> Wed, 24 Aug 2011 19:11:22 +0000 star_ comment 57785 at https://www.ejabberd.im Yes, it's difficult to escape https://www.ejabberd.im/node/4918#comment-57782 <p>Yes, it's difficult to escape some characters when using the shell.</p> <div class="quote-msg"> <div class="quote-author"><em>star_</em> wrote:</div> <p>I want to use php script to control ejabberd server via xmlrpc module, maybe there is easier way to set user vcard?</p></div> <p>If you install ejabberd_xmlrpc, you can execute the ejabberd commands using XMLRPC calls.</p> Wed, 24 Aug 2011 16:20:18 +0000 mfoss comment 57782 at https://www.ejabberd.im Thank you for advice. But I https://www.ejabberd.im/node/4918#comment-57780 <p>Thank you for advice.</p> <p>But I have some problems using send_stanza_c2s</p> <p>When I make command</p> <div class="codeblock"><code> ejabberdctl send_stanza_c2s user localhost Bahama &#039;&lt;message id=&quot;1&quot; type=&quot;chat&quot;&gt;&lt;body&gt;How goes?&lt;/body&gt;&lt;/message&gt;&#039;</code></div> <p>There is an error Error: the command "send_stanza_c2s" requires 3 less argument.</p> <p>When I tried such command</p> <div class="codeblock"><code> ejabberdctl send_stanza_c2s user localhost Bahama \&#039;&lt;message id=&quot;1&quot; type=&quot;chat&quot;&gt;&lt;body&gt;How goes?&lt;/body&gt;&lt;/message&gt;\&#039;</code></div> <p>Another error: <strong>-bash: syntax error near unexpected token `&lt;'</strong></p> <p>I want to use php script to control ejabberd server via xmlrpc module, maybe there is easier way to set user vcard?</p> Wed, 24 Aug 2011 12:04:11 +0000 star_ comment 57780 at https://www.ejabberd.im Maybe you can use the command https://www.ejabberd.im/node/4918#comment-57767 <p>Maybe you can use the command send_stanza_c2s to send a full XMPP stanza with exactly what you want.</p> <p>Another solution is to add another command to insert exactly what you want in the vcard.</p> Mon, 22 Aug 2011 09:50:51 +0000 mfoss comment 57767 at https://www.ejabberd.im