[asterisk-commits] may: branch may/chan_ooh323_rework r209379 - in /team/may/chan_ooh323_rework/...

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Mon Jul 27 19:34:24 CDT 2009


Author: may
Date: Mon Jul 27 19:34:20 2009
New Revision: 209379

URL: http://svn.asterisk.org/svn-view/asterisk?view=rev&rev=209379
Log:
change includes of spandsp,
change media set order,
introduce tracelevel config parameter,
strating termcap and masterslavedetermine procedure before connect if
selected codec is not preferred,
change logic of close/open log channels after request mode

basic functionality is done and code are ready for review board.


Modified:
    team/may/chan_ooh323_rework/addons/chan_ooh323.c
    team/may/chan_ooh323_rework/addons/ooh323c/src/ooCapability.c
    team/may/chan_ooh323_rework/addons/ooh323c/src/ooCapability.h
    team/may/chan_ooh323_rework/addons/ooh323c/src/ooLogChan.c
    team/may/chan_ooh323_rework/addons/ooh323c/src/ooh245.c
    team/may/chan_ooh323_rework/addons/ooh323c/src/ooh245.h
    team/may/chan_ooh323_rework/addons/ooh323c/src/ooh323.c
    team/may/chan_ooh323_rework/addons/ooh323c/src/ooq931.c
    team/may/chan_ooh323_rework/addons/ooh323cDriver.c

Modified: team/may/chan_ooh323_rework/addons/chan_ooh323.c
URL: http://svn.asterisk.org/svn-view/asterisk/team/may/chan_ooh323_rework/addons/chan_ooh323.c?view=diff&rev=209379&r1=209378&r2=209379
==============================================================================
--- team/may/chan_ooh323_rework/addons/chan_ooh323.c (original)
+++ team/may/chan_ooh323_rework/addons/chan_ooh323.c Mon Jul 27 19:34:20 2009
@@ -17,22 +17,13 @@
 
 #include "chan_ooh323.h"
 #include <math.h>
-#include "spandsp.h"
-#include "spandsp/private/logging.h"
-#include "spandsp/private/fsk.h"
-#include "spandsp/private/modem_connect_tones.h"
-#include "spandsp/private/v17rx.h"
-#include "spandsp/private/v17tx.h"
-#include "spandsp/private/v29rx.h"
-#include "spandsp/private/v29tx.h"
-#include "spandsp/private/v27ter_rx.h"
-#include "spandsp/private/v27ter_tx.h"
-#include "spandsp/private/hdlc.h"
-#include "spandsp/private/fax_modems.h"
-#include "spandsp/private/t38_core.h"
-#include "spandsp/private/t38_non_ecm_buffer.h"
-#include "spandsp/private/t38_gateway.h"
-
+
+#define HAVE_SPANDSP_EXPOSE_H
+#include <spandsp.h>
+#ifdef HAVE_SPANDSP_EXPOSE_H
+#include <spandsp/expose.h>
+#endif
+#include <spandsp/version.h>
 
 /* Defaults */
 #define DEFAULT_CONTEXT "default"
@@ -285,6 +276,7 @@
 static int  gIncomingLimit = 1024;
 static int  gOutgoingLimit = 1024;
 OOBOOL gH323Debug = FALSE;
+static int gTRCLVL = OOTRCLVLERR;
 
 static int t35countrycode = 0;
 static int t35extensions = 0;
@@ -336,11 +328,11 @@
 		ast_channel_lock(ch);
 		ch->tech = &ooh323_tech;
 
-		fmt = ast_codec_pref_index(&i->prefs, 0); 
+		fmt = ast_codec_pref_index(&i->prefs, 0);
 		if (!fmt) 
 			fmt = ast_best_codec(capability);
 
-		ch->nativeformats = fmt;
+		ch->nativeformats = ch->rawwriteformat = ch->rawreadformat = fmt;
 		/* ch->nativeformats = (capability) ? 0 : AST_FORMAT_SLINEAR; */
 
 		ast_channel_set_fd(ch, 0, ast_rtp_instance_fd(i->rtp, 0));
