[svn-commits] may: branch may/ooh323_ipv6_direct_rtp r349722 - in /team/may/ooh323_ipv6_dir...

SVN commits to the Digium repositories svn-commits at lists.digium.com
Thu Jan 5 14:07:54 CST 2012


Author: may
Date: Thu Jan  5 14:07:49 2012
New Revision: 349722

URL: http://svnview.digium.com/svn/asterisk?view=rev&rev=349722
Log:
Fix coding issues again

Modified:
    team/may/ooh323_ipv6_direct_rtp/addons/chan_ooh323.c
    team/may/ooh323_ipv6_direct_rtp/addons/ooh323c/src/ooCmdChannel.c
    team/may/ooh323_ipv6_direct_rtp/addons/ooh323c/src/ooLogChan.c
    team/may/ooh323_ipv6_direct_rtp/addons/ooh323c/src/ooStackCmds.c
    team/may/ooh323_ipv6_direct_rtp/addons/ooh323c/src/ooh245.c
    team/may/ooh323_ipv6_direct_rtp/addons/ooh323c/src/ooh323.c
    team/may/ooh323_ipv6_direct_rtp/addons/ooh323c/src/ooq931.c
    team/may/ooh323_ipv6_direct_rtp/addons/ooh323cDriver.c

Modified: team/may/ooh323_ipv6_direct_rtp/addons/chan_ooh323.c
URL: http://svnview.digium.com/svn/asterisk/team/may/ooh323_ipv6_direct_rtp/addons/chan_ooh323.c?view=diff&rev=349722&r1=349721&r2=349722
==============================================================================
--- team/may/ooh323_ipv6_direct_rtp/addons/chan_ooh323.c (original)
+++ team/may/ooh323_ipv6_direct_rtp/addons/chan_ooh323.c Thu Jan  5 14:07:49 2012
@@ -3043,8 +3043,8 @@
 		ast_cli(a->fd, "%-15.15s%s\n", "Name: ", peer->name);
 		ast_cli(a->fd, "%s:%s,%s\n", "FastStart/H.245 Tunneling", peer->faststart?"yes":"no",
 					peer->h245tunneling?"yes":"no");
-		ast_cli(a->fd, "%-15s%s\n", "DirectRTP", peer->directrtp?"yes":"no");
-		ast_cli(a->fd, "%-15s%s\n", "EarlyDirectRTP", peer->earlydirect?"yes":"no");
+		ast_cli(a->fd, "%-15s%s\n", "DirectRTP", peer->directrtp ? "yes" : "no");
+		ast_cli(a->fd, "%-15s%s\n", "EarlyDirectRTP", peer->earlydirect ? "yes" : "no");
 		ast_cli(a->fd, "%-15.15s%s", "Format Prefs: ", "(");
 		print_codec_to_cli(a->fd, &peer->prefs);
 		ast_cli(a->fd, ")\n");
@@ -3202,8 +3202,8 @@
 		ast_cli(a->fd, "%-15.15s%s\n", "Name: ", user->name);
 		ast_cli(a->fd, "%s:%s,%s\n", "FastStart/H.245 Tunneling", user->faststart?"yes":"no",
 					user->h245tunneling?"yes":"no");
-		ast_cli(a->fd, "%-15s%s\n", "DirectRTP", user->directrtp?"yes":"no");
-		ast_cli(a->fd, "%-15s%s\n", "EarlyDirectRTP", user->earlydirect?"yes":"no");
+		ast_cli(a->fd, "%-15s%s\n", "DirectRTP", user->directrtp ? "yes" : "no");
+		ast_cli(a->fd, "%-15s%s\n", "EarlyDirectRTP", user->earlydirect ? "yes" : "no");
 		ast_cli(a->fd, "%-15.15s%s", "Format Prefs: ", "(");
 		print_codec_to_cli(a->fd, &user->prefs);
 		ast_cli(a->fd, ")\n");
@@ -3366,8 +3366,8 @@
 	ast_cli(a->fd, "%-20s%s\n", "Tunneling", gTunneling?"yes":"no");
 	ast_cli(a->fd, "%-20s%s\n", "CallerId", gCallerID);
 	ast_cli(a->fd, "%-20s%s\n", "MediaWaitForConnect", gMediaWaitForConnect?"yes":"no");
-	ast_cli(a->fd, "%-20s%s\n", "DirectRTP", gDirectRTP?"yes":"no");
-	ast_cli(a->fd, "%-20s%s\n", "EarlyDirectRTP", gEarlyDirect?"yes":"no");
+	ast_cli(a->fd, "%-20s%s\n", "DirectRTP", gDirectRTP ? "yes" : "no");
+	ast_cli(a->fd, "%-20s%s\n", "EarlyDirectRTP", gEarlyDirect ? "yes" : "no");
 
 #if (0)
 		extern OOH323EndPoint gH323ep;
@@ -4207,8 +4207,9 @@
 	}
 
 	*rtp = p->vrtp ? ao2_ref(p->vrtp, +1), p->vrtp : NULL;
+
 	/* there must check of supporting video per call */
-	/* res = AST_RTP_GLUE_RESULT_LOCAL; */
+
 	res = AST_RTP_GLUE_RESULT_FORBID;
 
 	return res;
