Jaro,

On Sun, Feb 8, 2009 at 10:47 PM, Jaroslav Libak <jar...@seznam.cz> wrote:
> G.722 is supposed to report 8000 clockrate in SDP due to RFC bug. It also must
> use 8000 clockrate in RTP. Real sampling rate is 16Khz. If some other phone or
> software doesn't do so, its wrong and sipxtapi shouldn't have hacks to make it
> work. G.722 support already added enough hacks.

IMHO, I believe it is always good to be interoperable if you can.
If it is too much work, then there should be a line drawn in the sand.

>
> Its not very useful to use 8000 sample rate with G.722, due to degraded 
> quality.
> It simply doesn't make sense to tell people you support a wideband codec, and
> encode using 8Khz.

My point was that the default internal sampling rate for sipXtapi is
8000 so why not make the default sampling rate for G.722 be 8000 so
someone who builds it may see that it works.
However, this may give developers a false sense that it is operating
as intended at 16000 without them realizing it.
Maybe my idea is not good for the long run.

>
> Jaro
>
> D. S. schrieb:
>> As it stands, G.722 sessions will not connect using Recon with sipXtapi.
>> The reason is that G.722 sessions are negotiated with 8000 as the
>> sample rate even though it actually operates at 16000.
>> See sec. 4.5.2 in RFC3551 and the following link:
>> http://en.wikipedia.org/wiki/G.722
>>
>> I got it working with my Polycom phone with the patches to sipXtapi
>> that follows.
>> My old Grandstream Budgetone 102 phone insists on negotiating 16000 in
>> the SDP which goes against what the RFC says.
>> If anyone can add code to negotiate both rates, that would be appreciated.
>> My patch also changes the default internal sample rate of the codec to
>> get it working with the default internal sipXtapi sample rate of 8000.
>> How do you build sipXtapi to use an internal sample rate of 16000?
>>
>> David Suh
>>
>>
>> Index: SdpDefaultCodecFactory.cpp
>> ===================================================================
>> --- SdpDefaultCodecFactory.cpp        (revision 11260)
>> +++ SdpDefaultCodecFactory.cpp        (working copy)
>> @@ -69,7 +69,8 @@
>>     { SdpCodec::SDP_CODEC_G726_40,       "g726-40", 8000, 1,  NULL },
>>     { SdpCodec::SDP_CODEC_G729A,         "g729a",   8000, 1,  "annexb=no" },
>>     { SdpCodec::SDP_CODEC_G729A,         "g729",    8000, 1,  "annexb=no" },
>> -   { SdpCodec::SDP_CODEC_G722,          "g722",   16000, 1,  NULL },
>> +   // This advertised G.722 SDP sample rate is required to maintain
>> backward compatibility as stated in sec. 4.5.2 of RFC3551.
>> +   { SdpCodec::SDP_CODEC_G722,          "g722",    8000, 1,  NULL },
>>     { SdpCodec::SDP_CODEC_TONES,         "telephone-event", 8000, 1,   NULL  
>> },
>>     { SdpCodec::SDP_CODEC_L16_8000_MONO, "l16",     8000, 1,  NULL },
>>     { SdpCodec::SDP_CODEC_L16_11025_MONO, "l16",   11025, 1,  NULL },
>>
>>
>> Index: plgg722.c
>> ===================================================================
>> --- plgg722.c (revision 11260)
>> +++ plgg722.c (working copy)
>> @@ -28,8 +28,10 @@
>>  /// G.722 bitrate - we support only 64,000bps mode (as in RFC3551).
>>  #define G722_MODE      64000
>>  /// Set USE_8K_SAMPLES to G722_SAMPLE_RATE_8000 to accept 8kHz PCM data
>> -/// as input/output instead of 16kHz data.
>> -#define USE_8K_SAMPLES   0
>> +/// as input/output.
>> +/// Set USE_8K_SAMPLES to 0 to accept 16kHz PCM data
>> +/// as input/output.
>> +#define USE_8K_SAMPLES   G722_SAMPLE_RATE_8000
>>
>>  // STATIC VARIABLES INITIALIZATON
>>  /// Exported codec information.
>> @@ -45,7 +47,9 @@
>>     "G722",                      // mimeSubtype
>>     0,                           // fmtpsNum
>>     NULL,                        // fmtps
>> -   16000,                       // sampleRate
>> +   // This SDP advertised sample rate is required to maintain
>> backward compatibility as stated in sec. 4.5.2 of RFC3551.
>> +   // Actual operating sample rate is controlled by USE_8K_SAMPLES.
>> +   8000,                        // sampleRate
>>     1,                           // numChannels
>>     CODEC_FRAME_PACKING_NONE     // framePacking
>>  };
>> _______________________________________________
>> sipxtapi-dev mailing list
>> sipxtapi-dev@list.sipfoundry.org
>> List Archive: http://list.sipfoundry.org/archive/sipxtapi-dev/
>>
>
>
_______________________________________________
sipxtapi-dev mailing list
sipxtapi-dev@list.sipfoundry.org
List Archive: http://list.sipfoundry.org/archive/sipxtapi-dev/

Reply via email to