@@ -351,10 +343,9 @@
 			ch->rings = 1;
 
 		ch->adsicpe = AST_ADSI_UNAVAILABLE;
-		ch->writeformat = capability;
-		ch->rawwriteformat = 0;
-		ch->readformat = capability;
-		ch->rawreadformat = 0;
+		fmt = ast_best_codec(capability);
+		ast_set_write_format(ch, fmt);
+		ast_set_read_format(ch, fmt);
 		ch->tech_pvt = i;
 		i->owner = ch;
 
@@ -1406,14 +1397,11 @@
 			return;
 		}
 		if (gH323Debug)
-	  		ast_verbose("Writeformat before update %s\n", 
-				  ast_getformatname_multiple(formats,512, p->owner->writeformat));
+	  		ast_verbose("Writeformat before update %s/%s\n", 
+			  ast_getformatname_multiple(formats,512, p->owner->writeformat),
+			  ast_getformatname_multiple(formats,512, p->owner->nativeformats));
 		p->owner->nativeformats = fmt;
-		if (p->owner->writeformat == 0)
-			p->owner->writeformat = fmt;
 	  	ast_set_write_format(p->owner, p->owner->writeformat);
-		if (p->owner->readformat == 0)
-			p->owner->readformat = fmt;
 	  	ast_set_read_format(p->owner, p->owner->readformat);
 		ast_channel_unlock(p->owner);
    	} else
@@ -1463,12 +1451,7 @@
 	  		ast_verbose("Readformat before update %s\n", 
 				  ast_getformatname_multiple(formats,512, p->owner->readformat));
 		p->owner->nativeformats = fmt;
-		if (p->owner->readformat == 0)
-			p->owner->readformat = fmt;
 	  	ast_set_read_format(p->owner, p->owner->readformat);
-		/* if (p->owner->writeformat == 0)
-			p->owner->writeformat = fmt;
-	  	ast_set_write_format(p->owner, p->owner->writeformat); */
 		ast_channel_unlock(p->owner);
    	} else
 		ast_log(LOG_ERROR, "No owner found\n");
@@ -2392,6 +2375,7 @@
 	memset(&gPrefs, 0, sizeof(struct ast_codec_pref));
 	gDTMFMode = H323_DTMF_RFC2833;
 	gT38Support = T38_FAXGW;
+	gTRCLVL = OOTRCLVLERR;
 	gRasGkMode = RasNoGatekeeper;
 	gGatekeeper[0] = '\0';
 	gRTPTimeout = 60;
@@ -2581,6 +2565,9 @@
 				gT38Support = T38_FAXGW;
 			else if (!strcasecmp(v->value, "transparent"))
 				gT38Support = T38_TRANSPARENT;
+		} else if (!strcasecmp(v->name, "tracelevel")) {
+			gTRCLVL = atoi(v->value);
+			ooH323EpSetTraceLevel(gTRCLVL);
 		}
 		v = v->next;
 	}
@@ -3110,12 +3097,11 @@
 		if (gIsGateway)
 			ooH323EpSetAsGateway();
 
-      ooH323EpSetVersionInfo(t35countrycode, t35extensions, manufacturer, vendor, version);
-
+      		ooH323EpSetVersionInfo(t35countrycode, t35extensions, manufacturer,
+									 vendor, version);
 		ooH323EpDisableAutoAnswer();
 		ooH323EpSetH225MsgCallbacks(h225Callbacks);
-      ooH323EpSetTraceLevel(OOTRCLVLDBGC);
-      /* ooH323EpSetTraceLevel(OOTRCLVLERR); */
+      		ooH323EpSetTraceLevel(gTRCLVL);
 		ooH323EpSetLocalAddress(gIP, gPort);
 		ooH323EpSetCallerID(gCallerID);
  
