[OpenSIPS-Users] db_http usage with avpops
Alex Massover
alex at jajah.com
Tue Dec 4 14:42:55 CET 2012
Hello,
I'm trying to understand what is the exact format of how to use db_http in case when the table version isn't defined on the module avpops (avp_db_load function).
I managed to work with auth_db since it only asks in http query for c=ha1 and I answer with "string\n ha1_hash".
But with avpops and custom table when I do:
avp_db_load("$avp(input_val)","$avp(result)/my_table");
it ask for c=value,attribute,type
Let's say I want to return string containing "test", but I can't figure out what is the exact format to return from the web server to make dbrow2avp() happy.
Here's a log (little bit modified to remove real data):
Dec 3 15:41:00 T800-883 /usr/sbin/opensips[12961]: DBG:db_http:do_http_op: Sent:http://server1/my_table/?k=uuid,attribute&v=my_data,result&c=value,attribute,type
Dec 3 15:41:00 T800-883 /usr/sbin/opensips[12961]: DBG:db_http:form_result: Called with : string#012test#012
Dec 3 15:41:00 T800-883 /usr/sbin/opensips[12961]: DBG:core:db_new_result: allocate 48 bytes for result set at 0x7f9cbb136148
Dec 3 15:41:00 T800-883 /usr/sbin/opensips[12961]: DBG:core:db_allocate_rows: allocate 80 bytes for result rows and values at 0x7f9cbb136af0
Dec 3 15:41:00 T800-883 /usr/sbin/opensips[12961]: DBG:db_http:put_type_in_result: Found type: string 6
Dec 3 15:41:00 T800-883 /usr/sbin/opensips[12961]: DBG:db_http:put_value_in_result: Found value: test
Dec 3 15:41:00 T800-883 /usr/sbin/opensips[12961]: DBG:db_http:form_result: Finished query
Dec 3 15:41:00 T800-883 /usr/sbin/opensips[12961]: ERROR:avpops:dbrow2avp: wrong field types in dbrow
I'd appreciate if someone could enlighten me what is the format to return strings and ints in the format c=value,attribute,type.
--
Best Regards,
Alex Massover
More information about the Users
mailing list