]> git.ipfire.org Git - thirdparty/asterisk.git/commitdiff
Fix issue where it would be possible for the negotiated codecs to get set back to...
authorJoshua Colp <jcolp@digium.com>
Mon, 18 Jun 2007 13:55:00 +0000 (13:55 +0000)
committerJoshua Colp <jcolp@digium.com>
Mon, 18 Jun 2007 13:55:00 +0000 (13:55 +0000)
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@69625 65c4cc65-6c06-0410-ace0-fbb531ad65f3

channels/chan_sip.c

index 6a61a018a85063f9f4f06ece7fff5906f32c36ee..362976e655baeaa229e9924dcb25e1c0118ca229 100644 (file)
@@ -17085,14 +17085,16 @@ static int sip_set_rtp_peer(struct ast_channel *chan, struct ast_rtp *rtp, struc
                memset(&p->vredirip, 0, sizeof(p->vredirip));
                changed = 1;
        }
-       if (codecs && (p->redircodecs != codecs)) {
-               p->redircodecs = codecs;
-               changed = 1;
-       }
-       if ((p->capability & codecs) != p->capability) {
-               p->jointcapability &= codecs;
-               p->capability &= codecs;
-               changed = 1;
+       if (codecs) {
+               if ((p->redircodecs != codecs)) {
+                       p->redircodecs = codecs;
+                       changed = 1;
+               }
+               if ((p->capability & codecs) != p->capability) {
+                       p->jointcapability &= codecs;
+                       p->capability &= codecs;
+                       changed = 1;
+               }
        }
        if (changed && !ast_test_flag(&p->flags[0], SIP_GOTREFER)) {
                if (chan->_state != AST_STATE_UP) {     /* We are in early state */