]> git.ipfire.org Git - thirdparty/freeswitch.git/commitdiff
MODENDP-206 Ignore ptime when missing instead of using @0i - thanks stangor
authorMathieu Rene <mrene@avgs.ca>
Mon, 4 May 2009 22:53:41 +0000 (22:53 +0000)
committerMathieu Rene <mrene@avgs.ca>
Mon, 4 May 2009 22:53:41 +0000 (22:53 +0000)
git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@13231 d0543943-73ff-0310-b7d9-9358b9ac24b2

src/mod/endpoints/mod_sofia/sofia_glue.c

index e2a6ac7abdb56fa7a2fd1075b0361b753ff58cbc..0e0de85f1f2a071be4c091d036e4b3361bf06cd3 100644 (file)
@@ -2487,7 +2487,11 @@ void sofia_glue_set_r_sdp_codec_string(switch_channel_t *channel,const char *cod
                                        }
 
                                        if (match) {
-                                               switch_snprintf(buf + strlen(buf), sizeof(buf) - strlen(buf), ",%s@%uh@%di", imp->iananame, (int) map->rm_rate, ptime);
+                                               if(ptime > 0) {
+                                                       switch_snprintf(buf + strlen(buf), sizeof(buf) - strlen(buf), ",%s@%uh@%di", imp->iananame, (unsigned int) map->rm_rate, ptime);
+                                               } else {
+                                                       switch_snprintf(buf + strlen(buf), sizeof(buf) - strlen(buf), ",%s@%uh", imp->iananame, (unsigned int) map->rm_rate);
+                                               }
                                                already_did[imp->ianacode] = 1;
                                                break;
                                        }
@@ -2524,7 +2528,11 @@ void sofia_glue_set_r_sdp_codec_string(switch_channel_t *channel,const char *cod
                                        }
 
                                        if (match) {
-                                               switch_snprintf(buf + strlen(buf), sizeof(buf) - strlen(buf), ",%s@%uh@%di", imp->iananame, (int) map->rm_rate, ptime);
+                                               if(ptime > 0) {
+                                                       switch_snprintf(buf + strlen(buf), sizeof(buf) - strlen(buf), ",%s@%uh@%di", imp->iananame, (unsigned int) map->rm_rate, ptime);
+                                               } else {
+                                                       switch_snprintf(buf + strlen(buf), sizeof(buf) - strlen(buf), ",%s@%uh", imp->iananame, (unsigned int) map->rm_rate);
+                                               }
                                                already_did[imp->ianacode] = 1;
                                                break;
                                        }