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
[email protected]
List Archive: http://list.sipfoundry.org/archive/sipxtapi-dev/

Reply via email to