Hi all.

Here is G.728 codec support for ooh323c v0.8. I did 'cvs -Q diff -c <files>' and 'diff <orig_file> <changed_file>' against release version of the stack. I do not know better way (still a newbie with this programming stuff ;-) anyway). Somebody could guide me how to create real patch for whole stack. I tested this code and it seems to be OK, though maintainers should test it properly. Now I'll try to do the same thing for G.726 codecs, but I guess this won't be so straightforward (no placeholders in the stack).

   Regards,
      Aleksandar
Index: ooCapability.c
===================================================================
RCS file: //192.168.92.1/soft/cristina/sw/voip/ooh323c/ooCapability.c,v
retrieving revision 1.1
diff -c -r1.1 ooCapability.c
*** ooCapability.c      20 Jan 2006 14:29:41 -0000      1.1
--- ooCapability.c      14 Feb 2006 08:08:11 -0000
***************
*** 337,343 ****
     return OO_OK;
  }
  
! /* Used for g711 ulaw/alaw, g729 and g7231 */
  int ooCapabilityAddSimpleCapability
     (OOH323CallData *call, int cap, int txframes, 
      int rxframes, OOBOOL silenceSuppression, int dir, 
--- 337,343 ----
     return OO_OK;
  }
  
! /* Used for g711 ulaw/alaw, g729, g728, g726, and g7231 codecs (variants too) 
*/
  int ooCapabilityAddSimpleCapability
     (OOH323CallData *call, int cap, int txframes, 
      int rxframes, OOBOOL silenceSuppression, int dir, 
***************
*** 369,375 ****
     if(cap == OO_G7231)
        params->silenceSuppression = silenceSuppression;
     else
!       params->silenceSuppression = FALSE; /* Set to false for g711 and g729*/
  
     if(dir & OORXANDTX)
     {
--- 369,375 ----
     if(cap == OO_G7231)
        params->silenceSuppression = silenceSuppression;
     else
!       params->silenceSuppression = FALSE; /* Set to false for g711, g726, 
g728 and g729*/
  
     if(dir & OORXANDTX)
     {
***************
*** 589,594 ****
--- 589,595 ----
     case OO_G711ALAW56K:
     case OO_G711ULAW64K:
     case OO_G711ULAW56K:
+    case OO_G728:
     case OO_G729:
     case OO_G729A:
     case OO_G7231:
***************
*** 767,773 ****
     return pAudio;
  }
  
! /* This is used for g711 ulaw/alaw, g729, g729A, g7231*/
  struct H245AudioCapability* ooCapabilityCreateSimpleCapability
     (ooH323EpCapability *epCap, OOCTXT* pctxt, int dir)
  {
--- 768,774 ----
     return pAudio;
  }
  
! /* This is used for g711 ulaw/alaw, g729, g729A, g726, g728, and g7231*/
  struct H245AudioCapability* ooCapabilityCreateSimpleCapability
     (ooH323EpCapability *epCap, OOCTXT* pctxt, int dir)
  {
***************
*** 819,824 ****
--- 820,832 ----
        else
           pAudio->u.g711Ulaw64k = params->txframes;
        return pAudio;
+    case OO_G728:
+       pAudio->t = T_H245AudioCapability_g728;
+       if(dir & OORX)
+          pAudio->u.g728 = params->rxframes;
+       else
+          pAudio->u.g728 = params->txframes;
+       return pAudio;
     case OO_G729:
        pAudio->t = T_H245AudioCapability_g729;
        if(dir & OORX)
***************
*** 857,863 ****
     return NULL;
  }
  
! /*Used for g711 ulaw/alaw, g729, g729a, g7231 */
  ASN1BOOL ooCapabilityCheckCompatibility_Simple
     (OOH323CallData *call, ooH323EpCapability* epCap, 
      H245AudioCapability* audioCap, int dir)
--- 865,871 ----
     return NULL;
  }
  
! /*Used for g711 ulaw/alaw, g729, g729a, g726, g728, and g7231 */
  ASN1BOOL ooCapabilityCheckCompatibility_Simple
     (OOH323CallData *call, ooH323EpCapability* epCap, 
      H245AudioCapability* audioCap, int dir)
***************
*** 881,886 ****
--- 889,898 ----
        cap = OO_G711ALAW56K;
        noofframes = audioCap->u.g711Alaw56k;
        break;
+    case T_H245AudioCapability_g728:
+       cap = OO_G728;
+       noofframes = audioCap->u.g728;
+       break;
     case T_H245AudioCapability_g729:
        cap = OO_G729;
        noofframes = audioCap->u.g729;
***************
*** 1123,1128 ****
--- 1135,1141 ----
     case T_H245AudioCapability_g711Ulaw64k:
     case T_H245AudioCapability_g711Alaw64k:
     case T_H245AudioCapability_g711Alaw56k:
+    case T_H245AudioCapability_g728:
     case T_H245AudioCapability_g729:
     case T_H245AudioCapability_g729AnnexA:
     case T_H245AudioCapability_g7231:
***************
*** 1203,1208 ****
--- 1216,1222 ----
     case OO_G711ALAW56K:
     case OO_G711ULAW64K:
     case OO_G711ULAW56K:
+    case OO_G728:
     case OO_G729:
     case OO_G729A:
     case OO_G7231:
***************
*** 1360,1366 ****
  
  }
  
