wei | 6 Oct 2009 11:31
Picon

How to implement Friend Search function on IM client?

Hi all,


I send following stanza to get Friend Search Support info from ejabberd, but return error:
           <iq type='get' id='search1'>
                <query xmlns='jabber:iq:search'/>
           </iq>

error is:

[017:797]    <iq from='alex' to='alex' type='error' xml:lang='*' id='12'>
[017:797]      <query xmlns='jabber:iq:search'/>
[017:797]      <error code='503' type='cancel'>
[017:797]        <service-unavailable xmlns='urn:ietf:params:xml:ns:xmpp-stanzas'/>
[017:813]      </error>
[017:813]    </iq>

so, how to write the stanza to support user search?

Thanks a million.

alex
_______________________________________________
ejabberd mailing list
ejabberd <at> jabber.ru
http://lists.jabber.ru/mailman/listinfo/ejabberd
Pablo Polvorin | 6 Oct 2009 15:41
Favicon

Re: How to implement Friend Search function on IM client?

Hi,
you need to send it to the appropiate vcard user search (vjud)
component in your ejabberd server.
that is probably called "vjud.%YOURDOMAIN%" (you can change it in ejabberd.cfg)

2009/10/6 wei <tsingmei <at> gmail.com>:
> Hi all,
> I send following stanza to get Friend Search Support info from ejabberd, but
> return error:
>            <iq type='get' id='search1'>
>                 <query xmlns='jabber:iq:search'/>
>            </iq>
> error is:
> [017:797]    <iq from='alex' to='alex' type='error' xml:lang='*' id='12'>
> [017:797]      <query xmlns='jabber:iq:search'/>
> [017:797]      <error code='503' type='cancel'>
> [017:797]        <service-unavailable
> xmlns='urn:ietf:params:xml:ns:xmpp-stanzas'/>
> [017:813]      </error>
> [017:813]    </iq>
> so, how to write the stanza to support user search?
> Thanks a million.
> alex
> _______________________________________________
> ejabberd mailing list
> ejabberd <at> jabber.ru
> http://lists.jabber.ru/mailman/listinfo/ejabberd
>
>

--

-- 
Pablo Polvorin
ProcessOne
wei | 6 Oct 2009 16:38
Picon

Re: How to implement Friend Search function on IM client?

Thank you for your quick response. But I send the request stanza to the JUD component, but get error 400 from the server... I checked the help and internet, can't find any answer...

[032:563]    <iq type="set" from="alex <at> abc.com/call" to="jud.abc.com" id="12">
[032:563]      <query xmlns="jabber:iq:search">
[032:563]        <fn>
[032:563]          alexfull
[032:563]        </fn>
[032:563]      </query>
[032:563]    </iq>
[032:594] RECV <<<<<<<<<<<<<<<<<<<<<<<<< : Tue Oct 06 22:34:45 2009
[032:594]    <iq from='jud.abc.com' to='alex <at> abc.com/call' type='error ' xml:lang='*' id='12'>
[032:594]      <query xmlns='jabber:iq:search'>
[032:594]        <fn>
[032:594]          alexfull
[032:594]        </fn>
[032:594]      </query>
[032:594]      <error code='400' type='modify'>
[032:594]        <bad-request xmlns='urn:ietf:params:xml:ns:xmpp-stanzas'/>
[032:594]      </error>
[032:594]    </iq>

On Tue, Oct 6, 2009 at 9:41 PM, Pablo Polvorin <pablo.polvorin <at> process-one.net> wrote:
Hi,
you need to send it to the appropiate vcard user search (vjud)
component in your ejabberd server.
that is probably called "vjud.%YOURDOMAIN%" (you can change it in ejabberd.cfg)

2009/10/6 wei <tsingmei <at> gmail.com>:
> Hi all,
> I send following stanza to get Friend Search Support info from ejabberd, but
> return error:
>            <iq type='get' id='search1'>
>                 <query xmlns='jabber:iq:search'/>
>            </iq>
> error is:
> [017:797]    <iq from='alex' to='alex' type='error' xml:lang='*' id='12'>
> [017:797]      <query xmlns='jabber:iq:search'/>
> [017:797]      <error code='503' type='cancel'>
> [017:797]        <service-unavailable
> xmlns='urn:ietf:params:xml:ns:xmpp-stanzas'/>
> [017:813]      </error>
> [017:813]    </iq>
> so, how to write the stanza to support user search?
> Thanks a million.
> alex
> _______________________________________________
> ejabberd mailing list
> ejabberd <at> jabber.ru
> http://lists.jabber.ru/mailman/listinfo/ejabberd
>
>