@@ -4309,9 +4310,10 @@
 
 	if (changed) {
 		if (!ast_sockaddr_isnull(&p->redirip)) {
-			if (gH323Debug)
+			if (gH323Debug) {
 				ast_verb(0, "ooh323_set_rtp_peer  %s -> %s:%d\n", chan->name, ast_sockaddr_stringify_addr(&p->redirip),
 							ast_sockaddr_port(&p->redirip));
+			}
 			ooUpdateLogChannels(callToken, ast_sockaddr_stringify_addr(&p->redirip),
 							ast_sockaddr_port(&p->redirip));
 		} else {

Modified: team/may/ooh323_ipv6_direct_rtp/addons/ooh323c/src/ooCmdChannel.c
URL: http://svnview.digium.com/svn/asterisk/team/may/ooh323_ipv6_direct_rtp/addons/ooh323c/src/ooCmdChannel.c?view=diff&rev=349722&r1=349721&r2=349722
==============================================================================
--- team/may/ooh323_ipv6_direct_rtp/addons/ooh323c/src/ooCmdChannel.c (original)
+++ team/may/ooh323_ipv6_direct_rtp/addons/ooh323c/src/ooCmdChannel.c Thu Jan  5 14:07:49 2012
@@ -414,7 +414,7 @@
 	    case OO_CMD_UPDLC:
 		OOTRACEINFO4("Processing UpdLC command %s, localIP is %s, port is %d\n",
 				(char *)cmd.param1, (char *)cmd.param2, *(int *)cmd.param3);
-		if(cmd.param2) {
+		if (cmd.param2) {
 			ooUpdateAllLogicalChannels(call, (char *)cmd.param2, *(int *)cmd.param3);
 		}
 		break;
@@ -422,9 +422,15 @@
             default: OOTRACEERR1("ERROR:Unknown command\n");
          }
       }
-      if(cmd.param1) free(cmd.param1);
-      if(cmd.param2) free(cmd.param2);
-      if(cmd.param3) free(cmd.param3);
+      if (cmd.param1) {
+	free(cmd.param1);
+      }
+      if (cmd.param2) {
+	free(cmd.param2);
+      }
+      if (cmd.param3) {
+	free(cmd.param3);
+      }
    }
 
 

Modified: team/may/ooh323_ipv6_direct_rtp/addons/ooh323c/src/ooLogChan.c
URL: http://svnview.digium.com/svn/asterisk/team/may/ooh323_ipv6_direct_rtp/addons/ooh323c/src/ooLogChan.c?view=diff&rev=349722&r1=349721&r2=349722
==============================================================================
--- team/may/ooh323_ipv6_direct_rtp/addons/ooh323c/src/ooLogChan.c (original)
+++ team/may/ooh323_ipv6_direct_rtp/addons/ooh323c/src/ooLogChan.c Thu Jan  5 14:07:49 2012
@@ -263,11 +263,11 @@
 {
    OOLogicalChannel * pChannel = NULL;
    pChannel = call->logicalChans;
-   while(pChannel) {
+   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, "receive") && pChannel->state != OO_LOGICALCHAN_IDLE &&
+      if (!strcmp(pChannel->dir, "receive") && pChannel->state != OO_LOGICALCHAN_IDLE &&
 					       pChannel->state != OO_LOGICALCHAN_PROPOSEDFS) {
          return pChannel;
       } else {
@@ -349,7 +349,7 @@
    ooRemoveLogicalChannel(call, channelNo);/* TODO: efficiency - This causes re-search of
                                                     of logical channel in the list. Can be
                                                     easily improved.*/
-   } while ((pLogicalChannel = ooFindLogicalChannelByLogicalChannelNo(call,channelNo)));
+   } while ((pLogicalChannel = ooFindLogicalChannelByLogicalChannelNo(call, channelNo)));
    return OO_OK;
 }
 

Modified: team/may/ooh323_ipv6_direct_rtp/addons/ooh323c/src/ooStackCmds.c
URL: http://svnview.digium.com/svn/asterisk/team/may/ooh323_ipv6_direct_rtp/addons/ooh323c/src/ooStackCmds.c?view=diff&rev=349722&r1=349721&r2=349722
==============================================================================
--- team/may/ooh323_ipv6_direct_rtp/addons/ooh323c/src/ooStackCmds.c (original)
+++ team/may/ooh323_ipv6_direct_rtp/addons/ooh323c/src/ooStackCmds.c Thu Jan  5 14:07:49 2012
@@ -563,16 +563,17 @@
    }
 
    if (call->CmdChan == 0) {
-      if(ooCreateCallCmdConnection(call) != OO_OK)
-         return OO_STKCMD_CONNECTIONERR;
+      if (ooCreateCallCmdConnection(call) != OO_OK) {
+         return OO_STKCMD_CONNECTIONERR;
+      }
    }
 
    memset(&cmd, 0, sizeof(OOStackCommand));
    cmd.type = OO_CMD_UPDLC;
 
