43 |
43 |
44 void CSipStateMachine::ConstructL() |
44 void CSipStateMachine::ConstructL() |
45 /** |
45 /** |
46 This Function will startup the state machine with a default |
46 This Function will startup the state machine with a default |
47 state |
47 state |
48 */ |
48 */ |
49 { |
49 { |
50 // Tell the TE there's another StateMachine wishing to speak to it. |
50 // Tell the TE there's another StateMachine wishing to speak to it. |
51 // Remek: Where do you remove it??? Cos i couldn't find !!!!!!!!!!!!!!!!!!!!!!!!!!!!!! |
51 // Remek: Where do you remove it??? Cos i couldn't find !!!!!!!!!!!!!!!!!!!!!!!!!!!!!! |
52 iTe->AddStateMachineL(this); |
52 iTe->AddStateMachineL(this); |
53 |
53 |
54 // Initialize booleans |
54 // Initialize booleans |
55 iClientStimulus = EFalse; |
55 iClientStimulus = EFalse; |
56 iServerStimulus = EFalse; |
56 iServerStimulus = EFalse; |
57 iServerErrorStimulus = EFalse; |
57 iServerErrorStimulus = EFalse; |
58 iCallTerminateCallback = ETrue; |
58 iCallTerminateCallback = ETrue; |
59 iDeleteMeNow = EFalse; |
59 iDeleteMeNow = EFalse; |
60 isInviteSM = EFalse; |
60 isInviteSM = EFalse; |
61 isSubscribeSM = EFalse; |
61 isSubscribeSM = EFalse; |
62 |
62 |
63 iCallTerminateCode.iErrorCode = KErrNone; |
63 iCallTerminateCode.iErrorCode = KErrNone; |
64 iCallTerminateCode.iSipCode = KErrNone; |
64 iCallTerminateCode.iSipCode = KErrNone; |
65 |
65 |
66 // Construct States |
66 // Construct States |
67 iStateIdle = CStateIdle::NewL(this); |
67 iStateIdle = CStateIdle::NewL(this); |
68 CleanupStack::PushL (iStateIdle); |
68 |
69 |
69 iCommandCntx.iCommandState = iStateIdle; |
70 iCommandCntx.iCommandState = iStateIdle; |
70 iCommandCntx.iClientTx = NULL; |
71 iCommandCntx.iClientTx = NULL; |
71 iCommandCntx.iCancelClientTx = NULL; |
72 iCommandCntx.iCancelClientTx = NULL; |
72 iCommandCntx.iServerTx = NULL; |
73 iCommandCntx.iServerTx = NULL; |
73 iCommandCntx.iRegBinding = NULL; |
74 iCommandCntx.iRegBinding = NULL; |
74 iCommandCntx.iDialogAssoc = NULL; |
75 iCommandCntx.iDialogAssoc = NULL; |
75 |
76 |
76 iStateSessionInit = CStateSessionInitiation::NewL(this); |
77 |
77 iStateSessionEstablished = CStateSessionEstablished::NewL(this); |
78 iStateSessionInit = CStateSessionInitiation::NewL(this); |
78 iStateSessionTerminate = CStateSessionTerminate::NewL(this); |
79 CleanupStack::PushL(iStateSessionInit); |
79 |
80 iStateSessionEstablished = CStateSessionEstablished::NewL(this); |
80 iActiveState = iStateIdle; |
81 CleanupStack::PushL(iStateSessionEstablished); |
81 |
82 iStateSessionTerminate = CStateSessionTerminate::NewL(this); |
82 this->Start(&iStatus, NULL); |
83 CleanupStack::PushL(iStateSessionTerminate); |
83 // Maithra's fix : For stray signal |
84 |
84 MakeActive(); |
85 iActiveState = iStateIdle; |
85 } |
86 |
|
87 this->Start(&iStatus, NULL) ; |
|
88 // Maithra's fix : For stray signal |
|
89 MakeActive(); |
|
90 // Pop From Cleanup Stack |
|
91 CleanupStack::Pop(4, iStateIdle); |
|
92 } |
|
93 |
86 |
94 CSipStateMachine::CSipStateMachine(CSIPTransitionEngine * aTe, MSIPStateMachineClient* aClient,TBool aSMDirection) |
87 CSipStateMachine::CSipStateMachine(CSIPTransitionEngine * aTe, MSIPStateMachineClient* aClient,TBool aSMDirection) |
95 :CActive(EPriorityStandard), |
88 :CActive(EPriorityStandard), |
96 iTe(aTe), |
89 iTe(aTe), |
97 iClient(aClient), |
90 iClient(aClient), |
799 // Send Registration |
792 // Send Registration |
800 CSIPConnection * sipConn = GetTe()->GetSipConnection(); |
793 CSIPConnection * sipConn = GetTe()->GetSipConnection(); |
801 iCommandCntx.iRegBinding = CSIPRegistrationBinding::NewL( |
794 iCommandCntx.iRegBinding = CSIPRegistrationBinding::NewL( |
802 *sipConn, to, contact, |
795 *sipConn, to, contact, |
803 refresh,0, remoteUri, from); |
796 refresh,0, remoteUri, from); |
804 CleanupStack::PushL(iCommandCntx.iRegBinding); |
|
805 iCommandCntx.iClientTx = iCommandCntx.iRegBinding->RegisterL(); |
797 iCommandCntx.iClientTx = iCommandCntx.iRegBinding->RegisterL(); |
806 CleanupStack::Pop(6, refresh); |
798 CleanupStack::Pop(5, refresh); |
807 } |
799 } |
808 |
800 |
809 void CSipStateMachine::SendUnRegisterMessageL() |
801 void CSipStateMachine::SendUnRegisterMessageL() |
810 { |
802 { |
811 __FLOG_1(_L("[SipStateMachine]: CSipStateMachine[%x]::SendUnRegisterMessageL()"),this); |
803 __FLOG_1(_L("[SipStateMachine]: CSipStateMachine[%x]::SendUnRegisterMessageL()"),this); |