1076 // is IPv4 or IPv6, create GPDS_PDP_ADDRESS_INFO |
1076 // is IPv4 or IPv6, create GPDS_PDP_ADDRESS_INFO |
1077 if ( 0 < aPdpAddress.Length() && |
1077 if ( 0 < aPdpAddress.Length() && |
1078 ( GPDS_PDP_TYPE_IPV4 == aPdpType || |
1078 ( GPDS_PDP_TYPE_IPV4 == aPdpType || |
1079 GPDS_PDP_TYPE_IPV6 == aPdpType ) ) |
1079 GPDS_PDP_TYPE_IPV6 == aPdpType ) ) |
1080 { |
1080 { |
1081 // Set the pdp address info |
1081 TBuf8<KIpv6AddressLen> gpdsAddress; |
1082 TBuf8<KMaxLengthOfGdpsActivateReqSB> pdpAddressInfo; |
1082 ret = CMmStaticUtility::ConvertIPAddressFromClient( |
1083 pdpAddressInfo.Zero(); |
1083 aPdpAddress, gpdsAddress ); |
1084 TIsiSubBlock gpdsPdpAddressInfoSb ( |
1084 if ( KErrNone == ret ) |
1085 pdpAddressInfo, |
1085 { |
1086 GPDS_PDP_ADDRESS_INFO, |
1086 TBuf8<KMaxLengthOfGdpsActivateReqSB> pdpAddressInfo; |
1087 EIsiSubBlockTypeId8Len8 ); |
1087 pdpAddressInfo.Zero(); |
1088 |
1088 TIsiSubBlock gpdsPdpAddressInfoSb ( |
1089 pdpAddressInfo.Append( KGpdsPadding ); |
1089 pdpAddressInfo, |
1090 pdpAddressInfo.Append( aPdpAddress.Length() ); //lenght should always |
1090 GPDS_PDP_ADDRESS_INFO, |
1091 //be 4 or 16 |
1091 EIsiSubBlockTypeId8Len8 ); |
1092 pdpAddressInfo.Append( aPdpAddress ); |
1092 pdpAddressInfo.Append( KGpdsPadding ); |
1093 |
1093 pdpAddressInfo.Append( gpdsAddress.Length() ); |
1094 TUint8 subBlockCount( 1 ); |
1094 pdpAddressInfo.Append( gpdsAddress ); |
1095 gpdsActivateReq.Append( subBlockCount ); |
1095 |
1096 gpdsActivateReq.Append( gpdsPdpAddressInfoSb.CompleteSubBlock() ); |
1096 TUint8 subBlockCount( 1 ); |
|
1097 gpdsActivateReq.Append( subBlockCount ); |
|
1098 gpdsActivateReq.Append( gpdsPdpAddressInfoSb.CompleteSubBlock() ); |
|
1099 } |
1097 } |
1100 } |
1098 else |
1101 else |
1099 { |
1102 { |
1100 gpdsActivateReq.Append( 0 ); //sub block count |
1103 gpdsActivateReq.Append( 0 ); //sub block count |
1101 } |
1104 } |
1102 |
1105 |
1103 // Send Isi message via Phonet |
1106 if ( KErrNone == ret ) |
1104 ret = iPhoNetSender->Send( PN_GPDS, |
1107 { |
1105 aTransactionId, GPDS_CONTEXT_ACTIVATE_REQ, gpdsActivateReq ); |
1108 // Send Isi message via Phonet |
|
1109 ret = iPhoNetSender->Send( PN_GPDS, |
|
1110 aTransactionId, GPDS_CONTEXT_ACTIVATE_REQ, gpdsActivateReq ); |
|
1111 } |
|
1112 // no else |
|
1113 |
1106 } |
1114 } |
1107 // no else |
1115 // no else |
1108 |
1116 |
1109 return ret; |
1117 return ret; |
1110 } |
1118 } |
1989 // ----------------------------------------------------------------------------- |
1997 // ----------------------------------------------------------------------------- |
1990 // |
1998 // |
1991 TInt CMmPacketContextMessHandler::GpdsContextDeactivateReq( |
1999 TInt CMmPacketContextMessHandler::GpdsContextDeactivateReq( |
1992 const CMmDataPackage& aDataPackage ) |
2000 const CMmDataPackage& aDataPackage ) |
1993 { |
2001 { |
|
2002 TInt ret( KErrNone ); |
1994 TInfoName* contextName = NULL; |
2003 TInfoName* contextName = NULL; |
1995 aDataPackage.UnPackData( &contextName ); |
2004 aDataPackage.UnPackData( &contextName ); |
1996 TUint8 contextId( iContextList->GetContextIdByContextName( contextName ) ); |
2005 TUint8 contextId( iContextList->GetContextIdByContextName( contextName ) ); |
1997 |
2006 |
1998 if( GPDS_CID_VOID == contextId ) |
2007 if( GPDS_CID_VOID == contextId ) |
1999 { |
2008 { |
2000 contextId = iContextList->GetDialUpContextIdByName( contextName ); |
2009 contextId = iContextList->GetDialUpContextIdByName( contextName ); |
2001 } |
2010 } |
2002 // no else |
2011 // no else |
2003 |
2012 |
2004 TUint8 transactionId( GenerateTraId( contextId ) ); |
2013 if ( GPDS_CID_VOID != contextId ) |
2005 |
2014 { |
2006 TFLOGSTRING3("TSY: CMmPacketContextMessHandler::GpdsContextDeactivateReq. TransId: %d ContextId: %d", transactionId, contextId ); |
2015 TUint8 transactionId( GenerateTraId( contextId ) ); |
|
2016 TFLOGSTRING3("TSY: CMmPacketContextMessHandler::GpdsContextDeactivateReq. TransId: %d ContextId: %d", transactionId, contextId ); |
2007 OstTraceExt2( TRACE_NORMAL, CMMPACKETCONTEXTMESSHANDLER_GPDSCONTEXTDEACTIVATEREQ, "CMmPacketContextMessHandler::GpdsContextDeactivateReq;transactionId=%hhu;contextId=%hhu", transactionId, contextId ); |
2017 OstTraceExt2( TRACE_NORMAL, CMMPACKETCONTEXTMESSHANDLER_GPDSCONTEXTDEACTIVATEREQ, "CMmPacketContextMessHandler::GpdsContextDeactivateReq;transactionId=%hhu;contextId=%hhu", transactionId, contextId ); |
2008 |
2018 // Set the message data that consists of one parameter |
2009 // Set the message data that consists of one parameter |
2019 TBuf8<KMessageDataBufSize1> messageData; |
2010 TBuf8<KMessageDataBufSize1> messageData; |
2020 messageData.Append( contextId ); |
2011 messageData.Append( contextId ); |
2021 |
2012 |
2022 // Send Isi message via Phonet |
2013 // Send Isi message via Phonet |
2023 ret = iPhoNetSender->Send( PN_GPDS, |
2014 return iPhoNetSender->Send( PN_GPDS, |
2024 transactionId, GPDS_CONTEXT_DEACTIVATE_REQ, messageData ); |
2015 transactionId, GPDS_CONTEXT_DEACTIVATE_REQ, messageData ); |
2025 } |
|
2026 else |
|
2027 { |
|
2028 TFLOGSTRING("TSY: CMmPacketContextMessHandler::GpdsContextDeactivateReq. Context ID not found, return KErrNotFound" ); |
|
2029 OstTrace0( TRACE_NORMAL, DUP1_CMMPACKETCONTEXTMESSHANDLER_GPDSCONTEXTDEACTIVATEREQ, "CMmPacketContextMessHandler::GpdsContextDeactivateReq. Context ID not found, return KErrNotFound" ); |
|
2030 ret = KErrNotFound; |
|
2031 } |
|
2032 return ret; |
2016 } |
2033 } |
2017 |
2034 |
2018 // ----------------------------------------------------------------------------- |
2035 // ----------------------------------------------------------------------------- |
2019 // CMmPacketContextMessHandler::GpdsContextDeactivateRespL |
2036 // CMmPacketContextMessHandler::GpdsContextDeactivateRespL |
2020 // This method breaks the response to the context deactivation request. |
2037 // This method breaks the response to the context deactivation request. |
3283 { |
3300 { |
3284 |
3301 |
3285 TFLOGSTRING( "TSY: CMmPacketContextMessHandler::InitialiseContext"); |
3302 TFLOGSTRING( "TSY: CMmPacketContextMessHandler::InitialiseContext"); |
3286 OstTrace0( TRACE_NORMAL, CMMPACKETCONTEXTMESSHANDLER_INITIALISECONTEXT, "CMmPacketContextMessHandler::InitialiseContext" ); |
3303 OstTrace0( TRACE_NORMAL, CMMPACKETCONTEXTMESSHANDLER_INITIALISECONTEXT, "CMmPacketContextMessHandler::InitialiseContext" ); |
3287 |
3304 |
3288 TUint8 channelId( KTUint8NotDefined ); |
3305 TInt channelId( KTUint8NotDefined ); |
3289 TInfoName* contextName = NULL; |
3306 TInfoName* contextName = NULL; |
3290 TInfoName* hostCidName = NULL; |
3307 TInfoName* hostCidName = NULL; |
3291 TInt ret( KErrNone ); |
3308 TInt ret( KErrNone ); |
3292 iInitialiseError = KErrNone; |
3309 iInitialiseError = KErrNone; |
3293 TUint8 objectId( 0 ); |
3310 TUint8 objectId( 0 ); |
3949 aDataPackage.UnPackData( &config, &contextName ); |
3973 aDataPackage.UnPackData( &config, &contextName ); |
3950 |
3974 |
3951 TUint8 contextId( iContextList-> |
3975 TUint8 contextId( iContextList-> |
3952 GetContextIdByContextName( contextName ) ); |
3976 GetContextIdByContextName( contextName ) ); |
3953 |
3977 |
3954 iContextList->SetInitialiseMember( contextId, ETrue ); |
|
3955 |
|
3956 // Check that the mode given in aConfig is GPRS |
3978 // Check that the mode given in aConfig is GPRS |
3957 if ( TPacketDataConfigBase::KConfigGPRS == config->ExtensionId() ) |
3979 if ( TPacketDataConfigBase::KConfigGPRS == config->ExtensionId() ) |
3958 { |
3980 { |
3959 if ( GPDS_CID_VOID != contextId ) |
3981 if ( GPDS_CID_VOID != contextId ) |
3960 { |
3982 { |
3961 |
3983 TFLOGSTRING("TSY: CMmPacketContextMessHandler::SetConfig -> Rel97"); |
3962 TFLOGSTRING("TSY: CMmPacketContextMessHandler::SetConfig -> Rel97"); |
|
3963 OstTrace0( TRACE_NORMAL, DUP1_CMMPACKETCONTEXTMESSHANDLER_SETCONFIGL, "CMmPacketContextMessHandler::SetConfigL -> Rel97" ); |
3984 OstTrace0( TRACE_NORMAL, DUP1_CMMPACKETCONTEXTMESSHANDLER_SETCONFIGL, "CMmPacketContextMessHandler::SetConfigL -> Rel97" ); |
3964 |
3985 |
3965 iContextList->SetContextConfigurationType( |
3986 iContextList->SetInitialiseMember( contextId, ETrue ); |
3966 contextId, TPacketDataConfigBase::KConfigGPRS ); |
|
3967 |
3987 |
3968 RPacketContext::TContextConfigGPRS& configGPRS = |
3988 RPacketContext::TContextConfigGPRS& configGPRS = |
3969 *reinterpret_cast<RPacketContext::TContextConfigGPRS*>( |
3989 *reinterpret_cast<RPacketContext::TContextConfigGPRS*>( |
3970 config ); |
3990 config ); |
3971 |
3991 |
3972 TFLOGSTRING2("TSY: CMmPacketContextMessHandler::SetConfig iPrimaryDns:%S", &configGPRS.iProtocolConfigOption.iDnsAddresses.iPrimaryDns ); |
3992 TFLOGSTRING2("TSY: CMmPacketContextMessHandler::SetConfig IP.Length() = %d", configGPRS.iPdpAddress.Length()); |
3973 |
3993 TFLOGSTRING2("TSY: CMmPacketContextMessHandler::SetConfig iPrimaryDns.Length() = %d", configGPRS.iProtocolConfigOption.iDnsAddresses.iPrimaryDns.Length() ); |
3974 OstTraceExt1( TRACE_NORMAL, DUP2_CMMPACKETCONTEXTMESSHANDLER_SETCONFIGL, "CMmPacketContextMessHandler::SetConfigL;iPrimaryDns=%s", configGPRS.iProtocolConfigOption.iDnsAddresses.iPrimaryDns ); |
3994 TFLOGSTRING2("TSY: CMmPacketContextMessHandler::SetConfig iSecondaryDns.Length() = %d", configGPRS.iProtocolConfigOption.iDnsAddresses.iSecondaryDns.Length()); |
3975 TFLOGSTRING2("TSY: CMmPacketContextMessHandler::SetConfig iSecondaryDns:%S", &configGPRS.iProtocolConfigOption.iDnsAddresses.iSecondaryDns); |
3995 OstTrace1( TRACE_NORMAL, DUP10_CMMPACKETCONTEXTMESSHANDLER_SETCONFIGL, "CMmPacketContextMessHandler::SetConfigL;configGPRS.iPdpAddress.Length()=%d", configGPRS.iPdpAddress.Length() ); |
3976 OstTraceExt1( TRACE_NORMAL, DUP3_CMMPACKETCONTEXTMESSHANDLER_SETCONFIGL, "CMmPacketContextMessHandler::SetConfigL;iSecondaryDns=%s", configGPRS.iProtocolConfigOption.iDnsAddresses.iSecondaryDns ); |
3996 OstTrace1( TRACE_NORMAL, DUP11_CMMPACKETCONTEXTMESSHANDLER_SETCONFIGL, "CMmPacketContextMessHandler::SetConfigL;configGPRS.iProtocolConfigOption.iDnsAddresses.iPrimaryDns.Length()=%d", configGPRS.iProtocolConfigOption.iDnsAddresses.iPrimaryDns.Length() ); |
3977 |
3997 OstTrace1( TRACE_NORMAL, DUP12_CMMPACKETCONTEXTMESSHANDLER_SETCONFIGL, "CMmPacketContextMessHandler::SetConfigL;configGPRS.iProtocolConfigOption.iDnsAddresses.iSecondaryDns.Length()=%d", configGPRS.iProtocolConfigOption.iDnsAddresses.iSecondaryDns.Length() ); |
|
3998 |
|
3999 iContextList->SetContextConfigurationType( |
|
4000 contextId, TPacketDataConfigBase::KConfigGPRS ); |
3978 // save authentication data |
4001 // save authentication data |
3979 ret = iContextList->SaveConfig( |
4002 ret = iContextList->SaveConfig( |
3980 contextId, |
4003 contextId, |
3981 TPacketDataConfigBase::KConfigGPRS, |
4004 TPacketDataConfigBase::KConfigGPRS, |
3982 &configGPRS, |
4005 &configGPRS, |
4101 else |
4124 else |
4102 { |
4125 { |
4103 ret = KErrNotReady; |
4126 ret = KErrNotReady; |
4104 } |
4127 } |
4105 } |
4128 } |
4106 |
|
4107 else if ( TPacketDataConfigBase::KConfigRel99Rel4 == config->ExtensionId() |
4129 else if ( TPacketDataConfigBase::KConfigRel99Rel4 == config->ExtensionId() |
4108 || TPacketDataConfigBase::KConfigRel5 == config->ExtensionId() ) |
4130 || TPacketDataConfigBase::KConfigRel5 == config->ExtensionId() ) |
4109 { |
4131 { |
4110 if ( GPDS_CID_VOID != contextId ) |
4132 if ( GPDS_CID_VOID != contextId ) |
4111 { |
4133 { |
4112 if ( TPacketDataConfigBase::KConfigRel5 == config->ExtensionId() ) |
4134 if ( TPacketDataConfigBase::KConfigRel5 == config->ExtensionId() ) |
4113 { |
4135 { |
4114 |
4136 TFLOGSTRING("TSY: CMmPacketContextMessHandler::SetConfig -> R5"); |
4115 TFLOGSTRING("TSY: CMmPacketContextMessHandler::SetConfig -> R5"); |
|
4116 OstTrace0( TRACE_NORMAL, DUP4_CMMPACKETCONTEXTMESSHANDLER_SETCONFIGL, "CMmPacketContextMessHandler::SetConfigL -> R5" ); |
4137 OstTrace0( TRACE_NORMAL, DUP4_CMMPACKETCONTEXTMESSHANDLER_SETCONFIGL, "CMmPacketContextMessHandler::SetConfigL -> R5" ); |
4117 } |
4138 } |
4118 else |
4139 else |
4119 { |
4140 { |
4120 |
4141 TFLOGSTRING("TSY: CMmPacketContextMessHandler::SetConfig -> R99"); |
4121 TFLOGSTRING("TSY: CMmPacketContextMessHandler::SetConfig -> R99"); |
|
4122 OstTrace0( TRACE_NORMAL, DUP5_CMMPACKETCONTEXTMESSHANDLER_SETCONFIGL, "CMmPacketContextMessHandler::SetConfigL -> R99" ); |
4142 OstTrace0( TRACE_NORMAL, DUP5_CMMPACKETCONTEXTMESSHANDLER_SETCONFIGL, "CMmPacketContextMessHandler::SetConfigL -> R99" ); |
4123 } |
4143 } |
4124 |
|
4125 iContextList->SetContextConfigurationType( |
|
4126 contextId, TPacketDataConfigBase::KConfigRel99Rel4 ); |
|
4127 |
4144 |
4128 RPacketContext::TContextConfigR99_R4& configR99_R4 = |
4145 RPacketContext::TContextConfigR99_R4& configR99_R4 = |
4129 *reinterpret_cast<RPacketContext::TContextConfigR99_R4*>( |
4146 *reinterpret_cast<RPacketContext::TContextConfigR99_R4*>( |
4130 config ); |
4147 config ); |
4131 |
4148 |
|
4149 TFLOGSTRING2("TSY: CMmPacketContextMessHandler::SetConfig iMiscBuffer:%S", &configR99_R4.iProtocolConfigOption.iMiscBuffer ); |
|
4150 TFLOGSTRING2("TSY: CMmPacketContextMessHandler::SetConfig IP.Length() = %d", configR99_R4.iPdpAddress.Length()); |
|
4151 TFLOGSTRING2("TSY: CMmPacketContextMessHandler::SetConfig iPrimaryDns.Length() = %d", configR99_R4.iProtocolConfigOption.iDnsAddresses.iPrimaryDns.Length() ); |
|
4152 TFLOGSTRING2("TSY: CMmPacketContextMessHandler::SetConfig iSecondaryDns.Length() = %d", configR99_R4.iProtocolConfigOption.iDnsAddresses.iSecondaryDns.Length()); |
|
4153 OstTrace1( TRACE_NORMAL, DUP6_CMMPACKETCONTEXTMESSHANDLER_SETCONFIGL, "CMmPacketContextMessHandler::SetConfigL;configGPRS.iPdpAddress.Length()=%d", configR99_R4.iPdpAddress.Length() ); |
|
4154 OstTrace1( TRACE_NORMAL, DUP7_CMMPACKETCONTEXTMESSHANDLER_SETCONFIGL, "CMmPacketContextMessHandler::SetConfigL;configGPRS.iProtocolConfigOption.iDnsAddresses.iPrimaryDns.Length()=%d", configR99_R4.iProtocolConfigOption.iDnsAddresses.iPrimaryDns.Length() ); |
|
4155 OstTrace1( TRACE_NORMAL, DUP8_CMMPACKETCONTEXTMESSHANDLER_SETCONFIGL, "CMmPacketContextMessHandler::SetConfigL;configGPRS.iProtocolConfigOption.iDnsAddresses.iSecondaryDns.Length()=%d", configR99_R4.iProtocolConfigOption.iDnsAddresses.iSecondaryDns.Length() ); |
|
4156 |
|
4157 iContextList->SetContextConfigurationType( |
|
4158 contextId, TPacketDataConfigBase::KConfigRel99Rel4 ); |
4132 // save authentication data |
4159 // save authentication data |
4133 // No need to save REL5 type-> more complexity later as there is no |
4160 // No need to save REL5 type-> more complexity later as there is no |
4134 // own class for Rel5 Config. |
4161 // own class for Rel5 Config. |
4135 ret = iContextList->SaveConfig( contextId, |
4162 ret = iContextList->SaveConfig( contextId, |
4136 TPacketDataConfigBase::KConfigRel99Rel4, |
4163 TPacketDataConfigBase::KConfigRel99Rel4, |
4137 NULL, |
4164 NULL, |
4138 &configR99_R4 ); |
4165 &configR99_R4 ); |
4139 |
|
4140 TFLOGSTRING2("TSY: CMmPacketContextMessHandler::SetConfig iMiscBuffer:%S", &configR99_R4.iProtocolConfigOption.iMiscBuffer ); |
|
4141 OstTraceExt1( TRACE_NORMAL, DUP6_CMMPACKETCONTEXTMESSHANDLER_SETCONFIGL, "CMmPacketContextMessHandler::SetConfigL;iMiscBuffer=%s", configR99_R4.iProtocolConfigOption.iMiscBuffer ); |
|
4142 TFLOGSTRING2("TSY: CMmPacketContextMessHandler::SetConfig iPrimaryDns:%S", &configR99_R4.iProtocolConfigOption.iDnsAddresses.iPrimaryDns ); |
|
4143 OstTraceExt1( TRACE_NORMAL, DUP7_CMMPACKETCONTEXTMESSHANDLER_SETCONFIGL, "CMmPacketContextMessHandler::SetConfigL;iPrimaryDns=%s", configR99_R4.iProtocolConfigOption.iDnsAddresses.iPrimaryDns ); |
|
4144 TFLOGSTRING2("TSY: CMmPacketContextMessHandler::SetConfig iSecondaryDns:%S",&configR99_R4.iProtocolConfigOption.iDnsAddresses.iSecondaryDns ); |
|
4145 OstTraceExt1( TRACE_NORMAL, DUP8_CMMPACKETCONTEXTMESSHANDLER_SETCONFIGL, "CMmPacketContextMessHandler::SetConfigL;iSecondaryDns=%s", configR99_R4.iProtocolConfigOption.iDnsAddresses.iSecondaryDns ); |
|
4146 |
4166 |
4147 // Config saved succesfully |
4167 // Config saved succesfully |
4148 if ( KErrNone == ret ) |
4168 if ( KErrNone == ret ) |
4149 { |
4169 { |
4150 // Boolean for signalling info |
4170 // Boolean for signalling info |
4913 // couldn't send message, can't allow call activation |
4933 // couldn't send message, can't allow call activation |
4914 iCallModemResourceCallId = CALL_MODEM_ID_NONE; |
4934 iCallModemResourceCallId = CALL_MODEM_ID_NONE; |
4915 iDeactivateContextList->Reset(); |
4935 iDeactivateContextList->Reset(); |
4916 delete iDeactivateContextList; |
4936 delete iDeactivateContextList; |
4917 iDeactivateContextList = NULL; |
4937 iDeactivateContextList = NULL; |
4918 CallModemResourceReqDenied(); |
4938 |
|
4939 // detailed cause values. |
|
4940 // see 3GPP TS 24.008 V5.16.0 spec |
|
4941 _LIT8(KDetailedCause, "\xc0\x95\x82\x02"); |
|
4942 CallModemResourceReqDenied( |
|
4943 CALL_MODEM_CAUSE_TYPE_CLIENT, |
|
4944 CALL_MODEM_CAUSE_RELEASE_BY_USER, |
|
4945 KDetailedCause ); |
4919 } |
4946 } |
4920 //no else |
4947 //no else |
4921 } |
4948 } |
4922 else // no secondary contexts found => allow incoming call |
4949 else // no secondary contexts found => allow incoming call |
4923 { |
4950 { |
5642 OstTrace0( TRACE_NORMAL, CMMPACKETCONTEXTMESSHANDLER_CALLMODEMRESOURCEINDL, "CMmPacketContextMessHandler::CallModemResourceIndL" ); |
5669 OstTrace0( TRACE_NORMAL, CMMPACKETCONTEXTMESSHANDLER_CALLMODEMRESOURCEINDL, "CMmPacketContextMessHandler::CallModemResourceIndL" ); |
5643 |
5670 |
5644 TUint sbStartOffset( 0 ); |
5671 TUint sbStartOffset( 0 ); |
5645 //Default, 0 is unused value |
5672 //Default, 0 is unused value |
5646 TUint resourceId( 0 ); |
5673 TUint resourceId( 0 ); |
5647 // Default, emergency call mode not possible in MT call |
5674 TBool callModeFound( EFalse ); |
5648 TUint8 callMode( CALL_MODEM_MODE_EMERGENCY ); |
|
5649 // Make a copy of received message. Allocate heap memory. |
5675 // Make a copy of received message. Allocate heap memory. |
5650 // Can leave if out of mem. |
5676 // Can leave if out of mem. |
5651 iResourceControlMsg = HBufC8::NewL( aIsiMessage.GetBuffer().Length() ); |
5677 iResourceControlMsg = HBufC8::NewL( aIsiMessage.GetBuffer().Length() ); |
5652 // Copy data. |
5678 // Copy data. |
5653 *iResourceControlMsg = aIsiMessage.GetBuffer(); |
5679 *iResourceControlMsg = aIsiMessage.GetBuffer(); |
5672 ISI_HEADER_SIZE + SIZE_CALL_MODEM_RESOURCE_IND, |
5698 ISI_HEADER_SIZE + SIZE_CALL_MODEM_RESOURCE_IND, |
5673 CALL_MODEM_SB_MODE, |
5699 CALL_MODEM_SB_MODE, |
5674 EIsiSubBlockTypeId8Len8, |
5700 EIsiSubBlockTypeId8Len8, |
5675 sbStartOffset ) ) |
5701 sbStartOffset ) ) |
5676 { |
5702 { |
5677 callMode = aIsiMessage.Get8bit( |
5703 callModeFound = ETrue; |
5678 sbStartOffset + CALL_MODEM_SB_MODE_OFFSET_MODE ); |
|
5679 } |
5704 } |
5680 // check request |
5705 // check request |
5681 if ( ( CALL_MODEM_RES_ID_MT_INIT == resourceId ) && |
5706 if( CALL_MODEM_RES_ID_MT_INIT == resourceId ) |
5682 ( CALL_MODEM_ID_NONE != callId ) && |
5707 { |
5683 ( CALL_MODEM_MODE_SPEECH == callMode || |
5708 if( CALL_MODEM_ID_NONE != callId && callModeFound ) |
5684 CALL_MODEM_MODE_ALS_LINE_2 == callMode || |
5709 { |
5685 CALL_MODEM_MODE_MULTIMEDIA == callMode ) ) |
5710 // if DCM drive mode flag is enabled |
5686 { |
5711 if ( iDriveModeFlag ) |
5687 // if DCM drive mode flag is enabled |
5712 { |
5688 if ( iDriveModeFlag ) |
|
5689 { |
|
5690 TFLOGSTRING( "TSY: CMmPacketContextMessHandler::CallModemResourceIndL - DCM Drive Mode enabled" ); |
5713 TFLOGSTRING( "TSY: CMmPacketContextMessHandler::CallModemResourceIndL - DCM Drive Mode enabled" ); |
5691 OstTrace0( TRACE_NORMAL, DUP8_CMMPACKETCONTEXTMESSHANDLER_CALLMODEMRESOURCEINDL, "CMmPacketContextMessHandler::CallModemResourceIndL - DCM Drive Mode enabled" ); |
5714 OstTrace0( TRACE_NORMAL, DUP8_CMMPACKETCONTEXTMESSHANDLER_CALLMODEMRESOURCEINDL, "CMmPacketContextMessHandler::CallModemResourceIndL - DCM Drive Mode enabled" ); |
5692 |
5715 |
5693 // Complete DCM specific functionality |
5716 // Complete DCM specific functionality |
5694 // Drive mode rejects automatically incoming calls |
5717 // Drive mode rejects automatically incoming calls |
5695 CompleteDCMdrivemodeFunctionalityL(); |
5718 CompleteDCMdrivemodeFunctionalityL(); |
5696 CallModemResourceReqDenied(); |
5719 |
5697 } |
5720 // detailed cause values. |
5698 else |
5721 // see 3GPP TS 24.008 V5.16.0 spec |
5699 { |
5722 _LIT8(KDetailedCause, "\xc0\x95\x82\x02"); |
|
5723 CallModemResourceReqDenied( |
|
5724 CALL_MODEM_CAUSE_TYPE_CLIENT, |
|
5725 CALL_MODEM_CAUSE_RELEASE_BY_USER, |
|
5726 KDetailedCause ); |
|
5727 } |
|
5728 else |
|
5729 { |
5700 TFLOGSTRING( "TSY: CMmPacketContextMessHandler::CallModemResourceIndL - Allow incoming call activation" ); |
5730 TFLOGSTRING( "TSY: CMmPacketContextMessHandler::CallModemResourceIndL - Allow incoming call activation" ); |
5701 OstTrace0( TRACE_NORMAL, DUP6_CMMPACKETCONTEXTMESSHANDLER_CALLMODEMRESOURCEINDL, "CMmPacketContextMessHandler::CallModemResourceIndL - Allow incoming call activation" ); |
5731 OstTrace0( TRACE_NORMAL, DUP6_CMMPACKETCONTEXTMESSHANDLER_CALLMODEMRESOURCEINDL, "CMmPacketContextMessHandler::CallModemResourceIndL - Allow incoming call activation" ); |
5702 |
5732 |
5703 // allow incoming call activation |
5733 // allow incoming call activation |
5704 iCallModemResourceCallId = callId; |
5734 iCallModemResourceCallId = callId; |
5705 AllowIncomingCallActivationL(); |
5735 AllowIncomingCallActivationL(); |
|
5736 } |
|
5737 } |
|
5738 else |
|
5739 { |
|
5740 TFLOGSTRING( "TSY: CMmPacketContextMessHandler::CallModemResourceIndL - Call mode missing, resource is denied" ); |
|
5741 OstTrace0( TRACE_NORMAL, DUP1_CMMPACKETCONTEXTMESSHANDLER_CALLMODEMRESOURCEINDL, "CMmPacketContextMessHandler::CallModemResourceIndL - Call mode missing, resource is denied" ); |
|
5742 |
|
5743 // detailed cause values. |
|
5744 // see 3GPP TS 24.008 V5.16.0 spec |
|
5745 // in this case we need to return detailed cause as |
|
5746 // 0xE0 (coding standard GSM PLMN, location user) |
|
5747 // 0xD8 (cause 88) |
|
5748 _LIT8(KDetailedCause, "\xe0\xd8"); |
|
5749 CallModemResourceReqDenied( |
|
5750 CALL_MODEM_CAUSE_TYPE_NETWORK, |
|
5751 CALL_MODEM_NW_CAUSE_INCOMPATIBLE_DEST, |
|
5752 KDetailedCause ); |
5706 } |
5753 } |
5707 } |
5754 } |
5708 else |
5755 else |
5709 { |
5756 { |
5710 iCallModemResourceCallId = CALL_MODEM_ID_NONE; |
5757 iCallModemResourceCallId = CALL_MODEM_ID_NONE; |
5839 // CMmPacketContextMessHandler::CallModemResourceReqDenied |
5886 // CMmPacketContextMessHandler::CallModemResourceReqDenied |
5840 // Creates callModemResourceDenied ISI message to modem call server. |
5887 // Creates callModemResourceDenied ISI message to modem call server. |
5841 // (other items were commented in a header). |
5888 // (other items were commented in a header). |
5842 // ----------------------------------------------------------------------------- |
5889 // ----------------------------------------------------------------------------- |
5843 // |
5890 // |
5844 void CMmPacketContextMessHandler::CallModemResourceReqDenied() |
5891 void CMmPacketContextMessHandler::CallModemResourceReqDenied( |
5845 { |
5892 const TUint8 aCauseType, |
|
5893 const TUint8 aCause, |
|
5894 const TDesC8& aDetailedCause ) |
|
5895 { |
5846 TFLOGSTRING("TSY: CMmPacketContextMessHandler::CallModemResourceReqDenied"); |
5896 TFLOGSTRING("TSY: CMmPacketContextMessHandler::CallModemResourceReqDenied"); |
5847 OstTrace0( TRACE_NORMAL, CMMPACKETCONTEXTMESSHANDLER_CALLMODEMRESOURCEREQDENIED, "CMmPacketContextMessHandler::CallModemResourceReqDenied" ); |
5897 OstTrace0( TRACE_NORMAL, CMMPACKETCONTEXTMESSHANDLER_CALLMODEMRESOURCEREQDENIED, "CMmPacketContextMessHandler::CallModemResourceReqDenied" ); |
5848 |
5898 |
5849 TIsiSend callModemResourceDenied( iPhoNetSender->SendBufferDes() ); |
5899 TIsiSend callModemResourceDenied( iPhoNetSender->SendBufferDes() ); |
5850 |
5900 |
5864 |
5914 |
5865 // Set call id |
5915 // Set call id |
5866 callModemResourceDenied.Set8bit( |
5916 callModemResourceDenied.Set8bit( |
5867 ISI_HEADER_SIZE + CALL_MODEM_RESOURCE_REQ_OFFSET_CALLID, callId ); |
5917 ISI_HEADER_SIZE + CALL_MODEM_RESOURCE_REQ_OFFSET_CALLID, callId ); |
5868 |
5918 |
5869 TInt aCurrentMsgOffset( |
5919 TInt currentMsgOffset( |
5870 ISI_HEADER_SIZE + SIZE_CALL_MODEM_RESOURCE_REQ ); |
5920 ISI_HEADER_SIZE + SIZE_CALL_MODEM_RESOURCE_REQ ); |
5871 |
5921 |
5872 TUint8 numOfSbInMessage( 0 ); |
5922 TUint8 numOfSbInMessage( 0 ); |
|
5923 TUint subblockOffset( 0 ); |
|
5924 |
|
5925 // CALL_MODEM_SB_RESOURCE (same as in indication) |
|
5926 if ( KErrNone == isimessage.FindSubBlockOffsetById( |
|
5927 ISI_HEADER_SIZE + SIZE_CALL_MODEM_RESOURCE_IND, |
|
5928 CALL_MODEM_SB_RESOURCE, |
|
5929 EIsiSubBlockTypeId8Len8, |
|
5930 subblockOffset ) ) |
|
5931 { |
|
5932 TUint subblockLength( isimessage.Get8bit( |
|
5933 subblockOffset + KSubblockTypeId8Len8LengthOffset ) ); |
|
5934 |
|
5935 callModemResourceDenied.CopyData( |
|
5936 currentMsgOffset, |
|
5937 isimessage.GetData( |
|
5938 subblockOffset, |
|
5939 subblockLength ) ); |
|
5940 numOfSbInMessage++; |
|
5941 currentMsgOffset += subblockLength; |
|
5942 } |
|
5943 |
|
5944 // CALL_MODEM_SB_RESOURCE_SEQ_ID (same as in indication) |
|
5945 if ( KErrNone == isimessage.FindSubBlockOffsetById( |
|
5946 ISI_HEADER_SIZE + SIZE_CALL_MODEM_RESOURCE_IND, |
|
5947 CALL_MODEM_SB_RESOURCE_SEQ_ID, |
|
5948 EIsiSubBlockTypeId8Len8, |
|
5949 subblockOffset ) ) |
|
5950 { |
|
5951 TUint subblockLength( isimessage.Get8bit( |
|
5952 subblockOffset + KSubblockTypeId8Len8LengthOffset ) ); |
|
5953 |
|
5954 callModemResourceDenied.CopyData( |
|
5955 currentMsgOffset, |
|
5956 isimessage.GetData( |
|
5957 subblockOffset, |
|
5958 subblockLength ) ); |
|
5959 numOfSbInMessage++; |
|
5960 currentMsgOffset += subblockLength; |
|
5961 } |
5873 |
5962 |
5874 // buffer for CALL_MODEM_SB_RESOURCE_STATUS subblock |
5963 // buffer for CALL_MODEM_SB_RESOURCE_STATUS subblock |
5875 TBuf8<CALL_MODEM_SB_RESOURCE_STATUS> resourceStatus; |
5964 TBuf8<CALL_MODEM_SB_RESOURCE_STATUS> resourceStatus; |
5876 |
5965 |
5877 // Add CALL_MODEM_SB_RESOURCE_STATUS subblock |
5966 // Add CALL_MODEM_SB_RESOURCE_STATUS subblock |
5882 // resource status + filler byte |
5971 // resource status + filler byte |
5883 resourceStatus.Append( CALL_MODEM_RESOURCE_DENIED ); |
5972 resourceStatus.Append( CALL_MODEM_RESOURCE_DENIED ); |
5884 resourceStatus.Append( KCallPadding ); |
5973 resourceStatus.Append( KCallPadding ); |
5885 |
5974 |
5886 callModemResourceDenied.CopyData( |
5975 callModemResourceDenied.CopyData( |
5887 aCurrentMsgOffset, resourceStatusSb.CompleteSubBlock() ); |
5976 currentMsgOffset, resourceStatusSb.CompleteSubBlock() ); |
5888 // Set new offset and increase subblock count |
5977 // Set new offset and increase subblock count |
5889 aCurrentMsgOffset = |
5978 currentMsgOffset = |
5890 aCurrentMsgOffset + resourceStatus.Length(); |
5979 currentMsgOffset + resourceStatus.Length(); |
5891 // increase subblock count |
5980 // increase subblock count |
5892 numOfSbInMessage++; |
5981 numOfSbInMessage++; |
5893 |
5982 |
5894 TFLOGSTRING2("TSY: CMmPacketContextMessHandler::CallModemResourceReqDenied - CALL_MODEM_SB_RESOURCE_STATUS - Subblock Count: %d", numOfSbInMessage ); |
5983 TFLOGSTRING2("TSY: CMmPacketContextMessHandler::CallModemResourceReqDenied - CALL_MODEM_SB_RESOURCE_STATUS - Subblock Count: %d", numOfSbInMessage ); |
5895 OstTraceExt1( TRACE_NORMAL, DUP2_CMMPACKETCONTEXTMESSHANDLER_CALLMODEMRESOURCEREQDENIED, "CMmPacketContextMessHandler::CallModemResourceReqDenied- CALL_MODEM_SB_RESOURCE_STATUS - Subblock Count=%hhu", numOfSbInMessage ); |
5984 OstTraceExt1( TRACE_NORMAL, DUP2_CMMPACKETCONTEXTMESSHANDLER_CALLMODEMRESOURCEREQDENIED, "CMmPacketContextMessHandler::CallModemResourceReqDenied- CALL_MODEM_SB_RESOURCE_STATUS - Subblock Count=%hhu", numOfSbInMessage ); |
5901 TIsiSubBlock modemSbCauseSb( |
5990 TIsiSubBlock modemSbCauseSb( |
5902 modemSbCause, |
5991 modemSbCause, |
5903 CALL_MODEM_SB_CAUSE, |
5992 CALL_MODEM_SB_CAUSE, |
5904 EIsiSubBlockTypeId8Len8 ); |
5993 EIsiSubBlockTypeId8Len8 ); |
5905 // cause type + cause |
5994 // cause type + cause |
5906 modemSbCause.Append( CALL_MODEM_CAUSE_TYPE_CLIENT ); |
5995 modemSbCause.Append( aCauseType ); |
5907 modemSbCause.Append( CALL_MODEM_CAUSE_RELEASE_BY_USER ); |
5996 modemSbCause.Append( aCause ); |
5908 |
5997 |
5909 callModemResourceDenied.CopyData( |
5998 callModemResourceDenied.CopyData( |
5910 aCurrentMsgOffset, modemSbCauseSb.CompleteSubBlock() ); |
5999 currentMsgOffset, modemSbCauseSb.CompleteSubBlock() ); |
5911 // Set new offset and increase subblock count |
6000 // Set new offset and increase subblock count |
5912 aCurrentMsgOffset = |
6001 currentMsgOffset = |
5913 aCurrentMsgOffset + modemSbCause.Length(); |
6002 currentMsgOffset + modemSbCause.Length(); |
5914 // increase subblock count |
6003 // increase subblock count |
5915 numOfSbInMessage++; |
6004 numOfSbInMessage++; |
5916 |
6005 |
5917 TFLOGSTRING2("TSY: CMmPacketContextMessHandler::CallModemResourceReqDenied - CALL_MODEM_SB_CAUSE - Subblock Count: %d", numOfSbInMessage ); |
6006 TFLOGSTRING2("TSY: CMmPacketContextMessHandler::CallModemResourceReqDenied - CALL_MODEM_SB_CAUSE - Subblock Count: %d", numOfSbInMessage ); |
5918 OstTraceExt1( TRACE_NORMAL, DUP4_CMMPACKETCONTEXTMESSHANDLER_CALLMODEMRESOURCEREQDENIED, "CMmPacketContextMessHandler::CallModemResourceReqDenied- CALL_MODEM_SB_CAUSE - Subblock Count=%hhu", numOfSbInMessage ); |
6007 OstTraceExt1( TRACE_NORMAL, DUP4_CMMPACKETCONTEXTMESSHANDLER_CALLMODEMRESOURCEREQDENIED, "CMmPacketContextMessHandler::CallModemResourceReqDenied- CALL_MODEM_SB_CAUSE - Subblock Count=%hhu", numOfSbInMessage ); |
5923 // Add CALL_MODEM_SB_DETAILED_CAUSE subblock |
6012 // Add CALL_MODEM_SB_DETAILED_CAUSE subblock |
5924 TIsiSubBlock detailedCauseSb( |
6013 TIsiSubBlock detailedCauseSb( |
5925 detailedCause, |
6014 detailedCause, |
5926 CALL_MODEM_SB_DETAILED_CAUSE, |
6015 CALL_MODEM_SB_DETAILED_CAUSE, |
5927 EIsiSubBlockTypeId8Len8 ); |
6016 EIsiSubBlockTypeId8Len8 ); |
5928 // cause length + cause values ( 4 ) + filler |
6017 // cause length + cause values |
5929 detailedCause.Append( KDiagnosticsOctet2 ); |
6018 detailedCause.Append( aDetailedCause.Length() ); |
5930 detailedCause.Append( KDiagnosticsOctet3 ); |
6019 detailedCause.Append( aDetailedCause ); |
5931 detailedCause.Append( KDiagnosticsOctet4 ); |
|
5932 detailedCause.Append( KDiagnosticsOctet5 ); |
|
5933 detailedCause.Append( KDiagnosticsOctet6 ); |
|
5934 detailedCause.Append( KCallPadding ); |
|
5935 |
6020 |
5936 callModemResourceDenied.CopyData( |
6021 callModemResourceDenied.CopyData( |
5937 aCurrentMsgOffset, detailedCauseSb.CompleteSubBlock() ); |
6022 currentMsgOffset, detailedCauseSb.CompleteSubBlock() ); |
5938 // Set new offset and increase subblock count |
6023 // Set new offset and increase subblock count |
5939 aCurrentMsgOffset = |
6024 currentMsgOffset = |
5940 aCurrentMsgOffset + detailedCause.Length(); |
6025 currentMsgOffset + detailedCause.Length(); |
5941 // increase subblock count |
6026 // increase subblock count |
5942 numOfSbInMessage++; |
6027 numOfSbInMessage++; |
5943 |
6028 |
5944 TFLOGSTRING2("TSY: CMmPacketContextMessHandler::CallModemResourceReqDenied - CALL_MODEM_SB_DETAILED_CAUSE - Subblock Count: %d", numOfSbInMessage ); |
6029 TFLOGSTRING2("TSY: CMmPacketContextMessHandler::CallModemResourceReqDenied - CALL_MODEM_SB_DETAILED_CAUSE - Subblock Count: %d", numOfSbInMessage ); |
5945 OstTraceExt1( TRACE_NORMAL, DUP3_CMMPACKETCONTEXTMESSHANDLER_CALLMODEMRESOURCEREQDENIED, "CMmPacketContextMessHandler::CallModemResourceReqDenied- CALL_MODEM_SB_DETAILED_CAUSE - Subblock Count=%hhu", numOfSbInMessage ); |
6030 OstTraceExt1( TRACE_NORMAL, DUP3_CMMPACKETCONTEXTMESSHANDLER_CALLMODEMRESOURCEREQDENIED, "CMmPacketContextMessHandler::CallModemResourceReqDenied- CALL_MODEM_SB_DETAILED_CAUSE - Subblock Count=%hhu", numOfSbInMessage ); |
6057 &callData, |
6141 &callData, |
6058 result ); |
6142 result ); |
6059 |
6143 |
6060 } |
6144 } |
6061 |
6145 |
|
6146 // ----------------------------------------------------------------------------- |
|
6147 // CMmPacketContextMessHandler::getProxyId |
|
6148 // This method interpretes channel ID from context name. |
|
6149 // (other items were commented in a header). |
|
6150 // ----------------------------------------------------------------------------- |
|
6151 // |
|
6152 TInt CMmPacketContextMessHandler::getProxyId(const TInfoName& contextName) |
|
6153 { |
|
6154 _LIT(KUnderscore, "_"); |
|
6155 TInt channelId ; |
|
6156 TInt pos = contextName.Find( KUnderscore ); |
|
6157 if ( pos != KErrNotFound ) |
|
6158 { |
|
6159 TLex(contextName.Mid(pos+1)).Val(channelId); |
|
6160 TFLOGSTRING2("TSY: CMmPacketContextMessHandler::getProxyId channelId = %d", channelId ); |
|
6161 OstTrace1( TRACE_NORMAL, CMMPACKETCONTEXTMESSHANDLER_GETPROXYID, "CMmPacketContextMessHandler::getProxyId;channelId=%d", channelId ); |
|
6162 } |
|
6163 else |
|
6164 { |
|
6165 TFLOGSTRING("TSY: CMmPacketContextMessHandler::getProxyId channelId NOT FOUND !!!" ); |
|
6166 OstTrace0( TRACE_NORMAL, DUP1_CMMPACKETCONTEXTMESSHANDLER_GETPROXYID, "CMmPacketContextMessHandler::getProxyId: channelId NOT FOUND !!!" ); |
|
6167 // FAIL, this should never happen.. |
|
6168 } |
|
6169 return channelId; |
|
6170 } |
|
6171 |
6062 // ========================== OTHER EXPORTED FUNCTIONS ========================= |
6172 // ========================== OTHER EXPORTED FUNCTIONS ========================= |
6063 |
6173 |
6064 // None |
6174 // None |
6065 |
6175 |
6066 // End of File |
6176 // End of File |