|
|
@ -1591,7 +1591,7 @@ restart:
|
|
|
|
rwlock_unlock_r(&m->hashlock);
|
|
|
|
rwlock_unlock_r(&m->hashlock);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
if (viabranch && !g_hash_table_lookup(c->branches, viabranch))
|
|
|
|
if (viabranch && *viabranch && !g_hash_table_lookup(c->branches, viabranch))
|
|
|
|
g_hash_table_insert(c->branches, call_strdup(c, viabranch),
|
|
|
|
g_hash_table_insert(c->branches, call_strdup(c, viabranch),
|
|
|
|
(void *) 0x1);
|
|
|
|
(void *) 0x1);
|
|
|
|
|
|
|
|
|
|
|
@ -1688,31 +1688,29 @@ char *call_lookup_udp(const char **out, struct callmaster *m) {
|
|
|
|
struct stream st;
|
|
|
|
struct stream st;
|
|
|
|
int num;
|
|
|
|
int num;
|
|
|
|
char *ret;
|
|
|
|
char *ret;
|
|
|
|
|
|
|
|
const char *branch;
|
|
|
|
|
|
|
|
|
|
|
|
rwlock_lock_r(&m->hashlock);
|
|
|
|
rwlock_lock_r(&m->hashlock);
|
|
|
|
c = g_hash_table_lookup(m->callhash, out[RE_UDP_UL_CALLID]);
|
|
|
|
c = g_hash_table_lookup(m->callhash, out[RE_UDP_UL_CALLID]);
|
|
|
|
if (c)
|
|
|
|
if (c)
|
|
|
|
mutex_lock(&c->lock);
|
|
|
|
mutex_lock(&c->lock);
|
|
|
|
else
|
|
|
|
else {
|
|
|
|
goto not_found;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (!out[RE_UDP_UL_VIABRANCH] || !*out[RE_UDP_UL_VIABRANCH])
|
|
|
|
|
|
|
|
goto skip_branch;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (!g_hash_table_lookup(c->branches, out[RE_UDP_UL_VIABRANCH])) {
|
|
|
|
|
|
|
|
mutex_unlock(&c->lock);
|
|
|
|
|
|
|
|
not_found:
|
|
|
|
|
|
|
|
rwlock_unlock_r(&m->hashlock);
|
|
|
|
rwlock_unlock_r(&m->hashlock);
|
|
|
|
mylog(LOG_WARNING, LOG_PREFIX_CI "Got UDP LOOKUP for unknown call-id or unknown via-branch",
|
|
|
|
mylog(LOG_WARNING, LOG_PREFIX_CI "Got UDP LOOKUP for unknown call-id or unknown via-branch",
|
|
|
|
out[RE_UDP_UL_CALLID], out[RE_UDP_UL_VIABRANCH]);
|
|
|
|
out[RE_UDP_UL_CALLID], out[RE_UDP_UL_VIABRANCH]);
|
|
|
|
xasprintf(&ret, "%s 0 " IPF "\n", out[RE_UDP_COOKIE], IPP(m->conf.ipv4));
|
|
|
|
xasprintf(&ret, "%s 0 " IPF "\n", out[RE_UDP_COOKIE], IPP(m->conf.ipv4));
|
|
|
|
return ret;
|
|
|
|
return ret;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
skip_branch:
|
|
|
|
|
|
|
|
obj_hold(c);
|
|
|
|
obj_hold(c);
|
|
|
|
rwlock_unlock_r(&m->hashlock);
|
|
|
|
rwlock_unlock_r(&m->hashlock);
|
|
|
|
|
|
|
|
|
|
|
|
log_info = out[RE_UDP_UL_VIABRANCH];
|
|
|
|
branch = out[RE_UDP_UL_VIABRANCH];
|
|
|
|
|
|
|
|
if (branch && *branch && !g_hash_table_lookup(c->branches, branch))
|
|
|
|
|
|
|
|
g_hash_table_insert(c->branches, call_strdup(c, branch),
|
|
|
|
|
|
|
|
(void *) 0x1);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
log_info = branch;
|
|
|
|
c->called_agent = "UNKNOWN(udp)";
|
|
|
|
c->called_agent = "UNKNOWN(udp)";
|
|
|
|
|
|
|
|
|
|
|
|
if (addr_parse_udp(&st, out))
|
|
|
|
if (addr_parse_udp(&st, out))
|
|
|
|