[ previous ] [ next ] [ threads ]
 To :  "'Paul Chitescu'" <paulc@v...>,<yate@v...>
 From :  "Andrew Checkov" <expert@a...>
 Subject :  RE: [yate] Yate 3.0.0 - Jabber client mode
 Date :  Thu, 1 Apr 2010 00:58:09 +0400
Hi,

How I can get original iq text from jabber.iq message at external php script
in case of jabberclient? 

In case of jabberserver there is 'dump_iq' parameter used to dump the iq
into a 'data' string parameter of the jabber.iq message. This doesn't work
with jabberclient.

Here's an example of the info I got from yate:

 Receiving from 'gmail.com'  [0x8fbb850]

 Processing event (0xb78020e0,Iq)
PHP Event: incoming
PHP Message: jabber.iq params=Array
(
    [module] => jabberclient
    [protocol] => jabber
    [account] => grglitter0@g...
    [line] => grglitter0@g...
    [from] => grglitter0@g...
    [from_instance] => gmail.B20C1501
    [to] => grglitter0@g...
    [to_instance] => 8A1EDF7A
    [id] => 133
    [type] => set
    [xml] => 
)

jabberclient.cpp code fragment creating iq message

    // Route the iq
    Message m("jabber.iq");
    __plugin.complete(m,ev->clientStream());
    m.addParam("from",ev->from().bare());
    m.addParam("from_instance",ev->from().resource());
    m.addParam("to",ev->to().bare());
    m.addParam("to_instance",ev->to().resource());
    addValidParam(m,"id",ev->id());
    addValidParam(m,"type",ev->stanzaType());
    if (!rsp && n != XMPPNamespace::Count)
        m.addParam("xmlns",XMPPUtils::s_ns[n]);
    m.addParam(new NamedPointer("xml",ev->releaseXml()));
    XmlElement* xmlRsp = 0;
    if (Engine::dispatch(m)) {

Andrew Checkov

> -----Original Message-----
> From: Paul Chitescu [mailto:paulc@v...]
> Sent: Tuesday, March 30, 2010 21:52
> To: yate@v...
> Subject: Re: [yate] Yate 3.0.0 - Jabber client mode
> 
> Hi, Andrew!
> 
> As far as I know the caps.id is an obscure string that happens to contain
> concatenated the index, node, version and extensions.
> 
> You must not assume anything about the format of this ID. Its only purpose
> is
> to be used as an unique key for storing decoded capabilities.
> 
> Paul
> 
> 
> On Tuesday 30 March 2010 08:41:00 pm Andrew Checkov wrote:
> > Marian,
> >
> > It seems that current yate parse GMail presence messages in the wrong
> way -
> > look to the message and to the caps.id field of resource.notify message.
> >
> > Andrew
> >
> >
> >  Receiving from 'gmail.com'  > from="acheckov@g.../gmail.A126F6B7"
> > to="optiroam@g...">away0
> >  > ext="pmuc-v1 sms-v1 camera-v1 video-v1 voice-v1"
> > xmlns:caps="http://jabber.org/protocol/caps"/>
> > 
> [0xb7702188]
> >
> >  Processing event (0x9cf2728,Presence)
> >
> >  User 'acheckov@g...' instance=gmail.A126F6B7
> node=(null)
> > is online
> >
> > PHP Event: incoming
> > PHP Message: resource.notify params=Array
> > (
> >     [module] => jabberclient
> >     [protocol] => jabber
> >     [account] => optiroam@g...
> >     [line] => optiroam@g...
> >     [operation] => online
> >     [contact] => acheckov@g...
> >     [instance] => gmail.A126F6B7
> >     [uri] => acheckov@g.../gmail.A126F6B7
> >     [priority] => 0
> >     [show] => away
> >     [caps.id] => 1http://mail.google.com/xmpp/client/caps1.1pmuc-v1 sms-
> v1
> > camera-v1 video-v1 voice-v1
> >     [caps.params] => caps.jingle_version,caps.audio
> >     [caps.jingle_version] => 0
> >     [caps.audio] => true
> > )
> >
> > Andrew
> >
> >
> > > [...]