[svn-commits] trunk r207 - /trunk/asterisk-ooh323c/ooh323c/src/

svn-commits at lists.digium.com svn-commits at lists.digium.com
Wed Apr 12 14:03:45 MST 2006


Author: objsys
Date: Wed Apr 12 16:03:41 2006
New Revision: 207

URL: http://svn.digium.com/view/asterisk-addons?rev=207&view=rev
Log:
Added G.728 audio codec negotation support, Thanks to Aleksandar Sutic

Modified:
    trunk/asterisk-ooh323c/ooh323c/src/ooCalls.c
    trunk/asterisk-ooh323c/ooh323c/src/ooCalls.h
    trunk/asterisk-ooh323c/ooh323c/src/ooCapability.c
    trunk/asterisk-ooh323c/ooh323c/src/ooCapability.h
    trunk/asterisk-ooh323c/ooh323c/src/oochannels.c
    trunk/asterisk-ooh323c/ooh323c/src/ooh245.c
    trunk/asterisk-ooh323c/ooh323c/src/ooh323.c
    trunk/asterisk-ooh323c/ooh323c/src/ooh323ep.c
    trunk/asterisk-ooh323c/ooh323c/src/ooh323ep.h

Modified: trunk/asterisk-ooh323c/ooh323c/src/ooCalls.c
URL: http://svn.digium.com/view/asterisk-addons/trunk/asterisk-ooh323c/ooh323c/src/ooCalls.c?rev=207&r1=206&r2=207&view=diff
==============================================================================
--- trunk/asterisk-ooh323c/ooh323c/src/ooCalls.c (original)
+++ trunk/asterisk-ooh323c/ooh323c/src/ooCalls.c Wed Apr 12 16:03:41 2006
@@ -513,6 +513,32 @@
                           stopReceiveChannel, stopTransmitChannel, FALSE);
 }
 
+/*
+int ooCallAddG726Capability(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 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,

Modified: trunk/asterisk-ooh323c/ooh323c/src/ooCalls.h
URL: http://svn.digium.com/view/asterisk-addons/trunk/asterisk-ooh323c/ooh323c/src/ooCalls.h?rev=207&r1=206&r2=207&view=diff
==============================================================================
--- trunk/asterisk-ooh323c/ooh323c/src/ooCalls.h (original)
+++ trunk/asterisk-ooh323c/ooh323c/src/ooCalls.h Wed Apr 12 16:03:41 2006
@@ -463,6 +463,29 @@
                             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 G729 capability for the call. The 
  * "ooCallAdd...Capability" functions allow to override the global endpoint 
  * capabilities and use specific capabilities for specific calls.

Modified: trunk/asterisk-ooh323c/ooh323c/src/ooCapability.c
URL: http://svn.digium.com/view/asterisk-addons/trunk/asterisk-ooh323c/ooh323c/src/ooCapability.c?rev=207&r1=206&r2=207&view=diff
==============================================================================
--- trunk/asterisk-ooh323c/ooh323c/src/ooCapability.c (original)
+++ trunk/asterisk-ooh323c/ooh323c/src/ooCapability.c Wed Apr 12 16:03:41 2006
@@ -348,7 +348,7 @@
    return OO_OK;
 }
 
-/* Used for g711 ulaw/alaw, g729 and g7231 */
+/* Used for g711 ulaw/alaw, g728, g729 and g7231 */
 int ooCapabilityAddSimpleCapability
    (OOH323CallData *call, int cap, int txframes, 
     int rxframes, OOBOOL silenceSuppression, int dir, 
@@ -609,6 +609,8 @@
    case OO_G711ALAW56K:
    case OO_G711ULAW64K:
    case OO_G711ULAW56K:
+   /*case OO_G726:*/
+   case OO_G728:
    case OO_G729:
    case OO_G729A:
    case OO_G7231:
@@ -786,7 +788,7 @@
    return pAudio;
 }
 
