From b06465a3b838854d997adc5437ba087fde3b895c Mon Sep 17 00:00:00 2001 From: Mathieu Rene Date: Mon, 4 May 2009 22:53:41 +0000 Subject: [PATCH] MODENDP-206 Ignore ptime when missing instead of using @0i - thanks stangor git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@13231 d0543943-73ff-0310-b7d9-9358b9ac24b2 --- src/mod/endpoints/mod_sofia/sofia_glue.c | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/src/mod/endpoints/mod_sofia/sofia_glue.c b/src/mod/endpoints/mod_sofia/sofia_glue.c index e2a6ac7abd..0e0de85f1f 100644 --- a/src/mod/endpoints/mod_sofia/sofia_glue.c +++ b/src/mod/endpoints/mod_sofia/sofia_glue.c @@ -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; }