[Asterisk-Users] Little patch for packetization in G729 in chan_h323
mawali at news.icns.com
mawali at news.icns.com
Sat Aug 23 18:23:12 MST 2003
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
-------------- next part --------------
A non-text attachment was scrubbed...
Name: mawali_patch_g729packets.gz
Type: application/x-gzip
Size: 822 bytes
Desc:
Url : http://lists.digium.com/pipermail/asterisk-users/attachments/20030823/a224db72/mawali_patch_g729packets.bin
More information about the asterisk-users
mailing list