--
Pablo Polvorin
ProcessOne
_______________________________________________
ejabberd mailing list
ejabberd <at> jabber.ru
http://lists.jabber.ru/mailman/listinfo/ejabberd

_______________________________________________
ejabberd mailing list
ejabberd <at> jabber.ru
http://lists.jabber.ru/mailman/listinfo/ejabberd
Pablo Polvorin | 6 Oct 2009 18:12
Favicon

Re: How to implement Friend Search function on IM client?

You are doing the wrong requests, as ejabberd uses data forms* for
user search. See the search form ejabberd gives you, you should see
something like:

<iq ..>
<query xmlns="jabber:iq:search">
<instructions>You need an x:data capable client to search</instructions>
<x xmlns="jabber:x:data" type="form" >
   [...]
</x>
</query>
</iq>

*http://xmpp.org/extensions/xep-0004.html

2009/10/6 wei <tsingmei <at> gmail.com>:
> Thank you for your quick response. But I send the request stanza to the JUD
> component, but get error 400 from the server... I checked the help and
> internet, can't find any answer...
> [032:563]    <iq type="set" from="alex <at> abc.com/call"
> to="jud.abc.com" id="12">
> [032:563]      <query xmlns="jabber:iq:search">
> [032:563]        <fn>
> [032:563]          alexfull
> [032:563]        </fn>
> [032:563]      </query>
> [032:563]    </iq>
> [032:594] RECV <<<<<<<<<<<<<<<<<<<<<<<<< : Tue Oct 06 22:34:45 2009
> [032:594]    <iq from='jud.abc.com' to='alex <at> abc.com/call' type='error '
> xml:lang='*' id='12'>
> [032:594]      <query xmlns='jabber:iq:search'>
> [032:594]        <fn>
> [032:594]          alexfull
> [032:594]        </fn>
> [032:594]      </query>
> [032:594]      <error code='400' type='modify'>
> [032:594]        <bad-request xmlns='urn:ietf:params:xml:ns:xmpp-stanzas'/>
> [032:594]      </error>
> [032:594]    </iq>
> On Tue, Oct 6, 2009 at 9:41 PM, Pablo Polvorin
> <pablo.polvorin <at> process-one.net> wrote:
>>
>> Hi,
>> you need to send it to the appropiate vcard user search (vjud)
>> component in your ejabberd server.
>> that is probably called "vjud.%YOURDOMAIN%" (you can change it in
>> ejabberd.cfg)
>>
>> 2009/10/6 wei <tsingmei <at> gmail.com>:
>> > Hi all,
>> > I send following stanza to get Friend Search Support info from ejabberd,
>> > but
>> > return error:
>> >            <iq type='get' id='search1'>
>> >                 <query xmlns='jabber:iq:search'/>
>> >            </iq>
>> > error is:
>> > [017:797]    <iq from='alex' to='alex' type='error' xml:lang='*'
>> > id='12'>
>> > [017:797]      <query xmlns='jabber:iq:search'/>
>> > [017:797]      <error code='503' type='cancel'>
>> > [017:797]        <service-unavailable
>> > xmlns='urn:ietf:params:xml:ns:xmpp-stanzas'/>
>> > [017:813]      </error>
>> > [017:813]    </iq>
>> > so, how to write the stanza to support user search?
>> > Thanks a million.
>> > alex
>> > _______________________________________________
>> > ejabberd mailing list
>> > ejabberd <at> jabber.ru
>> > http://lists.jabber.ru/mailman/listinfo/ejabberd
>> >
>> >
>>
>>
>>
>> --
>> Pablo Polvorin
>> ProcessOne
>> _______________________________________________
>> ejabberd mailing list
>> ejabberd <at> jabber.ru
>> http://lists.jabber.ru/mailman/listinfo/ejabberd
>
>
> _______________________________________________
> ejabberd mailing list
> ejabberd <at> jabber.ru
> http://lists.jabber.ru/mailman/listinfo/ejabberd
>
>

--

-- 
Pablo Polvorin
ProcessOne
wei | 6 Oct 2009 19:32
Picon

Re: How to implement Friend Search function on IM client?

