[asterisk-addons-commits] trunk - r191 /trunk/asterisk-ooh323c/ooh323c/src/

asterisk-addons-commits at lists.digium.com asterisk-addons-commits at lists.digium.com
Mon Jan 23 15:06:53 MST 2006


Author: objsys
Date: Mon Jan 23 16:06:52 2006
New Revision: 191

URL: http://svn.digium.com/view/asterisk-addons?rev=191&view=rev
Log:
ECS support for call hold

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

Modified: trunk/asterisk-ooh323c/ooh323c/src/ooCalls.c
URL: http://svn.digium.com/view/asterisk-addons/trunk/asterisk-ooh323c/ooh323c/src/ooCalls.c?rev=191&r1=190&r2=191&view=diff
==============================================================================
--- trunk/asterisk-ooh323c/ooh323c/src/ooCalls.c (original)
+++ trunk/asterisk-ooh323c/ooh323c/src/ooCalls.c Mon Jan 23 16:06:52 2006
@@ -780,6 +780,7 @@
       "OO_CALL_WAITING_ADMISSION",
       "OO_CALL_CONNECTING",
       "OO_CALL_CONNECTED",
+      "OO_CALL_PAUSED",
       "OO_CALL_CLEAR",
       "OO_CALL_CLEAR_RELEASERECVD",
       "OO_CALL_CLEAR_RELEASESENT",

Modified: trunk/asterisk-ooh323c/ooh323c/src/ooCalls.h
URL: http://svn.digium.com/view/asterisk-addons/trunk/asterisk-ooh323c/ooh323c/src/ooCalls.h?rev=191&r1=190&r2=191&view=diff
==============================================================================
--- trunk/asterisk-ooh323c/ooh323c/src/ooCalls.h (original)
+++ trunk/asterisk-ooh323c/ooh323c/src/ooCalls.h Mon Jan 23 16:06:52 2006
@@ -62,6 +62,7 @@
    OO_CALL_WAITING_ADMISSION,     /*!< Call waiting for admission by GK */
    OO_CALL_CONNECTING,            /*!< Call in process of connecting */
    OO_CALL_CONNECTED,             /*!< Call currently connected. */
+   OO_CALL_PAUSED,                /*!< Call Paused for hold/transfer. */
    OO_CALL_CLEAR,                 /*!< Call marked for clearing */
    OO_CALL_CLEAR_RELEASERECVD,    /*!< Release command received. */
    OO_CALL_CLEAR_RELEASESENT,     /*!< Release sent */
@@ -73,6 +74,7 @@
  */
 typedef enum {
    OO_H245SESSION_IDLE,
+   OO_H245SESSION_PAUSED,
    OO_H245SESSION_ACTIVE,
    OO_H245SESSION_ENDSENT, 
    OO_H245SESSION_ENDRECVD,

Modified: trunk/asterisk-ooh323c/ooh323c/src/oochannels.c
URL: http://svn.digium.com/view/asterisk-addons/trunk/asterisk-ooh323c/ooh323c/src/oochannels.c?rev=191&r1=190&r2=191&view=diff
==============================================================================
--- trunk/asterisk-ooh323c/ooh323c/src/oochannels.c (original)
+++ trunk/asterisk-ooh323c/ooh323c/src/oochannels.c Mon Jan 23 16:06:52 2006
@@ -960,7 +960,7 @@
       message boundary. Has to be done at channel level, as channels
       know the message formats and can determine boundaries
    */
-   if(recvLen<=0)
+   if(recvLen<=0 && call->h245SessionState != OO_H245SESSION_PAUSED)
    {
       if(recvLen == 0)
          OOTRACEINFO3("Closing H.245 channels as remote end point closed H.245"
@@ -977,6 +977,33 @@
          call->callState = OO_CALL_CLEAR;
       }
       return OO_FAILED;
+   }
+   if(call->h245SessionState == OO_H245SESSION_PAUSED) 
+   {
+      ooLogicalChannel *temp;
+
+      OOTRACEINFO3("Call Paused, closing logical channels"
+                    " (%s, %s)\n", call->callType, call->callToken);
+
+      temp = call->logicalChans;
+      while(temp)
+      {
+         if(temp->state == OO_LOGICALCHAN_ESTABLISHED)
+         {
+            /* Sending closelogicalchannel only for outgoing channels*/
+            if(!strcmp(temp->dir, "transmit"))
+            {
+               ooSendCloseLogicalChannel(call, temp);
+            }
+         }
+         temp = temp->next;
+      }
+      call->masterSlaveState = OO_MasterSlave_Idle;
+      call->callState = OO_CALL_PAUSED;
+      call->localTermCapState = OO_LocalTermCapExchange_Idle;
+      call->remoteTermCapState = OO_RemoteTermCapExchange_Idle;
+      call->h245SessionState = OO_H245SESSION_IDLE;
+      call->logicalChans = NULL;
    }
    OOTRACEDBGC1("Receiving H245 message\n");
    if(recvLen != 4)
@@ -1482,17 +1509,20 @@
                       "(%s, %s)\n", call->callType, call->callToken);
       break;
    case OOTerminalCapabilitySet:
