]> git.ipfire.org Git - thirdparty/asterisk.git/commitdiff
Handle media specific T.38 SDP information
authorMatthew Nicholson <mnicholson@digium.com>
Wed, 22 Sep 2010 17:39:12 +0000 (17:39 +0000)
committerMatthew Nicholson <mnicholson@digium.com>
Wed, 22 Sep 2010 17:39:12 +0000 (17:39 +0000)
(closes issue #16647)
Reported by: kwemheuer

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

channels/chan_sip.c

index b9996c1a52c3fc95390fa12be4293831c2bfba85..c652460eb9c733c617dabbf94704e28afa2df985 100644 (file)
@@ -5463,9 +5463,11 @@ static int process_sdp(struct sip_pvt *p, struct sip_request *req)
        /* Host information */
        struct ast_hostent audiohp;
        struct ast_hostent videohp;
+       struct ast_hostent imagehp;
        struct ast_hostent sessionhp;
        struct hostent *hp = NULL;      /*!< RTP Audio host IP */
        struct hostent *vhp = NULL;     /*!< RTP video host IP */
+       struct hostent *ihp = NULL;     /*!< UDPTL host IP */
        int portno = -1;                /*!< RTP Audio port number */
        int vportno = -1;               /*!< RTP Video port number */
        int udptlportno = -1;           /*!< UDPTL Image port number */
@@ -5541,6 +5543,7 @@ static int process_sdp(struct sip_pvt *p, struct sip_request *req)
                                processed = TRUE;
                                hp = &sessionhp.hp;
                                vhp = hp;
+                               ihp = hp;
                        }
                        break;
                case 'a':
@@ -5675,6 +5678,11 @@ static int process_sdp(struct sip_pvt *p, struct sip_request *req)
                                                processed = TRUE;
                                                vhp = &videohp.hp;
                                        }
+                               } else if (image) {
+                                       if (process_sdp_c(value, &imagehp)) {
+                                               processed = TRUE;
+                                               ihp = &imagehp.hp;
+                                       }
                                }
                                break;
                        case 'a':
@@ -5709,7 +5717,7 @@ static int process_sdp(struct sip_pvt *p, struct sip_request *req)
        }
 
        /* Sanity checks */
-       if (!hp && !vhp) {
+       if (!hp && !vhp && !ihp) {
                ast_log(LOG_WARNING, "Insufficient information in SDP (c=)...\n");
                return -1;
        }
@@ -5844,7 +5852,7 @@ static int process_sdp(struct sip_pvt *p, struct sip_request *req)
                                                ast_log(LOG_DEBUG, "Peer T.38 UDPTL is set behind NAT and with destination, destination address now %s\n", ast_inet_ntoa(isin.sin_addr));
                                }
                        } else
-                               memcpy(&isin.sin_addr, hp->h_addr, sizeof(isin.sin_addr));
+                               memcpy(&isin.sin_addr, ihp->h_addr, sizeof(isin.sin_addr));
                        ast_udptl_set_peer(p->udptl, &isin);
                        if (debug)
                                ast_log(LOG_DEBUG,"Peer T.38 UDPTL is at port %s:%d\n",ast_inet_ntoa(isin.sin_addr), ntohs(isin.sin_port));