yes... i checked xep-0004 and send following stanza to ejabberd server, can get result now. Is following stanza correct? or still needs optimization? Bunch of thanks.


[009:406] SEND >>>>>>>>>>>>>>>>>>>>>>>>> : Wed Oct 07 01:27:40 2009
[009:422]    <iq type="set" from="alex <at> abc/call" to="jud.abc.com" id="12">
[009:422]      <query xmlns="jabber:iq:search">
[009:422]        <x xmlns="jabber:x:data" type="submit">
[009:422]          <field xmlns="" type="text-single" var="user">
[009:422]            <value>
[009:422]              alex
[009:422]            </value>
[009:422]          </field>
[009:422]        </x>
[009:438]      </query>
[009:438]    </iq>
[009:485] RECV <<<<<<<<<<<<<<<<<<<<<<<<< : Wed Oct 07 01:27:40 2009
[009:485]    <iq from='jud.abc.com' to='alex <at> abc.com/call' id='12' type='result'>
[009:485]      <query xmlns='jabber:iq:search'>
[009:485]        <x xmlns='jabber:x:data' type='result'>
[009:485]          <title>
[009:485]            搜索结果属于关键
_______________________________________________
ejabberd mailing list
ejabberd <at> jabber.ru
http://lists.jabber.ru/mailman/listinfo/ejabberd
wei | 7 Oct 2009 16:40
Picon

How to support Chinese username?

Hi all,


I use English username "alex" to register and login, everything goes well. 

When I add a Chinese username called "中文" into the Database, user "alex" can add him as friend. But, I can't login as user "中文". I tried UTF-8 format JID node as well as ANSI format, none is available,  the return stanza is always:

[008:000]    <failure xmlns='urn:ietf:params:xml:ns:xmpp-sasl'>
[008:000]      <not-authorized/>
[008:000]    </failure>
[008:000] XmppLoginTask::Advance - LOGINSTATE_SASL_RUNNING

What's the reason? 

Bunch of Thanks.

Alex
_______________________________________________
ejabberd mailing list
ejabberd <at> jabber.ru
http://lists.jabber.ru/mailman/listinfo/ejabberd
Badlop | 7 Oct 2009 17:17
Picon

Re: How to support Chinese username?

2009/10/7 wei <tsingmei <at> gmail.com>:
> I use English username "alex" to register and login, everything goes well.
> When I add a Chinese username called "中文" into the Database, user "alex" can
> add him as friend. But, I can't login as user "中文". I tried UTF-8 format JID
> node as well as ANSI format, none is available,  the return stanza is
> always:
> [008:000]    <failure xmlns='urn:ietf:params:xml:ns:xmpp-sasl'>
> [008:000]      <not-authorized/>
> [008:000]    </failure>
> [008:000] XmppLoginTask::Advance - LOGINSTATE_SASL_RUNNING
> What's the reason?
> Bunch of Thanks.

Maybe it's how you created the account: I tried with Tkabber and
ejabberdctl, both worked.
Or maybe the problem is in your client: I tried with Tkabber and worked.
You can also try other clients like Psi, Gajim and Jabbim, probably it
will work too.

Now I describe how I tested it.
I create the account 中文 using Tkabber in my test server, and logged in
correctly.
Then tested with ejabberdctl:

$ ejabberdctl registered_users localhost
badlop
中文

$ ejabberdctl connected_users
中文 <at> localhost/HomeTka

$ ejabberdctl user_resources 中文 localhost
HomeTka

$ ejabberdctl register 中文 localhost mypass123
User 中文 <at> localhost already registered at node ejabberd <at> localhost

$ ejabberdctl register 中文2 localhost mypass123
User 中文2 <at> localhost succesfully registered

$ ejabberdctl registered_users localhost
badlop
中文
中文2

Then I disconnect of previous account and connect in the new 中文2:
$ ejabberdctl connected_users
中文2 <at> localhost/Home

In ejabberd.log I got this. You can notice that the non-ASCII
characters are strangely displayed in those informative texts:

