aboutsummaryrefslogtreecommitdiffstats
path: root/pbx
diff options
context:
space:
mode:
authormarkster <markster@f38db490-d61c-443f-a65b-d21fe96a405b>2004-10-29 22:31:36 +0000
committermarkster <markster@f38db490-d61c-443f-a65b-d21fe96a405b>2004-10-29 22:31:36 +0000
commitb79c33ce215b33f73857ff6babc91ea367e7a7aa (patch)
treee59f662c920a07ef39c819c40c1641e3ffa0bede /pbx
parentecaeb77ddbaa63a060b0c0dbfae2300124b3b747 (diff)
Oopsies...
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@4128 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'pbx')
-rwxr-xr-xpbx/pbx_dundi.c13
1 files changed, 8 insertions, 5 deletions
diff --git a/pbx/pbx_dundi.c b/pbx/pbx_dundi.c
index 07dd70c40..8b583ef71 100755
--- a/pbx/pbx_dundi.c
+++ b/pbx/pbx_dundi.c
@@ -3605,8 +3605,8 @@ static void reschedule_precache(const char *number, const char *context, int exp
};
if (!qe) {
len = sizeof(struct dundi_precache_queue);
- len += strlen(number + 1);
- len += strlen(context + 1);
+ len += strlen(number) + 1;
+ len += strlen(context) + 1;
qe = malloc(len);
if (qe) {
memset(qe, 0, len);
@@ -4110,7 +4110,7 @@ static void populate_addr(struct dundi_peer *peer, dundi_eid *eid)
}
-static void build_peer(dundi_eid *eid, struct ast_variable *v)
+static void build_peer(dundi_eid *eid, struct ast_variable *v, int *globalpcmode)
{
struct dundi_peer *peer;
struct ast_hostent he;
@@ -4237,6 +4237,7 @@ static void build_peer(dundi_eid *eid, struct ast_variable *v)
}
v = v->next;
}
+ (*globalpcmode) |= peer->pcmodel;
if (!peer->model && !peer->pcmodel) {
ast_log(LOG_WARNING, "Peer '%s' lacks a model or pcmodel, discarding!\n",
dundi_eid_to_str(eid_str, sizeof(eid_str), &peer->eid));
@@ -4393,6 +4394,7 @@ static int set_config(char *config_file, struct sockaddr_in* sin)
struct hostent *hp;
struct sockaddr_in sin2;
static int last_port = 0;
+ int globalpcmodel = 0;
dundi_eid testeid;
dundi_ttl = DUNDI_DEFAULT_TTL;
@@ -4512,7 +4514,7 @@ static int set_config(char *config_file, struct sockaddr_in* sin)
if (strcasecmp(cat, "general") && strcasecmp(cat, "mappings")) {
/* Entries */
if (!dundi_str_to_eid(&testeid, cat))
- build_peer(&testeid, ast_variable_browse(cfg, cat));
+ build_peer(&testeid, ast_variable_browse(cfg, cat), &globalpcmodel);
else
ast_log(LOG_NOTICE, "Ignoring invalid EID entry '%s'\n", cat);
}
@@ -4521,7 +4523,8 @@ static int set_config(char *config_file, struct sockaddr_in* sin)
prune_peers();
ast_destroy(cfg);
load_password();
- dundi_precache_full();
+ if (globalpcmodel & DUNDI_MODEL_OUTBOUND)
+ dundi_precache_full();
return 0;
}