! /* used for g711 ulaw/alaw, g729, g729a, g7231 */
  ooH323EpCapability* ooIsAudioDataTypeSimpleSupported
     (OOH323CallData *call, H245AudioCapability* audioCap, int dir)
  {
--- 1374,1380 ----
  
  }
  
! /* used for g711 ulaw/alaw, g729, g729a, g726, g728, and g7231 */
  ooH323EpCapability* ooIsAudioDataTypeSimpleSupported
     (OOH323CallData *call, H245AudioCapability* audioCap, int dir)
  {
***************
*** 1387,1392 ****
--- 1401,1410 ----
           framesPerPkt = audioCap->u.g711Ulaw64k;
           cap = OO_G711ULAW64K;
           break;
+       case T_H245AudioCapability_g728:
+          framesPerPkt = audioCap->u.g728;
+          cap = OO_G728;
+          break;
        case T_H245AudioCapability_g729:
           framesPerPkt = audioCap->u.g729;
           cap = OO_G729;
***************
*** 1523,1528 ****
--- 1541,1547 ----
        case T_H245AudioCapability_g711Alaw56k:
        case T_H245AudioCapability_g711Ulaw56k:
        case T_H245AudioCapability_g711Ulaw64k:
+       case T_H245AudioCapability_g728:
        case T_H245AudioCapability_g729:
        case T_H245AudioCapability_g729AnnexA:
        case T_H245AudioCapability_g7231:
***************
*** 1931,1936 ****
--- 1950,1964 ----
        }
        return ooCapabilityAddSimpleCapability(call, OO_G711ULAW56K, txframes, 
                             rxframes, FALSE, dir, NULL, NULL, NULL, NULL, 
TRUE);
+    case T_H245AudioCapability_g728:
+       if(dir&OOTX) txframes = audioCap->u.g728;
+       else if(dir&OORX) rxframes = audioCap->u.g728;
+       else{ 
+          txframes = audioCap->u.g728; 
+          rxframes = audioCap->u.g728; 
+       }
+       return ooCapabilityAddSimpleCapability(call, OO_G728, txframes, 
+                            rxframes, FALSE, dir, NULL, NULL, NULL, NULL, 
TRUE);
     case T_H245AudioCapability_g729:
        if(dir&OOTX) txframes = audioCap->u.g729;
        else if(dir&OORX) rxframes = audioCap->u.g729;
Index: ooCapability.h
===================================================================
RCS file: //192.168.92.1/soft/cristina/sw/voip/ooh323c/ooCapability.h,v
retrieving revision 1.1
diff -c -r1.1 ooCapability.h
*** ooCapability.h      20 Jan 2006 14:30:51 -0000      1.1
--- ooCapability.h      13 Feb 2006 12:51:02 -0000
***************
*** 38,43 ****
--- 38,44 ----
     OO_G711ULAW64K         = 4,
     OO_G711ULAW56K         = 5,
     OO_G7231               = 9,
+    OO_G728                = 10,
     OO_G729                = 11,
     OO_G729A               = 12,
     OO_GSMFULLRATE         = 18,
