49#if defined(__FreeBSD__) || defined(__OpenBSD__) || defined(__NetBSD__) || defined(__Darwin__)
153#define MAX_RESULTS 64
155#define MAX_PACKET_SIZE 8192
157#define MAX_WEIGHT 59999
159#define DUNDI_MODEL_INBOUND (1 << 0)
160#define DUNDI_MODEL_OUTBOUND (1 << 1)
161#define DUNDI_MODEL_SYMMETRIC (DUNDI_MODEL_INBOUND | DUNDI_MODEL_OUTBOUND)
164#define DUNDI_TIMING_HISTORY 10
176#define DUNDI_FLAG_INTERNAL_NOPARTIAL (1 << 17)
179#define DUNDI_SECRET_TIME 15
181#define DUNDI_SECRET_TIME DUNDI_DEFAULT_CACHE_TIME
191static unsigned int tos = 0;
375 if (!strcasecmp(perm->
name,
"all") || !strcasecmp(perm->
name, cont))
402 if (!strcasecmp(
str,
"IAX") || !strcasecmp(
str,
"IAX2"))
404 else if (!strcasecmp(
str,
"SIP"))
406 else if (!strcasecmp(
str,
"H323"))
408 else if (!strcasecmp(
str,
"PJSIP"))
414static int dundi_lookup_internal(
struct dundi_result *
result,
int maxret,
struct ast_channel *chan,
const char *dcontext,
const char *
number,
int ttl,
int blockempty,
struct dundi_hint_metadata *md,
int *expiration,
int cybpass,
int modeselect,
dundi_eid *skip,
dundi_eid *avoid[],
int direct[]);
471 memset(&
tmp, 0,
sizeof(
tmp));
472 memset(&trans, 0,
sizeof(trans));
479 tmp.hdr.cmdflags = 0;
482 tmp.pack.parent = &trans;
499 tid = (tid % 32766) + 1;
500 }
while (tid != stid);
542 unsigned int *fluffy;
544 fluffy = (
unsigned int *)(iv);
611 dr[anscnt].techint = map->
tech;
614 dr[anscnt].eid = *us_eid;
635 dr[anscnt].dest[0] =
'\0';
643 for (x = 0; x < (
sizeof(
tmp) - 1); x++) {
644 tmp[x] = called_number[x];
650 if (strlen(
tmp) > strlen(hmd->
exten)) {
677 memset(&ied, 0,
sizeof(ied));
678 memset(&
dr, 0,
sizeof(
dr));
679 memset(&hmd, 0,
sizeof(hmd));
686 for (x=0;x<ouranswers;x++) {
693 res =
dundi_lookup_internal(
dr + ouranswers,
MAX_RESULTS - ouranswers,
NULL, st->
called_context, st->
called_number, st->
ttl, 1, &hmd, &expiration, st->
nocache, 0,
NULL, st->
eids, st->
directs);
698 if ((res < -1) && (!ouranswers))
707 ast_debug(1,
"Our transaction went away!\n");
711 for (x=0;x<ouranswers;x++) {
713 if (
dr[x].expiration && (expiration >
dr[x].expiration))
714 expiration =
dr[x].expiration;
736 memset(&ied, 0,
sizeof(ied));
746 ast_debug(1,
"Our transaction went away!\n");
771 memset(&ied, 0,
sizeof(ied));
772 memset(&dei, 0,
sizeof(dei));
773 memset(&hmd, 0,
sizeof(hmd));
776 ast_debug(1,
"Neat, someone look for us!\n");
791 ast_debug(1,
"Our transaction went away!\n");
823 pthread_t lookupthread;
844 for (x=skipfirst;ies->
eids[x];x++) {
846 *st->
eids[x-skipfirst] = *ies->
eids[x];
875 char eidpeer_str[20];
876 char eidroot_str[20];
891 snprintf(key1,
sizeof(key1),
"hint/%s/%s/%s/e%08x", eidpeer_str, hint->
data, req->
dcontext, unaffected ? 0 : req->
crc32);
892 snprintf(key2,
sizeof(key2),
"hint/%s/%s/%s/r%s", eidpeer_str, hint->
data, req->
dcontext, eidroot_str);
895 timeout += expiration;
896 snprintf(data,
sizeof(data),
"%ld|", (
long)(timeout));
899 ast_debug(1,
"Caching hint at '%s'\n", key1);
901 ast_debug(1,
"Caching hint at '%s'\n", key2);
911 char eidpeer_str[20];
912 char eidroot_str[20];
927 snprintf(key1,
sizeof(key1),
"%s/%s/%s/e%08x", eidpeer_str, req->
number, req->
dcontext, unaffected ? 0 : req->
crc32);
928 snprintf(key2,
sizeof(key2),
"%s/%s/%s/r%s", eidpeer_str, req->
number, req->
dcontext, eidroot_str);
931 timeout += expiration;
932 snprintf(data,
sizeof(data),
"%ld|", (
long)(timeout));
935 if (strchr(req->
dr[x].
dest,
'|'))
937 snprintf(data + strlen(data),
sizeof(data) - strlen(data),
"%u/%d/%d/%s/%s|",
961 pthread_t lookupthread;
963 memset(&dr2, 0,
sizeof(dr2));
964 memset(&
dr, 0,
sizeof(
dr));
965 memset(&hmd, 0,
sizeof(hmd));
973 dr.pfds[0] =
dr.pfds[1] = -1;
1023 if (!strcasecmp(cur->
dcontext, ccontext))
1053 for (x=skipfirst;ies->
eids[x];x++) {
1055 *st->
eids[x-skipfirst] = *ies->
eids[x];
1063 if (!strcasecmp(cur->
dcontext, ccontext)) {
1078 memset(&ied, 0,
sizeof(ied));
1085 memset(&ied, 0,
sizeof(ied));
1104 pthread_t lookupthread;
1108 if (!strcasecmp(cur->
dcontext, ccontext))
1136 for (x=skipfirst;ies->
eids[x];x++) {
1138 *st->
eids[x-skipfirst] = *ies->
eids[x];
1146 if (!strcasecmp(cur->
dcontext, ccontext)) {
1161 memset(&ied, 0,
sizeof(ied));
1168 memset(&ied, 0,
sizeof(ied));
1179 char *ptr, *term, *src;
1188 if (!
ast_db_get(
"dundi/cache", key, data,
sizeof(data))) {
1192 int expiration = timeout - now;
1193 if (expiration > 0) {
1194 ast_debug(1,
"Found cache expiring in %d seconds!\n", expiration);
1196 while((sscanf(ptr,
"%30d/%30d/%30d/%n", (
int *)&(
flags.flags), &
weight, &tech, &length) == 3)) {
1198 term = strchr(ptr,
'|');
1201 src = strrchr(ptr,
'/');
1207 ast_debug(1,
"Found cached answer '%s/%s' originally from '%s' with flags '%s' on behalf of '%s'\n",
1212 !strcmp(req->
dr[z].
dest, ptr))
1236 if (expiration < *lowexpiration)
1237 *lowexpiration = expiration;
1251 char eidroot_str[20];
1255 char eid_str_full[20];
1258 char key[
sizeof(eid_str) +
sizeof(
tmp) +
sizeof(req->
dcontext) +
sizeof(eidroot_str) +
sizeof(
"hint////r")];
1265 snprintf(key,
sizeof(key),
"%s/%s/%s/e%08x", eid_str, req->
number, req->
dcontext, crc);
1267 snprintf(key,
sizeof(key),
"%s/%s/%s/e%08x", eid_str, req->
number, req->
dcontext, (
unsigned)0);
1269 snprintf(key,
sizeof(key),
"%s/%s/%s/r%s", eid_str, req->
number, req->
dcontext, eidroot_str);
1280 snprintf(key,
sizeof(key),
"hint/%s/%s/%s/e%08x", eid_str,
tmp, req->
dcontext, crc);
1282 snprintf(key,
sizeof(key),
"hint/%s/%s/%s/e%08x", eid_str,
tmp, req->
dcontext, (
unsigned)0);
1284 snprintf(key,
sizeof(key),
"hint/%s/%s/%s/r%s", eid_str,
tmp, req->
dcontext, eidroot_str);
1342 unsigned char key[16];
1352 ast_log(
LOG_NOTICE,
"No such key '%s' for creating RSA encrypted shared key for '%s'!\n",
1358 ast_log(
LOG_NOTICE,
"No such key '%s' for signing RSA encrypted shared key for '%s'!\n",
1381 unsigned char curblock[16];
1383 memcpy(curblock, iv,
sizeof(curblock));
1386 curblock[x] ^= src[x];
1388 memcpy(curblock, dst,
sizeof(curblock));
1397 unsigned char lastblock[16];
1399 memcpy(lastblock, iv,
sizeof(lastblock));
1403 dst[x] ^= lastblock[x];
1404 memcpy(lastblock, src,
sizeof(lastblock));
1414 int space = *dstlen;
1415 unsigned long bytes;
1417 unsigned char *decrypt_space;
1424 if (uncompress(dst + 6, &bytes, decrypt_space, srclen) != Z_OK) {
1425 ast_debug(1,
"Ouch, uncompress failed :(\n");
1429 *dstlen = bytes + 6;
1436 unsigned char *compress_space;
1439 unsigned long bytes;
1442 unsigned char iv[16];
1445 memset(compress_space, 0,
len);
1448 res = compress(compress_space, &bytes, pack->
data + 6, pack->
datalen - 6);
1450 ast_debug(1,
"Ouch, compression failed!\n");
1453 memset(&ied, 0,
sizeof(ied));
1483 if ((ied.
pos + bytes) >=
sizeof(ied.
buf)) {
1488 ied.
pos += ((bytes + 15) / 16) * 16;
1500 unsigned char dst[128];
1508 }
else if (!newkey || !newsig)
1510 if (!memcmp(peer->
rxenckey, newkey, 128) &&
1511 !memcmp(peer->
rxenckey + 128, newsig, 128)) {
1542 ast_debug(1,
"Wow, new key combo passed signature and decrypt!\n");
1543 memcpy(peer->
rxenckey, newkey, 128);
1544 memcpy(peer->
rxenckey + 128, newsig, 128);
1555 *peer_dst = *peer_src;
1568 memset(&peer_dst->
permit, 0,
sizeof(peer_dst->
permit));
1572 if (!(perm =
ast_calloc(1,
sizeof(*perm) + strlen(cur->
name) + 1)))
1582 if (!(perm =
ast_calloc(1,
sizeof(*perm) + strlen(cur->
name) + 1)))
1595 int final = hdr->
cmdresp & 0x80;
1596 int cmd = hdr->
cmdresp & 0x7f;
1601 unsigned char *bufcpy;
1625 memcpy(bufcpy, hdr->
ies, datalen);
1626 ast_debug(1,
"Got canonical message %d (%d), %d bytes data%s\n", cmd, hdr->
oseqno, datalen,
final ?
" (Final)" :
"");
1629 goto return_cleanup;
1650 if (strlen(peer->
inkey)) {
1651 hasauth = encrypted;
1716 if (!peer || !peer->
dynamic) {
1723 hasauth = encrypted;
1735 ast_verb(3,
"Registered DUNDi peer '%s' at '%s'\n",
1751 if (ies.
cause < 1) {
1755 authpass = encrypted;
1835 if (ies.
cause < 1) {
1837 ast_debug(1,
"Looks like success of some sort (%d)\n", ies.
cause);
1839 authpass = encrypted;
1888 if (ies.
cause < 1) {
1892 hasauth = encrypted;
1940 memset(&ies, 0,
sizeof(ies));
1943 memset(ied, 0,
sizeof(*ied));
1976 ddatalen =
sizeof(decoded);
1987 ast_debug(1,
"Ouch, decrypt failed :(\n");
2033 if ((pack->
h->
oseqno + 1) % 255 == iseqno) {
2084 ast_debug(1,
"Dropping packet out of window!\n");
2098 if (
errno != ECONNREFUSED)
2118 unsigned char tmp[16];
2124 while((s = strchr(secret,
';'))) *s =
'+';
2125 while((s = strchr(secret,
'/'))) *s =
'+';
2126 while((s = strchr(secret,
':'))) *s =
'+';
2127 while((s = strchr(secret,
'@'))) *s =
'+';
2135 snprintf(
tmp,
sizeof(
tmp),
"%s;%s", oldkey, newkey);
2137 snprintf(
tmp,
sizeof(
tmp),
"%s", newkey);
2161 if ((time(
NULL) - expired) < 0) {
2207 int *socket_read_id2 =
NULL;
2214 if ((res > 1000) || (res < 0))
2227 if (socket_read_id2) {
2237 int striplen =
sizeof(
"/dundi/cache");
2241 pthread_setcanceltype(PTHREAD_CANCEL_DEFERRED,
NULL);
2246 for (; db_entry; db_entry = db_entry->
next) {
2251 ast_debug(1,
"clearing expired DUNDI cache entry: %s\n", db_entry->
key);
2258 pthread_setcanceltype(PTHREAD_CANCEL_ASYNCHRONOUS,
NULL);
2259 pthread_testcancel();
2261 pthread_testcancel();
2314 e->
command =
"dundi set debug {on|off}";
2316 "Usage: dundi set debug {on|off}\n"
2317 " Enables/Disables dumping of DUNDi packets for debugging purposes\n";
2323 if (
a->argc != e->
args) {
2326 if (!strncasecmp(
a->argv[e->
args -1],
"on", 2)) {
2328 ast_cli(
a->fd,
"DUNDi Debugging Enabled\n");
2331 ast_cli(
a->fd,
"DUNDi Debugging Disabled\n");
2340 e->
command =
"dundi store history {on|off}";
2342 "Usage: dundi store history {on|off}\n"
2343 " Enables/Disables storing of DUNDi requests and times for debugging\n"
2350 if (
a->argc != e->
args) {
2353 if (!strncasecmp(
a->argv[e->
args -1],
"on", 2)) {
2355 ast_cli(
a->fd,
"DUNDi History Storage Enabled\n");
2358 ast_cli(
a->fd,
"DUNDi History Storage Disabled\n");
2368 e->
command =
"dundi flush [stats]";
2370 "Usage: dundi flush [stats]\n"
2371 " Flushes DUNDi answer cache, used primarily for debug. If\n"
2372 "'stats' is present, clears timer statistics instead of normal\n"
2378 if ((
a->argc < 2) || (
a->argc > 3)) {
2382 if (!strcasecmp(
a->argv[2],
"stats")) {
2404 ast_cli(
a->fd,
"DUNDi Cache Flushed\n");
2459 qsort(results, count,
sizeof(results[0]),
rescomp);
2471 struct timeval start;
2476 "Usage: dundi lookup <number>[@context] [bypass]\n"
2477 " Lookup the given number within the given DUNDi context\n"
2478 "(or e164 if none is specified). Bypasses cache if 'bypass'\n"
2479 "keyword is specified.\n";
2485 if ((
a->argc < 3) || (
a->argc > 4)) {
2489 if (!strcasecmp(
a->argv[3],
"bypass")) {
2505 ast_cli(
a->fd,
"DUNDi lookup returned error.\n");
2507 ast_cli(
a->fd,
"DUNDi lookup returned no results.\n");
2510 for (x=0;x<res;x++) {
2512 ast_cli(
a->fd,
" from %s, expires in %d s\n",
dr[x].eid_str,
dr[x].expiration);
2523 struct timeval start;
2526 e->
command =
"dundi precache";
2528 "Usage: dundi precache <number>[@context]\n"
2529 " Lookup the given number within the given DUNDi context\n"
2530 "(or e164 if none is specified) and precaches the results to any\n"
2531 "upstream DUNDi push servers.\n";
2536 if ((
a->argc < 3) || (
a->argc > 3)) {
2549 ast_cli(
a->fd,
"DUNDi precache returned error.\n");
2551 ast_cli(
a->fd,
"DUNDi precache returned no error.\n");
2567 "Usage: dundi query <entity>[@context]\n"
2568 " Attempts to retrieve contact information for a specific\n"
2569 "DUNDi entity identifier (EID) within a given DUNDi context (or\n"
2570 "e164 if none is specified).\n";
2575 if ((
a->argc < 3) || (
a->argc > 3)) {
2579 ast_cli(
a->fd,
"'%s' is not a valid EID!\n",
a->argv[2]);
2590 ast_cli(
a->fd,
"DUNDi Query EID returned error.\n");
2592 ast_cli(
a->fd,
"DUNDi Query EID returned no results.\n");
2594 ast_cli(
a->fd,
"DUNDi Query EID succeeded:\n");
2610 return "(Unspecified)";
2636 e->
command =
"dundi show peer";
2638 "Usage: dundi show peer [peer]\n"
2639 " Provide a detailed description of a specifid DUNDi peer.\n";
2653 switch(peer->
order) {
2658 order =
"Secondary";
2664 order =
"Quartiary";
2690 ast_cli(
a->fd,
"Last few query times:\n");
2698 ast_cli(
a->fd,
"No such peer '%s'\n",
a->argv[3]);
2705#define FORMAT2 "%-20.20s %-41s %-6.6s %-10.10s %-8.8s %-15.15s\n"
2706#define FORMAT "%-20.20s %-41s %s %-6d %-10.10s %-8.8s %-15.15s\n"
2708 int registeredonly=0;
2711 int online_peers = 0;
2712 int offline_peers = 0;
2713 int unmonitored_peers = 0;
2714 int total_peers = 0;
2717 e->
command =
"dundi show peers [registered|include|exclude|begin]";
2719 "Usage: dundi show peers [registered|include|exclude|begin]\n"
2720 " Lists all known DUNDi peers.\n"
2721 " If 'registered' is present, only registered peers are shown.\n";
2727 if ((
a->argc != 3) && (
a->argc != 4) && (
a->argc != 5)) {
2730 if ((
a->argc == 4)) {
2731 if (!strcasecmp(
a->argv[3],
"registered")) {
2738 ast_cli(
a->fd,
FORMAT2,
"EID",
"Host",
"Port",
"Model",
"AvgTime",
"Status");
2741 int print_line = -1;
2750 strcpy(
status,
"UNREACHABLE");
2762 strcpy(
status,
"UNKNOWN");
2766 strcpy(
status,
"Unmonitored");
2767 unmonitored_peers++;
2772 strcpy(
avgms,
"Unavail");
2778 if (!strcasecmp(
a->argv[3],
"include") && strstr(srch,
a->argv[4])) {
2780 }
else if (!strcasecmp(
a->argv[3],
"exclude") && !strstr(srch,
a->argv[4])) {
2782 }
else if (!strcasecmp(
a->argv[3],
"begin") && !strncasecmp(srch,
a->argv[4],strlen(
a->argv[4]))) {
2795 ast_cli(
a->fd,
"%d dundi peers [%d online, %d offline, %d unmonitored]\n", total_peers, online_peers, offline_peers, unmonitored_peers);
2804#define FORMAT2 "%-47s %-5.5s %-5.5s %-3.3s %-3.3s %-3.3s\n"
2805#define FORMAT "%-41s:%5d %-5.5d %-5.5d %-3.3d %-3.3d %-3.3d\n"
2809 e->
command =
"dundi show trans";
2811 "Usage: dundi show trans\n"
2812 " Lists all known DUNDi transactions.\n";
2838 e->
command =
"dundi show entityid";
2840 "Usage: dundi show entityid\n"
2841 " Displays the global entityid for this host.\n";
2852 ast_cli(
a->fd,
"Global EID for this system is '%s'\n", eid_str);
2858#define FORMAT2 "%-15s %-15s %-15s %-3.3s %-3.3s\n"
2859#define FORMAT "%-15s %-15s %-15s %-3.3d %-3.3d\n"
2864 e->
command =
"dundi show requests";
2866 "Usage: dundi show requests\n"
2867 " Lists all known pending DUNDi requests.\n";
2891#define FORMAT2 "%-12.12s %-7.7s %-12.12s %-10.10s %-5.5s %-25.25s\n"
2892#define FORMAT "%-12.12s %-7s %-12.12s %-10.10s %-5.5s %-25.25s\n"
2898 e->
command =
"dundi show mappings";
2900 "Usage: dundi show mappings\n"
2901 " Lists all known DUNDi mappings.\n";
2910 ast_cli(
a->fd,
FORMAT2,
"DUNDi Cntxt",
"Weight",
"Local Cntxt",
"Options",
"Tech",
"Destination");
2925#define FORMAT2 "%-12.12s %-12.12s %-10.10s\n"
2926#define FORMAT "%-12.12s %-12.12s %02d:%02d:%02d\n"
2932 e->
command =
"dundi show precache";
2934 "Usage: dundi show precache\n"
2935 " Lists all known DUNDi scheduled precache updates.\n";
2963#define FORMAT2 "%-12.12s %-16.16s %-10.10s %-18s %-7s %s\n"
2964#define FORMAT "%-12.12s %-16.16s %6d sec %-18s %-7d %s/%s (%s)\n"
2969 char src_eid_str[20];
2970 int expiry, tech,
weight;
2978 e->
command =
"dundi show cache";
2980 "Usage: dundi show cache\n"
2981 " Lists all DUNDi cache entries.\n";
2993 ast_cli(
a->fd,
FORMAT2,
"Number",
"Context",
"Expiration",
"From",
"Weight",
"Destination (Flags)");
2994 for (db_entry = db_tree; db_entry; db_entry = db_entry->
next) {
2997 if ((strncmp(db_entry->
key,
"/dundi/cache/hint/", 18) == 0) ||
ast_get_time_t(db_entry->
data, &ts, 0, &length)) {
3007 ptr = db_entry->
key +
sizeof(
"/dundi/cache");
3008 strtok_r(ptr,
"/", &rest);
3011 ptr = strtok_r(
NULL,
"/", &rest);
3017 ptr = db_entry->
data + length + 1;
3019 if ((sscanf(ptr,
"%30u/%30d/%30d/%n", &(
flags.flags), &
weight, &tech, &length) != 3)) {
3025 term = strchr(ptr,
'|');
3035 src = strrchr(ptr,
'/');
3045 ast_cli(
a->fd,
FORMAT,
number,
context, expiry, src_eid_str,
weight,
tech2str(tech), dst,
dundi_flags2str(fs,
sizeof(fs),
flags.flags));
3048 ast_cli(
a->fd,
"Number of entries: %d\n", cnt);
3058#define FORMAT2 "%-12.12s %-16.16s %-10.10s %-18s\n"
3059#define FORMAT "%-12.12s %-16.16s %6d sec %-18s\n"
3064 char src_eid_str[20];
3071 e->
command =
"dundi show hints";
3073 "Usage: dundi show hints\n"
3074 " Lists all DUNDi 'DONTASK' hints in the cache.\n";
3088 for (db_entry = db_tree; db_entry; db_entry = db_entry->
next) {
3101 ptr = db_entry->
key +
sizeof(
"/dundi/cache/hint");
3102 src = strtok_r(ptr,
"/", &rest);
3105 ptr = strtok_r(
NULL,
"/", &rest);
3117 ast_cli(
a->fd,
"Number of entries: %d\n", cnt);
3155 if (!(trans =
ast_calloc(1,
sizeof(*trans))))
3229 if (ms < peer->
maxms) {
3273 if (write(trans->
parent->
pfds[1],
"killa!", 6) < 0) {
3322 if (ast_test_flag(trans, FLAG_ENCRYPT))
3427 memset(&ied, 0,
sizeof(ied));
3451 int direct[1] = { 0, };
3458 memset(&hmd, 0,
sizeof(hmd));
3459 memset(&
dr, 0,
sizeof(
dr));
3461 for (x=0;x<mapcount;x++)
3465 for (x=0;x<ouranswers;x++) {
3471 res =
dundi_lookup_internal(
dr + ouranswers,
MAX_RESULTS - ouranswers,
NULL, trans->
parent->
dcontext, trans->
parent->
number, trans->
ttl, 1, &hmd, &expiration, 0, 1, &trans->
them_eid, avoid, direct);
3478 if (ouranswers > 0) {
3479 *foundanswers += ouranswers;
3480 memset(&ied, 0,
sizeof(ied));
3489 for (x=0;x<ouranswers;x++) {
3491 if (
dr[x].expiration && (expiration >
dr[x].expiration))
3492 expiration =
dr[x].expiration;
3499 if (expiration < *minexp)
3500 *minexp = expiration;
3517 memset(&ied, 0,
sizeof(ied));
3565 ast_debug(1,
"Our transaction went away!\n");
3673 trans->
eids[x] = *avoid[x];
3706static void build_transactions(
struct dundi_request *
dr,
int ttl,
int order,
int *foundcache,
int *skipped,
int blockempty,
int nocache,
int modeselect,
dundi_eid *skip,
dundi_eid *avoid[],
int directs[])
3716 if (modeselect == 1) {
3738 for (x=0;avoid[x];x++) {
3741 if (directs && !directs[x])
3757 }
else if (!*skipped || (p->
order < *skipped))
3758 *skipped = p->
order;
3772 dr->dcontext,
dr->number);
3773 if (!strcasecmp(cur->
dcontext,
dr->dcontext) &&
3774 !strcasecmp(cur->
number,
dr->number) &&
3776 ast_debug(1,
"Found existing query for '%s@%s' for '%s' crc '%08x'\n",
3784 ast_debug(1,
"Registering request for '%s@%s' on behalf of '%s' crc '%08x'\n",
3819 uint32_t acrc32 = 0;
3821 for (x=0;avoid[x];x++) {
3824 acrc32 ^=
crc32(0L, (
unsigned char *)avoid[x],
sizeof(
dundi_eid));
3830static int dundi_lookup_internal(
struct dundi_result *
result,
int maxret,
struct ast_channel *chan,
const char *
dcontext,
const char *
number,
int ttl,
int blockempty,
struct dundi_hint_metadata *
hmd,
int *
expiration,
int cbypass,
int modeselect,
dundi_eid *skip,
dundi_eid *avoid[],
int direct[])
3842 struct timeval start;
3850 for (x=0;avoid[x];x++)
3853 memset(&
dr, 0,
sizeof(
dr));