|
|
|
@ -1568,7 +1568,7 @@ static int handle_command_response(struct dundi_transaction *trans, struct dundi
|
|
|
|
|
if (cmd == DUNDI_COMMAND_EIDQUERY) {
|
|
|
|
|
res = dundi_answer_entity(trans, &ies, ies.called_context);
|
|
|
|
|
} else {
|
|
|
|
|
if (!ies.called_number || ast_strlen_zero(ies.called_number)) {
|
|
|
|
|
if (ast_strlen_zero(ies.called_number)) {
|
|
|
|
|
/* They're not permitted to access that context */
|
|
|
|
|
dundi_ie_append_cause(&ied, DUNDI_IE_CAUSE, DUNDI_CAUSE_GENERAL, "Invalid or missing number/entity");
|
|
|
|
|
dundi_send(trans, resp, 0, 1, &ied);
|
|
|
|
@ -3872,7 +3872,7 @@ static int dundi_lookup_exec(struct ast_channel *chan, void *data)
|
|
|
|
|
dep_warning = 1;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (!data || ast_strlen_zero(data)) {
|
|
|
|
|
if (ast_strlen_zero(data)) {
|
|
|
|
|
ast_log(LOG_WARNING, "DUNDiLookup requires an argument (number)\n");
|
|
|
|
|
LOCAL_USER_REMOVE(u);
|
|
|
|
|
return 0;
|
|
|
|
@ -3898,7 +3898,7 @@ static int dundi_lookup_exec(struct ast_channel *chan, void *data)
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (!context || ast_strlen_zero(context))
|
|
|
|
|
if (ast_strlen_zero(context))
|
|
|
|
|
context = "e164";
|
|
|
|
|
|
|
|
|
|
results = dundi_lookup(dr, MAX_RESULTS, NULL, context, num, bypass);
|
|
|
|
@ -3934,7 +3934,7 @@ static char *dundifunc_read(struct ast_channel *chan, char *cmd, char *data, cha
|
|
|
|
|
|
|
|
|
|
buf[0] = '\0';
|
|
|
|
|
|
|
|
|
|
if (!data || ast_strlen_zero(data)) {
|
|
|
|
|
if (ast_strlen_zero(data)) {
|
|
|
|
|
ast_log(LOG_WARNING, "DUNDILOOKUP requires an argument (number)\n");
|
|
|
|
|
LOCAL_USER_REMOVE(u);
|
|
|
|
|
return buf;
|
|
|
|
@ -3960,7 +3960,7 @@ static char *dundifunc_read(struct ast_channel *chan, char *cmd, char *data, cha
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (!context || ast_strlen_zero(context))
|
|
|
|
|
if (ast_strlen_zero(context))
|
|
|
|
|
context = "e164";
|
|
|
|
|
|
|
|
|
|
results = dundi_lookup(dr, MAX_RESULTS, NULL, context, num, bypass);
|
|
|
|
@ -4447,19 +4447,19 @@ static int dundi_helper(struct ast_channel *chan, const char *context, const cha
|
|
|
|
|
/* If done as a macro, use macro extension */
|
|
|
|
|
if (!strcasecmp(exten, "s")) {
|
|
|
|
|
exten = pbx_builtin_getvar_helper(chan, "ARG1");
|
|
|
|
|
if (!exten || ast_strlen_zero(exten))
|
|
|
|
|
if (ast_strlen_zero(exten))
|
|
|
|
|
exten = chan->macroexten;
|
|
|
|
|
if (!exten || ast_strlen_zero(exten))
|
|
|
|
|
if (ast_strlen_zero(exten))
|
|
|
|
|
exten = chan->exten;
|
|
|
|
|
if (!exten || ast_strlen_zero(exten)) {
|
|
|
|
|
if (ast_strlen_zero(exten)) {
|
|
|
|
|
ast_log(LOG_WARNING, "Called in Macro mode with no ARG1 or MACRO_EXTEN?\n");
|
|
|
|
|
return -1;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
if (!data || ast_strlen_zero(data))
|
|
|
|
|
if (ast_strlen_zero(data))
|
|
|
|
|
data = "e164";
|
|
|
|
|
} else {
|
|
|
|
|
if (!data || ast_strlen_zero(data))
|
|
|
|
|
if (ast_strlen_zero(data))
|
|
|
|
|
data = context;
|
|
|
|
|
}
|
|
|
|
|
res = dundi_lookup(results, MAX_RESULTS, chan, data, exten, 0);
|
|
|
|
@ -4498,19 +4498,19 @@ static int dundi_exec(struct ast_channel *chan, const char *context, const char
|
|
|
|
|
/* If done as a macro, use macro extension */
|
|
|
|
|
if (!strcasecmp(exten, "s")) {
|
|
|
|
|
exten = pbx_builtin_getvar_helper(chan, "ARG1");
|
|
|
|
|
if (!exten || ast_strlen_zero(exten))
|
|
|
|
|
if (ast_strlen_zero(exten))
|
|
|
|
|
exten = chan->macroexten;
|
|
|
|
|
if (!exten || ast_strlen_zero(exten))
|
|
|
|
|
if (ast_strlen_zero(exten))
|
|
|
|
|
exten = chan->exten;
|
|
|
|
|
if (!exten || ast_strlen_zero(exten)) {
|
|
|
|
|
if (ast_strlen_zero(exten)) {
|
|
|
|
|
ast_log(LOG_WARNING, "Called in Macro mode with no ARG1 or MACRO_EXTEN?\n");
|
|
|
|
|
return -1;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
if (!data || ast_strlen_zero(data))
|
|
|
|
|
if (ast_strlen_zero(data))
|
|
|
|
|
data = "e164";
|
|
|
|
|
} else {
|
|
|
|
|
if (!data || ast_strlen_zero(data))
|
|
|
|
|
if (ast_strlen_zero(data))
|
|
|
|
|
data = context;
|
|
|
|
|
}
|
|
|
|
|
res = dundi_lookup(results, MAX_RESULTS, chan, data, exten, 0);
|
|
|
|
|