--- ooGkClient.c-orig 2006-03-02 22:21:17.000000000 +0000 +++ ooGkClient.c 2007-02-28 23:12:48.000000000 +0000 @@ -984,6 +984,39 @@ pRegReq->m.timeToLivePresent = TRUE; pRegReq->timeToLive = pGkClient->regTimeout; + /* + * Cisco Gatekeeper re-registration fix. Mike Tubby (mike@tubby.org) 28feb2007 + * + * Cisco H.323 Gatekeepers insist that we provide our endpoint identifier + * on re-registration as they support the light-weight re-registration option + * and ignore all params if KeepAlive is set and we provide the EndpointIdentifier + * back to them. + * + * Without this patch initial registration works, but re-registration fails! + */ + if ((pGkClient->state == GkClientDiscovered) || (pGkClient->state == GkClientUnregistered)) { + /* must be a first registration */ + OOTRACEINFO1("Sending RRQ for initial registration (without EndpointID)\n"); + } else if (pGkClient->state == GkClientRegistered) { + /* we must be registered already, so this must be a re-registration... + allocate storage for endpoint-identifier, and populate it from what the + GK told us from the previous RCF. Only allocate on the first pass thru here */ + if (!pRegReq->endpointIdentifier.data) { + pRegReq->endpointIdentifier.data = (ASN116BITCHAR*)memAlloc(pctxt, pGkClient->gkId.nchars*sizeof(ASN116BITCHAR)); + if (pRegReq->endpointIdentifier.data) { + pRegReq->endpointIdentifier.nchars = pGkClient->endpointId.nchars; + pRegReq->m.endpointIdentifierPresent = TRUE; + memcpy(pRegReq->endpointIdentifier.data, pGkClient->endpointId.data, pGkClient->endpointId.nchars*sizeof(ASN116BITCHAR)); + OOTRACEINFO1("Sending RRQ for re-registration (with EndpointID)\n"); + } else { + OOTRACEERR1("Error: Failed to allocate memory for EndpointIdentifier in RRQ \n"); + memReset(pctxt); + pGkClient->state = GkClientFailed; + return OO_FAILED; + } + } + } + iRet = ooGkClientSendMsg(pGkClient, pRasMsg); if(iRet != OO_OK) {