@@ -4040,7 +4026,7 @@
 
 	if (p->owner) {
 		/* We already hold the channel lock */
-		if (f->frametype == AST_FRAME_VOICE) {
+		if (f->frametype == AST_FRAME_VOICE && !p->faxmode) {
 			if (f->subclass != p->owner->nativeformats) {
             			ast_debug(1, "Oooh, format changed to %d\n", f->subclass);
 				p->owner->nativeformats = f->subclass;
@@ -4166,6 +4152,14 @@
 	if (gH323Debug)
        		ast_debug(1, "change mode to %d for %s\n", t38mode, call->callToken);
 
+	if (t38mode == p->faxmode) {
+		if (gH323Debug)
+			ast_debug(1, "mode for %s is already %d\n", call->callToken,
+					t38mode);
+		ast_mutex_unlock(&p->lock);
+		return;
+	}
+
 	if (p->owner) {
 		while (p->owner && ast_channel_trylock(p->owner)) {
 			ast_debug(1,"Failed to grab lock, trying again\n");
@@ -4227,14 +4221,12 @@
 			if (gH323Debug)
 				ast_debug(1,"Going to change native format for %s\n", call->callToken);
 			p->owner->nativeformats = AST_FORMAT_SLINEAR;
-			p->owner->rawreadformat = AST_FORMAT_SLINEAR;
-			p->owner->rawwriteformat = AST_FORMAT_SLINEAR;
-			ast_set_read_format(p->owner, p->owner->rawreadformat);
-			ast_set_write_format(p->owner, p->owner->rawwriteformat);
+			p->owner->readformat = AST_FORMAT_SLINEAR;
+			p->owner->writeformat = AST_FORMAT_SLINEAR;
+			ast_set_read_format(p->owner, p->owner->readformat);
+			ast_set_write_format(p->owner, p->owner->writeformat);
 			p->faxmode = 1;
-			ast_channel_unlock(p->owner);
 			ast_settimeout(p->owner, 34, t30_read, p->owner);
-			ast_channel_lock(p->owner);
 			p->lastTxT38 = time(NULL);
 		}
 	} else {

Modified: team/may/chan_ooh323_rework/addons/ooh323c/src/ooCapability.c
URL: http://svn.asterisk.org/svn-view/asterisk/team/may/chan_ooh323_rework/addons/ooh323c/src/ooCapability.c?view=diff&rev=209379&r1=209378&r2=209379
==============================================================================
--- team/may/chan_ooh323_rework/addons/ooh323c/src/ooCapability.c (original)
+++ team/may/chan_ooh323_rework/addons/ooh323c/src/ooCapability.c Mon Jul 27 19:34:20 2009
@@ -338,8 +338,7 @@
         if(!call->ourCaps){
            call->ourCaps = epCap;
            ooResetCapPrefs(call);
-        }
-        else{
+        }else{
            cur = call->ourCaps;
            while(cur->next) cur = cur->next;
            cur->next = epCap;
@@ -450,6 +449,20 @@
    }
            
    return OO_OK;
+}
+
+int epCapIsPreferred(OOH323CallData *call, ooH323EpCapability *epCap)
+{
+ ooH323EpCapability *curCap = call->ourCaps;
+ while (curCap) {
+  if (curCap->capType == epCap->capType) {
+   if (curCap->cap == epCap->cap)
+    return 1;
+   else
+    return 0;
+   }
+   curCap = curCap->next;
+ }
 }
 
 int ooCapabilityAddGSMCapability(OOH323CallData *call, int cap, 
@@ -1109,7 +1122,7 @@
       app->u.t38fax->t38FaxProfile.t38FaxUdpOptions.m.t38FaxMaxDatagramPresent = TRUE;
       app->u.t38fax->t38FaxProfile.t38FaxUdpOptions.t38FaxMaxDatagram = 72;
       app->u.t38fax->t38FaxProfile.t38FaxUdpOptions.t38FaxUdpEC.t =
-						T_H245T38FaxUdpOptions_t38FaxUdpEC_t38UDPFEC;
+					T_H245T38FaxUdpOptions_t38FaxUdpEC_t38UDPRedundancy;
 
       return app;
 }
@@ -2553,7 +2566,6 @@
    return OO_OK;
 }
 
-       
 int ooAddRemoteCapability(OOH323CallData *call, H245Capability *cap)
 {
    switch(cap->t)

Modified: team/may/chan_ooh323_rework/addons/ooh323c/src/ooCapability.h
URL: http://svn.asterisk.org/svn-view/asterisk/team/may/chan_ooh323_rework/addons/ooh323c/src/ooCapability.h?view=diff&rev=209379&r1=209378&r2=209379
==============================================================================
--- team/may/chan_ooh323_rework/addons/ooh323c/src/ooCapability.h (original)
+++ team/may/chan_ooh323_rework/addons/ooh323c/src/ooCapability.h Mon Jul 27 19:34:20 2009
@@ -727,6 +727,9 @@
 EXTERN const char* ooGetCapTypeText (OOCapabilities cap);
 
 
+EXTERN int epCapIsPreferred(struct OOH323CallData *call, ooH323EpCapability *epCap);
+
+
 /** 
  * @} 
  */

Modified: team/may/chan_ooh323_rework/addons/ooh323c/src/ooLogChan.c
URL: http://svn.asterisk.org/svn-view/asterisk/team/may/chan_ooh323_rework/addons/ooh323c/src/ooLogChan.c?view=diff&rev=209379&r1=209378&r2=209379
==============================================================================
--- team/may/chan_ooh323_rework/addons/ooh323c/src/ooLogChan.c (original)
+++ team/may/chan_ooh323_rework/addons/ooh323c/src/ooLogChan.c Mon Jul 27 19:34:20 2009
@@ -233,6 +233,26 @@
    return NULL;
 }
 
+/* function is to get channel with particular direction */
+
+OOLogicalChannel* ooGetTransmitLogicalChannel
+   (OOH323CallData *call)
+{
+   OOLogicalChannel * pChannel = NULL;
+   pChannel = call->logicalChans;
+   while(pChannel)
+   {
+      OOTRACEINFO6("Listing logical channel %d cap %d state %d for (%s, %s)\n",
+		pChannel->channelNo, pChannel->chanCap->cap, pChannel->state, 
+		call->callType, call->callToken);
+      if(!strcmp(pChannel->dir, "transmit") && pChannel->state == OO_LOGICALCHAN_IDLE)
+         return pChannel;
+      else
+         pChannel = pChannel->next;
+   }
+   return NULL;
+}
+
 int ooClearAllLogicalChannels(OOH323CallData *call)
 {
    OOLogicalChannel * temp = NULL, *prev = NULL;

Modified: team/may/chan_ooh323_rework/addons/ooh323c/src/ooh245.c
URL: http://svn.asterisk.org/svn-view/asterisk/team/may/chan_ooh323_rework/addons/ooh323c/src/ooh245.c?view=diff&rev=209379&r1=209378&r2=209379
==============================================================================
--- team/may/chan_ooh323_rework/addons/ooh323c/src/ooh245.c (original)
+++ team/may/chan_ooh323_rework/addons/ooh323c/src/ooh245.c Mon Jul 27 19:34:20 2009
@@ -1358,13 +1358,12 @@
 
 	call->reqFlags = 0; /* don't handle duplicate ack packet */
 
-	ooCloseAllLogicalChannels(call);
+	ooCloseAllLogicalChannels(call, "transmit");
 	if(gH323ep.h323Callbacks.onModeChanged) {
 		OOTRACEDBGA3("Handle RequestModeAck: (%s, %s), calling "
 			"callback onModeChanged\n", call->callType, call->callToken);
 		gH323ep.h323Callbacks.onModeChanged(call, t38mode);
 	}
-	ooOpenLogicalChannels(call);
 }
 
 int ooHandleRequestMode(OOH323CallData* call,
@@ -1392,13 +1391,11 @@
 
 				OO_CLRFLAG(call->flags, OO_M_AUDIOSESSION);
 				OO_SETFLAG(call->flags, OO_M_DATASESSION);
-				ooCloseAllLogicalChannels(call);
 				if(gH323ep.h323Callbacks.onModeChanged) {
 					OOTRACEDBGA3("Handle RequestMode: (%s, %s), calling "
 					"callback onModeChanged\n", call->callType, call->callToken);
 					gH323ep.h323Callbacks.onModeChanged(call, 1);
 				}
-				ooOpenLogicalChannels(call);
 			}
 		} else {
 			ooSendRequestModeReject(call, requestMode->sequenceNumber);
@@ -1410,13 +1407,11 @@
 
 			OO_CLRFLAG(call->flags, OO_M_DATASESSION);
 			OO_SETFLAG(call->flags, OO_M_AUDIOSESSION);
-			ooCloseAllLogicalChannels(call);
 			if(gH323ep.h323Callbacks.onModeChanged) {
 				OOTRACEDBGA3("Handle RequestMode: (%s, %s), calling "
 				"callback onModeChanged\n", call->callType, call->callToken);
 				gH323ep.h323Callbacks.onModeChanged(call, 0);
 			}
-			ooOpenLogicalChannels(call);
 		}
 		break;
 	default:
@@ -2092,14 +2087,15 @@
    return OO_OK;
 }
 
-int ooCloseAllLogicalChannels(OOH323CallData *call)
+int ooCloseAllLogicalChannels(OOH323CallData *call, char* dir)
 {
    ooLogicalChannel *temp;
 
    temp = call->logicalChans;
    while(temp)
    {
-      if(temp->state == OO_LOGICALCHAN_ESTABLISHED)
+      if(temp->state == OO_LOGICALCHAN_ESTABLISHED && 
+	(dir == NULL || !strcmp(temp->dir,dir)))
       {
          /* Sending closelogicalchannel only for outgoing channels*/
          if(!strcmp(temp->dir, "transmit"))
@@ -2544,6 +2540,8 @@
             case T_H245RequestMessage_openLogicalChannel:
                ooHandleOpenLogicalChannel(call, 
                                           request->u.openLogicalChannel);
+		if(!ooGetTransmitLogicalChannel(call))
+			ooOpenLogicalChannels(call);
                break;
 	    case T_H245RequestMessage_requestMode:
 		OOTRACEINFO4("Received request mode - %d (%s, %s)\n",
@@ -2555,8 +2553,10 @@
                OOTRACEINFO4("Received close logical Channel - %d (%s, %s)\n",
                   request->u.closeLogicalChannel->forwardLogicalChannelNumber, 
                   call->callType, call->callToken);
-               ooOnReceivedCloseLogicalChannel(call, 
-                                               request->u.closeLogicalChannel);
+               if (ooOnReceivedCloseLogicalChannel(call, 
+                                               request->u.closeLogicalChannel) == OO_OK) {
+			ooCloseAllLogicalChannels(call, NULL);
+	       }
                break;
             case T_H245RequestMessage_requestChannelClose:
                OOTRACEINFO4("Received RequestChannelClose - %d (%s, %s)\n",

Modified: team/may/chan_ooh323_rework/addons/ooh323c/src/ooh245.h
URL: http://svn.asterisk.org/svn-view/asterisk/team/may/chan_ooh323_rework/addons/ooh323c/src/ooh245.h?view=diff&rev=209379&r1=209378&r2=209379
==============================================================================
--- team/may/chan_ooh323_rework/addons/ooh323c/src/ooh245.h (original)
+++ team/may/chan_ooh323_rework/addons/ooh323c/src/ooh245.h Mon Jul 27 19:34:20 2009
@@ -288,7 +288,7 @@
  *
  * @return              OO_OK, on success. OO_FAILED, on failure.
  */
-EXTERN int ooCloseAllLogicalChannels(struct OOH323CallData *call);
+EXTERN int ooCloseAllLogicalChannels(struct OOH323CallData *call, char* dir);
 
 
 /**

Modified: team/may/chan_ooh323_rework/addons/ooh323c/src/ooh323.c
URL: http://svn.asterisk.org/svn-view/asterisk/team/may/chan_ooh323_rework/addons/ooh323c/src/ooh323.c?view=diff&rev=209379&r1=209378&r2=209379
==============================================================================
--- team/may/chan_ooh323_rework/addons/ooh323c/src/ooh323.c (original)
+++ team/may/chan_ooh323_rework/addons/ooh323c/src/ooh323.c Mon Jul 27 19:34:20 2009
@@ -474,6 +474,26 @@
             }
             if(!strcmp(pChannel->dir, "transmit"))
             {
+	/* May 20090728 */
+		if (!epCapIsPreferred(call, pChannel->chanCap)) {
+      		 if(call->localTermCapState == OO_LocalTermCapExchange_Idle) {
+         		ret = ooSendTermCapMsg(call);
+         		if(ret != OO_OK) {
+            		 OOTRACEERR3("ERROR:Sending Terminal capability message (%s, %s)\n",
+                         			call->callType, call->callToken);
+            		 return ret;
+         		}
+      		 }
+      		 if(call->masterSlaveState == OO_MasterSlave_Idle) {
+         		ret = ooSendMasterSlaveDetermination(call);
+         		if(ret != OO_OK) {
+            		 OOTRACEERR3("ERROR:Sending Master-slave determination message "
+                     			"(%s, %s)\n", call->callType, call->callToken);
+            		 return ret;
+         		}
+      		 }
+		}
+
                if(olc->forwardLogicalChannelParameters.multiplexParameters.t !=
                   T_H245OpenLogicalChannel_forwardLogicalChannelParameters_multiplexParameters_h2250LogicalChannelParameters)
                {
@@ -671,6 +691,26 @@
             }
             if(!strcmp(pChannel->dir, "transmit"))
             {
+	/* May 20090728 */
+		if (!epCapIsPreferred(call, pChannel->chanCap)) {
+      		 if(call->localTermCapState == OO_LocalTermCapExchange_Idle) {
+         		ret = ooSendTermCapMsg(call);
+         		if(ret != OO_OK) {
+            		 OOTRACEERR3("ERROR:Sending Terminal capability message (%s, %s)\n",
+                         			call->callType, call->callToken);
+            		 return ret;
+         		}
+      		 }
+      		 if(call->masterSlaveState == OO_MasterSlave_Idle) {
+         		ret = ooSendMasterSlaveDetermination(call);
+         		if(ret != OO_OK) {
+            		 OOTRACEERR3("ERROR:Sending Master-slave determination message "
+                     			"(%s, %s)\n", call->callType, call->callToken);
+            		 return ret;
+         		}
+      		 }
+		}
+
                if(olc->forwardLogicalChannelParameters.multiplexParameters.t !=
                   T_H245OpenLogicalChannel_forwardLogicalChannelParameters_multiplexParameters_h2250LogicalChannelParameters)
                {
@@ -716,11 +756,11 @@
                   return OO_FAILED;
                }
                pChannel->chanCap->startTransmitChannel(call, pChannel);
-            }
-            /* Mark the current channel as established and close all other 
-               logical channels with same session id and in same direction.
-            */
-            ooOnLogicalChannelEstablished(call, pChannel);
+               /* Mark the current channel as established and close all other 
+                  logical channels with same session id and in same direction.
+               */
+               ooOnLogicalChannelEstablished(call, pChannel);
+	    }
          }
          finishPrint();
          removeEventHandler(call->pctxt);
@@ -763,6 +803,8 @@
          return OO_FAILED;
       }
    }
+
+
    return OO_OK;
 }
 
@@ -867,6 +909,26 @@
             }
             if(!strcmp(pChannel->dir, "transmit"))
             {
+	/* May 20090728 */
+		if (!epCapIsPreferred(call, pChannel->chanCap)) {
+      		 if(call->localTermCapState == OO_LocalTermCapExchange_Idle) {
+         		ret = ooSendTermCapMsg(call);
+         		if(ret != OO_OK) {
+            		 OOTRACEERR3("ERROR:Sending Terminal capability message (%s, %s)\n",
+                         			call->callType, call->callToken);
+            		 return ret;
+         		}
+      		 }
+      		 if(call->masterSlaveState == OO_MasterSlave_Idle) {
+         		ret = ooSendMasterSlaveDetermination(call);
+         		if(ret != OO_OK) {
+            		 OOTRACEERR3("ERROR:Sending Master-slave determination message "
+                     			"(%s, %s)\n", call->callType, call->callToken);
+            		 return ret;
+         		}
+      		 }
+		}
+
                if(olc->forwardLogicalChannelParameters.multiplexParameters.t !=
                   T_H245OpenLogicalChannel_forwardLogicalChannelParameters_multiplexParameters_h2250LogicalChannelParameters)
                {
@@ -959,6 +1021,7 @@
          return OO_FAILED;
       }
    }