-      if(OO_TESTFLAG (call->flags, OO_M_TUNNELING)){
+      if(OO_TESTFLAG (call->flags, OO_M_TUNNELING)) {
          /* If session isn't marked active yet, do it. possible in case of 
             tunneling */
-         if(call->h245SessionState == OO_H245SESSION_IDLE)
+         if(call->h245SessionState == OO_H245SESSION_IDLE ||
+            call->h245SessionState == OO_H245SESSION_PAUSED) {
             call->h245SessionState = OO_H245SESSION_ACTIVE;
+         }
          OOTRACEINFO3("Tunneled Message - TerminalCapabilitySet (%s, %s)\n", 
                        call->callType, call->callToken);
       }
-      else
+      else {
          OOTRACEINFO3("Sent Message - TerminalCapabilitySet (%s, %s)\n", 
                        call->callType, call->callToken);
+      }
       /* Start TCS timer */
       cbData = (ooTimerCallback*) memAlloc(call->pctxt, 
                                                      sizeof(ooTimerCallback));

Modified: trunk/asterisk-ooh323c/ooh323c/src/ooh245.c
URL: http://svn.digium.com/view/asterisk-addons/trunk/asterisk-ooh323c/ooh323c/src/ooh245.c?rev=191&r1=190&r2=191&view=diff
==============================================================================
--- trunk/asterisk-ooh323c/ooh323c/src/ooh245.c (original)
+++ trunk/asterisk-ooh323c/ooh323c/src/ooh245.c Mon Jan 23 16:06:52 2006
@@ -270,7 +270,6 @@
          ooSendMsg(call, OOH245MSG);
       }
       else{
-
          dListAppend (call->pctxt, &call->pH245Channel->outQueue, encodebuf);
          OOTRACEDBGC4("Queued H245 messages %d. (%s, %s)\n", 
          call->pH245Channel->outQueue.count, 
@@ -659,9 +658,10 @@
       OOTRACEERR3("Error:Failed to enqueue TCS message to outbound queue. "
                   "(%s, %s)\n", call->callType, call->callToken);
    }
-   else
+   else {
       call->localTermCapState = OO_LocalTermCapSetSent;
-   
+   }
+
    ooFreeH245Message(call,ph245msg);
 
    return ret;
@@ -2407,7 +2407,7 @@
          gH323ep.h323Callbacks.onReceivedDTMF(call,indication->u.alphanumeric);
    }
    else if((indication->t == T_H245UserInputIndication_signal) && 
-      (call->dtmfmode & OO_CAP_DTMF_H245_signal)) {
+           (call->dtmfmode & OO_CAP_DTMF_H245_signal)) {
       if(gH323ep.h323Callbacks.onReceivedDTMF)
          gH323ep.h323Callbacks.onReceivedDTMF(call, 
                                              indication->u.signal->signalType);
@@ -2439,35 +2439,39 @@
   
    if(!tcs->m.capabilityTablePresent)
    {
-      OOTRACEWARN3("Warn:Ignoring TCS as no capability table present(%s, %s)\n",
-                   call->callType, call->callToken);
-      ooSendTerminalCapabilitySetReject(call, tcs->sequenceNumber, 
-                         T_H245TerminalCapabilitySetReject_cause_unspecified);
-      return OO_OK;
+      // OOTRACEWARN3("Warn:Ignoring TCS as no capability table present(%s, %s)\n",
+      OOTRACEWARN3("Empty TCS found.  Pausing call...(%s, %s)\n",
+                    call->callType, call->callToken);
+      call->h245SessionState = OO_H245SESSION_PAUSED;
+      //ooSendTerminalCapabilitySetReject(call, tcs->sequenceNumber, 
+      //                   T_H245TerminalCapabilitySetReject_cause_unspecified);
+      //return OO_OK;
    }
    call->remoteTermCapSeqNo = tcs->sequenceNumber;
 
-   for(k=0; k<(int)tcs->capabilityTable.count; k++)
-   {
-      pNode = dListFindByIndex(&tcs->capabilityTable, k);
-      if(pNode)
+   if(tcs->m.capabilityTablePresent) {
+      for(k=0; k<(int)tcs->capabilityTable.count; k++)
       {
-         OOTRACEDBGC4("Processing CapabilityTable Entry %d (%s, %s)\n", k,
-                       call->callType, call->callToken);
-         capEntry = (H245CapabilityTableEntry*) pNode->data;
-         if(capEntry->m.capabilityPresent){
-            ret =  ooAddRemoteCapability(call, &capEntry->capability);
-            if(ret != OO_OK)
-            {
-               OOTRACEERR4("Error:Failed to process remote capability in "
-                           "capability table at index %d. (%s, %s)\n", 
-                            k, call->callType, call->callToken);
+         pNode = dListFindByIndex(&tcs->capabilityTable, k);
+         if(pNode)
+         {
+            OOTRACEDBGC4("Processing CapabilityTable Entry %d (%s, %s)\n", 
+                          k, call->callType, call->callToken);
+            capEntry = (H245CapabilityTableEntry*) pNode->data;
+            if(capEntry->m.capabilityPresent){
+               ret =  ooAddRemoteCapability(call, &capEntry->capability);
+               if(ret != OO_OK)
+               {
+                  OOTRACEERR4("Error:Failed to process remote capability in "
+                              "capability table at index %d. (%s, %s)\n", 
+                               k, call->callType, call->callToken);
+               }
+               ooCapabilityUpdateJointCapabilities(call, &capEntry->capability);
             }
-            ooCapabilityUpdateJointCapabilities(call, &capEntry->capability);
-         }
-      }
-      pNode = NULL;
-      capEntry=NULL;
+         }
+         pNode = NULL;
+         capEntry=NULL;
+      }
    }
 
    
@@ -3475,12 +3479,12 @@
                  call->callToken);
 
    if(call->h245SessionState != OO_H245SESSION_IDLE && 
-      call->h245SessionState != OO_H245SESSION_CLOSED)  
-   {
+      call->h245SessionState != OO_H245SESSION_CLOSED &&
+      call->h245SessionState != OO_H245SESSION_PAUSED) {
+
       ret = ooCloseH245Connection(call);
    
-      if(ret != OO_OK)
-      {
+      if(ret != OO_OK) {
          OOTRACEERR3("Error:Failed to close H.245 connection (%s, %s)\n",
                      call->callType, call->callToken);
       } 



More information about the asterisk-addons-commits mailing list