mirror of
https://github.com/asterisk/asterisk.git
synced 2025-11-20 16:50:14 +00:00
Allow for redirecting reasons to be set to arbitrary strings.
This allows for the REDIRECTING dialplan function to be used to set the reason to any string. The SIP channel driver has been modified to set the redirecting reason string to the value received in a Diversion header. In addition, SIP 480 response reason text will set the redirecting reason as well. (closes issue AST-942) reported by Malcolm Davenport (closes issue AST-943) reported by Malcolm Davenport Review: https://reviewboard.asterisk.org/r/2101 git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@373701 65c4cc65-6c06-0410-ace0-fbb531ad65f3
This commit is contained in:
@@ -1237,12 +1237,17 @@ const char *ast_redirecting_reason_describe(int data)
|
||||
return "not-known";
|
||||
}
|
||||
|
||||
const char *ast_redirecting_reason_name(int data)
|
||||
const char *ast_redirecting_reason_name(const struct ast_party_redirecting_reason *data)
|
||||
{
|
||||
int index;
|
||||
|
||||
if (!ast_strlen_zero(data->str)) {
|
||||
/* Use this string if it has been set. Otherwise, use the table. */
|
||||
return data->str;
|
||||
}
|
||||
|
||||
for (index = 0; index < ARRAY_LEN(redirecting_reason_types); ++index) {
|
||||
if (redirecting_reason_types[index].value == data) {
|
||||
if (redirecting_reason_types[index].value == data->code) {
|
||||
return redirecting_reason_types[index].name;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user