Not logged in. · Lost password · Register
Forum: agsXMPP RSS
Avatar
pestouille #1
Member since Jan 2007 · 7 posts
Group memberships: Members
Show profile · Link to this post
Subject: extension jivesoftware bug ?
Hi,

I'm really new to agsXMPP (started this afternoon) but I find the library very impressive !

I was looking for catching the phone-event from jivesoftware. I look around and found that the approach was almost the same as an example I saw about a weather app on this forum.

Like this :

            if (msg.HasTag(typeof(PhoneEvent)))
            {
                PhoneEvent ph_event = msg.SelectSingleElement(typeof(PhoneEvent)) as PhoneEvent;
                Console.WriteLine("CallerID: "+ ph_event.CallerId);
                Console.WriteLine("Device: " + ph_event.Device);
                Console.WriteLine("Status: " + ph_event.Status);
            }

I renamed the Event class in jivesoftware extension to PhoneEvent and I add "public" before class PhoneEvent.

When I receive a OnMessage event I can get the Device information but the 2 others field are left null, here is the XML output :

RECV: <message xmlns="jabber:client" from="phone.moreax.morea.fr" to="adrien@moreax.morea.fr/MoreaJabber" id="1168827518.31"><phone-event xmlns="http://jivesoftware.com/xmlns/phone" callID="1168827518.31" device="SIP/200" type="RING"><callerID>200</callerID><callerIDName>(Home) Adrien</callerIDName></phone-event></message>
RECV: <message xmlns="jabber:client" from="phone.moreax.morea.fr" to="adrien@moreax.morea.fr/MoreaJabber" id="1168827516.30"><phone-event xmlns="http://jivesoftware.com/xmlns/phone" callID="1168827516.30" device="SIP/200" type="DIALED"><callerID>200</callerID><callerIDName>(Home) Adrien</callerIDName></phone-event></message>
RECV: <message xmlns="jabber:client" from="phone.moreax.morea.fr" to="adrien@moreax.morea.fr/MoreaJabber" id="1168827518.31"><phone-event xmlns="http://jivesoftware.com/xmlns/phone" callID="1168827518.31" device="SIP/200" type="HANG_UP" /></message>
RECV: <message xmlns="jabber:client" from="phone.moreax.morea.fr" to="adrien@moreax.morea.fr/MoreaJabber" id="1168827516.30"><phone-event xmlns="http://jivesoftware.com/xmlns/phone" callID="1168827516.30" device="SIP/200" type="HANG_UP" /></message>


Any help is welcome :)

BTW Happy New Year =)

Regards,

Adrien
Avatar
Alex #2
Member since Feb 2003 · 4317 posts · Location: Germany
Group memberships: Administrators, Members
Show profile · Link to this post
Hello pestouille,

when we implemented the Jive Software extensions the documentation was not complete and inconsistent. And i think it was never updated. I also tried to contact the developers multiple times without success.

We run no Asterisk servers and can't test this extension on our servers. But your XML logfiles are very helpful. In the afternoon i will update the extension and attach the new code to this post.

It would be very helpful if you can get some more XML logs.

Alex
Avatar
Alex #3
Member since Feb 2003 · 4317 posts · Location: Germany
Group memberships: Administrators, Members
Show profile · Link to this post
This is another log which i got a while ago:

  1. <message>
  2.    <phone-event status="RING" device="SIP/6131" id="a7f2ag">
  3.       <callerID>5037061376</callerID>
  4.    </phone-event>
  5. </message>

It looks like JiveSoftware changes it

in the <phone-event/>

Attribute status -> type
Attribute id -> callID

Which version of Wildfire are you running?
Can you make sure that the logs are from the latest version and confirm the changes?

Alex
Avatar
pestouille #4
Member since Jan 2007 · 7 posts
Group memberships: Members
Show profile · Link to this post
In reply to post #2
Hi Alex,

Thank you for your very quick reply :)

Ask me what you need, what kind of XML dump ? another phone-event fired ?

If you modify the code of the jivesoftware extension don't forget the "public" keyword beforce the class Event. If you can rename this class with "PhoneEvent" it would be clearer.

Thank you again.

