219 TFLOGSTRING("TSY: CMmUssdMessHandler::SsGsmUssdSendReq"); |
219 TFLOGSTRING("TSY: CMmUssdMessHandler::SsGsmUssdSendReq"); |
220 OstTrace0( TRACE_NORMAL, CMMUSSDMESSHANDLER_SSGSMUSSDSENDREQ, "CMmUssdMessHandler::SsGsmUssdSendReq" ); |
220 OstTrace0( TRACE_NORMAL, CMMUSSDMESSHANDLER_SSGSMUSSDSENDREQ, "CMmUssdMessHandler::SsGsmUssdSendReq" ); |
221 TInt ret ( KErrNone ); |
221 TInt ret ( KErrNone ); |
222 TBuf8<RMobileUssdMessaging::KGsmUssdDataSize> data( 0 ); |
222 TBuf8<RMobileUssdMessaging::KGsmUssdDataSize> data( 0 ); |
223 TDes8* attributes( 0 ); |
223 TDes8* attributes( 0 ); |
224 TUint8 numOfSubblocks( 2 ); |
224 TUint8 numOfSubblocks( 0 ); |
225 |
225 |
226 aDataPackage->UnPackData( data, attributes ); |
226 aDataPackage->UnPackData( data, attributes ); |
227 |
227 |
228 RMobileUssdMessaging::TMobileUssdAttributesV1Pckg* msgAttrPck ( |
228 RMobileUssdMessaging::TMobileUssdAttributesV1Pckg* msgAttrPck ( |
229 (RMobileUssdMessaging::TMobileUssdAttributesV1Pckg*) ( attributes ) ); |
229 (RMobileUssdMessaging::TMobileUssdAttributesV1Pckg*) ( attributes ) ); |
239 { |
239 { |
240 switch ( msgAttr.iType ) |
240 switch ( msgAttr.iType ) |
241 { |
241 { |
242 // User has requested to send MO USSD |
242 // User has requested to send MO USSD |
243 case RMobileUssdMessaging::EUssdMORequest: |
243 case RMobileUssdMessaging::EUssdMORequest: |
|
244 { |
|
245 ussdType = SS_GSM_USSD_COMMAND; |
|
246 break; |
|
247 } |
244 case RMobileUssdMessaging::EUssdMOReply: |
248 case RMobileUssdMessaging::EUssdMOReply: |
245 { |
249 { |
246 ussdType = SS_GSM_USSD_COMMAND; |
250 TFLOGSTRING2("TSY: CMmUssdMessHandler::SsGsmUssdSendReq; iLastMtUssdIsRequest = %d", iLastMtUssdIsRequest); |
|
251 OstTrace1( TRACE_NORMAL, DUP5_CMMUSSDMESSHANDLER_SSGSMUSSDSENDREQ, "CMmUssdMessHandler::SsGsmUssdSendReq;iLastMtUssdIsRequest=%d", iLastMtUssdIsRequest ); |
|
252 if ( iLastMtUssdIsRequest ) |
|
253 { |
|
254 ussdType = SS_GSM_USSD_MT_REPLY; |
|
255 } |
|
256 else |
|
257 { |
|
258 ussdType = SS_GSM_USSD_COMMAND; |
|
259 } |
|
260 // no need to reset the field, because MT USSD indication |
|
261 // will always precede this kind of response |
247 break; |
262 break; |
248 } |
263 } |
249 // User is signing for the MT request |
264 // User is signing for the MT request |
250 case RMobileUssdMessaging::EUssdMOAcknowledgement: |
265 case RMobileUssdMessaging::EUssdMOAcknowledgement: |
251 { |
266 { |
301 SS_GSM_USSD_SEND_REQ ); |
316 SS_GSM_USSD_SEND_REQ ); |
302 |
317 |
303 ssGsmUssdSendReq.Set8bit( ISI_HEADER_SIZE + |
318 ssGsmUssdSendReq.Set8bit( ISI_HEADER_SIZE + |
304 SS_GSM_USSD_SEND_REQ_OFFSET_USSDTYPE, ussdType ); |
319 SS_GSM_USSD_SEND_REQ_OFFSET_USSDTYPE, ussdType ); |
305 |
320 |
306 // Create SsGsmUssdString subblock. |
321 if ( SS_GSM_USSD_NOTIFY != ussdType ) |
307 // subblock header + ussd string length subblock max length = 164 |
|
308 |
|
309 TBuf8<KMaxLengthOfUssdMessage + 3> ssGsmUssdStringSb( 0 ); |
|
310 |
|
311 TIsiSubBlock subblockSSGsmUssdString( |
|
312 ssGsmUssdStringSb, SS_GSM_USSD_STRING, EIsiSubBlockTypeId8Len8 ); |
|
313 |
|
314 ssGsmUssdStringSb.Append( codingInfo ); |
|
315 ssGsmUssdStringSb.Append( data.Length() ); |
|
316 ssGsmUssdStringSb.Append( data ); |
|
317 |
|
318 ssGsmUssdSendReq.CopyData( ISI_HEADER_SIZE + |
|
319 SIZE_SS_GSM_USSD_SEND_REQ, |
|
320 subblockSSGsmUssdString.CompleteSubBlock() ); |
|
321 |
|
322 // create subblock SS_SB_CHECK_INFO |
|
323 TBuf8<SIZE_SS_SB_CHECK_INFO>sbData( 0 ); |
|
324 TIsiSubBlock ssCheckInfoSb( |
|
325 sbData, |
|
326 SS_SB_CHECK_INFO, |
|
327 EIsiSubBlockTypeId8Len8 ); |
|
328 |
|
329 if( iNoFdnUSSDReq ) |
|
330 { |
322 { |
331 sbData.Append( SS_FDN_CHECK_SUPPRESS ); |
323 // Create SsGsmUssdString subblock. |
|
324 // subblock header + ussd string length subblock max length = 164 |
|
325 TBuf8<KMaxLengthOfUssdMessage + 3> ssGsmUssdStringSb( 0 ); |
|
326 TIsiSubBlock subblockSSGsmUssdString( |
|
327 ssGsmUssdStringSb, SS_GSM_USSD_STRING, EIsiSubBlockTypeId8Len8 ); |
|
328 |
|
329 ssGsmUssdStringSb.Append( codingInfo ); |
|
330 ssGsmUssdStringSb.Append( data.Length() ); |
|
331 ssGsmUssdStringSb.Append( data ); |
|
332 |
|
333 ssGsmUssdSendReq.CopyData( ISI_HEADER_SIZE + |
|
334 SIZE_SS_GSM_USSD_SEND_REQ, |
|
335 subblockSSGsmUssdString.CompleteSubBlock() ); |
|
336 numOfSubblocks++; |
|
337 |
|
338 if ( SS_GSM_USSD_COMMAND == ussdType ) |
|
339 { |
|
340 // create subblock SS_SB_CHECK_INFO |
|
341 TBuf8<SIZE_SS_SB_CHECK_INFO>sbData( 0 ); |
|
342 TIsiSubBlock ssCheckInfoSb( |
|
343 sbData, |
|
344 SS_SB_CHECK_INFO, |
|
345 EIsiSubBlockTypeId8Len8 ); |
|
346 |
|
347 if( iNoFdnUSSDReq ) |
|
348 { |
|
349 sbData.Append( SS_FDN_CHECK_SUPPRESS ); |
|
350 } |
|
351 else |
|
352 { |
|
353 sbData.Append( SS_NO_FDN_CHECK_SUPPRESS ); |
|
354 } |
|
355 |
|
356 sbData.Append( SS_NO_RESOURCE_CONTROL_SUPPRESS ); |
|
357 |
|
358 // add the SIZE_SS_SB_CHECK_INFO subblock to service req |
|
359 ssGsmUssdSendReq.CopyData( |
|
360 ISI_HEADER_SIZE + SIZE_SS_GSM_USSD_SEND_REQ + |
|
361 ssGsmUssdStringSb.Length(), |
|
362 ssCheckInfoSb.CompleteSubBlock( ) ); |
|
363 numOfSubblocks++; |
|
364 } |
332 } |
365 } |
333 else |
|
334 { |
|
335 sbData.Append( SS_NO_FDN_CHECK_SUPPRESS ); |
|
336 } |
|
337 |
|
338 sbData.Append( SS_NO_RESOURCE_CONTROL_SUPPRESS ); |
|
339 |
|
340 // add the SIZE_SS_SB_CHECK_INFO subblock to service req |
|
341 ssGsmUssdSendReq.CopyData( |
|
342 ISI_HEADER_SIZE + SIZE_SS_GSM_USSD_SEND_REQ + |
|
343 ssGsmUssdStringSb.Length(), |
|
344 ssCheckInfoSb.CompleteSubBlock( ) ); |
|
345 |
366 |
346 ssGsmUssdSendReq.Set8bit( ISI_HEADER_SIZE + |
367 ssGsmUssdSendReq.Set8bit( ISI_HEADER_SIZE + |
347 SS_GSM_USSD_SEND_REQ_OFFSET_SUBBLOCKCOUNT, numOfSubblocks ); |
368 SS_GSM_USSD_SEND_REQ_OFFSET_SUBBLOCKCOUNT, numOfSubblocks ); |
348 |
|
349 |
369 |
350 //send message via phonet |
370 //send message via phonet |
351 ret = iPhoNetSender->Send( ssGsmUssdSendReq.Complete() ); |
371 ret = iPhoNetSender->Send( ssGsmUssdSendReq.Complete() ); |
352 } |
372 } |
353 else |
373 else |
573 // sw1, sw2 and result is inserted to SS_SB_RESOURCE_CONTROL_INFO |
593 // sw1, sw2 and result is inserted to SS_SB_RESOURCE_CONTROL_INFO |
574 // by simatktsy and ther order from first byte is: sw1, sw2 and result |
594 // by simatktsy and ther order from first byte is: sw1, sw2 and result |
575 TUint8 sw1 = data[KSw1Index]; |
595 TUint8 sw1 = data[KSw1Index]; |
576 TUint8 sw2 = data[KSw2Index]; |
596 TUint8 sw2 = data[KSw2Index]; |
577 TUint8 result = data[KResultIndex]; |
597 TUint8 result = data[KResultIndex]; |
578 epocError = CMmStaticUtility::MapSw1Sw2ToEpocError( |
598 epocError = CMmStaticUtility::MapSw1Sw2ToEpocError( |
579 sw1, |
599 sw1, |
580 sw2, |
600 sw2, |
581 result ); |
601 result ); |
582 errorMappingNeeded = EFalse; |
602 errorMappingNeeded = EFalse; |
583 } |
603 } |
584 } |
604 } |
585 else |
605 else |
737 switch ( ussdType ) |
757 switch ( ussdType ) |
738 { |
758 { |
739 case SS_GSM_USSD_REQUEST: |
759 case SS_GSM_USSD_REQUEST: |
740 case SS_GSM_USSD_COMMAND: |
760 case SS_GSM_USSD_COMMAND: |
741 { |
761 { |
|
762 iLastMtUssdIsRequest = SS_GSM_USSD_REQUEST == ussdType; |
|
763 TFLOGSTRING2("TSY: CMmUssdMessHandler::SsGsmUssdSendReq; iLastMtUssdIsRequest = %d", iLastMtUssdIsRequest); |
|
764 OstTrace1( TRACE_NORMAL, DUP3_CMMUSSDMESSHANDLER_SSGSMUSSDRECEIVEIND, "CMmUssdMessHandler::SsGsmUssdReceiveInd;iLastMtUssdIsRequest=%d", iLastMtUssdIsRequest ); |
742 receiveUssdMessageAttributes.iType = |
765 receiveUssdMessageAttributes.iType = |
743 RMobileUssdMessaging::EUssdMTRequest; |
766 RMobileUssdMessaging::EUssdMTRequest; |
744 break; |
767 break; |
745 } |
768 } |
746 // Set USSD message type to EUssdMTReply if ussdType is . |
769 // Set USSD message type to EUssdMTReply if ussdType is . |