res_pjsip_diversion: handle 181

Adapt the response handler so it also called when 181 is received.
In the case 181 is received, also generate the 181 response.

ASTERISK-29001 #close

Change-Id: I73cfee46a8ca85371280ebdb38674f8fde7510df
This commit is contained in:
Torrey Searle 2020-07-22 10:45:57 +02:00 committed by George Joseph
parent c925ed0eb9
commit 04051b324b
1 changed files with 5 additions and 1 deletions

View File

@ -259,6 +259,10 @@ static void set_redirecting(struct ast_sip_session *session,
++data.count;
ast_channel_set_redirecting(session->channel, &data, &update);
/* Only queue an indication if it was due to a response */
if (session->inv_session->role == PJSIP_ROLE_UAC) {
ast_channel_queue_redirecting_update(session->channel, &data, &update);
}
ast_party_redirecting_free(&data);
}
@ -406,7 +410,7 @@ static struct ast_sip_session_supplement diversion_supplement = {
.incoming_response = diversion_incoming_response,
.outgoing_request = diversion_outgoing_request,
.outgoing_response = diversion_outgoing_response,
.response_priority = AST_SIP_SESSION_BEFORE_REDIRECTING,
.response_priority = AST_SIP_SESSION_BEFORE_REDIRECTING|AST_SIP_SESSION_BEFORE_MEDIA,
};
static int load_module(void)