[Asterisk-Users] Little patch for packetization in G729 in chan_h323

Jeremy McNamara jj at nufone.net
Sat Aug 23 17:11:06 MST 2003


I cannot see how this code does anything at all.  There are two sides to 
my channel driver, the Asterisk side and the H.323 side.   The 
configuration is in the Asterisk side.  Since you defined the int 
g729Frames =8 in the Asterisk side, you would need to pass that value to 
the H.323 side.

Did you actually check the value of  g729Frames in ast_h323.cpp before 
calling

g729aCap->SetTxFramesInPacket(g729Frames); ?


Jeremy McNamara




mawali at news.icns.com wrote:

>Hi
>I have hacked this patch to make G729/chan_h323 work with most other 
>platforms, all it does is let me set the packetization interval. It 
>defaults to 24 which is way too high for me and even though it should
>work but does not for some reason and after connecting the voice coming 
>from asterisk is really bad (oversampled??). This lets you set the 
>packetization to your choice (I use a value between 2 to 8) by putting 
>"g729Frames=<number>" in the h323.conf. For me g729Frames=2 works pretty 
>good.
>
>I am getting really good quality with G729 now, (this is the codec I 
>bought from digium)> And it is a G729AnnexA codec.
>
>Apply it to latest CVS by (should apply fine to older ones too)
>
>$ gunzip mawali_patch_g729packets.gz
>$ cd asterisk
>$ patch -p1 < ../mawali_patch_g729packets
>
>The patch is below and also attached as gz, since it is tiny.
>
>diff -aurp asterisk/channels/chan_h323.c asterisk-cvs030823/channels/chan_h323.c
>--- asterisk/channels/chan_h323.c       2003-08-16 12:00:22.000000000 -0500
>+++ asterisk-cvs030823/channels/chan_h323.c     2003-08-23 14:16:51.000000000 -0500
>@@ -74,6 +74,9 @@ static int  usingGk;
> static int     port = 1720;
> static int  gkroute = 0;
>
>+/* Added for G729 Packetization */
>+int  g729Frames = 8;
>+
> /* Just about everybody seems to support ulaw, so make it a nice default */
> static int capability = AST_FORMAT_ULAW;
>
>@@ -1365,6 +1368,10 @@ int reload_config()
>
>        v = ast_variable_browse(cfg, "general");
>        while(v) {
>+                /* Temporary hack to read G729 Packetization interval */
>+                if (!strcasecmp(v->name, "g729Frames")) {
>+                       g729Frames = (int)strtol(v->value, NULL, 10);
>+                }
>                /* Create the interface list */
>                if (!strcasecmp(v->name, "port")) {
>                        port = (int)strtol(v->value, NULL, 10);
>diff -aurp asterisk/channels/h323/ast_h323.cpp asterisk-cvs030823/channels/h323/ast_h323.cpp
>--- asterisk/channels/h323/ast_h323.cpp 2003-08-12 17:20:12.000000000 -0500
>+++ asterisk-cvs030823/channels/h323/ast_h323.cpp       2003-08-23 14:13:31.000000000 -0500
>@@ -34,6 +34,9 @@
> #define BUILD_TYPE    ReleaseCode
> #define BUILD_NUMBER  0
>
>+/* Temporary addition for G729 Packetization interval */
>+extern int g729Frames;
>+
> /** Counter for the number of connections */
> int channelsOpen;
>
>@@ -784,6 +787,9 @@ int h323_set_capability(int cap, int dtm
>        if (cap & AST_FORMAT_G729A) {
>                H323_G729ACapability *g729aCap;
>                endPoint->SetCapability(0, 0, g729aCap = new H323_G729ACapability);
>+                cout << "setting g729Frames to " << g729Frames << " * 10\n";
>+                g729aCap->SetTxFramesInPacket(g729Frames);
>+
>        }
> #endif
>
>
>  
>





More information about the asterisk-users mailing list