]> git.ipfire.org Git - thirdparty/asterisk.git/commitdiff
res_pjsip_diversion: handle 181
authorTorrey Searle <tsearle@voxbone.com>
Wed, 22 Jul 2020 08:45:57 +0000 (10:45 +0200)
committerFriendly Automation <jenkins2@gerrit.asterisk.org>
Wed, 26 Aug 2020 18:14:37 +0000 (13:14 -0500)
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

res/res_pjsip_diversion.c

index 96a9069d5b6d1ef413128dab193f2fc6e30202d6..3f7487104d2b1732ba4c4fdc19258476db1709a1 100644 (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)