[asterisk-commits] may: branch 10 r371061 - in /branches/10: ./ addons/ooh323c/src/ooGkClient.c

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Fri Aug 10 10:13:13 CDT 2012


Author: may
Date: Fri Aug 10 10:13:10 2012
New Revision: 371061

URL: http://svnview.digium.com/svn/asterisk?view=rev&rev=371061
Log:
Send re-register packets by GRQ (gatekeeper request) interval

(close issue ASTERISK-20094)

Patches:
   ASTERISK-20094-2.patch 
........

Merged revisions 371060 from http://svn.asterisk.org/svn/asterisk/branches/1.8

Modified:
    branches/10/   (props changed)
    branches/10/addons/ooh323c/src/ooGkClient.c

Propchange: branches/10/
------------------------------------------------------------------------------
Binary property 'branch-1.8-merged' - no diff available.

Modified: branches/10/addons/ooh323c/src/ooGkClient.c
URL: http://svnview.digium.com/svn/asterisk/branches/10/addons/ooh323c/src/ooGkClient.c?view=diff&rev=371061&r1=371060&r2=371061
==============================================================================
--- branches/10/addons/ooh323c/src/ooGkClient.c (original)
+++ branches/10/addons/ooh323c/src/ooGkClient.c Fri Aug 10 10:13:10 2012
@@ -1283,6 +1283,8 @@
    unsigned int x=0;
    DListNode *pNode = NULL;
    OOTimer *pTimer = NULL;
+   ooGkClientTimerCb *cbData=NULL;
+
    /* First delete the corresponding RRQ timer */
    for(x=0; x<pGkClient->timerList.count; x++)
    {
@@ -1379,14 +1381,33 @@
    pGkClient->rrqRetries = 0;
    pGkClient->grqRetries = 0;
    pGkClient->discoveryComplete = FALSE;
+
+   cbData = (ooGkClientTimerCb*) memAlloc
+                               (&pGkClient->ctxt, sizeof(ooGkClientTimerCb));
+   if(!cbData)
+   {
+      OOTRACEERR1("Error:Failed to allocate memory to GRQ timer callback\n");
+      pGkClient->state = GkClientFailed;
+      ast_mutex_unlock(&pGkClient->Lock);
+      return OO_FAILED;
+   }
+   cbData->timerType = OO_GRQ_TIMER;
+   cbData->pGkClient = pGkClient;
+   if(!ooTimerCreate(&pGkClient->ctxt, &pGkClient->timerList,
+                     &ooGkClientGRQTimerExpired, pGkClient->grqTimeout,
+                     cbData, FALSE))
+   {
+      OOTRACEERR1("Error:Unable to create GRQ timer.\n ");
+      memFreePtr(&pGkClient->ctxt, cbData);
+      pGkClient->state = GkClientFailed;
+      ast_mutex_unlock(&pGkClient->Lock);
+      return OO_FAILED;
+   }
+
    ast_mutex_unlock(&pGkClient->Lock);
 
-   iRet = ooGkClientSendGRQ(pGkClient);
-   if(iRet != OO_OK){
-      OOTRACEERR1("\nError: Transmission of rediscovery of GK failed\n");
-      return OO_FAILED;
-   }
    return OO_OK;
+
 }
 
 




More information about the asterisk-commits mailing list