+
    return OO_OK;
 }
    

Modified: team/may/chan_ooh323_rework/addons/ooh323c/src/ooq931.c
URL: http://svn.asterisk.org/svn-view/asterisk/team/may/chan_ooh323_rework/addons/ooh323c/src/ooq931.c?view=diff&rev=209379&r1=209378&r2=209379
==============================================================================
--- team/may/chan_ooh323_rework/addons/ooh323c/src/ooq931.c (original)
+++ team/may/chan_ooh323_rework/addons/ooh323c/src/ooq931.c Mon Jul 27 19:34:20 2009
@@ -886,7 +886,7 @@
    
       
    /* If fast start supported and remote endpoint has sent faststart element */
-   if(OO_TESTFLAG(gH323ep.flags, OO_M_FASTSTART) && 
+   if(OO_TESTFLAG(pCall->flags, OO_M_FASTSTART) && 
       pCall->remoteFastStartOLCs.count>0)
    {
       pFS = (ASN1DynOctStr*)memAlloc(pctxt, 
@@ -1238,7 +1238,7 @@
    memset (q931msg->userInfo, 0, sizeof(H225H323_UserInformation));
    q931msg->userInfo->h323_uu_pdu.m.h245TunnelingPresent=1; 
    q931msg->userInfo->h323_uu_pdu.h245Tunneling = 
-                                   OO_TESTFLAG(gH323ep.flags, OO_M_TUNNELING); 
+                                   OO_TESTFLAG(call->flags, OO_M_TUNNELING); 
    q931msg->userInfo->h323_uu_pdu.h323_message_body.t = 
          T_H225H323_UU_PDU_h323_message_body_callProceeding;
    
@@ -1337,7 +1337,7 @@
    }
    memset (q931msg->userInfo, 0, sizeof(H225H323_UserInformation));
    q931msg->userInfo->h323_uu_pdu.m.h245TunnelingPresent=1; 
-   q931msg->userInfo->h323_uu_pdu.h245Tunneling = OO_TESTFLAG(gH323ep.flags, 
+   q931msg->userInfo->h323_uu_pdu.h245Tunneling = OO_TESTFLAG(call->flags, 
                                                               OO_M_TUNNELING); 
    q931msg->userInfo->h323_uu_pdu.h323_message_body.t = 
          T_H225H323_UU_PDU_h323_message_body_alerting;
@@ -1467,7 +1467,7 @@
    }
    memset (q931msg->userInfo, 0, sizeof(H225H323_UserInformation));
    q931msg->userInfo->h323_uu_pdu.m.h245TunnelingPresent=1; 
-   q931msg->userInfo->h323_uu_pdu.h245Tunneling = OO_TESTFLAG(gH323ep.flags, 
+   q931msg->userInfo->h323_uu_pdu.h245Tunneling = OO_TESTFLAG(call->flags, 
                                                               OO_M_TUNNELING); 
    q931msg->userInfo->h323_uu_pdu.h323_message_body.t = 
          T_H225H323_UU_PDU_h323_message_body_progress;
@@ -1667,7 +1667,7 @@
    }
    memset(releaseComplete, 0, sizeof(H225ReleaseComplete_UUIE));
    q931msg->userInfo->h323_uu_pdu.m.h245TunnelingPresent=1; 
-   q931msg->userInfo->h323_uu_pdu.h245Tunneling = OO_TESTFLAG(gH323ep.flags, 
+   q931msg->userInfo->h323_uu_pdu.h245Tunneling = OO_TESTFLAG(call->flags, 
                                                               OO_M_TUNNELING); 
    q931msg->userInfo->h323_uu_pdu.h323_message_body.t = 
          T_H225H323_UU_PDU_h323_message_body_releaseComplete;
@@ -2429,7 +2429,7 @@
    setup->sourceCallSignalAddress.u.ipAddress = srcCallSignalIpAddress;
    setup->m.sourceCallSignalAddressPresent=TRUE;
    /* No fast start */
-   if(!OO_TESTFLAG(gH323ep.flags, OO_M_FASTSTART))
+   if(!OO_TESTFLAG(call->flags, OO_M_FASTSTART))
    {
       setup->m.fastStartPresent = FALSE;
    }
@@ -2666,8 +2666,10 @@
    /* For H.323 version 4 and higher, if fast connect, tunneling should be 
       supported.
    */
-   if(OO_TESTFLAG(call->flags, OO_M_FASTSTART))
+   if(OO_TESTFLAG(call->flags, OO_M_FASTSTART)) {
       q931msg->userInfo->h323_uu_pdu.h245Tunneling = TRUE;
+      OO_SETFLAG(call->flags, OO_M_TUNNELING);
+   }
 
    OOTRACEDBGA3("Built SETUP message (%s, %s)\n", call->callType, 
                  call->callToken);
@@ -2718,7 +2720,7 @@
       return OO_FAILED;
    }
    q931msg->userInfo->h323_uu_pdu.m.h245TunnelingPresent=1; 
-   q931msg->userInfo->h323_uu_pdu.h245Tunneling = OO_TESTFLAG(gH323ep.flags, 
+   q931msg->userInfo->h323_uu_pdu.h245Tunneling = OO_TESTFLAG(call->flags, 
                                                               OO_M_TUNNELING); 
    q931msg->userInfo->h323_uu_pdu.h323_message_body.t = 
          T_H225H323_UU_PDU_h323_message_body_information;

Modified: team/may/chan_ooh323_rework/addons/ooh323cDriver.c
URL: http://svn.asterisk.org/svn-view/asterisk/team/may/chan_ooh323_rework/addons/ooh323cDriver.c?view=diff&rev=209379&r1=209378&r2=209379
==============================================================================
--- team/may/chan_ooh323_rework/addons/ooh323cDriver.c (original)
+++ team/may/chan_ooh323_rework/addons/ooh323cDriver.c Mon Jul 27 19:34:20 2009
@@ -357,7 +357,7 @@
          if(gH323Debug)
             ast_verbose("\tAdding g729 capability to call(%s, %s)\n",
                                             call->callType, call->callToken);
-         ret|= ooCallAddG729Capability(call, OO_G729, txframes, 24, 
+         ret|= ooCallAddG729Capability(call, OO_G729, txframes, 4, 
                                      OORXANDTX, &ooh323c_start_receive_channel,
                                      &ooh323c_start_transmit_channel,
                                      &ooh323c_stop_receive_channel, 
@@ -365,7 +365,7 @@
          if(gH323Debug)
             ast_verbose("\tAdding g729A capability to call(%s, %s)\n",
                                             call->callType, call->callToken);
-         ret= ooCallAddG729Capability(call, OO_G729A, txframes, 24, 
+         ret= ooCallAddG729Capability(call, OO_G729A, txframes, 4, 
                                      OORXANDTX, &ooh323c_start_receive_channel,
                                      &ooh323c_start_transmit_channel,
                                      &ooh323c_stop_receive_channel, 
@@ -373,7 +373,7 @@
          if(gH323Debug)
             ast_verbose("\tAdding g729B capability to call(%s, %s)\n",
                                             call->callType, call->callToken);
-         ret|= ooCallAddG729Capability(call, OO_G729B, txframes, 24, 
+         ret|= ooCallAddG729Capability(call, OO_G729B, txframes, 4, 
                                      OORXANDTX, &ooh323c_start_receive_channel,
                                      &ooh323c_start_transmit_channel,
                                      &ooh323c_stop_receive_channel, 




More information about the asterisk-commits mailing list