Not logged in. · Lost password · Register
Forum: MatriX RSS
I'm filling the all room configuration form but still presistent room is not creating, what is wrong in my code?
Avatar
aliviretechnologies2 #1
Member since Aug 2013 · 4 posts
Group memberships: Members
Show profile · Link to this post
Subject: Presistent Chat Room is not creating
  1. <presence to=\"groupa@conference.vtalk.viretechnologies.com/+1888\" xmlns=\"jabber:client\">
  2.  <x xmlns=\"http://jabber.org/protocol/muc\" />
  3.  <x xmlns=\"vcard-temp:x:update\">
  4.     <photo>+gmkzGaajv8xZbqNhKoX9JGTVJk=</photo>
  5.  </x>
  6. </presence>
  7. <iq id=\"MX_4\" type=\"set\" to=\"groupa@conference.vtalk.viretechnologies.com\" xmlns=\"jabber:client\">
  8.  <query xmlns=\"http://jabber.org/protocol/muc#owner\">
  9.     <x xmlns=\"jabber:x:data\">
  10.       <field type=\"hidden\" var=\"FORM_TYPE\">http://jabber.org/protocol/muc#roomconfig</field>
  11.       <field type=\"text-single\" var=\"muc#roomconfig_roomname\">A Dark Cave</field>
  12.       <field type=\"text-single\" var=\"muc#roomconfig_roomdesc\">The place for all good witches!</field>
  13.       <field type=\"boolean\" var=\"muc#roomconfig_enablelogging\">0</field>
  14.       <field type=\"boolean\" var=\"muc#roomconfig_changesubject\">1</field>
  15.       <field type=\"boolean\" var=\"muc#roomconfig_allowinvites\">0</field>
  16.       <field type=\"list-single\" var=\"muc#roomconfig_allowpm\">anyone</field>
  17.       <field type=\"list-single\" var=\"muc#roomconfig_maxusers\">25</field>
  18.       <field type=\"boolean\" var=\"muc#roomconfig_publicroom\">0</field>
  19.      <field type=\"boolean\" var=\"muc#roomconfig_persistentroom\">0</field>
  20.       <field type=\"boolean\" var=\"muc#roomconfig_moderatedroom\">0</field>
  21.       <field type=\"boolean\" var=\"muc#roomconfig_membersonly\">0</field>
  22.       <field type=\"boolean\" var=\"muc#roomconfig_passwordprotectedroom\">0</field>
  23.       <field type=\"text-private\" var=\"'muc#roomconfig_roomsecret\"></field>  
  24.       <field type=\"list-single\" var=\"muc#roomconfig_whois\">moderators</field>
  25.       <field type=\"text-single\" var=\"muc#maxhistoryfetch\">50</field>
  26.       <field type=\"jid-multi\" var=\"muc#roomconfig_roomadmins\">+1888@vtalk.viretechnologies.com</field>
  27.     </x>
  28.  </query>
  29. </iq>
  30. <message to=\"groupa@conference.vtalk.viretechnologies.com\" xmlns=\"jabber:client\">
  31.  <x xmlns=\"http://jabber.org/protocol/muc#user\">
  32.     <invite to=\"+13434822866@vtalk.viretechnologies.com\">
  33.       <reason>want to chat</reason>
  34.     </invite>
  35.  </x>
  36. </message>
  37. <presence to=\"+1888@vtalk.viretechnologies.com/Matrix-Windows-Phone\" from=\"groupa@conference.vtalk.viretechnologies.com/+1888\" xmlns=\"jabber:client\">
  38.  <x xmlns=\"vcard-temp:x:update\">
  39.     <photo>+gmkzGaajv8xZbqNhKoX9JGTVJk=</photo>
  40.  </x>
  41.  <x xmlns=\"http://jabber.org/protocol/muc#user\">
  42.     <item jid=\"+1888@vtalk.viretechnologies.com/Matrix-Windows-Phone\" affiliation=\"owner\" role=\"moderator\" />
  43.    <status code=\"201\" />
  44.  </x>
  45. </presence>
  46. <iq id=\"MX_5\" to=\"groupa@conference.vtalk.viretechnologies.com\" type=\"get\" xmlns=\"jabber:client\">
  47.  <vCard xmlns=\"vcard-temp\" />
  48. </iq>
  49. <iq id=\"MX_6\" type=\"set\" to=\"groupa@conference.vtalk.viretechnologies.com/+1888\" xmlns=\"jabber:client\">
  50.  <query xmlns=\"http://jabber.org/protocol/muc#owner\">
  51.     <x type=\"submit\" xmlns=\"jabber:x:data\" />
  52.  </query>
  53. </iq>
  54. <message type=\"groupchat\" from=\"groupa@conference.vtalk.viretechnologies.com\" to=\"+1888@vtalk.viretechnologies.com/Matrix-Windows-Phone\" xmlns=\"jabber:client\">
  55.  <body>This room is locked from entry until configuration is confirmed.</body>
  56. </message>
  57. <iq type=\"error\" id=\"MX_4\" from=\"groupa@conference.vtalk.viretechnologies.com\" to=\"+1888@vtalk.viretechnologies.com/Matrix-Windows-Phone\" xmlns=\"jabber:client\">
  58.  <query xmlns=\"http://jabber.org/protocol/muc#owner\">
  59.     <x xmlns=\"jabber:x:data\">
  60.       <field type=\"hidden\" var=\"FORM_TYPE\">http://jabber.org/protocol/muc#roomconfig</field>
  61.       <field type=\"text-single\" var=\"muc#roomconfig_roomname\">A Dark Cave</field>
  62.       <field type=\"text-single\" var=\"muc#roomconfig_roomdesc\">The place for all good witches!</field>
  63.       <field type=\"boolean\" var=\"muc#roomconfig_enablelogging\">0</field>
  64.       <field type=\"boolean\" var=\"muc#roomconfig_changesubject\">1</field>
  65.       <field type=\"boolean\" var=\"muc#roomconfig_allowinvites\">0</field>
  66.       <field type=\"list-single\" var=\"muc#roomconfig_allowpm\">anyone</field>
  67.       <field type=\"list-single\" var=\"muc#roomconfig_maxusers\">25</field>
  68.       <field type=\"boolean\" var=\"muc#roomconfig_publicroom\">0</field>
  69.       <field type=\"boolean\" var=\"muc#roomconfig_persistentroom\">0</field>
  70.      <field type=\"boolean\" var=\"muc#roomconfig_moderatedroom\">0</field>
  71.       <field type=\"boolean\" var=\"muc#roomconfig_membersonly\">0</field>
  72.      <field type=\"boolean\" var=\"muc#roomconfig_passwordprotectedroom\">0</field>
  73.       <field type=\"text-private\" var=\"'muc#roomconfig_roomsecret\" />
  74.       <field type=\"list-single\" var=\"muc#roomconfig_whois\">moderators</field>
  75.       <field type=\"text-single\" var=\"muc#maxhistoryfetch\">50</field>
  76.       <field type=\"jid-multi\" var=\"muc#roomconfig_roomadmins\">+1888@vtalk.viretechnologies.com</field>
  77.    </x>
  78.  </query>\r\n  <error code=\"500\" type=\"wait\">
  79.     <internal-server-error xmlns=\"urn:ietf:params:xml:ns:xmpp-stanzas\" />
  80.  </error>
  81. </iq>