=INFO REPORT==== 7-Oct-2009::16:47:52 ===
I(<0.360.0>:ejabberd_listener:224) : (#Port<0.3826>) Accepted
connection {{127,0,0,1},45077} -> {{127,0,0,1},5222}

=INFO REPORT==== 7-Oct-2009::16:47:52 ===
I(<0.383.0>:ejabberd_c2s:703) :
({socket_state,gen_tcp,#Port<0.3826>,<0.382.0>}) Accepted
authentication for 中æ by ejabberd_auth_internal

=INFO REPORT==== 7-Oct-2009::16:47:52 ===
I(<0.383.0>:ejabberd_c2s:817) :
({socket_state,gen_tcp,#Port<0.3826>,<0.382.0>}) Opened session for
中æ <at> localhost/Home

=INFO REPORT==== 7-Oct-2009::16:50:53 ===
I(<0.383.0>:ejabberd_c2s:1330) :
({socket_state,gen_tcp,#Port<0.3826>,<0.382.0>}) Close session for
中æ <at> localhost/Home

=INFO REPORT==== 7-Oct-2009::16:51:12 ===
I(<0.360.0>:ejabberd_listener:224) : (#Port<0.3873>) Accepted
connection {{127,0,0,1},45092} -> {{127,0,0,1},5222}

=INFO REPORT==== 7-Oct-2009::16:51:12 ===
I(<0.453.0>:ejabberd_c2s:703) :
({socket_state,gen_tcp,#Port<0.3873>,<0.452.0>}) Accepted
authentication for 中æ2 by ejabberd_auth_internal

=INFO REPORT==== 7-Oct-2009::16:51:12 ===
I(<0.453.0>:ejabberd_c2s:817) :
({socket_state,gen_tcp,#Port<0.3873>,<0.452.0>}) Opened session for
中æ2 <at> localhost/Home

$ ejabberdctl debug
(ejabberd <at> localhost)1> ets:tab2list(passwd).
[{passwd,{"badlop","localhost"},"mypass111"},
 {passwd,{[228,184,173,230,150,135],"localhost"},"mypass123"},
 {passwd,{[228,184,173,230,150,135,50],"localhost"}, "mypass123"}]

I used ejabberd 2.1.0-rc1, Erlang/OTP R13B02 and Tkabber SVN.
In previous versions of those programs, maybe the text varies,
but surely you must be able to register the account and log in correctly.

---
Badlop
ProcessOne
_______________________________________________
ejabberd mailing list
ejabberd <at> jabber.ru
http://lists.jabber.ru/mailman/listinfo/ejabberd
wei | 7 Oct 2009 17:59
Picon

Re: How to support Chinese username?

Hi Badlop,


Thank you so much. Yes, UTF-8 format is correct. Use UTF-8 format, ejabberd can support Chinese Now :-)

Thank you all :-D

alex

On Wed, Oct 7, 2009 at 11:17 PM, Badlop <badlop <at> gmail.com> wrote:
2009/10/7 wei <tsingmei <at> gmail.com>:
> I use English username "alex" to register and login, everything goes well.
> When I add a Chinese username called "中文" into the Database, user "alex" can
> add him as friend. But, I can't login as user "中文". I tried UTF-8 format JID
> node as well as ANSI format, none is available,  the return stanza is
> always:
> [008:000]    <failure xmlns='urn:ietf:params:xml:ns:xmpp-sasl'>
> [008:000]      <not-authorized/>
> [008:000]    </failure>
> [008:000] XmppLoginTask::Advance - LOGINSTATE_SASL_RUNNING
> What's the reason?
> Bunch of Thanks.

Maybe it's how you created the account: I tried with Tkabber and
ejabberdctl, both worked.
Or maybe the problem is in your client: I tried with Tkabber and worked.
You can also try other clients like Psi, Gajim and Jabbim, probably it
will work too.

Now I describe how I tested it.
I create the account 中文 using Tkabber in my test server, and logged in
correctly.
Then tested with ejabberdctl:

$ ejabberdctl registered_users localhost
badlop
中文

$ ejabberdctl connected_users
中文 <at> localhost/HomeTka

$ ejabberdctl user_resources 中文 localhost
HomeTka

$ ejabberdctl register 中文 localhost mypass123
User 中文 <at> localhost already registered at node ejabberd <at> localhost

$ ejabberdctl register 中文2 localhost mypass123
User 中文2 <at> localhost succesfully registered

$ ejabberdctl registered_users localhost
badlop
中文
中文2

Then I disconnect of previous account and connect in the new 中文2:
$ ejabberdctl connected_users
中文2 <at> localhost/Home


In ejabberd.log I got this. You can notice that the non-ASCII
characters are strangely displayed in those informative texts:

=INFO REPORT==== 7-Oct-2009::16:47:52 ===
I(<0.360.0>:ejabberd_listener:224) : (#Port<0.3826>) Accepted
connection {{127,0,0,1},45077} -> {{127,0,0,1},5222}

=INFO REPORT==== 7-Oct-2009::16:47:52 ===
I(<0.383.0>:ejabberd_c2s:703) :
({socket_state,gen_tcp,#Port<0.3826>,<0.382.0>}) Accepted
authentication for 中æ by ejabberd_auth_internal

=INFO REPORT==== 7-Oct-2009::16:47:52 ===
I(<0.383.0>:ejabberd_c2s:817) :
({socket_state,gen_tcp,#Port<0.3826>,<0.382.0>}) Opened session for
中æ <at> localhost/Home

=INFO REPORT==== 7-Oct-2009::16:50:53 ===
I(<0.383.0>:ejabberd_c2s:1330) :
({socket_state,gen_tcp,#Port<0.3826>,<0.382.0>}) Close session for
中æ <at> localhost/Home

=INFO REPORT==== 7-Oct-2009::16:51:12 ===
I(<0.360.0>:ejabberd_listener:224) : (#Port<0.3873>) Accepted
connection {{127,0,0,1},45092} -> {{127,0,0,1},5222}

=INFO REPORT==== 7-Oct-2009::16:51:12 ===
I(<0.453.0>:ejabberd_c2s:703) :
({socket_state,gen_tcp,#Port<0.3873>,<0.452.0>}) Accepted
authentication for 中æ2 by ejabberd_auth_internal

=INFO REPORT==== 7-Oct-2009::16:51:12 ===
I(<0.453.0>:ejabberd_c2s:817) :
({socket_state,gen_tcp,#Port<0.3873>,<0.452.0>}) Opened session for
中æ2 <at> localhost/Home


$ ejabberdctl debug
(ejabberd <at> localhost)1> ets:tab2list(passwd).
[{passwd,{"badlop","localhost"},"mypass111"},
 {passwd,{[228,184,173,230,150,135],"localhost"},"mypass123"},
 {passwd,{[228,184,173,230,150,135,50],"localhost"}, "mypass123"}]


I used ejabberd 2.1.0-rc1, Erlang/OTP R13B02 and Tkabber SVN.
In previous versions of those programs, maybe the text varies,
but surely you must be able to register the account and log in correctly.


---
Badlop
ProcessOne
_______________________________________________
ejabberd mailing list
ejabberd <at> jabber.ru
http://lists.jabber.ru/mailman/listinfo/ejabberd

_______________________________________________
ejabberd mailing list
ejabberd <at> jabber.ru
http://lists.jabber.ru/mailman/listinfo/ejabberd
Evgeniy Khramtsov | 7 Oct 2009 18:01
Picon
Gravatar

Re: How to support Chinese username?

Badlop wrote:
> Maybe it's how you created the account: I tried with Tkabber and
> ejabberdctl, both worked.
>   

Works for me as well with Psi. I'm using R13B01 and ejabberd 2.1.0-rc1.

--

-- 
Regards,
Evgeniy Khramtsov, ProcessOne.
xmpp:xram <at> jabber.ru.
Fabio Forno | 8 Oct 2009 17:36
Picon

node creation problem

Today we run into a strange problem. We have always been able to
create nodes in the pubsub service (ejabberd 2.0.5), but now for any
new node we get the forbidden error.

This is the stanza we send is this one (acls allow creation from any
user, as for default conf):

<iq to='pubsub.jabber.bluendo.com' type='set' id='H_2'>
  <pubsub xmlns='http://jabber.org/protocol/pubsub'>
   <create node='test01'/>
   <configure/>
  </pubsub>
</iq>

And here is the result:
<iq from='pubsub.jabber.bluendo.com'
to='test <at> jabber.bluendo.com/2603889948125516012842851' type='error'
id='H_2'><pubsub xmlns='http://jabber.org/protocol/pubsub'><create
node='test01'/><configure/></pubsub><error code='403'
type='auth'><forbidden
xmlns='urn:ietf:params:xml:ns:xmpp-stanzas'/></error></iq>

--

-- 
Fabio Forno,
Bluendo srl http://www.bluendo.com
jabber id: ff <at> jabber.bluendo.com

Gmane