PS : I forgot, I used the last wildfire server (3.1.1) and a modified asterisk-im plugin (the one available on the official site doesn't work with the latest wildfire version).
If you need more information on how everything works I will be pleased to explain you.

Regards,

Adrien
Avatar
pestouille #5
Member since Jan 2007 · 7 posts
Group memberships: Members
Show profile · Link to this post
Ok I've modified the Event to PhoneEvent like this :

    public class PhoneEvent : Element
    {
        #region << Constructors >>
        public PhoneEvent()
        {
            this.TagName    = "phone-event";
            this.Namespace  = Uri.JIVESOFTWARE_PHONE;
        }

        public PhoneEvent(StatusType status) : this()
        {
            Status = status;
        }

        public PhoneEvent(StatusType status, string device) : this(status)           
        {
            Device = device;
        }

        public PhoneEvent(StatusType status, string device, string id) : this(status, device)
        {
            Id = id;
        }

        public PhoneEvent(StatusType status, string device, string id, string callerId): this(status, device, id)
        {
            CallerId = callerId;
        }       
        #endregion

        public string Id
        {
            get
            {
                return GetAttribute("callID");
            }
            set
            {
                SetAttribute("callID", value);
            }
        }

        public string Device
        {
            get { return GetAttribute("device"); }
            set { SetAttribute("device", value); }
        }

        public StatusType Status
        {
            set
            {
                SetAttribute("type", value.ToString());
            }
            get
            {
                return (StatusType)GetAttributeEnum("type", typeof(StatusType));
            }
        }

        public string CallerId
        {
            set
            {
                SetTag("callerID", value.ToString());
            }
            get
            {
                return GetTag("callerID");
            }
        }
        public string CallerIdName
        {
            set
            {
                SetTag("callerIDName", value.ToString());
            }
            get
            {
                return GetTag("callerIDName");
            }
        }
    }
}

And it works very very well :)

Thanks

Adrien
Avatar
Alex #6
Member since Feb 2003 · 4317 posts · Location: Germany
Group memberships: Administrators, Members
Show profile · Link to this post
This looks similar to my changes ;-)
I will upload my changes to SVN now.

can you post a link to the modified working plugin version?

Alex
Avatar
Alex #7
Member since Feb 2003 · 4317 posts · Location: Germany
Group memberships: Administrators, Members
Show profile · Link to this post
code is in SVN now.

There should be also <phone-status/> and <phone-action/>.
If you can get some XML dump from them i can check if they are ok or need aslo some fixes.

Alex
Avatar
pestouille #8
Member since Jan 2007 · 7 posts
Group memberships: Members
Show profile · Link to this post
In reply to post #6
Yes sure.

Found at http://www.couplet.be/temp/status_fix/asterisk-im.jar

from Ignite Realtime forums (jivesoftware)

I will send you more xml as my test go on.

See you soon.

Adrien
This post was edited on 2013-03-06, 18:59 by Alex.
Avatar
Alex #9
Member since Feb 2003 · 4317 posts · Location: Germany
Group memberships: Administrators, Members
Show profile · Link to this post
Thanks for the links.
Did the latest SVN code work for you?

Alex
Avatar
pestouille #10
Member since Jan 2007 · 7 posts
Group memberships: Members
Show profile · Link to this post
In reply to post #1
Some things seem to have changed from my downloaded version and the trunk one, my MiniClient doesn't compil now :

XmppCon.OnPresence            += new agsXMPP.XmppClientConnection.PresenceHandler(XmppCon_OnPresence);
XmppCon.OnMessage            += new agsXMPP.XmppClientConnection.MessageHandler(XmppCon_OnMessage);

XmppCon.OnIq                += new StreamHandler(XmppCon_OnIq);

XmppCon.OnAuthError            += new OnXmppErrorHandler(XmppCon_OnAuthError);
XmppCon.OnXmppConnectionStateChanged        += new agsXMPP.XmppClientConnection.XmppConnectionStateHandler(XmppCon_OnXmppConnectionStateChanged);
 ByteStreamCon.OnXmppConnectionStateChanged += new agsXMPP.XmppClientConnection.XmppConnectionStateHandler(XmppCon_OnXmppConnectionStateChanged);


BeginInvoke(new OnXmppErrorHandler(XmppCon_OnAuthError), new object[]{sender, e});


