sig_analog: Add fuller Caller ID support.

A previous change, ASTERISK_29991, made it possible
to send additional Caller ID parameters that were
not previously supported.

This change adds support for analog DAHDI channels
to now be able to receive these parameters for
on-hook Caller ID, in order to enhance the usability
of CPE that support these parameters.

Resolves: #94
ASTERISK-30331

UserNote: Additional Caller ID properties are now supported on
incoming calls to FXS stations, namely the
redirecting reason and call qualifier.

(cherry picked from commit f56477a604)
This commit is contained in:
Naveen Albert
2023-05-18 16:29:35 +00:00
committed by Asterisk Development Team
parent 08053123f1
commit 0dbcc9370c
5 changed files with 52 additions and 2 deletions

View File

@@ -1073,6 +1073,8 @@ int analog_call(struct analog_pvt *p, struct ast_channel *ast, const char *rdest
}
}
/* Name and Number */
n = ast_channel_connected(ast)->id.name.valid ? ast_channel_connected(ast)->id.name.str : NULL;
l = ast_channel_connected(ast)->id.number.valid ? ast_channel_connected(ast)->id.number.str : NULL;
if (l) {
@@ -1087,12 +1089,25 @@ int analog_call(struct analog_pvt *p, struct ast_channel *ast, const char *rdest
}
if (p->use_callerid) {
const char *qual_var;
/* Caller ID Name and Number */
p->caller.id.name.str = p->lastcid_name;
p->caller.id.number.str = p->lastcid_num;
p->caller.id.name.valid = ast_channel_connected(ast)->id.name.valid;
p->caller.id.number.valid = ast_channel_connected(ast)->id.number.valid;
p->caller.id.name.presentation = ast_channel_connected(ast)->id.name.presentation;
p->caller.id.number.presentation = ast_channel_connected(ast)->id.number.presentation;
/* Redirecting Reason */
p->redirecting_reason = ast_channel_redirecting(ast)->from.number.valid ? ast_channel_redirecting(ast)->reason.code : -1;
/* Call Qualifier */
ast_channel_lock(ast);
/* XXX In the future, we may want to make this a CALLERID or CHANNEL property and fetch it from there. */
qual_var = pbx_builtin_getvar_helper(ast, "CALL_QUALIFIER");
p->call_qualifier = ast_true(qual_var) ? 1 : 0;
ast_channel_unlock(ast);
}
ast_setstate(ast, AST_STATE_RINGING);