-/* This is used for g711 ulaw/alaw, g729, g729A, g7231*/
+/* This is used for g711 ulaw/alaw, g728, g729, g729A, g7231*/
 struct H245AudioCapability* ooCapabilityCreateSimpleCapability
    (ooH323EpCapability *epCap, OOCTXT* pctxt, int dir)
 {
@@ -838,6 +840,20 @@
       else
          pAudio->u.g711Ulaw64k = params->txframes;
       return pAudio;
+   /*case OO_G726:
+      pAudio->t = T_H245AudioCapability_g726;
+      if(dir & OORX)
+         pAudio->u.g726 = params->rxframes;
+      else
+         pAudio->u.g726 = 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)
@@ -876,7 +892,7 @@
    return NULL;
 }
 
-/* Used for g711 ulaw/alaw, g729, g729a, g7231 */
+/* Used for g711 ulaw/alaw, g728, g729, g729a, g7231 */
 ASN1BOOL ooCapabilityCheckCompatibility_Simple
    (OOH323CallData *call, ooH323EpCapability* epCap, 
     H245AudioCapability* audioCap, int dir)
@@ -900,6 +916,14 @@
       cap = OO_G711ALAW56K;
       noofframes = audioCap->u.g711Alaw56k;
       break;
+   /*case T_H245AudioCapability_g726:
+      cap = OO_G726;
+      noofframes = audioCap->u.g726;
+      break;*/
+   case T_H245AudioCapability_g728:
+      cap = OO_G728;
+      noofframes = audioCap->u.g728;
+      break;
    case T_H245AudioCapability_g729:
       cap = OO_G729;
       noofframes = audioCap->u.g729;
@@ -921,6 +945,12 @@
    /* Can we receive this capability */
    if(dir & OORX)
    {
+      //if(cap == OO_G7231) {
+      //   if(((OOCapParams*)epCap->params)->rxframes <= noofframes) {
+      //      return TRUE;
+      //   }
+      //}
+      //else
       if(((OOCapParams*)epCap->params)->rxframes >= noofframes) {
          return TRUE;
       }
@@ -929,6 +959,12 @@
    /* Can we transmit compatible stream */
    if(dir & OOTX)
    {
+      //if(cap == OO_G7231) {
+      //   if(((OOCapParams*)epCap->params)->txframes >= noofframes) {
+      //      return TRUE;
+      //   }
+      //}
+      //else 
       if(((OOCapParams*)epCap->params)->txframes <= noofframes) {
          return TRUE;
       }
@@ -1156,6 +1192,8 @@
    case T_H245AudioCapability_g711Ulaw64k:
    case T_H245AudioCapability_g711Alaw64k:
    case T_H245AudioCapability_g711Alaw56k:
+   /*case T_H245AudioCapability_g726:*/
+   case T_H245AudioCapability_g728:
    case T_H245AudioCapability_g729:
    case T_H245AudioCapability_g729AnnexA:
    case T_H245AudioCapability_g7231:
@@ -1236,6 +1274,8 @@
    case OO_G711ALAW56K:
    case OO_G711ULAW64K:
    case OO_G711ULAW56K:
+   /*case OO_G726:*/
+   case OO_G728:
    case OO_G729:
    case OO_G729A:
    case OO_G7231:
@@ -1393,7 +1433,7 @@
 
 }
 
-/* used for g711 ulaw/alaw, g729, g729a, g7231 */
+/* used for g711 ulaw/alaw, g728, g729, g729a, g7231 */
 ooH323EpCapability* ooIsAudioDataTypeSimpleSupported
    (OOH323CallData *call, H245AudioCapability* audioCap, int dir)
 {
@@ -1420,6 +1460,17 @@
          framesPerPkt = audioCap->u.g711Ulaw64k;
          cap = OO_G711ULAW64K;
          break;
+
+/*      case T_H245AudioCapability_g726:
+         framesPerPkt = audioCap->u.g726;
+         cap = OO_G726;
+         break;
+*/
+      case T_H245AudioCapability_g728:
+         framesPerPkt = audioCap->u.g728;
+         cap = OO_G728;
+         break;
+
       case T_H245AudioCapability_g729:
          framesPerPkt = audioCap->u.g729;
          cap = OO_G729;
@@ -1556,6 +1607,8 @@
       case T_H245AudioCapability_g711Alaw56k:
       case T_H245AudioCapability_g711Ulaw56k:
       case T_H245AudioCapability_g711Ulaw64k:
+      /*case T_H245AudioCapability_g726:*/
+      case T_H245AudioCapability_g728:
       case T_H245AudioCapability_g729:
       case T_H245AudioCapability_g729AnnexA:
       case T_H245AudioCapability_g7231:
@@ -1964,6 +2017,27 @@
       }
       return ooCapabilityAddSimpleCapability(call, OO_G711ULAW56K, txframes, 
                            rxframes, FALSE, dir, NULL, NULL, NULL, NULL, TRUE);
+
+/*   case T_H245AudioCapability_g726:
+      if(dir&OOTX) txframes = audioCap->u.g726;
+      else if(dir&OORX) rxframes = audioCap->u.g726;
+      else{ 
+         txframes = audioCap->u.g726; 
+         rxframes = audioCap->u.g726; 
+      }
+      return ooCapabilityAddSimpleCapability(call, OO_G726, 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;

Modified: trunk/asterisk-ooh323c/ooh323c/src/ooCapability.h
URL: http://svn.digium.com/view/asterisk-addons/trunk/asterisk-ooh323c/ooh323c/src/ooCapability.h?rev=207&r1=206&r2=207&view=diff
==============================================================================
--- trunk/asterisk-ooh323c/ooh323c/src/ooCapability.h (original)
+++ trunk/asterisk-ooh323c/ooh323c/src/ooCapability.h Wed Apr 12 16:03:41 2006
@@ -279,7 +279,8 @@
 
 /**
  * This function is used to add simple capabilities which have only rxframes
- * and txframes parameters to the endpoint or call.(ex. G711, G729)
+ * and txframes parameters to the endpoint or call.(ex. G711, G728, G723.1, 
+ * G729)
  * @param call                 Handle to a call. If this is not Null, then 
  *                             capability is added to call's remote enpoint 
  *                             capability list, else it is added to local H323 
@@ -564,8 +565,9 @@
    (ooH323EpCapability *epCap, OOCTXT* pctxt, int dir);
 
 /**
- * This function is used to create a simple(g711, g729) audio capability 
- * structure.
+ * This function is used to create a simple(g711, g728, g723.1, g729) audio 
+ * capability structure.
+ *
  * @param epCap       Handle to the endpoint capability
  * @param pctxt       Handle to OOCTXT which will be used to allocate memory 
  *                    for new audio capability.

Modified: trunk/asterisk-ooh323c/ooh323c/src/oochannels.c
URL: http://svn.digium.com/view/asterisk-addons/trunk/asterisk-ooh323c/ooh323c/src/oochannels.c?rev=207&r1=206&r2=207&view=diff
==============================================================================
--- trunk/asterisk-ooh323c/ooh323c/src/oochannels.c (original)
+++ trunk/asterisk-ooh323c/ooh323c/src/oochannels.c Wed Apr 12 16:03:41 2006
@@ -918,7 +918,6 @@
 
    initializePrintHandler(&printHandler, "Received H.2250 Message");
    setEventHandler (pctxt, &printHandler);
-
    ret = ooQ931Decode (call, pmsg, len, message);
    if(ret != OO_OK) {
       OOTRACEERR3("Error:Failed to decode received H.2250 message. (%s, %s)\n",
@@ -1432,8 +1431,8 @@
       {
          call->callState = OO_CALL_CLEARED;
       }
-
-      break;
+      break;
+
    case OOFacility:
       if(tunneledMsgType == OOFacility)
       {
@@ -1447,9 +1446,8 @@
 
          ooOnSendMsg(call, tunneledMsgType, 0, associatedChan);
       }
-
-      
-      break;
+      break;
+
    case OOMasterSlaveDetermination:
      if(OO_TESTFLAG (call->flags, OO_M_TUNNELING))
         OOTRACEINFO3("Tunneled Message - MasterSlaveDetermination (%s, %s)\n", 
@@ -1536,8 +1534,9 @@
          memFreePtr(call->pctxt, cbData);
          return OO_FAILED;
       }
-
-      break;
+      break;
+
+
    case OOTerminalCapabilitySetAck:
       if(OO_TESTFLAG (call->flags, OO_M_TUNNELING))
          OOTRACEINFO3("Tunneled Message - TerminalCapabilitySetAck (%s, %s)\n",

Modified: trunk/asterisk-ooh323c/ooh323c/src/ooh245.c
URL: http://svn.digium.com/view/asterisk-addons/trunk/asterisk-ooh323c/ooh323c/src/ooh245.c?rev=207&r1=206&r2=207&view=diff
==============================================================================
--- trunk/asterisk-ooh323c/ooh323c/src/ooh245.c (original)
+++ trunk/asterisk-ooh323c/ooh323c/src/ooh245.c Wed Apr 12 16:03:41 2006
@@ -2924,6 +2924,8 @@
    case OO_G711ALAW56K:
    case OO_G711ULAW64K:
    case OO_G711ULAW56K:
+   /*case OO_G726:*/
+   case OO_G728:
    case OO_G729:
    case OO_G729A:
    case OO_G7231:

Modified: trunk/asterisk-ooh323c/ooh323c/src/ooh323.c
URL: http://svn.digium.com/view/asterisk-addons/trunk/asterisk-ooh323c/ooh323c/src/ooh323.c?rev=207&r1=206&r2=207&view=diff
==============================================================================
--- trunk/asterisk-ooh323c/ooh323c/src/ooh323.c (original)
+++ trunk/asterisk-ooh323c/ooh323c/src/ooh323.c Wed Apr 12 16:03:41 2006
@@ -932,7 +932,7 @@
       OO_SETFLAG(call->flags, OO_M_FASTSTARTANSWERED);
    }
 
-   /* Retrieve the H.245 control channel address from the connect msg */
+   /* Retrieve the H.245 control channel address from the CONNECT msg */
    if(connect->m.h245AddressPresent)
    {
       if (OO_TESTFLAG (call->flags, OO_M_TUNNELING))
@@ -1085,7 +1085,9 @@
 
          ooFreeQ931Message(q931Msg);
          break;
-      case Q931AlertingMsg:/* Alerting message received */
+
+
+      case Q931AlertingMsg:/* ALERTING message received */
          OOTRACEINFO3("H.225 Alerting message received (%s, %s)\n", 
                       call->callType, call->callToken);
 
@@ -1095,7 +1097,9 @@
             gH323ep.h323Callbacks.onAlerting(call);
          ooFreeQ931Message(q931Msg);
          break;
-      case Q931ConnectMsg:/* Connect message received */
+
+
+      case Q931ConnectMsg:/* CONNECT message received */
          OOTRACEINFO3("H.225 Connect message received (%s, %s)\n",
                       call->callType, call->callToken);
 
@@ -1133,7 +1137,9 @@
                        call->callType, call->callToken);
          ooFreeQ931Message(q931Msg);
          break;
-      case Q931ReleaseCompleteMsg:/* Release complete message received */
+
+
+      case Q931ReleaseCompleteMsg:/* RELEASE COMPLETE message received */
          OOTRACEINFO3("H.225 Release Complete message received (%s, %s)\n",
                       call->callType, call->callToken);
 

Modified: trunk/asterisk-ooh323c/ooh323c/src/ooh323ep.c
URL: http://svn.digium.com/view/asterisk-addons/trunk/asterisk-ooh323c/ooh323c/src/ooh323ep.c?rev=207&r1=206&r2=207&view=diff
==============================================================================
--- trunk/asterisk-ooh323c/ooh323c/src/ooh323ep.c (original)
+++ trunk/asterisk-ooh323c/ooh323c/src/ooh323ep.c Wed Apr 12 16:03:41 2006
@@ -594,6 +594,17 @@
                             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 ooH323EpAddG729Capability(int cap, int txframes, int rxframes, int dir,
                               cb_StartReceiveChannel startReceiveChannel,
                               cb_StartTransmitChannel startTransmitChannel,

Modified: trunk/asterisk-ooh323c/ooh323c/src/ooh323ep.h
URL: http://svn.digium.com/view/asterisk-addons/trunk/asterisk-ooh323c/ooh323c/src/ooh323ep.h?rev=207&r1=206&r2=207&view=diff
==============================================================================
--- trunk/asterisk-ooh323c/ooh323c/src/ooh323ep.h (original)
+++ trunk/asterisk-ooh323c/ooh323c/src/ooh323ep.h Wed Apr 12 16:03:41 2006
@@ -434,6 +434,25 @@
 void ooH323EpPrintConfig(void);
 
 
+/**
+ * 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);
 
 /**
  * This function is used to add G729 capability to the H323 endpoint.



More information about the svn-commits mailing list