Following is my code:

  1. Utility.mucManager = new MucManager(Utility.xmppClient);
  2. string roomId = txtgroupname.Text + "@conference." + Utility.Domain; //id is dynamic
  3. Jid m_RoomJid = new Jid(roomId);
  4. Utility.mucManager.EnterRoom(m_RoomJid, Utility.xmppClient.Username);
  5. Field f_form = new Field(FieldType.Hidden);
  6. f_form.Var = "FORM_TYPE";
  7. f_form.Value = "http://jabber.org/protocol/muc#roomconfig";
  8. Field f_roomname = new Field(FieldType.Text_Single);
  9. f_roomname.Var = "muc#roomconfig_roomname";
  10. f_roomname.Value = "A Dark Cave";
  11. Field f_roomdesc = new Field(FieldType.Text_Single);
  12. f_roomdesc.Var = "muc#roomconfig_roomdesc";
  13. f_roomdesc.Value = "The place for all good witches!";
  14. Field f_enablelogging = new Field(FieldType.Boolean);
  15. f_enablelogging.Var = "muc#roomconfig_enablelogging";
  16. f_enablelogging.Value = "0";
  17. Field f_changesubject = new Field(FieldType.Boolean);
  18. f_changesubject.Var = "muc#roomconfig_changesubject";
  19. f_changesubject.Value = "1";
  20. Field f_allowinvites = new Field(FieldType.Boolean);
  21. f_allowinvites.Var = "muc#roomconfig_allowinvites";
  22. f_allowinvites.Value = "0";
  23. Field f_allowpm = new Field(FieldType.List_Single);
  24. f_allowpm.Var = "muc#roomconfig_allowpm";
  25. f_allowpm.Value = "anyone";              
  26. Field f_maxusers = new Field(FieldType.List_Single);
  27. f_maxusers.Var = "muc#roomconfig_maxusers";
  28. f_maxusers.Value = "25";
  29. Field f_publicroom = new Field(FieldType.Boolean);
  30. f_publicroom.Var = "muc#roomconfig_publicroom";
  31. f_publicroom.Value = "0";
  32. Field f_persistentroom = new Field(FieldType.Boolean);
  33. f_persistentroom.Var = "muc#roomconfig_persistentroom";
  34. f_persistentroom.Value = "0";                      
  35. Field f_moderatedroom = new Field(FieldType.Boolean);
  36. f_moderatedroom.Var = "muc#roomconfig_moderatedroom";
  37. f_moderatedroom.Value = "0";                    
  38. Field f_memberonly = new Field(FieldType.Boolean);
  39. f_memberonly.Var = "muc#roomconfig_membersonly";
  40. f_memberonly.Value = "0";
  41. Field f_passwordprotectedroom = new Field(FieldType.Boolean);
  42. f_passwordprotectedroom.Var = "muc#roomconfig_passwordprotectedroom";
  43. f_passwordprotectedroom.Value = "0";
  44. Field f_roomsecret = new Field(FieldType.Text_Private);
  45. f_roomsecret.Var = "'muc#roomconfig_roomsecret";
  46. f_roomsecret.Value = "";                      
  47. Field f_whois = new Field(FieldType.List_Single);
  48. f_whois.Var = "muc#roomconfig_whois";
  49. f_whois.Value = "moderators";
  50. Field f_maxhistoryfetech = new Field(FieldType.Text_Single);
  51. f_maxhistoryfetech.Var = "muc#maxhistoryfetch";
  52. f_maxhistoryfetech.Value = "50";
  53. Field f_roomadmins = new Field(FieldType.Jid_Multi);
  54. f_roomadmins.Var = "muc#roomconfig_roomadmins";
  55. f_roomadmins.Value = Utility.xmppClient.Username+"@"+Utility.Domain;
  56. Data data = new Data();
  57. data.Add(f_form);
  58. data.Add(f_roomname);
  59. data.Add(f_roomdesc);
  60. data.Add(f_enablelogging);
  61. data.Add(f_changesubject);
  62. data.Add(f_allowinvites);
  63. data.Add(f_allowpm);
  64. data.Add(f_maxusers);
  65. data.Add(f_publicroom);
  66. data.Add(f_persistentroom);
  67. data.Add(f_moderatedroom);
  68. data.Add(f_memberonly);
  69. data.Add(f_passwordprotectedroom);
  70. data.Add(f_roomsecret);