Index: ooCalls.c
===================================================================
RCS file: //192.168.92.1/soft/cristina/sw/voip/ooh323c/ooCalls.c,v
retrieving revision 1.1
diff -c -r1.1 ooCalls.c
*** ooCalls.c   20 Jan 2006 14:28:41 -0000      1.1
--- ooCalls.c   13 Feb 2006 13:30:43 -0000
***************
*** 503,508 ****
--- 503,520 ----
                            stopReceiveChannel, stopTransmitChannel, FALSE);
  }
  
+ int ooCallAddG728Capability(OOH323CallData *call, int cap, int txframes, 
+                             int rxframes, int dir,
+                             cb_StartReceiveChannel startReceiveChannel,
+                             cb_StartTransmitChannel startTransmitChannel,
+                             cb_StopReceiveChannel stopReceiveChannel,
+                             cb_StopTransmitChannel stopTransmitChannel)
+ {
+    return ooCapabilityAddSimpleCapability(call, cap, txframes, rxframes, 
FALSE,
+                             dir, startReceiveChannel, startTransmitChannel, 
+                             stopReceiveChannel, stopTransmitChannel, FALSE);
+ }
+ 
  int ooCallAddG711Capability(OOH323CallData *call, int cap, int txframes, 
                              int rxframes, int dir,
                              cb_StartReceiveChannel startReceiveChannel,
Index: ooCalls.h
===================================================================
RCS file: //192.168.92.1/soft/cristina/sw/voip/ooh323c/ooCalls.h,v
retrieving revision 1.1
diff -c -r1.1 ooCalls.h
*** ooCalls.h   20 Jan 2006 14:29:16 -0000      1.1
--- ooCalls.h   13 Feb 2006 13:30:02 -0000
***************
*** 506,511 ****
--- 506,533 ----
                              cb_StopReceiveChannel stopReceiveChannel,
                              cb_StopTransmitChannel stopTransmitChannel);
  
