summaryrefslogtreecommitdiffstats
path: root/data/mnet/GP10/Host/jcc/src/LUDBTimerProc.cpp
blob: fff946ce9309ca1680656af52089769f8fe41940 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
// *******************************************************************
//
// (c) Copyright Cisco 2000
// All Rights Reserved
//
// *******************************************************************

// *******************************************************************
//
// Version     : 1.0
// Status      : Under development
// File        : LudbTimerProc.cpp
// Author(s)   : Kevin Lim 
// Create Date : 07-26-99 
// Description :  
//
// *******************************************************************

// #define DEBUG_MM_HANDOVER
// #define DEBUG_MM_HANDOVER_EFR

// *******************************************************************
// Include Files.
// *******************************************************************

#include "taskLib.h"
#include "stdLib.h"
#include "string.h"
#include "LOGGING/vcmodules.h"
#include "LOGGING/vclogging.h"
#include "oam_api.h"

// included L3 Message header for messages from other Layer 3 modules (CC, RR)
#include "JCC/JCCL3Msg.h"

#include "JCC/JCCUtil.h"
#include "JCC/JCCTimer.h"

// MM Message Constants
#include "JCC/LUDB.h"
#include "JCC/LUDBApi.h"
#include "JCC/LUDBMMMsgProc.h"
#include "LUDBVoipMsgProc.h"

extern LUDB				gLUDB;

// ****************************************************************************
void LudbTimerMsgProc(LudbMsgStruct *inMsg)
{
	DBG_FUNC("LUDB_Timer_MsgProc", LUDB_LAYER);
	DBG_ENTER();
	
	short ludb_id = inMsg->ludb_id;
	short mmId = ludbGetMMId(ludb_id);	
	bool status;
	switch(inMsg->msg_type)
	{
		case LUDB_VBREQ_TIMEOUT:
				DBG_TRACE("ludb %d vb request timeout\n", ludb_id);
				status = sendMobileRegRejToMM(mmId, CNI_RIL3_REJECT_NETWORK_FAILURE);
				if(!status) {
					DBG_ERROR("Registration Reject send to MM failed\n");
				}
				if(gLUDB.getState(ludb_id) == LUDBEntry::SECREQ)
					gLUDB.update(ludb_id, LUDBEntry::ACTIVE);
				else
					ludbEntryInit(ludb_id);	
				break;
		case LUDB_PURGE_TIMEOUT:
				DBG_TRACE("ludb %d purge timeout\n", ludb_id);

				T_CNI_RIL3_IE_MOBILE_ID mobile_id = ludbGetMobileId(ludb_id);
				status = sendMobileUnRegReq(mobile_id, mmId, ludb_id);
				if(!status){
					DBG_ERROR("UnRegistration Request send to VB failed\n");
				}
			//	ludbEntryInit(ludb_id);	
				break;
		default:
			DBG_TRACE("Unknown message received from Timer, Msg Type: %d\n", inMsg->msg_type);
	}
	DBG_LEAVE();
}