aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorrussell <russell@f38db490-d61c-443f-a65b-d21fe96a405b>2008-02-01 23:06:32 +0000
committerrussell <russell@f38db490-d61c-443f-a65b-d21fe96a405b>2008-02-01 23:06:32 +0000
commitd76b2bde7902b2bee69c5a1ca18a94b1ac35c4fa (patch)
treec469f2f2c67f7fbc1cb852a50ce189422331370e
parente1115249eb2e81adda75c83d77f9621fa491525c (diff)
Change the SDP_SAMPLE_RATE macro. It turns out that even though G.722 is 16 kHz,
it is supposed to specified as 8 kHz in the RTP, and RTP timestamps are supposed to be calculated based on 8 kHz. (Apparently this is due to a bug in a spec, but people follow it anyway, because it's the spec ...) git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.4@101989 f38db490-d61c-443f-a65b-d21fe96a405b
-rw-r--r--channels/chan_sip.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/channels/chan_sip.c b/channels/chan_sip.c
index 13351e7fb..ff09964e5 100644
--- a/channels/chan_sip.c
+++ b/channels/chan_sip.c
@@ -6346,7 +6346,12 @@ static void add_noncodec_to_sdp(const struct sip_pvt *p, int format, int sample_
ast_build_string(a_buf, a_size, "a=fmtp:%d 0-16\r\n", rtp_code);
}
-#define SDP_SAMPLE_RATE(x) (x == AST_FORMAT_G722) ? 16000 : 8000
+/*!
+ * \note G.722 actually is supposed to specified as 8 kHz, even though it is
+ * really 16 kHz. Update this macro for other formats as they are added in
+ * the future.
+ */
+#define SDP_SAMPLE_RATE(x) 8000
/*! \brief Add Session Description Protocol message */
static enum sip_result add_sdp(struct sip_request *resp, struct sip_pvt *p)