Error    1    The type name 'PresenceHandler' does not exist in the type 'agsXMPP.XmppClientConnection'    C:\Documents and Settings\Adrien\Mes documents\agsxmpp\samples\VS2005\MiniClient\frmMain.cs    133    64    MiniClient
Error    2    The type name 'MessageHandler' does not exist in the type 'agsXMPP.XmppClientConnection'    C:\Documents and Settings\Adrien\Mes documents\agsxmpp\samples\VS2005\MiniClient\frmMain.cs    134    63    MiniClient
Error    3    Cannot implicitly convert type 'agsXMPP.Xml.StreamHandler' to 'agsXMPP.protocol.client.IqHandler'    C:\Documents and Settings\Adrien\Mes documents\agsxmpp\samples\VS2005\MiniClient\frmMain.cs    135    44    MiniClient
Error    4    The type or namespace name 'OnXmppErrorHandler' could not be found (are you missing a using directive or an assembly reference?)    C:\Documents and Settings\Adrien\Mes documents\agsxmpp\samples\VS2005\MiniClient\frmMain.cs    136    36    MiniClient
Error    5    The type name 'XmppConnectionStateHandler' does not exist in the type 'agsXMPP.XmppClientConnection'    C:\Documents and Settings\Adrien\Mes documents\agsxmpp\samples\VS2005\MiniClient\frmMain.cs    144    78    MiniClient
Error    6    The type name 'XmppConnectionStateHandler' does not exist in the type 'agsXMPP.XmppClientConnection'    C:\Documents and Settings\Adrien\Mes documents\agsxmpp\samples\VS2005\MiniClient\frmMain.cs    146    92    MiniClient
Error    7    The type or namespace name 'OnXmppErrorHandler' could not be found (are you missing a using directive or an assembly reference?)    C:\Documents and Settings\Adrien\Mes documents\agsxmpp\samples\VS2005\MiniClient\frmMain.cs    779    21    MiniClient
Error    8    The best overloaded method match for 'System.Windows.Forms.Control.BeginInvoke(System.Delegate, params object[])' has some invalid arguments    C:\Documents and Settings\Adrien\Mes documents\agsxmpp\samples\VS2005\MiniClient\frmMain.cs    779    5    MiniClient
Error    9    Argument '1': cannot convert from 'OnXmppErrorHandler' to 'System.Delegate'    C:\Documents and Settings\Adrien\Mes documents\agsxmpp\samples\VS2005\MiniClient\frmMain.cs    779    17    MiniClient


Adrien

PS : the key.snk is missing in the svn trunk directory of agsxmpp.ui (I needed to get it back from the downloaded version)
Avatar
Alex #11
Member since Feb 2003 · 4317 posts · Location: Germany
Group memberships: Administrators, Members
Show profile · Link to this post
Hello Adrien,

yes we refactored some handlers. You will find them in other namespaces now. We moved them to:
agsXMPP.protocol.client, agsXMPP.protocol.server, agsXMPP.protocol.component.

I will checkin the missing key.

Alex
Avatar
pestouille #12
Member since Jan 2007 · 7 posts
Group memberships: Members
Show profile · Link to this post
Ok everything is fine.

Handler were found under agsXMPP.protocol.client namespace.

Your modifications for jivesoftware extensions work well. I've not tried the PhoneAction yet but I will tell you if it works later.

Thanks
Avatar
Alex #13
Member since Feb 2003 · 4317 posts · Location: Germany
Group memberships: Administrators, Members
Show profile · Link to this post
normally we don't make such changes.

But we are very close to release 1.0 now. The complete XMPP core is fully supported now, and most items on our TODO list for 1.0 are done. So it was time to make this interface changes.

Alex
Avatar
pestouille #14
Member since Jan 2007 · 7 posts
Group memberships: Members
Show profile · Link to this post
Subject: presence status updated
Hi Alex,

You asked me to give you more xml dump with the use of the jivesoftware extensions. Below you will find a xml dump of a presence status updated by jivesoftware :

  1. <presence xmlns="jabber:client" from="olivier@moreax.morea.fr/WengoPhone" to="adrien@moreax.morea.fr/MoreaJabber">
  2.    <show>away</show>
  3.    <status>On the phone</status>
  4.    <phone-status xmlns="http://jivesoftware.com/xmlns/phone" status="ON_PHONE" />
  5. </presence>

I've not look yet at the library to see if this kind of special presence status is carried.

Regards,

--
Adrien
This post was edited on 2013-03-06, 19:00 by Alex.
Avatar
Alex #15
Member since Feb 2003 · 4317 posts · Location: Germany
Group memberships: Administrators, Members
Show profile · Link to this post
Thanks, this looks OK.
You can read the phone status in the presence with the PhoneStatus class.

Alex
Close Smaller – Larger + Reply to this post:
Verification code: VeriCode Please enter the word from the image into the text field below. (Type the letters only, lower case is okay.)
Smileys: :-) ;-) :-D :-p :blush: :cool: :rolleyes: :huh: :-/ <_< :-( :'( :#: :scared: 8-( :nuts: :-O
Special characters:
Forum: agsXMPP RSS