This post was edited 2 times, last on 2018-06-01, 13:24 by Alex.
Avatar
Alex #2
Member since Feb 2003 · 4308 posts · Location: Germany
Group memberships: Administrators, Members
Show profile · Link to this post
the server replies to your config with an error.

  1. <iq type=\"error\" id=\"MX_4\" from=\"groupa@conference.vtalk.viretechnologies.com\" to=\"+1888@vtalk.viretechnologies.com/Matrix-Windows-Phone\" xmlns=\"jabber:client\">
  2.  <query xmlns=\"http://jabber.org/protocol/muc#owner\">
  3.     <x xmlns=\"jabber:x:data\">
  4.       <!-- snip -->
  5.    </x>
  6.  </query>
  7.  <error code=\"500\" type=\"wait\">
  8.     <internal-server-error xmlns=\"urn:ietf:params:xml:ns:xmpp-stanzas\" />
  9.  </error>
  10. </iq>

You don't set the type to submit in your form when you transmit it, this is probably the reason.

It must look like:
  1. <x xmlns="jabber:x:data" type="submit">
  2.    <!-- snip -->
  3. </x>

Alex
Avatar
aliviretechnologies2 #3
Member since Aug 2013 · 4 posts
Group memberships: Members
Show profile · Link to this post
I'm Using this following function in add group, IqTpe does not contains type submit, how can i set type submit.

  1. var oiq = new OwnerIq { Type = IqType.set, To = m_RoomJid };
  2. oiq.Query.Add(data);
  3. Utility.xmppClient.IqFilter.SendIq(oiq,OnRoomConfigResult);



