From cbf79ca4890dd0faabb4fbbbe927e389dbc241d3 Mon Sep 17 00:00:00 2001 From: Joshua Colp Date: Mon, 24 Jul 2006 15:47:59 +0000 Subject: Start out with cleared RTP payload structures instead of defaults. This should prevent issues where if a stream (audio/stream) is not present and it's RTP payload structure is combined with the overall capability then the capability would be every codec that Asterisk supports. git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@38158 65c4cc65-6c06-0410-ace0-fbb531ad65f3 --- channels/chan_sip.c | 13 ++++--------- 1 file changed, 4 insertions(+), 9 deletions(-) (limited to 'channels') diff --git a/channels/chan_sip.c b/channels/chan_sip.c index 97130210f..f3ff61504 100644 --- a/channels/chan_sip.c +++ b/channels/chan_sip.c @@ -4478,11 +4478,11 @@ static int process_sdp(struct sip_pvt *p, struct sip_request *req) /* Initialize the temporary RTP structures we use to evaluate the offer from the peer */ newaudiortp = alloca(ast_rtp_alloc_size()); memset(newaudiortp, 0, ast_rtp_alloc_size()); - ast_rtp_pt_default(newaudiortp); + ast_rtp_pt_clear(newaudiortp); newvideortp = alloca(ast_rtp_alloc_size()); memset(newvideortp, 0, ast_rtp_alloc_size()); - ast_rtp_pt_default(newvideortp); + ast_rtp_pt_clear(newvideortp); /* Update our last rtprx when we receive an SDP, too */ p->lastrtprx = p->lastrtptx = time(NULL); /* XXX why both ? */ @@ -4520,8 +4520,6 @@ static int process_sdp(struct sip_pvt *p, struct sip_request *req) int x; int audio = FALSE; - if (p->vrtp) - ast_rtp_pt_clear(newvideortp); /* Must be cleared in case no m=video line exists */ numberofports = 1; if ((sscanf(m, "audio %d/%d RTP/AVP %n", &x, &numberofports, &len) == 2) || (sscanf(m, "audio %d RTP/AVP %n", &x, &len) == 1)) { @@ -4530,7 +4528,6 @@ static int process_sdp(struct sip_pvt *p, struct sip_request *req) /* Found audio stream in this media definition */ portno = x; /* Scan through the RTP payload types specified in a "m=" line: */ - ast_rtp_pt_clear(newaudiortp); for (codecs = m + len; !ast_strlen_zero(codecs); codecs = ast_skip_blanks(codecs + len)) { if (sscanf(codecs, "%d%n", &codec, &len) != 1) { ast_log(LOG_WARNING, "Error in codec string '%s'\n", codecs); @@ -4825,10 +4822,8 @@ static int process_sdp(struct sip_pvt *p, struct sip_request *req) } /* Now gather all of the codecs that we are asked for: */ - if (p->rtp) - ast_rtp_get_current_formats(newaudiortp, &peercapability, &peernoncodeccapability); - if (p->vrtp) - ast_rtp_get_current_formats(newvideortp, &vpeercapability, &vpeernoncodeccapability); + ast_rtp_get_current_formats(newaudiortp, &peercapability, &peernoncodeccapability); + ast_rtp_get_current_formats(newvideortp, &vpeercapability, &vpeernoncodeccapability); newjointcapability = p->capability & (peercapability | vpeercapability); newpeercapability = (peercapability | vpeercapability); -- cgit v1.2.3