+ /**
+  * This function is used to add G728 capability for the call. The 
+  * "ooCallAdd...Capability" functions allow to override the global endpoint 
+  * capabilities and use specific capabilities for specific calls.
+  * @param call                 Call for which capability has to be added.
+  * @param cap                  Capability to be added.
+  * @param txframes             Number of frames per packet for transmission. 
+  * @param rxframes             Number of frames per packet for reception.
+  * @param dir                  Direction of capability.OORX, OOTX, OORXANDTX
+  * @param startReceiveChannel  Callback function to start receive channel.
+  * @param startTransmitChannel Callback function to start transmit channel.
+  * @param stopReceiveChannel   Callback function to stop receive channel.
+  * @param stopTransmitChannel  Callback function to stop transmit channel.
+  *
+  * @return                     OO_OK, on success. OO_FAILED, on failure. 
+  */
+ EXTERN int ooCallAddG728Capability(OOH323CallData *call, int cap, int 
txframes, 
+                             int rxframes, int dir,
+                             cb_StartReceiveChannel startReceiveChannel,
+                             cb_StartTransmitChannel startTransmitChannel,
+                             cb_StopReceiveChannel stopReceiveChannel,
+                             cb_StopTransmitChannel stopTransmitChannel);
  
  /**
   * This function is used to add GSM capability for the call. The 
Index: ooh245.c
===================================================================
RCS file: //192.168.92.1/soft/cristina/sw/voip/ooh323c/ooh245.c,v
retrieving revision 1.1
diff -c -r1.1 ooh245.c
*** ooh245.c    20 Jan 2006 14:39:16 -0000      1.1
--- ooh245.c    14 Feb 2006 08:09:44 -0000
***************
*** 2904,2909 ****
--- 2904,2911 ----
     case OO_G711ALAW56K:
     case OO_G711ULAW64K:
     case OO_G711ULAW56K:
+    case OO_G728:
+    case OO_G729:
     case OO_G729A:
     case OO_G7231:
     case OO_GSMFULLRATE:
Index: ooh323ep.c
===================================================================
RCS file: //192.168.92.1/soft/cristina/sw/voip/ooh323c/ooh323ep.c,v
retrieving revision 1.1
diff -c -r1.1 ooh323ep.c
*** ooh323ep.c  20 Jan 2006 14:41:36 -0000      1.1
--- ooh323ep.c  13 Feb 2006 13:33:25 -0000
***************
*** 598,603 ****
--- 598,613 ----
                                 stopReceiveChannel, stopTransmitChannel, 
FALSE);
  }
  
+ int ooH323EpAddG728Capability(int cap, int txframes, int rxframes, int dir,
+                               cb_StartReceiveChannel startReceiveChannel,
+                               cb_StartTransmitChannel startTransmitChannel,
+                               cb_StopReceiveChannel stopReceiveChannel,
+                               cb_StopTransmitChannel stopTransmitChannel)
+ {
+    return ooCapabilityAddSimpleCapability(NULL, cap, txframes, rxframes, 
FALSE,
+                                dir, startReceiveChannel, 
startTransmitChannel, 
+                                stopReceiveChannel, stopTransmitChannel, 
FALSE);
+ }
  
  int ooH323EpAddG7231Capability(int cap, int txframes, int rxframes, 
                                OOBOOL silenceSuppression, int dir,
Index: ooh323ep.h
===================================================================
RCS file: //192.168.92.1/soft/cristina/sw/voip/ooh323c/ooh323ep.h,v
retrieving revision 1.3
diff -c -r1.3 ooh323ep.h
*** ooh323ep.h  13 Feb 2006 13:24:04 -0000      1.3
--- ooh323ep.h  14 Feb 2006 08:10:31 -0000
***************
*** 496,501 ****
--- 496,521 ----
      cb_StartTransmitChannel startTransmitChannel,
      cb_StopReceiveChannel stopReceiveChannel,
      cb_StopTransmitChannel stopTransmitChannel);
+     
+ /**
+  * This function is used to add G728 capability to the H323 endpoint.
+  * @param cap                  Type of G728 capability to be added.
+  * @param txframes             Number of frames per packet for transmission. 
+  * @param rxframes             Number of frames per packet for reception.
+  * @param dir                  Direction of capability.OORX, OOTX, OORXANDTX
+  * @param startReceiveChannel  Callback function to start receive channel.
+  * @param startTransmitChannel Callback function to start transmit channel.
+  * @param stopReceiveChannel   Callback function to stop receive channel.
+  * @param stopTransmitChannel  Callback function to stop transmit channel.
+  *
+  * @return                     OO_OK, on success. OO_FAILED, on failure. 
+  */
+ EXTERN int ooH323EpAddG728Capability
+    (int cap, int txframes, int rxframes, int dir, 
+     cb_StartReceiveChannel startReceiveChannel,
+     cb_StartTransmitChannel startTransmitChannel,
+     cb_StopReceiveChannel stopReceiveChannel,
+     cb_StopTransmitChannel stopTransmitChannel);
  
  
  /**
506,517d505
< int ooCallAddG728Capability(OOH323CallData *call, int cap, int txframes, 
<                             int rxframes, int dir,
<                             cb_StartReceiveChannel startReceiveChannel,
<                             cb_StartTransmitChannel startTransmitChannel,
<                             cb_StopReceiveChannel stopReceiveChannel,
<                             cb_StopTransmitChannel stopTransmitChannel)
< {
<    return ooCapabilityAddSimpleCapability(call, cap, txframes, rxframes, 
FALSE,
<                             dir, startReceiveChannel, startTransmitChannel, 
<                             stopReceiveChannel, stopTransmitChannel, FALSE);
< }
< 
509,530d508
< /**
<  * This function is used to add G728 capability for the call. The 
<  * "ooCallAdd...Capability" functions allow to override the global endpoint 
<  * capabilities and use specific capabilities for specific calls.
<  * @param call                 Call for which capability has to be added.
<  * @param cap                  Capability to be added.
<  * @param txframes             Number of frames per packet for transmission. 
<  * @param rxframes             Number of frames per packet for reception.
<  * @param dir                  Direction of capability.OORX, OOTX, OORXANDTX
<  * @param startReceiveChannel  Callback function to start receive channel.
<  * @param startTransmitChannel Callback function to start transmit channel.
<  * @param stopReceiveChannel   Callback function to stop receive channel.
<  * @param stopTransmitChannel  Callback function to stop transmit channel.
<  *
<  * @return                     OO_OK, on success. OO_FAILED, on failure. 
<  */
< EXTERN int ooCallAddG728Capability(OOH323CallData *call, int cap, int 
txframes, 
<                             int rxframes, int dir,
<                             cb_StartReceiveChannel startReceiveChannel,
<                             cb_StartTransmitChannel startTransmitChannel,
<                             cb_StopReceiveChannel stopReceiveChannel,
<                             cb_StopTransmitChannel stopTransmitChannel);
340c340
< /* Used for g711 ulaw/alaw, g729, g728, g726, and g7231 codecs (variants too) 
*/
---
> /* Used for g711 ulaw/alaw, g729 and g7231 */
372c372
<       params->silenceSuppression = FALSE; /* Set to false for g711, g726, 
g728 and g729*/
---
>       params->silenceSuppression = FALSE; /* Set to false for g711 and g729*/
592d591
<    case OO_G728:
771c770
< /* This is used for g711 ulaw/alaw, g729, g729A, g726, g728, and g7231*/
---
> /* This is used for g711 ulaw/alaw, g729, g729A, g7231*/
823,829d821
<    case OO_G728:
<       pAudio->t = T_H245AudioCapability_g728;
<       if(dir & OORX)
<          pAudio->u.g728 = params->rxframes;
<       else
<          pAudio->u.g728 = params->txframes;
<       return pAudio;
868c860
< /*Used for g711 ulaw/alaw, g729, g729a, g726, g728, and g7231 */
---
> /*Used for g711 ulaw/alaw, g729, g729a, g7231 */
892,895d883
<    case T_H245AudioCapability_g728:
<       cap = OO_G728;
<       noofframes = audioCap->u.g728;
<       break;
1138d1125
<    case T_H245AudioCapability_g728:
1219d1205
<    case OO_G728:
1377c1363
< /* used for g711 ulaw/alaw, g729, g729a, g726, g728, and g7231 */
---
> /* used for g711 ulaw/alaw, g729, g729a, g7231 */
1404,1407d1389
<       case T_H245AudioCapability_g728:
<          framesPerPkt = audioCap->u.g728;
<          cap = OO_G728;
<          break;
1544d1525
<       case T_H245AudioCapability_g728:
1953,1961d1933
<    case T_H245AudioCapability_g728:
<       if(dir&OOTX) txframes = audioCap->u.g728;
<       else if(dir&OORX) rxframes = audioCap->u.g728;
<       else{ 
<          txframes = audioCap->u.g728; 
<          rxframes = audioCap->u.g728; 
<       }
<       return ooCapabilityAddSimpleCapability(call, OO_G728, txframes, 
<                            rxframes, FALSE, dir, NULL, NULL, NULL, NULL, 
TRUE);
41d40
<    OO_G728                = 10,
2907,2908d2906
<    case OO_G728:
<    case OO_G729:
601,610d600
< int ooH323EpAddG728Capability(int cap, int txframes, int rxframes, int dir,
<                               cb_StartReceiveChannel startReceiveChannel,
<                               cb_StartTransmitChannel startTransmitChannel,
<                               cb_StopReceiveChannel stopReceiveChannel,
<                               cb_StopTransmitChannel stopTransmitChannel)
< {
<    return ooCapabilityAddSimpleCapability(NULL, cap, txframes, rxframes, 
FALSE,
<                                dir, startReceiveChannel, 
startTransmitChannel, 
<                                stopReceiveChannel, stopTransmitChannel, 
FALSE);
< }
499,518d498
<     
< /**
<  * This function is used to add G728 capability to the H323 endpoint.
<  * @param cap                  Type of G728 capability to be added.
<  * @param txframes             Number of frames per packet for transmission. 
<  * @param rxframes             Number of frames per packet for reception.
<  * @param dir                  Direction of capability.OORX, OOTX, OORXANDTX
<  * @param startReceiveChannel  Callback function to start receive channel.
<  * @param startTransmitChannel Callback function to start transmit channel.
<  * @param stopReceiveChannel   Callback function to stop receive channel.
<  * @param stopTransmitChannel  Callback function to stop transmit channel.
<  *
<  * @return                     OO_OK, on success. OO_FAILED, on failure. 
<  */
< EXTERN int ooH323EpAddG728Capability
<    (int cap, int txframes, int rxframes, int dir, 
<     cb_StartReceiveChannel startReceiveChannel,
<     cb_StartTransmitChannel startTransmitChannel,
<     cb_StopReceiveChannel stopReceiveChannel,
<     cb_StopTransmitChannel stopTransmitChannel);

Reply via email to