376 ) |
376 ) |
377 { |
377 { |
378 OstTrace0( TRACE_NORMAL, CSATMOSMSCTRL_SMSRESOURCEINDRECEIVED, "CSatMoSmsCtrl::SmsResourceIndReceived" ); |
378 OstTrace0( TRACE_NORMAL, CSATMOSMSCTRL_SMSRESOURCEINDRECEIVED, "CSatMoSmsCtrl::SmsResourceIndReceived" ); |
379 TFLOGSTRING("TSY:CSatMoSmsCtrl::SmsResourceIndReceived"); |
379 TFLOGSTRING("TSY:CSatMoSmsCtrl::SmsResourceIndReceived"); |
380 |
380 |
381 TBuf8<256> addressData1; |
381 TUint sbOffset; |
382 TBuf8<256> addressData2; |
|
383 |
382 |
384 // Save the transaction id, which is going to |
383 // Save the transaction id, which is going to |
385 // be re-used in the resp. |
384 // be re-used in the resp. |
386 iMoSmsCtrlReqTransactionId = aIsiMessage.Get8bit( ISI_HEADER_OFFSET_TRANSID ); |
385 iMoSmsCtrlReqTransactionId = aIsiMessage.Get8bit( ISI_HEADER_OFFSET_TRANSID ); |
387 |
386 |
388 // Save the sender object id, in order to re-use it |
387 // Save the sender object id, in order to re-use it |
389 // in the response to this request |
388 // in the response to this request |
390 iSenderObject = aIsiMessage.Get8bit( ISI_HEADER_OFFSET_SENDEROBJECT ); |
389 iSenderObject = aIsiMessage.Get8bit( ISI_HEADER_OFFSET_SENDEROBJECT ); |
391 |
390 |
392 // Save Sequence id to send it in request message |
391 // Save Sequence id to send it in request message |
393 iSequenceId = aIsiMessage.Get8bit( ISI_HEADER_SIZE+SIZE_SMS_RESOURCE_IND+ |
392 if ( KErrNotFound != aIsiMessage.FindSubBlockOffsetById( |
394 SIZE_SMS_SB_RESOURCE+SMS_SB_RESOURCE_SEQ_ID_OFFSET_SEQUENCEID ); |
393 ISI_HEADER_SIZE+SIZE_SMS_RESOURCE_IND, |
|
394 SMS_SB_RESOURCE_SEQ_ID, |
|
395 EIsiSubBlockTypeId16Len16, |
|
396 sbOffset ) ) |
|
397 { |
|
398 iSequenceId = aIsiMessage.Get8bit( |
|
399 sbOffset + SMS_SB_RESOURCE_SEQ_ID_OFFSET_SEQUENCEID ); |
|
400 } |
395 |
401 |
396 // save resource id to send it in request mesage |
402 // save resource id to send it in request mesage |
397 iResourceId = aIsiMessage.Get16bit( ISI_HEADER_SIZE+SIZE_SMS_RESOURCE_IND+ |
403 if ( KErrNotFound != aIsiMessage.FindSubBlockOffsetById( |
398 SMS_SB_RESOURCE_OFFSET_RESOURCES ); |
404 ISI_HEADER_SIZE+SIZE_SMS_RESOURCE_IND, |
399 |
405 SMS_SB_RESOURCE, |
400 |
406 EIsiSubBlockTypeId16Len16, |
401 // Save Service Centre Address Subblock to send it in request message if server has |
407 sbOffset ) ) |
402 //denied to access |
408 { |
403 iAddressSubblock = aIsiMessage.GetData( ISI_HEADER_SIZE+SIZE_SMS_RESOURCE_IND+SIZE_SMS_SB_RESOURCE+ |
409 iResourceId = aIsiMessage.Get16bit( |
404 SIZE_SMS_SB_RESOURCE_SEQ_ID+SMS_SB_ADDRESS_OFFSET_ADDRESSDATA , |
410 sbOffset + SMS_SB_RESOURCE_OFFSET_RESOURCES ); |
405 aIsiMessage.Get8bit(ISI_HEADER_SIZE+SIZE_SMS_RESOURCE_IND+SIZE_SMS_SB_RESOURCE+SIZE_SMS_SB_RESOURCE_SEQ_ID+ |
411 } |
406 SMS_SB_ADDRESS_OFFSET_ADDRESSDATALENGTH) ); |
412 |
407 |
413 // Save Service Centre Address Subblock to send it in request message if server has |
408 // Calculate Address Subblock length |
414 //denied to access |
409 TUint8 addrSbLen = aIsiMessage.Get16bit( ISI_HEADER_SIZE+SIZE_SMS_RESOURCE_IND+SIZE_SMS_SB_RESOURCE+SIZE_SMS_SB_RESOURCE_SEQ_ID+ |
415 if ( KErrNotFound != aIsiMessage.FindSubBlockOffsetById( |
410 SMS_SB_ADDRESS_OFFSET_SUBBLOCKLENGTH ); |
416 ISI_HEADER_SIZE+SIZE_SMS_RESOURCE_IND, |
411 |
417 SMS_SB_ADDRESS, |
412 // Save Destination address TPDU to send it in request message if server has |
418 EIsiSubBlockTypeId16Len16, |
413 // Denied the access for that address |
419 sbOffset ) ) |
414 iUserDataSubblock = ( aIsiMessage.GetData( ISI_HEADER_SIZE+SIZE_SMS_RESOURCE_IND+SIZE_SMS_SB_RESOURCE+ |
420 { |
415 SIZE_SMS_SB_RESOURCE_SEQ_ID+addrSbLen+ |
421 TUint8 addressLength = aIsiMessage.Get8bit( |
416 SMS_SB_TPDU_OFFSET_DATABYTES, |
422 sbOffset + SMS_SB_ADDRESS_OFFSET_ADDRESSDATALENGTH ); |
417 aIsiMessage.Get8bit( ISI_HEADER_SIZE+SIZE_SMS_RESOURCE_IND+SIZE_SMS_SB_RESOURCE+ |
423 iAddressSubblock = aIsiMessage.GetData( |
418 SIZE_SMS_SB_RESOURCE_SEQ_ID+addrSbLen+SMS_SB_TPDU_OFFSET_DATALENGTH ))); |
424 sbOffset + SMS_SB_ADDRESS_OFFSET_ADDRESSDATA, |
419 |
425 addressLength ); |
|
426 } |
|
427 else |
|
428 { |
|
429 iAddressSubblock.Zero(); |
|
430 } |
|
431 |
|
432 // Save TPDU to send it in request message if server has |
|
433 // Denied the access for that address |
|
434 if ( KErrNotFound != aIsiMessage.FindSubBlockOffsetById( |
|
435 ISI_HEADER_SIZE+SIZE_SMS_RESOURCE_IND, |
|
436 SMS_SB_TPDU, |
|
437 EIsiSubBlockTypeId16Len16, |
|
438 sbOffset ) ) |
|
439 { |
|
440 TUint8 tpduLength = |
|
441 aIsiMessage.Get8bit( sbOffset + SMS_SB_TPDU_OFFSET_DATALENGTH ); |
|
442 iUserDataSubblock = aIsiMessage.GetData( |
|
443 sbOffset + SMS_SB_TPDU_OFFSET_DATABYTES, |
|
444 tpduLength ); |
|
445 } |
|
446 else |
|
447 { |
|
448 iUserDataSubblock.Zero(); |
|
449 } |
420 |
450 |
421 //Check if location data is present. Otherwise response to SmsResourceInd |
451 //Check if location data is present. Otherwise response to SmsResourceInd |
422 //is always ALLOWED. |
452 //is always ALLOWED. |
423 if ( !iSatMessHandler->ServiceAvailable() ) |
453 if ( !iSatMessHandler->ServiceAvailable() ) |
424 { |
454 { |
502 } |
532 } |
503 else |
533 else |
504 { |
534 { |
505 if( iIsMoSmsCtrlActivated ) // Check is MO SMS is activated or not |
535 if( iIsMoSmsCtrlActivated ) // Check is MO SMS is activated or not |
506 { |
536 { |
507 TDes8* addressData = NULL; |
537 TPtrC8 addressData2; |
508 if(SMS_SB_ADDRESS == aIsiMessage.Get16bit( ISI_HEADER_SIZE+SIZE_SMS_RESOURCE_IND+SIZE_SMS_SB_RESOURCE+ |
538 |
509 SIZE_SMS_SB_RESOURCE_SEQ_ID+SMS_SB_ADDRESS_OFFSET_SUBBLOCKID )) |
539 if ( iUserDataSubblock.Length() ) |
510 { |
540 { |
511 addressData = &addressData1; |
|
512 |
|
513 TPtrC8 phoneNumber = aIsiMessage.GetData( ISI_HEADER_SIZE+SIZE_SMS_RESOURCE_IND+SIZE_SMS_SB_RESOURCE+ |
|
514 SIZE_SMS_SB_RESOURCE_SEQ_ID+SMS_SB_ADDRESS_OFFSET_ADDRESSDATA, |
|
515 aIsiMessage.Get8bit( ISI_HEADER_SIZE+SIZE_SMS_RESOURCE_IND+SIZE_SMS_SB_RESOURCE+ |
|
516 SIZE_SMS_SB_RESOURCE_SEQ_ID+SMS_SB_ADDRESS_OFFSET_ADDRESSDATALENGTH ) ); |
|
517 |
|
518 addressData->Append( phoneNumber.Mid( 0, phoneNumber.Length()) ); |
|
519 |
|
520 } |
|
521 if(SMS_SB_TPDU == aIsiMessage.Get16bit( ISI_HEADER_SIZE+SIZE_SMS_RESOURCE_IND+SIZE_SMS_SB_RESOURCE |
|
522 +SIZE_SMS_SB_RESOURCE_SEQ_ID+addrSbLen+SMS_SB_TPDU_OFFSET_SUBBLOCKID )) |
|
523 { |
|
524 addressData =&addressData2; |
|
525 |
|
526 // check for message type |
541 // check for message type |
527 // Whether its a command type message or Submit type |
542 // Whether its a command type message or Submit type |
528 |
|
529 if(KSmsCommandType == ( iUserDataSubblock[0]& 0x03 )) |
543 if(KSmsCommandType == ( iUserDataSubblock[0]& 0x03 )) |
530 { |
544 { |
531 iMessageType = KSmsCommandType; |
545 iMessageType = KSmsCommandType; |
532 TPtrC8 phoneNumber = &iUserDataSubblock[5]; |
546 TPtrC8 phoneNumber = &iUserDataSubblock[5]; |
533 |
|
534 // Addition of two for Type of number semi octet |
547 // Addition of two for Type of number semi octet |
535 addressData->Append( phoneNumber.Mid( 1, (iUserDataSubblock[5]/2)+1 )); |
548 addressData2.Set( |
|
549 phoneNumber.Mid( 1, (iUserDataSubblock[5]/2)+1 ) ); |
536 } |
550 } |
537 else if( KSmsSubmitType == ( iUserDataSubblock[0] & 0x03 )) |
551 else if( KSmsSubmitType == ( iUserDataSubblock[0] & 0x03 ) ) |
538 { |
552 { |
539 iMessageType = KSmsSubmitType; |
553 iMessageType = KSmsSubmitType; |
540 TPtrC8 phoneNumber = &iUserDataSubblock[2]; |
554 TPtrC8 phoneNumber = &iUserDataSubblock[2]; |
541 // Addition of two for Type of number semi octet |
555 // Addition of two for Type of number semi octet |
542 addressData->Append( phoneNumber.Mid( 1, (iUserDataSubblock[2]/2)+1 )); |
556 addressData2.Set( |
|
557 phoneNumber.Mid( 1, (iUserDataSubblock[2]/2)+1 ) ); |
543 } |
558 } |
544 } |
559 } |
545 // Dialled Number String, the length has to be removed (first byte) |
560 // Dialled Number String, the length has to be removed (first byte) |
546 |
561 |
547 iMoSmsCtrlEnvelopeTransactionId = iSatMessaging->GetTransactionId(); |
562 iMoSmsCtrlEnvelopeTransactionId = iSatMessaging->GetTransactionId(); |
548 |
563 |
549 TFLOGSTRING("TSY:CSatMoSmsCtrl::SmsResourceIndReceived, Send envelope"); |
564 TFLOGSTRING("TSY:CSatMoSmsCtrl::SmsResourceIndReceived, Send envelope"); |
550 OstTrace0( TRACE_NORMAL, DUP3_CSATMOSMSCTRL_SMSRESOURCEINDRECEIVED, "CSatMoSmsCtrl::SmsResourceIndReceived, Send envelope" ); |
565 OstTrace0( TRACE_NORMAL, DUP3_CSATMOSMSCTRL_SMSRESOURCEINDRECEIVED, "CSatMoSmsCtrl::SmsResourceIndReceived, Send envelope" ); |
551 |
566 |
552 // The envelope is sent if MO SMS is activated |
567 // The envelope is sent if MO SMS is activated |
553 SendMoSmsCtrlEnvelope( |
568 SendMoSmsCtrlEnvelope( |
554 iMoSmsCtrlEnvelopeTransactionId, |
569 iMoSmsCtrlEnvelopeTransactionId, |
555 addressData1, |
570 iAddressSubblock, |
556 addressData2 |
571 addressData2 |
557 ); |
572 ); |
558 } |
573 } |
559 else // If MO SMS is not activated |
574 else // If MO SMS is not activated |
560 { |
575 { |
561 TBuf8<KMaxLengthOfResourceReq> dataResp; |
576 TBuf8<KMaxLengthOfResourceReq> dataResp; |
562 TIsiSend resourceReq( dataResp ); |
577 TIsiSend resourceReq( dataResp ); |
563 |
578 |