I am currently trying to do an xml-rpc call to usrloc.show_contacts. The xml packet I am sending is the following
POST /RPC2 HTTP/1.0 User-Agent: Radio UserLand/7.1b7 (WinNT) Host: localhost:5060 Content-Type: text/xml Content-length: 131
<?xml version=\"1.0\"?> <methodCall> <methodName>usrloc.show_contacts</methodName> <params> </params> </methodCall>
As a return packet I am getting
HTTP/1.0 200 OK Via: SIP/2.0/UDP 127.0.0.1:32769 Server: Sip EXpress router (0.10.99-janakj_experimental (i386/linux)) Content-Length: 303 Warning: 392 127.0.0.1:5060 "Noisy feedback tells: pid=5820 req_src_ip=127.0.0.1 req_src_port=32769 in_uri=/RPC2 out_uri=/RPC2 via_cnt==1"
<?xml version="1.0" encoding="UTF-8"?> <methodResponse> <fault> <value><struct> <member><name>faultCode</name> <value><i4>400</i4></value></member> <member><name>faultString</name> <value><string>More Parameters Expected</string></value></member> </struct></value> </fault> </methodResponse>
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 ./sip_router/modules/usrloc/ul_rpc.c
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?
Thanks,
Zach Keatts Software Engineer Nuvio.com
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\"?> <methodCall> <methodName>usrloc.show_contacts</methodName> <params> <param> <value><string>location</string></value> </param> <param> <value><string>jan@iptel.org</string></value> </param> </params> </methodCall>
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
POST /RPC2 HTTP/1.0 User-Agent: Radio UserLand/7.1b7 (WinNT) Host: localhost:5060 Content-Type: text/xml Content-length: 131
<?xml version=\"1.0\"?>
<methodCall> <methodName>usrloc.show_contacts</methodName> <params> </params> </methodCall>
As a return packet I am getting
HTTP/1.0 200 OK Via: SIP/2.0/UDP 127.0.0.1:32769 Server: Sip EXpress router (0.10.99-janakj_experimental (i386/linux)) Content-Length: 303 Warning: 392 127.0.0.1:5060 "Noisy feedback tells: pid=5820 req_src_ip=127.0.0.1 req_src_port=32769 in_uri=/RPC2 out_uri=/RPC2 via_cnt==1"
<?xml version="1.0" encoding="UTF-8"?>
<methodResponse> <fault> <value><struct> <member><name>faultCode</name> <value><i4>400</i4></value></member> <member><name>faultString</name> <value><string>More Parameters Expected</string></value></member> </struct></value> </fault> </methodResponse>
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 ./sip_router/modules/usrloc/ul_rpc.c
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?
Thanks,
Zach Keatts Software Engineer Nuvio.com
Serusers mailing list serusers@lists.iptel.org http://lists.iptel.org/mailman/listinfo/serusers
Jan,
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 Nuvio.com
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\"?>
<methodCall> <methodName>usrloc.show_contacts</methodName> <params> <param> <value><string>location</string></value> </param> <param> <value><string>jan@iptel.org</string></value> </param> </params> </methodCall>
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
POST /RPC2 HTTP/1.0 User-Agent: Radio UserLand/7.1b7 (WinNT) Host: localhost:5060 Content-Type: text/xml Content-length: 131
<?xml version=\"1.0\"?>
<methodCall> <methodName>usrloc.show_contacts</methodName> <params> </params> </methodCall>
As a return packet I am getting
HTTP/1.0 200 OK Via: SIP/2.0/UDP 127.0.0.1:32769 Server: Sip EXpress router (0.10.99-janakj_experimental (i386/linux)) Content-Length: 303 Warning: 392 127.0.0.1:5060 "Noisy feedback tells: pid=5820 req_src_ip=127.0.0.1 req_src_port=32769 in_uri=/RPC2 out_uri=/RPC2 via_cnt==1"
<?xml version="1.0" encoding="UTF-8"?>
<methodResponse> <fault> <value><struct> <member><name>faultCode</name> <value><i4>400</i4></value></member> <member><name>faultString</name> <value><string>More Parameters Expected</string></value></member> </struct></value> </fault> </methodResponse>
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 ./sip_router/modules/usrloc/ul_rpc.c
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?
Thanks,
Zach Keatts Software Engineer Nuvio.com
Serusers mailing list serusers@lists.iptel.org http://lists.iptel.org/mailman/listinfo/serusers
I think I have figured out why it would only accept location or aliases as a valid table. Doing a userloc.statistics returns to me those two specific table names listed as a member of domain. Is it possible to add other tables under the accepted domain structure?
As for show_contacts I have run several more tests, but I still have not managed to get anything other than errors. I have manually added an entry into locations with the following data
+-----------+--------+-------------------------+----------+---------------------+-------+-------------------------------------+------+---------------------+-----------+-------+-------+---------------------------------------+ | username | domain | contact | received | expires | q | callid | cseq | last_modified | replicate | state | flags | user_agent | +-----------+--------+-------------------------+----------+---------------------+-------+-------------------------------------+------+---------------------+-----------+-------+-------+---------------------------------------+ | 271nv1001 | | sip:271nv1001@localhost | NULL | 2020-05-28 21:32:15 | -1.00 | 3653736-e3498618-a7aa0347@localhost | 42 | 2005-08-15 16:07:31 | 0 | 0 | 0 | PolycomSoundPointIP-SPIP_500-UA/1.4.1 | +-----------+--------+-------------------------+----------+---------------------+-------+-------------------------------------+------+---------------------+-----------+-------+-------+---------------------------------------+
I still get an AOR error when I try the following AOR's in my XML query.
<value><string>271nv1001</string></value> <value><string>271nv1001@localhost</string></value> <value><string>sip:271nv1001@localhost</string></value> <value><string>3653736-e3498618-a7aa0347@localhost</string>
Those seem to be the only logical choices for the AOR. Why would it still be returning an AOR not found?
Thanks,
Zach Keatts Software Engineer Nuvio.com
zkeatts wrote:
Jan,
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 Nuvio.com
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\"?>
<methodCall> <methodName>usrloc.show_contacts</methodName> <params> <param> <value><string>location</string></value> </param> <param> <value><string>jan@iptel.org</string></value> </param> </params> </methodCall>
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
POST /RPC2 HTTP/1.0 User-Agent: Radio UserLand/7.1b7 (WinNT) Host: localhost:5060 Content-Type: text/xml Content-length: 131
<?xml version=\"1.0\"?>
<methodCall> <methodName>usrloc.show_contacts</methodName> <params> </params> </methodCall>
As a return packet I am getting
HTTP/1.0 200 OK Via: SIP/2.0/UDP 127.0.0.1:32769 Server: Sip EXpress router (0.10.99-janakj_experimental (i386/linux)) Content-Length: 303 Warning: 392 127.0.0.1:5060 "Noisy feedback tells: pid=5820 req_src_ip=127.0.0.1 req_src_port=32769 in_uri=/RPC2 out_uri=/RPC2 via_cnt==1"
<?xml version="1.0" encoding="UTF-8"?>
<methodResponse> <fault> <value><struct> <member><name>faultCode</name> <value><i4>400</i4></value></member> <member><name>faultString</name> <value><string>More Parameters Expected</string></value></member> </struct></value> </fault> </methodResponse>
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 ./sip_router/modules/usrloc/ul_rpc.c
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?
Thanks,
Zach Keatts Software Engineer Nuvio.com
Serusers mailing list serusers@lists.iptel.org http://lists.iptel.org/mailman/listinfo/serusers
Serusers mailing list serusers@lists.iptel.org http://lists.iptel.org/mailman/listinfo/serusers
On 15-08-2005 14:21, zkeatts wrote:
I think I have figured out why it would only accept location or aliases as a valid table.
Because there are only two tables in usrloc, location and aliases. Location table stores the contacts of user agents, aliases implements SIP URI alias mapping.
Doing a userloc.statistics returns to me those two specific table names listed as a member of domain.
Yes, internally location table is created in memory when you call lookup("location"), aliases is created when you call lookup("aliases") somewhere in the configuration file.
Is it possible to add other tables under the accepted domain structure?
Yes, but I am not sure if it makes any sense.
As for show_contacts I have run several more tests, but I still have not managed to get anything other than errors. I have manually added an entry into locations with the following data
+-----------+--------+-------------------------+----------+---------------------+-------+-------------------------------------+------+---------------------+-----------+-------+-------+---------------------------------------+ | username | domain | contact | received | expires | q | callid | cseq | last_modified | replicate | state | flags | user_agent | +-----------+--------+-------------------------+----------+---------------------+-------+-------------------------------------+------+---------------------+-----------+-------+-------+---------------------------------------+ | 271nv1001 | | sip:271nv1001@localhost | NULL | 2020-05-28 21:32:15 | -1.00 | 3653736-e3498618-a7aa0347@localhost | 42 | 2005-08-15 16:07:31 | 0 | 0 | 0 | PolycomSoundPointIP-SPIP_500-UA/1.4.1 | +-----------+--------+-------------------------+----------+---------------------+-------+-------------------------------------+------+---------------------+-----------+-------+-------+---------------------------------------+
I still get an AOR error when I try the following AOR's in my XML query.
<value><string>271nv1001</string></value> <value><string>271nv1001@localhost</string></value> <value><string>sip:271nv1001@localhost</string></value> <value><string>3653736-e3498618-a7aa0347@localhost</string>
Those seem to be the only logical choices for the AOR. Why would it still be returning an AOR not found?
I will get back to this later, I have to check the sources, it is possible there is a bug.
Jan.
On 18-08-2005 19:01, Jan Janak wrote:
+-----------+--------+-------------------------+----------+---------------------+-------+-------------------------------------+------+---------------------+-----------+-------+-------+---------------------------------------+ | username | domain | contact | received | expires | q | callid | cseq | last_modified | replicate | state | flags | user_agent | +-----------+--------+-------------------------+----------+---------------------+-------+-------------------------------------+------+---------------------+-----------+-------+-------+---------------------------------------+ | 271nv1001 | | sip:271nv1001@localhost | NULL | 2020-05-28 21:32:15 | -1.00 | 3653736-e3498618-a7aa0347@localhost | 42 | 2005-08-15 16:07:31 | 0 | 0 | 0 | PolycomSoundPointIP-SPIP_500-UA/1.4.1 | +-----------+--------+-------------------------+----------+---------------------+-------+-------------------------------------+------+---------------------+-----------+-------+-------+---------------------------------------+
I still get an AOR error when I try the following AOR's in my XML query.
<value><string>271nv1001</string></value> <value><string>271nv1001@localhost</string></value> <value><string>sip:271nv1001@localhost</string></value> <value><string>3653736-e3498618-a7aa0347@localhost</string>
Those seem to be the only logical choices for the AOR. Why would it still be returning an AOR not found?
I will get back to this later, I have to check the sources, it is possible there is a bug.
I have been trying to reproduce this but without success (it works for me). Could you send me the output of usrloc.dump function and also full traces of xmlrpc communication -- showing both requests and replies ?
thanks, Jan.
Jan,
I have noticed a few more things in the xmlrpc that require some explanation. When I do
<methodNam>usrloc.add_contact</methodName>
I generally get a response containing
<boolean>1</boolean>
I am assuming this means that the operation was completed successfully. Strangely when I check the "location" database for new records I find no new rows. Should that be happening? Also when I try to run a
<methodName>usrloc.show_contacts</methodName>
operation right after the previous rpc call I get the following error.
<member><name>faultString</name> <value><string>Can't allocate 3055039997-byte memory block</string></value></member>
Why is this error coming back?
Thanks for your help,
Zach Keatts Software Engineer Nuvio.com
zkeatts wrote:
Jan,
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 Nuvio.com
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\"?>
<methodCall> <methodName>usrloc.show_contacts</methodName> <params> <param> <value><string>location</string></value> </param> <param> <value><string>jan@iptel.org</string></value> </param> </params> </methodCall>
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
POST /RPC2 HTTP/1.0 User-Agent: Radio UserLand/7.1b7 (WinNT) Host: localhost:5060 Content-Type: text/xml Content-length: 131
<?xml version=\"1.0\"?>
<methodCall> <methodName>usrloc.show_contacts</methodName> <params> </params> </methodCall>
As a return packet I am getting
HTTP/1.0 200 OK Via: SIP/2.0/UDP 127.0.0.1:32769 Server: Sip EXpress router (0.10.99-janakj_experimental (i386/linux)) Content-Length: 303 Warning: 392 127.0.0.1:5060 "Noisy feedback tells: pid=5820 req_src_ip=127.0.0.1 req_src_port=32769 in_uri=/RPC2 out_uri=/RPC2 via_cnt==1"
<?xml version="1.0" encoding="UTF-8"?>
<methodResponse> <fault> <value><struct> <member><name>faultCode</name> <value><i4>400</i4></value></member> <member><name>faultString</name> <value><string>More Parameters Expected</string></value></member> </struct></value> </fault> </methodResponse>
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 ./sip_router/modules/usrloc/ul_rpc.c
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?
Thanks,
Zach Keatts Software Engineer Nuvio.com
Serusers mailing list serusers@lists.iptel.org http://lists.iptel.org/mailman/listinfo/serusers
Serusers mailing list serusers@lists.iptel.org http://lists.iptel.org/mailman/listinfo/serusers