<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
</head>
<body bgcolor="#ffffff" text="#000000">
Hello!<br>
<br>
Seems like when corresponding fields are empty - an exception
occurs.<br>
When I comment out these parameters (setting string value to NULL
and .len=0), I get this:<br>
<br>
Program terminated with signal 11, Segmentation fault.<br>
#0 0x00007f88061cf3af in load_reg_info_from_db () at
reg_db_handler.c:265<br>
265 uac_param.contact_params.len =<br>
<br>
Here is how the table fields go:<br>
<br>
username(string,null) password(string,null) binding_URI(string)
binding_params(string,null) expiry(int,null)<br>
<br>
But in the code I see this:<br>
<br>
/* Get the authentication user */<br>
uac_param.auth_user.s =<br>
(char*)values[username_col].val.string_val;<br>
uac_param.auth_user.len =
strlen(uac_param.auth_user.s);<br>
if (uac_param.auth_user.len == 0)
uac_param.auth_user.s = NULL;<br>
<br>
/* Get the authentication password */<br>
uac_param.auth_password.s =<br>
(char*)values[password_col].val.string_val;<br>
uac_param.auth_password.len =
strlen(uac_param.auth_password.s);<br>
if (uac_param.auth_password.len == 0)<br>
uac_param.auth_password.s = NULL;<br>
<br>
/* Get the binding params */<br>
uac_param.contact_params.s =<br>
(char*)values[binding_params_col].val.string_val;<br>
uac_param.contact_params.len =<br>
strlen(uac_param.contact_params.s);<br>
if (uac_param.contact_params.len == 0)<br>
uac_param.contact_params.s = NULL;<br>
<br>
/* Get the expiration param */<br>
uac_param.expires =
values[expiry_col].val.int_val;<br>
<br>
Looks like binding_URI is not processed?<br>
Also, is it ok that binding params are assigned to
uac_param.contact_params?<br>
It seems binding_URI is never processed (however it is required
field).<br>
<br>
<br>
<div class="moz-cite-prefix">08.10.2012 15:01, Alexandr A.
Alexandrov пишет:<br>
</div>
<blockquote class=" cite" id="mid_5072B272_4040203_gmail_com"
cite="mid:5072B272.4040203@gmail.com" type="cite">
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
Hello!<br>
<br>
Program terminated with signal 11, Segmentation fault.<br>
#0 0x00007f9aae966ddf in load_reg_info_from_db () at
reg_db_handler.c:187<br>
187 uac_param.proxy_uri.len =<br>
<br>
<br>
(gdb) bt full<br>
#0 0x00007f9aae966ddf in load_reg_info_from_db () at
reg_db_handler.c:187<br>
res = (db_res_t *) 0x7f9ab136eaf8<br>
values = (db_val_t *) 0x7f9ab136dac8<br>
rows = (db_row_t *) 0x7f9ab136dab8<br>
nr_rows = <value optimized out><br>
q_cols = {0x7f9aaeb73130, 0x7f9aaeb73140, 0x7f9aaeb73150,
0x7f9aaeb73160, 0x7f9aaeb73170, 0x7f9aaeb73180, 0x7f9aaeb73190,
0x7f9aaeb731a0,<br>
0x7f9aaeb731b0, 0x7f9aaeb731c0}<br>
p = <value optimized out><br>
now = {s = 0x7f9ab136e960 "1349692979ion", len = 10}<br>
uri = {user = {s = 0x0, len = 0}, passwd = {s = 0x0, len =
0}, host = {s = 0x7f9ab135c8dc "wi\ngssof\t.ma\ngosip.\ru", len =
21}, port = {s = 0x0,<br>
len = 0}, params = {s = 0x0, len = 0}, headers = {s = 0x0, len
= 0}, port_no = 0, proto = 0, type = SIP_URI_T, transport = {s =
0x0, len = 0}, ttl = {<br>
s = 0x0, len = 0}, user_param = {s = 0x0, len = 0}, maddr = {s
= 0x0, len = 0}, method = {s = 0x0, len = 0}, lr = {s = 0x0, len =
0}, r2 = {s = 0x0,<br>
len = 0}, gr = {s = 0x0, len = 0}, transport_val = {s = 0x0,
len = 0}, ttl_val = {s = 0x0, len = 0}, user_param_val = {s = 0x0,
len = 0}, maddr_val = {<br>
s = 0x0, len = 0}, method_val = {s = 0x0, len = 0}, lr_val =
{s = 0x0, len = 0}, r2_val = {s = 0x0, len = 0}, gr_val = {s =
0x0, len = 0}, u_name = {{<br>
s = 0x0, len = 0}, {s = 0x0, len = 0}, {s = 0x0, len = 0},
{s = 0x0, len = 0}, {s = 0x0, len = 0}}, u_val = {{s = 0x0, len =
0}, {s = 0x0, len = 0}, {<br>
s = 0x0, len = 0}, {s = 0x0, len = 0}, {s = 0x0, len = 0}},
u_params_no = 0}<br>
host = {s = 0x7d6f87 "/usr/local/etc/opensips/dbtext", len
= -1363724976}<br>
port = <value optimized out><br>
proto = <value optimized out><br>
uac_param = {hash_code = 0, registrar_uri = {s =
0x7f9ab135c8d8 "sip:wi\ngssof\t.ma\ngosip.\ru", len = 25},
proxy_uri = {s = 0x0, len = 0},<br>
to_uri = {s = 0x0, len = 0}, from_uri = {s = 0x0, len = 0},
contact_uri = {s = 0x0, len = 0}, contact_params = {s = 0x0, len =
0}, auth_user = {s = 0x0,<br>
len = 0}, auth_password = {s = 0x0, len = 0}, expires = 0,
send_sock = 0x0, next = 0x0}<br>
__FUNCTION__ = "load_reg_info_from_db"<br>
#1 0x00007f9aae968cce in init_reg_db (db_url=0x7f9aaeb73550) at
reg_db_handler.c:350<br>
__FUNCTION__ = "init_reg_db"<br>
#2 0x00007f9aae96ab50 in mod_init () at registrant.c:198<br>
__FUNCTION__ = "mod_init"<br>
#3 0x00000000004928b4 in init_mod (m=0x7f9ab13607a8) at
sr_module.c:458<br>
__FUNCTION__ = "init_mod"<br>
#4 0x00000000004311cf in main (argc=<value optimized out>,
argv=0x7fffb9ee5fa8) at main.c:1466<br>
cfg_log_stderr = 0<br>
cfg_stream = (FILE *) 0x7c5010<br>
c = <value optimized out><br>
r = <value optimized out><br>
tmp = 0x7fffb9ee74e3 ""<br>
tmp_len = <value optimized out><br>
port = <value optimized out><br>
proto = <value optimized out><br>
ret = <value optimized out><br>
seed = 1449173645<br>
rfd = 4<br>
__FUNCTION__ = "main"<br>
<br>
<br>
<br>
<div class="moz-cite-prefix">08.10.2012 13:59, Alexandr A.
Alexandrov пишет:<br>
</div>
<blockquote class=" cite" id="mid_5072A416_90104_gmail_com"
cite="mid:5072A416.90104@gmail.com" type="cite">
<meta http-equiv="content-type" content="text/html;
charset=UTF-8">
Hi!<br>
<br>
I am trying to use uac_registrant with db_text.<br>
Here is 'registrant' table:<br>
<br>
id(int,auto) registrar(string) proxy(string,null) aor(string)
third_party_registrant(string,null) username(string,null)
password(string,null) binding_URI(string)
binding_params(string,null) expiry(int,null)
forced_socket(string,null)<br>
1:sip\:wi\ngsof\t.ma\ngosip.\ru::sip\:mf\tes\<a
moz-do-not-send="true" class="moz-txt-link-abbreviated"
href="mailto:t1@wi%5Cngsof%5Ct.ma%5Cngosip.%5Cru::mf%5Ctes%5Ct1:somepass:sip%5C:mf%5Ctes%5Ct1@wi%5Cngsof%5Ct.ma%5Cngosip.%5Cru">t1@wi\ngsof\t.ma\ngosip.\ru::mf\tes\t1:somepass:sip\:mf\tes\t1@wi\ngsof\t.ma\ngosip.\ru</a>::::<br>
<br>
The row seems to be ok (all escapes, \n in the end of line)<br>
<br>
Here is what I get in log:<br>
<br>
Oct 8 13:39:30 prod2 /usr/local/sbin/opensips[30380]:
DBG:db_text:dbt_load_file: request for table [registrant]<br>
Oct 8 13:39:30 prod2 /usr/local/sbin/opensips[30380]:
DBG:db_text:dbt_load_file: db is
[/usr/local/etc/opensips/dbtext]<br>
Oct 8 13:39:30 prod2 /usr/local/sbin/opensips[30380]:
DBG:db_text:dbt_load_file: loading file
[/usr/local/etc/opensips/dbtext/registrant]<br>
Oct 8 13:39:30 prod2 /usr/local/sbin/opensips[30380]:
DBG:db_text:dbt_table_new: mtime is 1349689164<br>
Oct 8 13:39:30 prod2 /usr/local/sbin/opensips[30380]:
DBG:db_text:dbt_load_file: column[0] is INT!<br>
Oct 8 13:39:30 prod2 /usr/local/sbin/opensips[30380]:
DBG:db_text:dbt_load_file: column[1] is STR!<br>
Oct 8 13:39:30 prod2 /usr/local/sbin/opensips[30380]:
DBG:db_text:dbt_load_file: column[1] is actually STRING!<br>
Oct 8 13:39:30 prod2 /usr/local/sbin/opensips[30380]:
DBG:db_text:dbt_load_file: column[2] is STR!<br>
Oct 8 13:39:30 prod2 /usr/local/sbin/opensips[30380]:
DBG:db_text:dbt_load_file: column[2] is actually STRING!<br>
Oct 8 13:39:30 prod2 /usr/local/sbin/opensips[30380]:
DBG:db_text:dbt_load_file: column[3] is STR!<br>
Oct 8 13:39:30 prod2 /usr/local/sbin/opensips[30380]:
DBG:db_text:dbt_load_file: column[3] is actually STRING!<br>
Oct 8 13:39:30 prod2 /usr/local/sbin/opensips[30380]:
DBG:db_text:dbt_load_file: column[4] is STR!<br>
Oct 8 13:39:30 prod2 /usr/local/sbin/opensips[30380]:
DBG:db_text:dbt_load_file: column[4] is actually STRING!<br>
Oct 8 13:39:30 prod2 /usr/local/sbin/opensips[30380]:
DBG:db_text:dbt_load_file: column[5] is STR!<br>
Oct 8 13:39:30 prod2 /usr/local/sbin/opensips[30380]:
DBG:db_text:dbt_load_file: column[5] is actually STRING!<br>
Oct 8 13:39:30 prod2 /usr/local/sbin/opensips[30380]:
DBG:db_text:dbt_load_file: column[6] is STR!<br>
Oct 8 13:39:30 prod2 /usr/local/sbin/opensips[30380]:
DBG:db_text:dbt_load_file: column[6] is actually STRING!<br>
Oct 8 13:39:30 prod2 /usr/local/sbin/opensips[30380]:
DBG:db_text:dbt_load_file: column[7] is STR!<br>
Oct 8 13:39:30 prod2 /usr/local/sbin/opensips[30380]:
DBG:db_text:dbt_load_file: column[7] is actually STRING!<br>
Oct 8 13:39:30 prod2 /usr/local/sbin/opensips[30380]:
DBG:db_text:dbt_load_file: column[8] is STR!<br>
Oct 8 13:39:30 prod2 /usr/local/sbin/opensips[30380]:
DBG:db_text:dbt_load_file: column[8] is actually STRING!<br>
Oct 8 13:39:30 prod2 /usr/local/sbin/opensips[30380]:
DBG:db_text:dbt_load_file: column[9] is INT!<br>
Oct 8 13:39:30 prod2 /usr/local/sbin/opensips[30380]:
DBG:db_text:dbt_load_file: column[10] is STR!<br>
Oct 8 13:39:30 prod2 /usr/local/sbin/opensips[30380]:
DBG:db_text:dbt_load_file: column[10] is actually STRING!<br>
Oct 8 13:39:30 prod2 /usr/local/sbin/opensips[30380]:
DBG:db_text:dbt_query: new res with 10 cols<br>
Oct 8 13:39:30 prod2 /usr/local/sbin/opensips[30380]:
DBG:db_text:dbt_result_new: new res with 10 cols<br>
Oct 8 13:39:30 prod2 /usr/local/sbin/opensips[30380]:
DBG:core:db_new_result: allocate 48 bytes for result set at
0x7fdded96baf8<br>
Oct 8 13:39:30 prod2 /usr/local/sbin/opensips[30380]:
DBG:core:db_allocate_columns: allocate 280 bytes for result
columns at 0x7fdded96a988<br>
Oct 8 13:39:30 prod2 /usr/local/sbin/opensips[30380]:
DBG:core:db_allocate_rows: allocate 336 bytes for result rows
and values at 0x7fdded96aab8<br>
Oct 8 13:39:30 prod2 /usr/local/sbin/opensips[30380]:
INFO:uac_registrant:load_reg_info_from_db: loading [1] records
from db<br>
Oct 8 13:39:30 prod2 kernel: opensips[30380]: segfault at 0 ip
00007fddeaf63ddf sp 00007ffff64e0f60 error 4 in
uac_registrant.so[7fddeaf61000+e000]<br>
Oct 8 13:39:30 prod2 opensips: DBG:core:wait_status_code: read
code 0 ? rc = 0, errno=Inappropriate ioctl for device<br>
Oct 8 13:39:30 prod2 opensips: INFO:core:daemonize: pre-daemon
process exiting with -1<br>
<br>
Best reagrds,<br>
Alexandr A. Alexandrov<br>
</blockquote>
<br>
</blockquote>
<br>
</body>
</html>