]> git.ipfire.org Git - thirdparty/freeswitch.git/commitdiff
FS-4134 --resolve
authorAnthony Minessale <anthm@freeswitch.org>
Thu, 19 Apr 2012 16:49:56 +0000 (11:49 -0500)
committerAnthony Minessale <anthm@freeswitch.org>
Thu, 19 Apr 2012 16:49:56 +0000 (11:49 -0500)
src/mod/endpoints/mod_sofia/sofia_glue.c

index eb201b3824b4368299d19aef6042bb6600dfac59..0d7f0b526aa1a28a6a02d8013506df81ff3fbb15 100644 (file)
@@ -1614,7 +1614,6 @@ void sofia_glue_tech_patch_sdp(private_object_t *tech_pvt)
        char vport_buf[25] = "";
        char *new_sdp;
        int bad = 0;
-       int skip_video = 0, skip_audio = 0, skip_image = 0;
 
        if (zstr(tech_pvt->local_sdp_str)) {
                return;
@@ -1649,14 +1648,6 @@ void sofia_glue_tech_patch_sdp(private_object_t *tech_pvt)
        qe = q + len - 1;
 
 
-       if (switch_stristr("m=video 0", p)) {
-               skip_video = 1;
-       } else if (switch_stristr("m=audio 0", p)) {
-               skip_audio = 1;
-       } else if (switch_stristr("m=image 0", p)) {
-               skip_image = 1;
-       }
-
        while (p && *p) {
                if (p >= pe) {
                        bad = 1;
@@ -1748,7 +1739,7 @@ void sofia_glue_tech_patch_sdp(private_object_t *tech_pvt)
 
                        }
 
-               } else if ((!skip_audio && !strncmp("m=audio ", p, 8)) || (!skip_image && !strncmp("m=image ", p, 8))) {
+               } else if ((!strncmp("m=audio ", p, 8) && *(p + 9) != '0') || (!strncmp("m=image ", p, 8) && *(p + 9) != '0')) {
                        strncpy(q, p, 8);
                        p += 8;
 
@@ -1784,7 +1775,7 @@ void sofia_glue_tech_patch_sdp(private_object_t *tech_pvt)
 
                        has_audio++;
 
-               } else if (!skip_video && !strncmp("m=video ", p, 8)) {
+               } else if (!strncmp("m=video ", p, 8) && *(p + 9) != '0') {
                        if (!has_video) {
                                sofia_glue_tech_choose_video_port(tech_pvt, 1);
                                tech_pvt->video_rm_encoding = "PROXY-VID";