diff options
author | Joshua Colp <jcolp@digium.com> | 2012-07-09 19:05:25 +0000 |
---|---|---|
committer | Joshua Colp <jcolp@digium.com> | 2012-07-09 19:05:25 +0000 |
commit | b46e1b45e4a1c466c89c59065abf760cc278714a (patch) | |
tree | 8fc4a8d26de926d3e9c5a5c754e00e7812d571be /channels/chan_motif.c | |
parent | 04504e80a36797b2cf59e7556a251d2c0a357d04 (diff) |
Force the clock rate of G.722 to be 16000 when using the Google transports as it is 8000 elsewhere.
(closes issue ASTERISK-20105)
Reported by: Malcolm Davenport
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@369838 65c4cc65-6c06-0410-ace0-fbb531ad65f3
Diffstat (limited to 'channels/chan_motif.c')
-rw-r--r-- | channels/chan_motif.c | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/channels/chan_motif.c b/channels/chan_motif.c index 60d201e06..d7238cec5 100644 --- a/channels/chan_motif.c +++ b/channels/chan_motif.c @@ -1142,8 +1142,13 @@ static int jingle_add_payloads_to_description(struct jingle_session *session, st iks_insert_attrib(payload, "id", tmp); iks_insert_attrib(payload, "name", ast_rtp_lookup_mime_subtype2(1, &format, 0, 0)); iks_insert_attrib(payload, "channels", "1"); - snprintf(tmp, sizeof(tmp), "%d", ast_rtp_lookup_sample_rate2(1, &format, 0)); - iks_insert_attrib(payload, "clockrate", tmp); + + if ((format.id == AST_FORMAT_G722) && ((session->transport == JINGLE_TRANSPORT_GOOGLE_V1) || (session->transport == JINGLE_TRANSPORT_GOOGLE_V2))) { + iks_insert_attrib(payload, "clockrate", "16000"); + } else { + snprintf(tmp, sizeof(tmp), "%d", ast_rtp_lookup_sample_rate2(1, &format, 0)); + iks_insert_attrib(payload, "clockrate", tmp); + } iks_insert_node(description, payload); payloads[i++] = payload; |