OnPresence Event:
  1.  var xUser = pres.MucUser;
  2.                     if (xUser != null)
  3.                     {
  4.                         if (xUser.HasStatus(110))
  5.                         {
  6.  
  7.                         }
  8.  
  9.                         if (xUser.HasStatus(201))
  10.                         {
  11.                             // 201, Inform user that a new room has been created
  12.                                Utility.mucManager.RequestInstantRoom(e.Presence.From, InstantRoomResult);
  13.                         }
  14.                     }
This post was edited on 2018-06-01, 13:25 by Alex.
Avatar
Alex #4
Member since Feb 2003 · 4308 posts · Location: Germany
Group memberships: Administrators, Members
Show profile · Link to this post
the type is missing on your data form, not on your MUC presence.

Use:
  1. data.Type = FormType.submit;

Alex
Avatar
aliviretechnologies2 #5
Member since Aug 2013 · 4 posts
Group memberships: Members
Show profile · Link to this post
hi, alex,

Persistent Room is creating successfully now, but it is returning a 400 error, and also room configuration settings is also not saving.

i saw from http://xmpp.org/extensions/xep-0045.html that field value are saving like

  1. <field var='muc#roomconfig_roomname'>
  2.         <value>A Dark Cave</value>
  3. </field>

 and i'm saving like 
  1. <field type=\"hidden\" var=\"FORM_TYPE\">http://jabber.org/protocol/muc#roomconfig</field>