-   cmd.param1 = (void*) malloc(strlen(callToken)+1);
-   cmd.param2 = (void*) malloc(strlen(localIP)+1);
-   cmd.param3 = (void*) malloc(sizeof(int)+1);
+   cmd.param1 = (void*) malloc(strlen(callToken) + 1);
+   cmd.param2 = (void*) malloc(strlen(localIP) + 1);
+   cmd.param3 = (void*) malloc(sizeof(int) + 1);
    if (!cmd.param1 || !cmd.param2 || !cmd.param3) {
       if (cmd.param1) {
 	free(cmd.param1); /* Release memory */
@@ -592,7 +593,7 @@
    *((int *)cmd.param3) = port;
    cmd.plen3 = sizeof(int) + 1;
 
-   if (ooWriteCallStackCommand(call,&cmd) != OO_OK) {
+   if (ooWriteCallStackCommand(call, &cmd) != OO_OK) {
       free(cmd.param1);
       free(cmd.param2);
       free(cmd.param3);

Modified: team/may/ooh323_ipv6_direct_rtp/addons/ooh323c/src/ooh245.c
URL: http://svnview.digium.com/svn/asterisk/team/may/ooh323_ipv6_direct_rtp/addons/ooh323c/src/ooh245.c?view=diff&rev=349722&r1=349721&r2=349722
==============================================================================
--- team/may/ooh323_ipv6_direct_rtp/addons/ooh323c/src/ooh245.c (original)
+++ team/may/ooh323_ipv6_direct_rtp/addons/ooh323c/src/ooh245.c Thu Jan  5 14:07:49 2012
@@ -820,18 +820,17 @@
 int ooSendEmptyTermCapMsg(OOH323CallData *call)
 {
    int ret;
-   H245RequestMessage *request=NULL;
-   OOCTXT *pctxt=NULL;
-   H245TerminalCapabilitySet *termCap=NULL;
-   H245Message *ph245msg=NULL;
-
-   ret = ooCreateH245Message(call, &ph245msg,  
-                             T_H245MultimediaSystemControlMessage_request);
- 
-   if(ret == OO_FAILED)
-   {
+   H245RequestMessage *request = NULL;
+   OOCTXT *pctxt = NULL;
+   H245TerminalCapabilitySet *termCap = NULL;
+   H245Message *ph245msg = NULL;
+
+   ret = ooCreateH245Message(call, &ph245msg,
+				T_H245MultimediaSystemControlMessage_request);
+
+   if (ret == OO_FAILED) {
       OOTRACEERR3("Error:Failed to create H245 message for Terminal "
-                  "CapabilitySet (%s, %s)\n", call->callType,call->callToken);
+                  "CapabilitySet (%s, %s)\n", call->callType, call->callToken);
       return OO_FAILED;
    }
 
@@ -840,35 +839,31 @@
    pctxt = call->msgctxt;
    ph245msg->msgType = OOTerminalCapabilitySet;
    memset(request, 0, sizeof(H245RequestMessage));
-   if(request == NULL)
-   {
+   if(request == NULL) {
       OOTRACEERR3("ERROR: No memory allocated for request message (%s, %s)\n",
                    call->callType, call->callToken);
       return OO_FAILED;
    }
-   
+
    request->t = T_H245RequestMessage_terminalCapabilitySet;
    request->u.terminalCapabilitySet = (H245TerminalCapabilitySet*)
-                  memAlloc(pctxt, sizeof(H245TerminalCapabilitySet)); 
+                  memAlloc(pctxt, sizeof(H245TerminalCapabilitySet));
    termCap = request->u.terminalCapabilitySet;
    memset(termCap, 0, sizeof(H245TerminalCapabilitySet));
    termCap->m.multiplexCapabilityPresent = 0;
    termCap->m.capabilityTablePresent = 0;
    termCap->m.capabilityDescriptorsPresent = 0;
-   termCap->sequenceNumber = ++(call->localTermCapSeqNo);  
+   termCap->sequenceNumber = ++(call->localTermCapSeqNo);
    termCap->protocolIdentifier = gh245ProtocolID; /* protocol id */
 
-   /* dListInit(&(termCap->capabilityDescriptors)); */
-
-   OOTRACEDBGA3("Built empty terminal capability set message (%s, %s)\n", 
+   OOTRACEDBGA3("Built empty terminal capability set message (%s, %s)\n",
                  call->callType, call->callToken);
    ret = ooSendH245Msg(call, ph245msg);
-   if(ret != OO_OK)
-   {
+   if (ret != OO_OK) {
       OOTRACEERR3("Error:Failed to enqueue empty TCS message to outbound queue. "
                   "(%s, %s)\n", call->callType, call->callToken);
    }
-   ooFreeH245Message(call,ph245msg);
+   ooFreeH245Message(call, ph245msg);
 
    return ret;
 }
@@ -1778,7 +1773,7 @@
    {
       epCap->startReceiveChannel(call, pLogicalChannel);      
       OOTRACEINFO6("Receive channel of type %s started at %s:%d(%s, %s)\n", 
-                    ooGetCapTypeText(epCap->cap), pLogicalChannel->localIP, 
+                    ooGetCapTypeText(epCap->cap), pLogicalChannel->localIP,
                     pLogicalChannel->localRtpPort, call->callType, 
                     call->callToken);
    }
@@ -2288,19 +2283,16 @@
 /* close all log chans */
 
    temp = call->logicalChans;
-   while(temp)
-   {
-      if(temp->state == OO_LOGICALCHAN_ESTABLISHED) {
+   while (temp) {
+      if (temp->state == OO_LOGICALCHAN_ESTABLISHED) {
           /* Sending closelogicalchannel only for outgoing channels */
-         if(!strcmp(temp->dir, "transmit"))
-         {
+         if (!strcmp(temp->dir, "transmit")) {
 	    if (call->h245SessionState != OO_H245SESSION_IDLE) {
               ooSendCloseLogicalChannel(call, temp);
             } else {
               ooClearLogicalChannel(call, temp->channelNo);
             }
-         }
-         else if (!eTCS && call->h245SessionState != OO_H245SESSION_IDLE) {
+         } else if (!eTCS && call->h245SessionState != OO_H245SESSION_IDLE) {
             ooSendEmptyTermCapMsg(call);
             eTCS = TRUE;
          }
@@ -2310,11 +2302,9 @@
 
 /* change media address for all caps */
 
-   if(call->mediaInfo)
-   {
+   if (call->mediaInfo) {
       pMediaInfo = call->mediaInfo;
-      while(pMediaInfo)
-      {
+      while (pMediaInfo) {
          strcpy(pMediaInfo->lMediaIP, lIP);
          pMediaInfo->lMediaRedirPort = port;
          pMediaInfo->lMediaRedirCPort = port + 1;
@@ -2332,8 +2322,6 @@
 
 /* Restart TCS exchange proc - Paul Cadah do it in chan_h323_exts native bridge code */
 /* We must do it after all log channels are closed */
-   /* call->localTermCapState = OO_LocalTermCapExchange_Idle;
-   ooSendTermCapMsg(call); */
 
    return OO_OK;
 }
@@ -2391,18 +2379,10 @@
    
    /* Stop the media transmission */
    /* Moved to OnReceivedClosedChannelAck */
-   /* OOTRACEINFO4("Closing logical channel %d (%s, %s)\n", 
-                clc->forwardLogicalChannelNumber, call->callType, 
-                call->callToken);
-   ret = ooClearLogicalChannel(call, clc->forwardLogicalChannelNumber);
-   if(ret != OO_OK)
-   {
-      OOTRACEERR4("ERROR:Failed to close logical channel %d (%s, %s)\n",
-         clc->forwardLogicalChannelNumber, call->callType, call->callToken);
-      return OO_FAILED;
-   } */
    logicalChan->state = OO_LOGICALCHAN_CLOSEPENDING;
-   if(error) return OO_FAILED;
+   if (error) {
+	return OO_FAILED;
+   }
    return ret;
 }
 
@@ -2799,8 +2779,7 @@
       clc->forwardLogicalChannelNumber, call->callType, call->callToken);
    
    ret = ooClearLogicalChannel(call, clc->forwardLogicalChannelNumber);
-   if(ret != OO_OK)
-   {
+   if (ret != OO_OK) {
       OOTRACEERR4("ERROR:Failed to close logical channel %d (%s, %s)\n",
          clc->forwardLogicalChannelNumber, call->callType, call->callToken);
       return OO_FAILED;
@@ -2924,8 +2903,8 @@
                                                request->u.closeLogicalChannel) == OO_OK) {
 		if (call->TCSPending && !ooGetTransmitLogicalChannel(call)) {
 			call->TCSPending = FALSE;
-   			call->localTermCapState = OO_LocalTermCapExchange_Idle;
-   			ooSendTermCapMsg(call);
+			call->localTermCapState = OO_LocalTermCapExchange_Idle;
+			ooSendTermCapMsg(call);
 		} else if (!call->TCSPending) {
 			ooCloseAllLogicalChannels(call, NULL);
 		}
@@ -3118,12 +3097,13 @@
                }
                ooOnReceivedCloseChannelAck(call, 
                                            response->u.closeLogicalChannelAck);
-	       if(call->TCSPending && !ooGetReceiveLogicalChannel(call)) {
+	       if (call->TCSPending && !ooGetReceiveLogicalChannel(call)) {
 			call->TCSPending = FALSE;
-   			call->localTermCapState = OO_LocalTermCapExchange_Idle;
-   			ooSendTermCapMsg(call);
-	       } else if(!ooGetTransmitLogicalChannel(call))
+			call->localTermCapState = OO_LocalTermCapExchange_Idle;
+			ooSendTermCapMsg(call);
+	       } else if (!ooGetTransmitLogicalChannel(call)) {
 			ooOpenLogicalChannels(call);
+	       }
                break;
             case T_H245ResponseMessage_requestChannelCloseAck:
                 OOTRACEINFO4("RequestChannelCloseAck received - %d (%s, %s)\n",
@@ -3146,8 +3126,6 @@
                   }
                 }
 		/* Do nothing by receive reqChanCloseAck */
-                /* ooOnReceivedRequestChannelCloseAck(call, 
-                                             response->u.requestChannelCloseAck); */
                 break;
             case T_H245ResponseMessage_requestChannelCloseReject:
                OOTRACEINFO4("RequestChannelCloseReject received - %d (%s, %s)\n",
@@ -3281,8 +3259,7 @@
    if(call->remoteTermCapSeqNo && call->remoteTermCapSeqNo == tcs->sequenceNumber)
     call->localTermCapState = OO_LocalTermCapExchange_Idle;
    }
-/* empty tcs - renegotiate logical channels 
- */ 
+/* empty tcs - renegotiate logical channels */
    if(!tcs->m.capabilityTablePresent)
    {
       OOTRACEDBGC3("Empty TCS found.  (%s, %s)\n",
@@ -3294,8 +3271,8 @@
 /* close all transmit chans */
 
       temp = call->logicalChans;
-      while(temp) {
-       if(temp->state == OO_LOGICALCHAN_ESTABLISHED) {
+      while (temp) {
+       if (temp->state == OO_LOGICALCHAN_ESTABLISHED) {
           /* Sending closelogicalchannel only for outgoing channels */
          if(!strcmp(temp->dir, "transmit")) {
             ooSendCloseLogicalChannel(call, temp);

Modified: team/may/ooh323_ipv6_direct_rtp/addons/ooh323c/src/ooh323.c
URL: http://svnview.digium.com/svn/asterisk/team/may/ooh323_ipv6_direct_rtp/addons/ooh323c/src/ooh323.c?view=diff&rev=349722&r1=349721&r2=349722
==============================================================================
--- team/may/ooh323_ipv6_direct_rtp/addons/ooh323c/src/ooh323.c (original)
+++ team/may/ooh323_ipv6_direct_rtp/addons/ooh323c/src/ooh323.c Thu Jan  5 14:07:49 2012
@@ -1742,9 +1742,9 @@
          }
 	 if (call->callState < OO_CALL_CLEAR) {
 		ooHandleFastStartChannels(call);
-         	ooSendCallProceeding(call);/* Send call proceeding message*/
-         	ret = ooH323CallAdmitted (call);
-	        call->callState = OO_CALL_CONNECTING;
+		ooSendCallProceeding(call);/* Send call proceeding message*/
+		ret = ooH323CallAdmitted (call);
+		call->callState = OO_CALL_CONNECTING;
 	  }
 
 

Modified: team/may/ooh323_ipv6_direct_rtp/addons/ooh323c/src/ooq931.c
URL: http://svnview.digium.com/svn/asterisk/team/may/ooh323_ipv6_direct_rtp/addons/ooh323c/src/ooq931.c?view=diff&rev=349722&r1=349721&r2=349722
==============================================================================
--- team/may/ooh323_ipv6_direct_rtp/addons/ooh323c/src/ooq931.c (original)
+++ team/may/ooh323_ipv6_direct_rtp/addons/ooh323c/src/ooq931.c Thu Jan  5 14:07:49 2012
@@ -872,6 +872,7 @@
 }
 
 /* Handle FS receive channels for early media */
+
 int ooHandleFastStartChannels(OOH323CallData *pCall)
 {
    int i=0, j=0, remoteMediaControlPort = 0, dir=0;
@@ -1756,18 +1757,16 @@
 
 int ooSendFSUpdate(OOH323CallData *call)
 {
-   int ret=0;
+   int ret = 0;
    Q931Message *pQ931Msg = NULL;
-   H225Facility_UUIE *facility=NULL;
+   H225Facility_UUIE *facility = NULL;
    OOCTXT *pctxt = call->msgctxt;
 
    OOTRACEDBGA3("Building FS update message (%s, %s)\n", call->callType,
                  call->callToken);
    ret = ooCreateQ931Message(pctxt, &pQ931Msg, Q931FacilityMsg);
-   if(ret != OO_OK)
-   {
-      OOTRACEERR3
-         ("ERROR: In allocating memory for facility message (%s, %s)\n",
+   if(ret != OO_OK) {
+      OOTRACEERR3("ERROR: In allocating memory for facility message (%s, %s)\n",
           call->callType, call->callToken);
       return OO_FAILED;
    }
@@ -1776,13 +1775,12 @@
 
    pQ931Msg->userInfo = (H225H323_UserInformation*)memAlloc(pctxt,
                              sizeof(H225H323_UserInformation));
-   if(!pQ931Msg->userInfo)
-   {
+   if (!pQ931Msg->userInfo) {
       OOTRACEERR3("ERROR:Memory - ooSendFSUpdate - userInfo(%s, %s)\n", 
                    call->callType, call->callToken);
       return OO_FAILED;
    }
-   memset (pQ931Msg->userInfo, 0, sizeof(H225H323_UserInformation));
+   memset(pQ931Msg->userInfo, 0, sizeof(H225H323_UserInformation));
    pQ931Msg->userInfo->h323_uu_pdu.m.h245TunnelingPresent=1; 
 
    pQ931Msg->userInfo->h323_uu_pdu.h245Tunneling = 
@@ -1794,47 +1792,45 @@
    facility = (H225Facility_UUIE*) 
       memAllocZ (pctxt, sizeof(H225Facility_UUIE));
 
-   if(!facility)
-   {
-      OOTRACEERR3("ERROR:Memory - ooSendFS Update - facility (%s, %s)"
-                  "\n", call->callType, call->callToken);
+   if (!facility) {
+      OOTRACEERR3("ERROR:Memory - ooSendFS Update - facility (%s, %s)\n",
+                  call->callType, call->callToken);
       return OO_FAILED;
    }
 
    pQ931Msg->userInfo->h323_uu_pdu.h323_message_body.u.facility = facility;
 
    /* Populate Facility UUIE */
-   facility->protocolIdentifier = gProtocolID;  
+   facility->protocolIdentifier = gProtocolID;
    facility->m.callIdentifierPresent = 1;
-   facility->callIdentifier.guid.numocts = 
+   facility->callIdentifier.guid.numocts =
                                    call->callIdentifier.guid.numocts;
-   memcpy(facility->callIdentifier.guid.data, 
-          call->callIdentifier.guid.data, 
-          call->callIdentifier.guid.numocts);
+   memcpy(facility->callIdentifier.guid.data,
+	call->callIdentifier.guid.data,
+	call->callIdentifier.guid.numocts);
    facility->reason.t = T_H225FacilityReason_forwardedElements;
 
    ret = ooSetFastStartResponse(call, pQ931Msg,
-       &facility->fastStart.n, &facility->fastStart.elem);
-   if(ret != ASN_OK) { return ret; }
-   if(facility->fastStart.n > 0) {
-       facility->m.fastStartPresent = TRUE;
-       call->fsSent = TRUE;
+	&facility->fastStart.n, &facility->fastStart.elem);
+   if (ret != ASN_OK) {
+	return ret;
+   }
+   if (facility->fastStart.n > 0) {
+	facility->m.fastStartPresent = TRUE;
+	call->fsSent = TRUE;
    } else {
-      facility->m.fastStartPresent = FALSE;
+	facility->m.fastStartPresent = FALSE;
    }
 
    OOTRACEDBGA3("Built Facility message to send (%s, %s)\n", call->callType,
-                 call->callToken);
+		call->callToken);
 
    ret = ooSendH225Msg(call, pQ931Msg);
-   if(ret != OO_OK)
-   {
-      OOTRACEERR3
-         ("Error:Failed to enqueue Facility message to outbound "
-         "queue.(%s, %s)\n", call->callType, call->callToken);
-   }
-   /* memReset (&gH323ep.msgctxt); */
-   memReset (call->msgctxt);
+   if (ret != OO_OK) {
+	OOTRACEERR3("Error:Failed to enqueue Facility message to outbound "
+			"queue.(%s, %s)\n", call->callType, call->callToken);
+   }
+   memReset(call->msgctxt);
    return ret;
 }
 

Modified: team/may/ooh323_ipv6_direct_rtp/addons/ooh323cDriver.c
URL: http://svnview.digium.com/svn/asterisk/team/may/ooh323_ipv6_direct_rtp/addons/ooh323cDriver.c?view=diff&rev=349722&r1=349721&r2=349722
==============================================================================
--- team/may/ooh323_ipv6_direct_rtp/addons/ooh323cDriver.c (original)
+++ team/may/ooh323_ipv6_direct_rtp/addons/ooh323cDriver.c Thu Jan  5 14:07:49 2012
@@ -261,23 +261,26 @@
 
       if(tmpfmt.id == AST_FORMAT_G729A)
       {
-         if(gH323Debug)
-            ast_verb(0, "\tAdding g729A capability to H323 endpoint\n");
+         if (gH323Debug) {
+	    ast_verb(0, "\tAdding g729A capability to H323 endpoint\n");
+	 }
          ret = ooH323EpAddG729Capability(OO_G729A, 2, 24, 
                                      OORXANDTX, &ooh323c_start_receive_channel,
                                      &ooh323c_start_transmit_channel,
                                      &ooh323c_stop_receive_channel, 
                                      &ooh323c_stop_transmit_channel);
 
-         if(gH323Debug)
+         if (gH323Debug) {
             ast_verb(0, "\tAdding g729 capability to H323 endpoint\n");
+	 }
          ret |= ooH323EpAddG729Capability(OO_G729, 2, 24, 
                                      OORXANDTX, &ooh323c_start_receive_channel,
                                      &ooh323c_start_transmit_channel,
                                      &ooh323c_stop_receive_channel, 
                                      &ooh323c_stop_transmit_channel);
-         if(gH323Debug)
+         if (gH323Debug) {
             ast_verb(0, "\tAdding g729b capability to H323 endpoint\n");
+	 }
          ret |= ooH323EpAddG729Capability(OO_G729B, 2, 24, 
                                      OORXANDTX, &ooh323c_start_receive_channel,
                                      &ooh323c_start_transmit_channel,
@@ -287,8 +290,9 @@
 
       if(tmpfmt.id == AST_FORMAT_G723_1)
       {
-         if(gH323Debug)
+         if (gH323Debug) {
             ast_verb(0, "\tAdding g7231 capability to H323 endpoint\n");
+	 }
          ret = ooH323EpAddG7231Capability(OO_G7231, 1, 1, FALSE, 
                                      OORXANDTX, &ooh323c_start_receive_channel,
                                      &ooh323c_start_transmit_channel,
@@ -299,8 +303,9 @@
 
       if(tmpfmt.id == AST_FORMAT_G726)
       {
-         if(gH323Debug)
+         if (gH323Debug) {
             ast_verb(0, "\tAdding g726 capability to H323 endpoint\n");
+	 }
          ret = ooH323EpAddG726Capability(OO_G726, gtxframes, grxframes, FALSE, 
                                      OORXANDTX, &ooh323c_start_receive_channel,
                                      &ooh323c_start_transmit_channel,
@@ -311,8 +316,9 @@
 
       if(tmpfmt.id == AST_FORMAT_G726_AAL2)
       {
-         if(gH323Debug)
+         if (gH323Debug) {
             ast_verb(0, "\tAdding g726aal2 capability to H323 endpoint\n");
+	 }
          ret = ooH323EpAddG726Capability(OO_G726AAL2, gtxframes, grxframes, FALSE, 
                                      OORXANDTX, &ooh323c_start_receive_channel,
                                      &ooh323c_start_transmit_channel,
@@ -323,8 +329,9 @@
 
       if(tmpfmt.id == AST_FORMAT_H263)
       {
-         if(gH323Debug)
+         if (gH323Debug) {
             ast_verb(0, "\tAdding h263 capability to H323 endpoint\n");
+	 }
          ret = ooH323EpAddH263VideoCapability(OO_H263VIDEO, 1, 0, 0, 0, 0, 320*1024, 
                                      OORXANDTX, &ooh323c_start_receive_channel,
                                      &ooh323c_start_transmit_channel,
@@ -335,8 +342,9 @@
 
       if(tmpfmt.id == AST_FORMAT_GSM)
       {
-         if(gH323Debug)
+         if (gH323Debug) {
             ast_verb(0, "\tAdding gsm capability to H323 endpoint\n");
+	 }
          ret = ooH323EpAddGSMCapability(OO_GSMFULLRATE, 4, FALSE, FALSE, 
                                      OORXANDTX, &ooh323c_start_receive_channel,
                                      &ooh323c_start_transmit_channel,
@@ -348,8 +356,9 @@
 #ifdef AST_FORMAT_AMRNB
       if(tmpfmt.id == AST_FORMAT_AMRNB)
       {
-         if(gH323Debug)
+         if (gH323Debug) {
             ast_verb(0, "\tAdding amr nb capability to H323 endpoint\n");
+	 }
          ret = ooH323EpAddAMRNBCapability(OO_AMRNB, 4, 4, FALSE, 
                                      OORXANDTX, &ooh323c_start_receive_channel,
                                      &ooh323c_start_transmit_channel,
@@ -362,8 +371,9 @@
 #ifdef AST_FORMAT_SPEEX
       if(tmpfmt.id == AST_FORMAT_SPEEX)
       {
-         if(gH323Debug)
+         if (gH323Debug) {
             ast_verb(0, "\tAdding speex capability to H323 endpoint\n");
+	 }
          ret = ooH323EpAddSpeexCapability(OO_SPEEX, 4, 4, FALSE, 
                                      OORXANDTX, &ooh323c_start_receive_channel,
                                      &ooh323c_start_transmit_channel,
@@ -393,9 +403,10 @@
 {
    int ret = 0, x, txframes;
    struct ast_format tmpfmt;
-   if(gH323Debug)
+   if (gH323Debug) {
      ast_verb(0, "\tAdding capabilities to call(%s, %s)\n", call->callType, 
                                                             call->callToken);
+   }
    if(dtmf & H323_DTMF_CISCO || 1)
       ret |= ooCallEnableDTMFCISCO(call,dtmfcodec);
    if(dtmf & H323_DTMF_RFC2833 || 1)
@@ -417,9 +428,10 @@
    {
       if(tmpfmt.id == AST_FORMAT_ULAW)
       {
-         if(gH323Debug)
+         if (gH323Debug) {
             ast_verb(0, "\tAdding g711 ulaw capability to call(%s, %s)\n", 
                                               call->callType, call->callToken);
+	 }
 	 txframes = prefs->framing[x];
          ret= ooCallAddG711Capability(call, OO_G711ULAW64K, txframes, 
                                       txframes, OORXANDTX, 
@@ -430,9 +442,10 @@
       }
       if(tmpfmt.id == AST_FORMAT_ALAW)
       {
-         if(gH323Debug)
+         if (gH323Debug) {
             ast_verb(0, "\tAdding g711 alaw capability to call(%s, %s)\n",
                                             call->callType, call->callToken);
+	 }
          txframes = prefs->framing[x];
          ret= ooCallAddG711Capability(call, OO_G711ALAW64K, txframes, 
                                      txframes, OORXANDTX, 
@@ -444,9 +457,10 @@
 
       if(tmpfmt.id == AST_FORMAT_G726)
       {
-         if(gH323Debug)
+         if (gH323Debug) {
             ast_verb(0, "\tAdding g726 capability to call (%s, %s)\n",
                                            call->callType, call->callToken);
+	 }
 	 txframes = prefs->framing[x];
          ret = ooCallAddG726Capability(call, OO_G726, txframes, grxframes, FALSE,
                                      OORXANDTX, &ooh323c_start_receive_channel,
@@ -458,9 +472,10 @@
 
       if(tmpfmt.id == AST_FORMAT_G726_AAL2)
       {
-         if(gH323Debug)
+         if (gH323Debug) {
             ast_verb(0, "\tAdding g726aal2 capability to call (%s, %s)\n",
                                            call->callType, call->callToken);
+	 }
 	 txframes = prefs->framing[x];
          ret = ooCallAddG726Capability(call, OO_G726AAL2, txframes, grxframes, FALSE,
                                      OORXANDTX, &ooh323c_start_receive_channel,
@@ -474,9 +489,10 @@
       {
       
          txframes = (prefs->framing[x])/10;
-         if(gH323Debug)
+         if (gH323Debug) {
             ast_verb(0, "\tAdding g729A capability to call(%s, %s)\n",
                                             call->callType, call->callToken);
+	 }
          ret= ooCallAddG729Capability(call, OO_G729A, txframes, txframes, 
                                      OORXANDTX, &ooh323c_start_receive_channel,
                                      &ooh323c_start_transmit_channel,
@@ -484,17 +500,19 @@
                                      &ooh323c_stop_transmit_channel);
 	 if (g729onlyA)
 		continue;
-         if(gH323Debug)
+         if (gH323Debug) {
             ast_verb(0, "\tAdding g729 capability to call(%s, %s)\n",
                                             call->callType, call->callToken);
+	 }
          ret|= ooCallAddG729Capability(call, OO_G729, txframes, txframes, 
                                      OORXANDTX, &ooh323c_start_receive_channel,
                                      &ooh323c_start_transmit_channel,
                                      &ooh323c_stop_receive_channel, 
                                      &ooh323c_stop_transmit_channel);
-         if(gH323Debug)
+         if (gH323Debug) {
             ast_verb(0, "\tAdding g729B capability to call(%s, %s)\n",
                                             call->callType, call->callToken);
+	 }
          ret|= ooCallAddG729Capability(call, OO_G729B, txframes, txframes, 
                                      OORXANDTX, &ooh323c_start_receive_channel,
                                      &ooh323c_start_transmit_channel,
@@ -505,9 +523,10 @@
 
       if(tmpfmt.id == AST_FORMAT_G723_1)
       {
-         if(gH323Debug)
+         if (gH323Debug) {
             ast_verb(0, "\tAdding g7231 capability to call (%s, %s)\n",
                                            call->callType, call->callToken);
+	 }
          ret = ooCallAddG7231Capability(call, OO_G7231, 1, 1, FALSE, 
                                      OORXANDTX, &ooh323c_start_receive_channel,
                                      &ooh323c_start_transmit_channel,
@@ -518,9 +537,10 @@
 
       if(tmpfmt.id == AST_FORMAT_H263)
       {
-         if(gH323Debug)
+         if (gH323Debug) {
             ast_verb(0, "\tAdding h263 capability to call (%s, %s)\n",
                                            call->callType, call->callToken);
+	 }
          ret = ooCallAddH263VideoCapability(call, OO_H263VIDEO, 1, 0, 0, 0, 0, 320*1024, 
                                      OORXANDTX, &ooh323c_start_receive_channel,
                                      &ooh323c_start_transmit_channel,
@@ -531,9 +551,10 @@
 
       if(tmpfmt.id == AST_FORMAT_GSM)
       {
-         if(gH323Debug)
+         if (gH323Debug) {
             ast_verb(0, "\tAdding gsm capability to call(%s, %s)\n", 
                                              call->callType, call->callToken);
+	 }
          ret = ooCallAddGSMCapability(call, OO_GSMFULLRATE, 4, FALSE, FALSE, 
                                      OORXANDTX, &ooh323c_start_receive_channel,
                                      &ooh323c_start_transmit_channel,
@@ -544,9 +565,10 @@
 #ifdef AST_FORMAT_AMRNB
       if(tmpfmt.id == AST_FORMAT_AMRNB)
       {
-         if(gH323Debug)
+         if (gH323Debug) {
             ast_verb(0, "\tAdding AMR capability to call(%s, %s)\n", 
                                              call->callType, call->callToken);
+	 }
          ret = ooCallAddAMRNBCapability(call, OO_AMRNB, 4, 4, FALSE, 
                                      OORXANDTX, &ooh323c_start_receive_channel,
                                      &ooh323c_start_transmit_channel,
@@ -557,9 +579,10 @@
 #ifdef AST_FORMAT_SPEEX
       if(tmpfmt.id == AST_FORMAT_SPEEX)
       {
-         if(gH323Debug)
+         if (gH323Debug) {
             ast_verb(0, "\tAdding Speex capability to call(%s, %s)\n", 
                                              call->callType, call->callToken);
+	 }
          ret = ooCallAddSpeexCapability(call, OO_SPEEX, 4, 4, FALSE, 
                                      OORXANDTX, &ooh323c_start_receive_channel,
                                      &ooh323c_start_transmit_channel,




More information about the svn-commits mailing list