mirror of
				https://github.com/asterisk/asterisk.git
				synced 2025-10-31 10:47:18 +00:00 
			
		
		
		
	small gk processing fixes:
- decrease for 1 second registration ttl for very low expirations (some providers expire few earlier than TTL) - delete rrq and registration expire timers on URQ received as we make new registration. git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.8@328427 65c4cc65-6c06-0410-ace0-fbb531ad65f3
This commit is contained in:
		| @@ -1210,8 +1210,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)); | ||||
| @@ -1259,7 +1262,6 @@ int ooGkClientHandleRegistrationConfirm | ||||
|          memFreePtr(&pGkClient->ctxt, pTimer->cbData); | ||||
|          ooTimerDelete(&pGkClient->ctxt, &pGkClient->timerList, pTimer); | ||||
|          OOTRACEDBGA1("Deleted RRQ Timer.\n"); | ||||
|          break; | ||||
|       } | ||||
|    } | ||||
|    pGkClient->state = GkClientRegistered; | ||||
| @@ -1504,7 +1506,9 @@ 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,  | ||||
| @@ -1527,6 +1531,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) | ||||
|       { | ||||
|   | ||||
		Reference in New Issue
	
	Block a user