is this thing is producing error ?


  1. <iq id=\"MX_4\" type=\"set\" to=\"new group@conference.vtalk.viretechnologies.com\" xmlns=\"jabber:client\">
  2.  <query xmlns=\"http://jabber.org/protocol/muc#owner\">
  3.     <x type=\"submit\" xmlns=\"jabber:x:data\">
  4.       <field type=\"hidden\" var=\"FORM_TYPE\">http://jabber.org/protocol/muc#roomconfig</field>
  5.       <field type=\"text-single\" var=\"muc#roomconfig_roomname\">A Dark Cave</field>
  6.       <field type=\"text-single\" var=\"muc#roomconfig_roomdesc\">The place for all good witches!</field>
  7.       <field type=\"boolean\" var=\"muc#roomconfig_enablelogging\">0</field>
  8.      <field type=\"boolean\" var=\"muc#roomconfig_changesubject\">1</field>
  9.       <field type=\"boolean\" var=\"muc#roomconfig_allowinvites\">0</field>
  10.       <field type=\"list-single\" var=\"muc#roomconfig_allowpm\">anyone</field>
  11.       <field type=\"list-single\" var=\"muc#roomconfig_maxusers\">25</field>
  12.       <field type=\"boolean\" var=\"muc#roomconfig_publicroom\">0</field>
  13.       <field type=\"boolean\" var=\"muc#roomconfig_persistentroom\">0</field>
  14.       <field type=\"boolean\" var=\"muc#roomconfig_moderatedroom\">0</field>
  15.       <field type=\"boolean\" var=\"muc#roomconfig_membersonly\">0</field>
  16.       <field type=\"boolean\" var=\"muc#roomconfig_passwordprotectedroom\">0</field>
  17.       <field type=\"text-private\" var=\"'muc#roomconfig_roomsecret\"></field>
  18.       <field type=\"list-single\" var=\"muc#roomconfig_whois\">moderators</field>
  19.       <field type=\"text-single\" var=\"muc#maxhistoryfetch\">50</field>
  20.       <field type=\"jid-multi\" var=\"muc#roomconfig_roomadmins\">+1888@vtalk.viretechnologies.com</field>
  21.     </x>
  22.  </query>
  23. </iq>
  24.  
  25. <message to=\"new group@conference.vtalk.viretechnologies.com\" xmlns=\"jabber:client\">\r\n  <x xmlns=\"http://jabber.org/protocol/muc#user\">\r\n    <invite to=\"+13434822866@vtalk.viretechnologies.com\">
  26.       <reason>want to chat</reason>
  27.     </invite>
  28.  </x>
  29. </message>
  30. <presence to=\"+1888@vtalk.viretechnologies.com/Matrix-Windows-Phone\" from=\"new group@conference.vtalk.viretechnologies.com/+1888\" type=\"error\" xmlns=\"jabber:client\">
  31.  <error code=\"400\" type=\"modify\">
  32.     <jid-malformed xmlns=\"urn:ietf:params:xml:ns:xmpp-stanzas\" />
  33.  </error>
  34. </presence>
  35.  
  36. <iq type=\"error\" id=\"MX_4\" to=\"+1888@vtalk.viretechnologies.com/Matrix-Windows-Phone\" from=\"new group@conference.vtalk.viretechnologies.com\" xmlns=\"jabber:client\">
  37.  <query xmlns=\"http://jabber.org/protocol/muc#owner\">
  38.     <x xmlns=\"jabber:x:data\" type=\"submit\">
  39.       <field type=\"hidden\" var=\"FORM_TYPE\">http://jabber.org/protocol/muc#roomconfig</field>
  40.       <field type=\"text-single\" var=\"muc#roomconfig_roomname\">A Dark Cave</field>
  41.       <field type=\"text-single\" var=\"muc#roomconfig_roomdesc\">The place for all good witches!</field>
  42.       <field type=\"boolean\" var=\"muc#roomconfig_enablelogging\">0</field>
  43.       <field type=\"boolean\" var=\"muc#roomconfig_changesubject\">1</field>
  44.       <field type=\"boolean\" var=\"muc#roomconfig_allowinvites\">0</field>
  45.       <field type=\"list-single\" var=\"muc#roomconfig_allowpm\">anyone</field>
  46.       <field type=\"list-single\" var=\"muc#roomconfig_maxusers\">25</field>
  47.       <field type=\"boolean\" var=\"muc#roomconfig_publicroom\">0</field>
  48.       <field type=\"boolean\" var=\"muc#roomconfig_persistentroom\">0</field>
  49.       <field type=\"boolean\" var=\"muc#roomconfig_moderatedroom\">0</field>
  50.       <field type=\"boolean\" var=\"muc#roomconfig_membersonly\">0</field>
  51.      <field type=\"boolean\" var=\"muc#roomconfig_passwordprotectedroom\">0</field>
  52.      <field type=\"text-private\" var=\"'muc#roomconfig_roomsecret\" />
  53.       <field type=\"list-single\" var=\"muc#roomconfig_whois\">moderators</field>
  54.       <field type=\"text-single\" var=\"muc#maxhistoryfetch\">50</field>
  55.      <field type=\"jid-multi\" var=\"muc#roomconfig_roomadmins\">+1888@vtalk.viretechnologies.com</field>
  56.    </x>
  57.  </query>
  58.  <error code=\"400\" type=\"modify\">
  59.     <jid-malformed xmlns=\"urn:ietf:params:xml:ns:xmpp-stanzas\" />
  60.  </error>
  61. </iq>
  62.  
  63. <message to=\"+1888@vtalk.viretechnologies.com/Matrix-Windows-Phone\" from=\"new group@conference.vtalk.viretechnologies.com\" type=\"error\" xmlns=\"jabber:client\">
  64.  <error code=\"400\" type=\"modify\">
  65.     <jid-malformed xmlns=\"urn:ietf:params:xml:ns:xmpp-stanzas\" />
  66.  </error>
  67. </message>
This post was edited 2 times, last on 2018-06-01, 13:26 by Alex.
Avatar
Alex #6
Member since Feb 2003 · 4308 posts · Location: Germany
Group memberships: Administrators, Members
Show profile · Link to this post
"new group@conference.vtalk.viretechnologies.com" is not a valid jid. A Jid is not allowed to contain a space character. Please change this.

Alex
Avatar
aliviretechnologies2 #7
Member since Aug 2013 · 4 posts
Group memberships: Members
Show profile · Link to this post
hi alex,

My group is creating successfully with no error, but the default values that em setting is not showing, it is actually showing Openfire default values. and the second thing that I noticed is that in room list group name is showing with "()" parenthesis like (group1)
Avatar
Alex #8
Member since Feb 2003 · 4308 posts · Location: Germany
Group memberships: Administrators, Members
Show profile · Link to this post
you have to ask the Openfire developers if they put the group name in brackets. MatriX does not add them.
When you post your complete Xml log then I check if everything is fine.
You can also try to request the configuration again after you submitted it, then you can check if Openfire accepted all your values or not.
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: MatriX RSS