]> git.ipfire.org Git - thirdparty/asterisk.git/commitdiff
chan_sip: Decline image streams on unsupported transports
authorKinsey Moore <kmoore@digium.com>
Wed, 22 Jan 2014 18:27:19 +0000 (18:27 +0000)
committerKinsey Moore <kmoore@digium.com>
Wed, 22 Jan 2014 18:27:19 +0000 (18:27 +0000)
This change allows chan_sip to decline individual image streams over
unsupported transports in the SDP of the 200 response. Previously,
an image stream offer with RTP/AVP as the transport would cause
chan_sip to respond with a 488.

(closes issue ASTERISK-22988)
Reported by: adomjan
Original patch by: adomjan

git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.8@406170 65c4cc65-6c06-0410-ace0-fbb531ad65f3

channels/chan_sip.c

index 4d329cdc39c75a98fd3a7e79317ee2a7a0ab1b36..1b7dd8461d8ef65613b09a50f93ff5cf7e83b44f 100644 (file)
@@ -9366,7 +9366,7 @@ static int process_sdp(struct sip_pvt *p, struct sip_request *req, int t38action
                int image = FALSE;
                int text = FALSE;
                int processed_crypto = FALSE;
-               char protocol[5] = {0,};
+               char protocol[18] = {0,};
                int x;
 
                numberofports = 0;
@@ -9550,6 +9550,9 @@ static int process_sdp(struct sip_pvt *p, struct sip_request *req, int t38action
                                         * respond with the EC they want to use */
                                        ast_udptl_set_error_correction_scheme(p->udptl, UDPTL_ERROR_CORRECTION_NONE);
                                }
+                       } else if (sscanf(m, "image %30u %17s t38%n", &x, protocol, &len) == 2 && len > 0) {
+                               ast_log(LOG_WARNING, "Declining image stream due to unsupported transport: %s\n", m);
+                               continue;
                        } else {
                                ast_log(LOG_WARNING, "Rejecting image media offer due to invalid or unsupported syntax: %s\n", m);
                                return -1;