Only deal with getting the supported payloads on audio if an audio RTP stream exists
authorJoshua Colp <jcolp@digium.com>
Mon, 24 Jul 2006 03:42:27 +0000 (03:42 +0000)
committerJoshua Colp <jcolp@digium.com>
Mon, 24 Jul 2006 03:42:27 +0000 (03:42 +0000)
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@38139 65c4cc65-6c06-0410-ace0-fbb531ad65f3

channels/chan_sip.c

index 07ce40d..5231b46 100644 (file)
@@ -4447,7 +4447,7 @@ static int process_sdp(struct sip_pvt *p, struct sip_request *req)
        int old = 0;
 
        /* Peer capability is the capability in the SDP, non codec is RFC2833 DTMF (101) */     
-       int peercapability, peernoncodeccapability;
+       int peercapability = 0, peernoncodeccapability = 0;
        int vpeercapability = 0, vpeernoncodeccapability = 0;
        struct sockaddr_in sin;         /*!< media socket address */
        struct sockaddr_in vsin;        /*!< Video socket address */
@@ -4825,7 +4825,8 @@ static int process_sdp(struct sip_pvt *p, struct sip_request *req)
        }
 
        /* Now gather all of the codecs that we are asked for: */
-       ast_rtp_get_current_formats(newaudiortp, &peercapability, &peernoncodeccapability);
+       if (p->rtp)
+               ast_rtp_get_current_formats(newaudiortp, &peercapability, &peernoncodeccapability);
        if (p->vrtp)
                ast_rtp_get_current_formats(newvideortp, &vpeercapability, &vpeernoncodeccapability);