]> git.ipfire.org Git - thirdparty/asterisk.git/commitdiff
pjsip: Generate progress (once) when receiving a 180 with a SDP
authorHolger Hans Peter Freyther <holger@moiji-mobile.com>
Thu, 7 Jan 2021 14:25:05 +0000 (22:25 +0800)
committerJoshua Colp <jcolp@sangoma.com>
Tue, 2 Mar 2021 17:22:44 +0000 (11:22 -0600)
ASTERISK-29105

Change-Id: If1615fe7115fe544ef974b044d3cea5c48b94a38

channels/chan_pjsip.c

index 5c194434685f8284240d979ae708f78afe44cb5b..773471d8ef7dce197592263e53c0c094b92f0c56 100644 (file)
@@ -3193,15 +3193,23 @@ static void chan_pjsip_incoming_response(struct ast_sip_session *session, struct
        }
 
        switch (status.code) {
-       case 180:
-               ast_trace(-1, "%s: Queueing RINGING\n", ast_sip_session_get_name(session));
-               ast_queue_control(session->channel, AST_CONTROL_RINGING);
+       case 180: {
+               pjsip_rdata_sdp_info *sdp = pjsip_rdata_get_sdp_info(rdata);
+               if (sdp && sdp->body.ptr) {
+                       ast_trace(-1, "%s: Queueing PROGRESS\n", ast_sip_session_get_name(session));
+                       ast_queue_control(session->channel, AST_CONTROL_PROGRESS);
+               } else {
+                       ast_trace(-1, "%s: Queueing RINGING\n", ast_sip_session_get_name(session));
+                       ast_queue_control(session->channel, AST_CONTROL_RINGING);
+               }
+
                ast_channel_lock(session->channel);
                if (ast_channel_state(session->channel) != AST_STATE_UP) {
                        ast_setstate(session->channel, AST_STATE_RINGING);
                }
                ast_channel_unlock(session->channel);
                break;
+       }
        case 183:
                ast_trace(-1, "%s: Queueing PROGRESS\n", ast_sip_session_get_name(session));
                if (session->endpoint->ignore_183_without_sdp) {