Not logged in. · Lost password · Register
Forum: MatriX RSS
Avatar
Zapbbx #1
Member since Jan 2014 · 7 posts
Group memberships: Members
Show profile · Link to this post
Subject: RPC Call
My client wants me to send an RPC request like this:

  1. <iq type=’set’
  2. from=’requester@company.com/jrpc-client’
  3. to=’pbx.api.customer.com’
  4. id=’rpc1’>
  5. <query xmlns=’jabber:iq:rpc’>
  6. <methodCall>
  7. <methodName>pbx.originate</methodName>
  8. <params>
  9. <param>
  10. <value><int>1234</int></value>
  11. </param>
  12. <param>
  13. <value><string>2125551234</string></value>
  14. </param>
  15. </params>
  16. </methodCall>
  17. </query>
  18. </iq>

From my code, my IQ looks like:
  1. <iq id="MX_7" to=’pbx.api.customer.com’ from=’requester@company.com/jrpc-client’ type="set" xmlns="jabber:client">
  2.  <query xmlns="jabber:iq:rpc">
  3.     <methodCall>
  4.       <methodName>pbx.originate</methodName>
  5.       <params>
  6.         <param>
  7.           <value>
  8.             <i4>200</i4>
  9.           </value>
  10.         </param>
  11.         <param>
  12.           <value>
  13.             <string>12125551212</string>
  14.           </value>
  15.         </param>
  16.       </params>
  17.     </methodCall>
  18.  </query>
  19. </iq>

Mine looks identical except for the <i4> vs <int> types.  The call doesn't work, so I can only assume its this.
Whats the difference between <i4> and <int> ?

Also, does just setting the value of the Method Call Invoke it?

iq.Rpc.MethodCall = call;

I don't get a response to sending this ?
This post was edited on 2014-01-25, 11:17 by Alex.
Avatar
Alex #2
Member since Feb 2003 · 4322 posts · Location: Germany
Group memberships: Administrators, Members
Show profile · Link to this post
Quote by Zapbbx:
Mine looks identical except for the <i4> vs <int> types.  The call doesn't work, so I can only assume its this.
Whats the difference between <i4> and <int> ?
see here from our code.
Int32 => i4
int16 => int
  1. else if (param is Int32)
  2. {
  3.    value.AddTag("i4", ((Int32)param).ToString());
  4. }
  5. else if (param is Int16) // code in fault
  6. {
  7.    value.AddTag("int", ((Int16)param).ToString());
  8. }


Quote by Zapbbx:
Also, does just setting the value of the Method Call Invoke it?

iq.Rpc.MethodCall = call;

I don't get a response to sending this ?
don't understand what you mean here, wan you please elaborate?

I suggest sending it either with the TAP pattern (async await in .net4.5) or the IqFilter like described here:
http://www.ag-software.net/matrix-xmpp-sdk/matrix-develope…

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: MatriX RSS