|
|
|
|
@ -16,7 +16,7 @@
|
|
|
|
|
|
|
|
|
|
{0, 0, 0}
|
|
|
|
|
};
|
|
|
|
|
@@ -2061,6 +2063,7 @@
|
|
|
|
|
@@ -2075,6 +2077,7 @@
|
|
|
|
|
char *path_ip_str = NULL;
|
|
|
|
|
unsigned int path_ip = 0;
|
|
|
|
|
unsigned short path_port = 0;
|
|
|
|
|
@ -24,7 +24,7 @@
|
|
|
|
|
|
|
|
|
|
if((*natping_state) == 0)
|
|
|
|
|
goto done;
|
|
|
|
|
@@ -2073,10 +2076,13 @@
|
|
|
|
|
@@ -2087,10 +2090,13 @@
|
|
|
|
|
goto done;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
@ -40,7 +40,7 @@
|
|
|
|
|
if (rval<0) {
|
|
|
|
|
LM_ERR("failed to fetch contacts\n");
|
|
|
|
|
goto done;
|
|
|
|
|
@@ -2092,8 +2098,7 @@
|
|
|
|
|
@@ -2106,8 +2112,7 @@
|
|
|
|
|
}
|
|
|
|
|
rval = ul.get_all_ucontacts_opt(buf,cblen,(ping_nated_only?ul.nat_flag:0),
|
|
|
|
|
((unsigned int)(unsigned long)timer_idx)*natping_interval+iteration,
|
|
|
|
|
@ -52,7 +52,7 @@
|
|
|
|
|
goto done;
|
|
|
|
|
--- a/modules/usrloc/dlist.c
|
|
|
|
|
+++ b/modules/usrloc/dlist.c
|
|
|
|
|
@@ -79,6 +79,53 @@
|
|
|
|
|
@@ -79,6 +79,44 @@
|
|
|
|
|
return 1;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@ -67,46 +67,37 @@
|
|
|
|
|
+ str s_proto = STR_NULL;
|
|
|
|
|
+ char *s = *buf;
|
|
|
|
|
+
|
|
|
|
|
+
|
|
|
|
|
+ list=get_sock_info_list(proto);
|
|
|
|
|
+ s_proto.s = get_valid_proto_name(proto);
|
|
|
|
|
+ s_proto.len = strlen(s_proto.s);
|
|
|
|
|
+ LM_DBG("s_proto[%d]:%.*s\n", s_proto.len, s_proto.len, s_proto.s);
|
|
|
|
|
+
|
|
|
|
|
+ for(si=list?*list:0; si; si=si->next){
|
|
|
|
|
+ if (si->addr_info_lst)
|
|
|
|
|
+ {
|
|
|
|
|
+ for (ai=si->addr_info_lst; ai; ai=ai->next)
|
|
|
|
|
+ {
|
|
|
|
|
+ size = 5 + s_proto.len + ai->address_str.len + si->port_no_str.len;
|
|
|
|
|
+ LM_DBG("pos:%d size:%d\n", pos, size);
|
|
|
|
|
+ if (pos + size + 1>len) return -1;
|
|
|
|
|
+ snprintf(s + pos, len-pos, ",'%s:%s:%s'",
|
|
|
|
|
+ s_proto.s, ai->address_str.s, si->port_no_str.s);
|
|
|
|
|
+ pos = pos + size;
|
|
|
|
|
+ LM_DBG("ip[%d]:%.*s\n", ai->address_str.len, ai->address_str.len, ai->address_str.s);
|
|
|
|
|
+ LM_DBG("port[%d]:%.*s\n", si->port_no_str.len, si->port_no_str.len, si->port_no_str.s);
|
|
|
|
|
+ LM_DBG("s:[%.*s]\n", pos, s);
|
|
|
|
|
+ }
|
|
|
|
|
+ }else{
|
|
|
|
|
+ size = 5 + s_proto.len + si->name.len + si->port_no_str.len;
|
|
|
|
|
+ LM_DBG("pos:%d size:%d\n", pos, size);
|
|
|
|
|
+ if (pos + size + 1>len) return -1;
|
|
|
|
|
+ snprintf(s + pos, len-pos, ",'%s:%s:%s'",
|
|
|
|
|
+ s_proto.s, si->name.s, si->port_no_str.s);
|
|
|
|
|
+ pos = pos + size;
|
|
|
|
|
+ LM_DBG("ip[%d]:%.*s\n", si->name.len, si->name.len, si->name.s);
|
|
|
|
|
+ LM_DBG("port[%d]:%.*s\n", si->port_no_str.len, si->port_no_str.len, si->port_no_str.s);
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ s[0] = '('; s[pos] = ')'; pos = pos + 1;
|
|
|
|
|
+ LM_DBG("pos:%d [%.*s]\n", pos, pos, s);
|
|
|
|
|
+ return pos;
|
|
|
|
|
+}
|
|
|
|
|
|
|
|
|
|
/*!
|
|
|
|
|
* \brief Get all contacts from the database, in partitions if wanted
|
|
|
|
|
@@ -96,6 +143,8 @@
|
|
|
|
|
@@ -96,6 +134,8 @@
|
|
|
|
|
unsigned int options)
|
|
|
|
|
{
|
|
|
|
|
static char query_buf[512];
|
|
|
|
|
@ -115,7 +106,7 @@
|
|
|
|
|
static str query_str;
|
|
|
|
|
|
|
|
|
|
struct socket_info *sock;
|
|
|
|
|
@@ -115,8 +164,52 @@
|
|
|
|
|
@@ -115,8 +155,50 @@
|
|
|
|
|
int i;
|
|
|
|
|
void *cp;
|
|
|
|
|
int shortage, needed;
|
|
|
|
|
@ -131,7 +122,6 @@
|
|
|
|
|
+ LM_ERR("error generating socket_list parameter\n");
|
|
|
|
|
+ return -1;
|
|
|
|
|
+ }
|
|
|
|
|
+ LM_DBG("socket_str[%d]:[%.*s]\n", socket_str.len, socket_str.len, socket_str.s);
|
|
|
|
|
+ query_format = "select %.*s, %.*s, %.*s,"
|
|
|
|
|
+ " %.*s, %.*s, %.*s from %s where %.*s > %.*s and"
|
|
|
|
|
+#ifdef ORACLE_USRLOC
|
|
|
|
|
@ -148,7 +138,6 @@
|
|
|
|
|
+ {
|
|
|
|
|
+ dbh = ul_dbh_ro;
|
|
|
|
|
+ dbf = &ul_dbf_ro;
|
|
|
|
|
+ LM_DBG("use read-only db\n");
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+ else
|
|
|
|
|
@ -169,7 +158,7 @@
|
|
|
|
|
LM_WARN("DB raw query support is required, but not implemented\n");
|
|
|
|
|
return -1;
|
|
|
|
|
}
|
|
|
|
|
@@ -136,13 +229,8 @@
|
|
|
|
|
@@ -136,13 +218,8 @@
|
|
|
|
|
|
|
|
|
|
for (dom = root; dom!=NULL ; dom=dom->next) {
|
|
|
|
|
/* build query */
|
|
|
|
|
@ -185,7 +174,7 @@
|
|
|
|
|
received_col.len, received_col.s,
|
|
|
|
|
contact_col.len, contact_col.s,
|
|
|
|
|
sock_col.len, sock_col.s,
|
|
|
|
|
@@ -153,19 +241,21 @@
|
|
|
|
|
@@ -153,19 +230,21 @@
|
|
|
|
|
expires_col.len, expires_col.s,
|
|
|
|
|
now_len, now_s,
|
|
|
|
|
cflags_col.len, cflags_col.s,
|
|
|
|
|
@ -210,7 +199,7 @@
|
|
|
|
|
continue;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@@ -269,7 +359,7 @@
|
|
|
|
|
@@ -269,7 +348,7 @@
|
|
|
|
|
len -= needed;
|
|
|
|
|
} /* row cycle */
|
|
|
|
|
|
|
|
|
|
|