[Serusers] xmlrpc calls

zkeatts zkeatts at nuvio.com
Mon Aug 15 17:06:23 CEST 2005


 Thank you for your explanation, it has really cleared up a lot of my questions.  
I am confused on one point, where you said "location" should be the value that I am
using.  Are there a set number or only a specific few tables that will be accepted by
this call?  When I use location I get the XML reply

<value><string>AOR Not Found</string></value>

which is expected, because my "location" table is empty.  When I switch "subscriber" 
for "location" I get the following reply

<value><string>Table Not Found</string></value>

That is perplexing since we both know that suscbribers is there.  Looking at the library itself 
I have been able to determine that I will get this sort of reply when the system cannot
find the domain.

ul_rpc.c (lines 374 - 403)

  rpc_find_domain(&t, &d);
  if (d) {
  }else {
     rpc->fault(400, "Table Not Found");

Why does the system find a domain for "location" but not for "subscriber"? E

Thank you for your patience so far,

Zach Keatts
Software Engineer

Jan Janak wrote:

>The function expects two parameters, the first one is the name of the
>table ("location" in your case) and the 2nd parameter is AOR (Address Of
>Record), the XML-RPC request should look like this:
><?xml version=\"1.0\"?>
>  <value><string>location</string></value>
>  <value><string>jan at iptel.org</string></value>
>Here is how you could find out what parameters does the function expect:
>Open ul_rpc.c and lookup function rpc_show_contacts.
>The function contains the following code at the beginning:
>if (rpc->scan("SS", &t, &aor) < 0) return;
>Function scan reads and parses the parameters. In this particular example
>you can see that the function expects two string parameters (hence
>double S in the formatting string) and from the name of the variables
>you could guess that the first one is the table name (well, t is not
>very descriptive, I admit), and the 2nd one is AOR.
>  Jan.
>On 09-08-2005 12:03, zkeatts wrote:
>>I am currently trying to do an xml-rpc call to usrloc.show_contacts.  
>>The xml packet I am sending is the following
>>User-Agent: Radio UserLand/7.1b7 (WinNT)
>>Host: localhost:5060
>>Content-Type: text/xml
>>Content-length: 131
>><?xml version=\"1.0\"?>
>>As a return packet I am getting
>>HTTP/1.0 200 OK
>>Via: SIP/2.0/UDP
>>Server: Sip EXpress router (0.10.99-janakj_experimental (i386/linux))
>>Content-Length: 303
>>Warning: 392 "Noisy feedback tells:  pid=5820 
>>req_src_ip= req_src_port=32769 in_uri=/RPC2 out_uri=/RPC2 
>><?xml version="1.0" encoding="UTF-8"?>
>><value><string>More Parameters Expected</string></value></member>
>>This tells me that I am not entering the correct information, but I am 
>>at a loss to exactly what else I should be inserting.
>>I did a search for rpc_show_contacts and found in 
>>static void rpc_show_contacts(rpc_t* rpc)
>>After searching some more I could not find the rpc_t structure.  Does 
>>anyone know what values I should be passing via XML?
>>Zach Keatts
>>Software Engineer
>>Serusers mailing list
>>serusers at lists.iptel.org

More information about the sr-users mailing list