diff -u src-orig/chan_h323.c src/chan_h323.c
--- src-orig/chan_h323.c	2005-11-11 12:49:21.000000000 -0800
+++ src/chan_h323.c	2005-11-25 14:29:52.000000000 -0800
@@ -125,6 +125,7 @@
    int amaflags;
    struct ast_dsp *vad;
    struct ooh323_pvt *next;	/* Next entity */
+   int framems;
 } *iflist = NULL;
 
 /* Protect the channel list (of h323_pvt's) */
@@ -144,6 +145,7 @@
    int         dtmfmode;
    int         rtptimeout;
    struct ooh323_user *next;
+   int		framems;
 };
 
 struct ooh323_peer{
@@ -164,6 +166,7 @@
    char        *e164;      /* e164 alias, which asterisk will register with gk to reach this peer*/
    int         rtptimeout;
    struct ooh323_peer *next;
+   int          framems;
 };
 
 
@@ -204,6 +207,7 @@
 static int  gDTMFMode = H323_DTMF_RFC2833;
 static char gGatekeeper[100];
 static enum RasGatekeeperMode gRasGkMode = RasNoGatekeeper;
+static int  gPacketization = 20;
 
 static int  gIsGateway = 0;
 static int  gFastStart = 1;
@@ -413,7 +417,8 @@
  
    ast_rtp_settos(pvt->rtp, gTOS);
 
-	
+   /* Set Frame packetization, use default if it doesn't exist. */
+   pvt->framems = gPacketization;
    pvt->call_reference = callref;
    if(callToken)
       pvt->callToken = strdup(callToken);
@@ -530,9 +535,13 @@
       p->dtmfmode = peer->dtmfmode;
       strncpy(p->accountcode, peer->accountcode, sizeof(p->accountcode)-1);
       p->amaflags = peer->amaflags;
+
+      /* Set Frame packetization, use default if it doesn't exist. */
+      p->framems = peer->framems;
    }else {
       p->dtmfmode = gDTMFMode;
       p->capability = gCapability;
+      p->framems = gPacketization;
 
       memcpy(&p->prefs, &gPrefs, sizeof(struct ast_codec_pref));
       p->username = strdup(dest);
@@ -1206,6 +1215,8 @@
          p->capability = user->capability;
          memcpy(&p->prefs, &user->prefs, sizeof(struct ast_codec_pref));
          p->dtmfmode = user->dtmfmode;
+         /* Set Frame packetization, use default if it doesn't exist. */
+         p->framems = user->framems;
          /* Since, call is coming from a pbx user, no need to use gk */
          OO_SETFLAG(p->flags, H323_DISABLEGK);
          OO_SETFLAG(call->flags, OO_M_DISABLEGK);
@@ -1214,7 +1225,7 @@
    }
 
 
-   ooh323c_set_capability_for_call(call, &p->prefs, p->capability,p->dtmfmode);
+   ooh323c_set_capability_for_call(call, &p->prefs, p->capability,p->dtmfmode,p->framems);
    configure_local_rtp(p, call);
 
    ast_mutex_unlock(&p->lock);
@@ -1311,7 +1322,7 @@
      }
 
      ooh323c_set_capability_for_call(call, &p->prefs, p->capability, 
-                                     p->dtmfmode);
+                                     p->dtmfmode,p->framems);
    
       configure_local_rtp(p, call);
       ast_mutex_unlock(&p->lock);
@@ -1497,6 +1508,7 @@
       user->capability = gCapability;
       memcpy(&user->prefs, &gPrefs, sizeof(struct ast_codec_pref));
       user->rtptimeout = gRTPTimeout;
+      user->framems = gPacketization;
       user->dtmfmode = gDTMFMode;
       /* set default context */
       strncpy(user->context, gContext, sizeof(user->context)-1);
