[Asterisk-code-review] chan ooh323: Fixes to work right with Cisco devices (asterisk[11])

Alexander Anikin asteriskteam at digium.com
Thu Nov 3 07:43:16 CDT 2016


Alexander Anikin has uploaded a new change for review. ( https://gerrit.asterisk.org/4285 )

Change subject: chan_ooh323: Fixes to work right with Cisco devices
......................................................................

chan_ooh323: Fixes to work right with Cisco devices

Changed output packets queue processing algo to one read-one write
instead of all read-all send

Remove h.245 tunneling parameter from ReleaseComplete packet

ASTERISK-24400 #close
Reported by: Dmitry Melekhov
Tested by: Dmitry Melekhov

Change-Id: I0b31933b062a21011dbac9a82b8bcfe345f406f6
---
M addons/ooh323c/src/ooCalls.c
M addons/ooh323c/src/oochannels.c
M addons/ooh323c/src/ooq931.c
3 files changed, 9 insertions(+), 15 deletions(-)


  git pull ssh://gerrit.asterisk.org:29418/asterisk refs/changes/85/4285/1

diff --git a/addons/ooh323c/src/ooCalls.c b/addons/ooh323c/src/ooCalls.c
index 70677ab..f43a0bf 100644
--- a/addons/ooh323c/src/ooCalls.c
+++ b/addons/ooh323c/src/ooCalls.c
@@ -223,7 +223,8 @@
       call->callState = OO_CALL_CLEARED;
    }
 
-   if(call->callState == OO_CALL_CLEARED || call->callState == OO_CALL_CLEAR_RELEASESENT)
+   if(call->callState == OO_CALL_CLEARED || ((strcmp(call->callType, "incoming")) &&
+     call->callState == OO_CALL_CLEAR_RELEASESENT))
    {
       ooCleanCall(call); 
       call->callState = OO_CALL_REMOVED;
diff --git a/addons/ooh323c/src/oochannels.c b/addons/ooh323c/src/oochannels.c
index ddc6bf6..882b576 100644
--- a/addons/ooh323c/src/oochannels.c
+++ b/addons/ooh323c/src/oochannels.c
@@ -679,9 +679,9 @@
     if (0 != call->pH245Channel && 0 != call->pH245Channel->sock)
     {
      if(ooPDWrite(pfds, nfds, call->pH245Channel->sock)) {
-      while (call->pH245Channel->outQueue.count>0) {
+      if (call->pH245Channel->outQueue.count>0) {
        if (ooSendMsg(call, OOH245MSG) != OO_OK)
-	break;
+	OOTRACEERR1("Error in sending h245 message\n");
       }
      }
     }
@@ -699,26 +699,24 @@
     {
      if(ooPDWrite(pfds, nfds, call->pH225Channel->sock))
      {
-      while (call->pH225Channel->outQueue.count>0)
+      if (call->pH225Channel->outQueue.count>0)
       {
        OOTRACEDBGC3("Sending H225 message (%s, %s)\n", 
                         call->callType, call->callToken);
        if (ooSendMsg(call, OOQ931MSG) != OO_OK)
-	break;
+	OOTRACEERR1("Error in sending h225 message\n");
       }
       if(call->pH245Channel && 
          call->pH245Channel->outQueue.count>0 && 
         OO_TESTFLAG (call->flags, OO_M_TUNNELING)) {
-       while (call->pH245Channel->outQueue.count>0) {
         OOTRACEDBGC3("H245 message needs to be tunneled. "
                           "(%s, %s)\n", call->callType, 
                                call->callToken);
         if (ooSendMsg(call, OOH245MSG) != OO_OK)
-	 break;
+	  OOTRACEERR1("Error in sending h245 message\n");
        }
-      }
-     }                                
-    }
+      }                                
+     }
 
      if(ooTimerNextTimeout(&call->timerList, &toNext))
      {
diff --git a/addons/ooh323c/src/ooq931.c b/addons/ooh323c/src/ooq931.c
index cbc4afb..4d6d993 100644
--- a/addons/ooh323c/src/ooq931.c
+++ b/addons/ooh323c/src/ooq931.c
@@ -2124,9 +2124,6 @@
       return OO_FAILED;
    }
    memset(releaseComplete, 0, sizeof(H225ReleaseComplete_UUIE));
-   q931msg->userInfo->h323_uu_pdu.m.h245TunnelingPresent=1; 
-   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;
    
@@ -2143,8 +2140,6 @@
    releaseComplete->reason.t = h225ReasonCode;
 
    /* Add user-user ie */
-   q931msg->userInfo->h323_uu_pdu.m.h245TunnelingPresent=TRUE; 
-   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;
    

-- 
To view, visit https://gerrit.asterisk.org/4285
To unsubscribe, visit https://gerrit.asterisk.org/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I0b31933b062a21011dbac9a82b8bcfe345f406f6
Gerrit-PatchSet: 1
Gerrit-Project: asterisk
Gerrit-Branch: 11
Gerrit-Owner: Alexander Anikin <may213 at yandex.ru>



More information about the asterisk-code-review mailing list