]> git.ipfire.org Git - thirdparty/freeswitch.git/commitdiff
rewrite video port too
authorAnthony Minessale <anthony.minessale@gmail.com>
Fri, 23 May 2008 12:39:35 +0000 (12:39 +0000)
committerAnthony Minessale <anthony.minessale@gmail.com>
Fri, 23 May 2008 12:39:35 +0000 (12:39 +0000)
git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@8538 d0543943-73ff-0310-b7d9-9358b9ac24b2

src/mod/endpoints/mod_sofia/sofia_glue.c

index e52a4d7a13d588a60f004bd1312f9d042c68eb7a..7dc3a62381ffa3f5e5613b7116b9749be68e0ec1 100644 (file)
@@ -777,7 +777,7 @@ switch_status_t sofia_glue_tech_proxy_remote_addr(private_object_t *tech_pvt)
 void sofia_glue_tech_patch_sdp(private_object_t *tech_pvt)
 {
        switch_size_t len;
-       char *p, *q, *ip_ptr = NULL, *port_ptr = NULL;
+       char *p, *q, *ip_ptr = NULL, *port_ptr = NULL, *vport_ptr = NULL;
        int x;
 
        if (switch_strlen_zero(tech_pvt->local_sdp_str)) {
@@ -798,6 +798,10 @@ void sofia_glue_tech_patch_sdp(private_object_t *tech_pvt)
        if ((p = (char *)switch_stristr("m=audio ", tech_pvt->local_sdp_str))) {
                port_ptr = p + 8;
        }
+
+       if ((p = (char *)switch_stristr("m=video ", tech_pvt->local_sdp_str))) {
+               vport_ptr = p + 8;
+       }
        
        if (!(ip_ptr && port_ptr)) {
                switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "%s SDP has no audio in it.\n%s\n", 
@@ -840,6 +844,16 @@ void sofia_glue_tech_patch_sdp(private_object_t *tech_pvt)
                        while(p && *p && (*p >= '0' && *p <= '9')) {
                                p++;
                        }
+               } else if (vport_ptr && p == vport_ptr) {
+                       char port_buf[25] = "";
+                       
+                       switch_snprintf(port_buf, sizeof(port_buf), "%u", tech_pvt->adv_sdp_video_port);
+                       strncpy(q, port_buf, strlen(port_buf));
+                       q += strlen(port_buf);
+                       x = 0;
+                       while(p && *p && (*p >= '0' && *p <= '9')) {
+                               p++;
+                       }
                }
 
                *q++ = *p++;