@@ -1506,6 +1518,8 @@
       while(v) {
          if (!strcasecmp(v->name, "context")) {
             strncpy(user->context, v->value, sizeof(user->context) - 1);
+         } else if (!strcasecmp(v->name, "packetization")) {
+            user->framems = atoi(v->value);
          } else if (!strcasecmp(v->name, "incominglimit")) {
             user->incominglimit = atoi(v->value);
             if (user->incominglimit < 0)
@@ -1559,6 +1573,7 @@
       peer->capability = gCapability;
       memcpy(&peer->prefs, &gPrefs, sizeof(struct ast_codec_pref));
       peer->rtptimeout = gRTPTimeout;
+      peer->framems = gPacketization;
       strncpy(peer->accountcode, gAccountcode, sizeof(peer->accountcode)-1);
       peer->amaflags = gAMAFLAGS;
       peer->dtmfmode = gDTMFMode;
@@ -1608,6 +1623,8 @@
             peer->port = atoi(v->value);
          } else if (!strcasecmp(v->name, "ip")) {
             strncpy(peer->ip, v->value, sizeof(peer->ip)-1);
+         } else if (!strcasecmp(v->name, "packetization")) {
+            peer->framems = atoi(v->value);
          } else if (!strcasecmp(v->name, "outgoinglimit")) {
             peer->outgoinglimit = atoi(v->value);
             if (peer->outgoinglimit < 0)
@@ -1783,6 +1800,10 @@
          gAliasList = pNewAlias;
          pNewAlias = NULL;
       }
+      else if (!strcasecmp(v->name, "packetization"))
+      {
+         gPacketization = atoi(v->value);
+      }
       else if (!strcasecmp(v->name, "callerid")) 
       {
          strncpy(gCallerID, v->value, sizeof(gCallerID)-1);
@@ -1978,6 +1999,7 @@
       ast_cli(fd, "%-15.15s%s\n", "Ip:Port: ", ip_port);
       ast_cli(fd, "%-15.15s%d\n", "OutgoingLimit: ", peer->outgoinglimit);
       ast_cli(fd, "%-15.15s%d\n", "rtptimeout: ", peer->rtptimeout);
+      ast_cli(fd, "%-15.15s%d\n", "rtp frame ms: ", peer->framems);
       ast_mutex_unlock(&peer->lock);
    }
    else{
@@ -2067,6 +2089,7 @@
       ast_cli(fd, "%-15.15s%s\n", "Context: ", user->context);
       ast_cli(fd, "%-15.15s%d\n", "IncomingLimit: ", user->incominglimit);
       ast_cli(fd, "%-15.15s%d\n", "rtptimeout: ", user->rtptimeout);
+      ast_cli(fd, "%-15.15s%d\n", "rtp frame ms: ", user->framems);
       ast_mutex_unlock(&user->lock);
    }
    else{
@@ -2370,7 +2393,7 @@
       ooH323EpSetH323Callbacks(h323Callbacks);
 
       /* Add some capabilities */
-      if(ooh323c_set_capability(&gPrefs, gCapability, gDTMFMode)<0) {
+      if(ooh323c_set_capability(&gPrefs, gCapability, gDTMFMode, gPacketization)<0) {
          ast_log(LOG_ERROR, "Capabilities failure for OOH323. OOH323 Disabled.\n");
          return 1;
       }
@@ -2822,6 +2845,9 @@
    if(gH323Debug)
       ast_verbose("---   configure_local_rtp\n");
 
+   if (p->rtp && p->framems) {
+           ast_rtp_set_framems(p->rtp, p->framems);
+    }
 
    /* figure out our local RTP port and tell the H.323 stack about it*/
    ast_rtp_get_us(p->rtp, &us);
Only in src/: chan_h323.c-dea
Common subdirectories: src-orig/CVS and src/CVS
diff -u src-orig/ooh323cDriver.c src/ooh323cDriver.c
--- src-orig/ooh323cDriver.c	2005-11-04 06:36:47.000000000 -0800
+++ src/ooh323cDriver.c	2005-11-25 15:33:38.000000000 -0800
@@ -60,7 +60,7 @@
 }
 
 int ooh323c_set_capability
-   (struct ast_codec_pref *prefs, int capability, int dtmf)
+   (struct ast_codec_pref *prefs, int capability, int dtmf, int framems)
 {
    int ret, x, format=0;
    if(gH323Debug)
@@ -70,6 +70,8 @@
    {
       if(format & AST_FORMAT_ULAW)
       {
+	 gtxframes = framems;
+	 grxframes = framems * 8;
          if(gH323Debug)
             ast_verbose("\tAdding g711 ulaw capability to H323 endpoint\n");
          ret= ooH323EpAddG711Capability(OO_G711ULAW64K, gtxframes, grxframes, 
@@ -80,6 +82,8 @@
       }
       if(format & AST_FORMAT_ALAW)
       {
+         gtxframes = framems;
+         grxframes = framems * 8;
          if(gH323Debug)
             ast_verbose("\tAdding g711 alaw capability to H323 endpoint\n");
          ret= ooH323EpAddG711Capability(OO_G711ALAW64K, gtxframes, grxframes, 
@@ -91,9 +95,11 @@
 
       if(format & AST_FORMAT_G729A)
       {
+         gtxframes = framems / 10;
+         grxframes = (framems / 10) * 12;
          if(gH323Debug)
             ast_verbose("\tAdding g729A capability to H323 endpoint\n");
-         ret = ooH323EpAddG729Capability(OO_G729A, 2, 24, 
+         ret = ooH323EpAddG729Capability(OO_G729A, gtxframes, grxframes, 
                                      OORXANDTX, &ooh323c_start_receive_channel,
                                      &ooh323c_start_transmit_channel,
                                      &ooh323c_stop_receive_channel, 
@@ -138,7 +144,7 @@
 }
 
 int ooh323c_set_capability_for_call
-   (ooCallData *call, struct ast_codec_pref *prefs, int capability, int dtmf)
+   (ooCallData *call, struct ast_codec_pref *prefs, int capability, int dtmf, int framems)
 {
    int ret, x;
    int format=0;
@@ -160,6 +166,8 @@
          if(gH323Debug)
             ast_verbose("\tAdding g711 ulaw capability to call(%s, %s)\n", 
                                               call->callType, call->callToken);
+	 gtxframes = framems;
+	 grxframes = framems * 8;
          ret= ooCallAddG711Capability(call, OO_G711ULAW64K, gtxframes, 
                                       grxframes, OORXANDTX, 
                                       &ooh323c_start_receive_channel,
@@ -172,6 +180,8 @@
          if(gH323Debug)
             ast_verbose("\tAdding g711 alaw capability to call(%s, %s)\n",
                                             call->callType, call->callToken);
+	 gtxframes = framems;
+	 grxframes = framems * 8;
          ret= ooCallAddG711Capability(call, OO_G711ALAW64K, gtxframes, 
                                       grxframes, OORXANDTX, 
                                      &ooh323c_start_receive_channel,
@@ -185,7 +195,9 @@
          if(gH323Debug)
             ast_verbose("\tAdding g729A capability to call(%s, %s)\n",
                                             call->callType, call->callToken);
-         ret= ooCallAddG729Capability(call, OO_G729A, 6, 24, 
+	 gtxframes = framems / 10;
+	 grxframes = (framems / 10) * 12;
+         ret= ooCallAddG729Capability(call, OO_G729A, gtxframes, grxframes, 
                                      OORXANDTX, &ooh323c_start_receive_channel,
                                      &ooh323c_start_transmit_channel,
                                      &ooh323c_stop_receive_channel, 
diff -u src-orig/ooh323cDriver.h src/ooh323cDriver.h
--- src-orig/ooh323cDriver.h	2005-09-02 07:27:10.000000000 -0700
+++ src/ooh323cDriver.h	2005-11-25 14:30:53.000000000 -0800
@@ -32,8 +32,8 @@
 int ooh323c_start_stack_thread(void);
 int ooh323c_stop_stack_thread(void);
 int ooh323c_set_capability
-   (struct ast_codec_pref *prefs, int capability, int dtmf);
+   (struct ast_codec_pref *prefs, int capability, int dtmf, int framems);
 int convertH323CapToAsteriskCap(int cap);
 int ooh323c_set_capability_for_call
-   (ooCallData *call, struct ast_codec_pref *prefs, int capability, int dtmf);
+   (ooCallData *call, struct ast_codec_pref *prefs, int capability, int dtmf, int framems);
 #endif
