aboutsummaryrefslogtreecommitdiffstats
path: root/addons/ooh323c
diff options
context:
space:
mode:
authorPatrick McHardy <kaber@trash.net>2011-07-22 16:44:20 +0200
committerPatrick McHardy <kaber@trash.net>2011-07-22 16:44:20 +0200
commit2b9be10b177024bd663bd5fce19ea0fb76260c27 (patch)
treef6c296350683ee94c120213bef57e14fd153b23a /addons/ooh323c
parent916e420bf0c8db7a8cb1f60557cd2807652142cf (diff)
parent28da2a199d7e1624ac56ccb27d3671117f4e2717 (diff)
Merge branch 'master' of 192.168.0.100:/repos/git/asteriskHEADmaster
Diffstat (limited to 'addons/ooh323c')
-rw-r--r--addons/ooh323c/src/ooGkClient.c32
1 files changed, 27 insertions, 5 deletions
diff --git a/addons/ooh323c/src/ooGkClient.c b/addons/ooh323c/src/ooGkClient.c
index 04359998a..33d7df019 100644
--- a/addons/ooh323c/src/ooGkClient.c
+++ b/addons/ooh323c/src/ooGkClient.c
@@ -1211,8 +1211,11 @@ int ooGkClientHandleRegistrationConfirm
if(pGkClient->regTimeout > DEFAULT_TTL_OFFSET)
regTTL = pGkClient->regTimeout - DEFAULT_TTL_OFFSET;
- else
- regTTL = pGkClient->regTimeout;
+ else {
+ regTTL = pGkClient->regTimeout - 1; /* -1 due to some ops expire us few earlier */
+ if (regTTL <= 0)
+ regTTL = 1;
+ }
cbData = (ooGkClientTimerCb*) memAlloc
(&pGkClient->ctxt, sizeof(ooGkClientTimerCb));
@@ -1260,7 +1263,6 @@ int ooGkClientHandleRegistrationConfirm
memFreePtr(&pGkClient->ctxt, pTimer->cbData);
ooTimerDelete(&pGkClient->ctxt, &pGkClient->timerList, pTimer);
OOTRACEDBGA1("Deleted RRQ Timer.\n");
- break;
}
}
pGkClient->state = GkClientRegistered;
@@ -1505,8 +1507,10 @@ int ooGkClientSendURQ(ooGkClient *pGkClient, ooAliases *aliases)
int ooGkClientHandleUnregistrationRequest
(ooGkClient *pGkClient, H225UnregistrationRequest * punregistrationRequest)
{
- int iRet=0;
-
+ int iRet=0, x;
+ OOTimer *pTimer = NULL;
+ DListNode *pNode = NULL;
+
/* Lets first send unregistration confirm message back to gatekeeper*/
ooGkClientSendUnregistrationConfirm(pGkClient,
punregistrationRequest->requestSeqNum);
@@ -1528,6 +1532,24 @@ int ooGkClientHandleUnregistrationRequest
pGkClient->rrqRetries = 0;
pGkClient->state = GkClientDiscovered;
+
+ /* delete the corresponding RRQ & REG timers */
+ pNode = NULL;
+ for(x=0; x<pGkClient->timerList.count; x++) {
+ pNode = dListFindByIndex(&pGkClient->timerList, x);
+ pTimer = (OOTimer*)pNode->data;
+ if(((ooGkClientTimerCb*)pTimer->cbData)->timerType & OO_RRQ_TIMER) {
+ memFreePtr(&pGkClient->ctxt, pTimer->cbData);
+ ooTimerDelete(&pGkClient->ctxt, &pGkClient->timerList, pTimer);
+ OOTRACEDBGA1("Deleted RRQ Timer.\n");
+ }
+ if(((ooGkClientTimerCb*)pTimer->cbData)->timerType & OO_REG_TIMER) {
+ memFreePtr(&pGkClient->ctxt, pTimer->cbData);
+ ooTimerDelete(&pGkClient->ctxt, &pGkClient->timerList, pTimer);
+ OOTRACEDBGA1("Deleted REG Timer.\n");
+ }
+ }
+
iRet = ooGkClientSendRRQ(pGkClient, 0);
if(iRet != OO_OK)
{