telephonyserverplugins/simtsy/test/Te_SimSms/Te_SimSmsUtil.cpp
changeset 0 3553901f7fa8
child 24 6638e7f4bd8f
equal deleted inserted replaced
-1:000000000000 0:3553901f7fa8
       
     1 // Copyright (c) 1997-2009 Nokia Corporation and/or its subsidiary(-ies).
       
     2 // All rights reserved.
       
     3 // This component and the accompanying materials are made available
       
     4 // under the terms of "Eclipse Public License v1.0"
       
     5 // which accompanies this distribution, and is available
       
     6 // at the URL "http://www.eclipse.org/legal/epl-v10.html".
       
     7 //
       
     8 // Initial Contributors:
       
     9 // Nokia Corporation - initial contribution.
       
    10 //
       
    11 // Contributors:
       
    12 //
       
    13 // Description:
       
    14 //
       
    15 
       
    16 #include <etelmm.h> // for RMobilePhone::TMobileAddress
       
    17 #include "Te_SimSmsUtil.h"
       
    18 #include "Te_SimSmsPanic.h"
       
    19 
       
    20 //
       
    21 // Currently this file can not include the matstd file due to a dependency that
       
    22 // the test code t_sms has on this. So the constants needed are duplicated below.
       
    23 _LIT8(KMEStorage,"ME");
       
    24 _LIT8(KMTStorage,"MT");
       
    25 _LIT8(KSMStorage,"SM");
       
    26 
       
    27 //
       
    28 // Panic Function
       
    29 //
       
    30 GLDEF_C void Panic(TTSYPanic aPanicNumber)
       
    31 	{
       
    32 	_LIT(panicText,"MM TSY");
       
    33 	User::Panic(panicText,aPanicNumber);
       
    34 	}
       
    35 
       
    36 RMobilePhone::TMobileTON CATSmsUtils::ConvertTypeOfNumber(TInt aValue) 
       
    37 /**
       
    38  * @param aValue should be an ETSI Type-Of-Number field
       
    39  * @return The equivalent RMobilePhone::TMobileTON value for aValue
       
    40  */
       
    41 	{
       
    42 	switch(aValue)
       
    43 		{
       
    44 		// The below 'magic numbers' come from the ETSI 03.40
       
    45 		// specification for Address Fields (section 9.1.2.5)
       
    46 	case 0:		
       
    47 		return RMobilePhone::EUnknownNumber;
       
    48 	case 1:		
       
    49 		return RMobilePhone::EInternationalNumber;
       
    50 	case 2:
       
    51 		return RMobilePhone::ENationalNumber;
       
    52 	case 3:
       
    53 		return RMobilePhone::ENetworkSpecificNumber;
       
    54 	case 4:
       
    55 		return RMobilePhone::ESubscriberNumber;
       
    56 	default:
       
    57 		return RMobilePhone::EUnknownNumber;
       
    58 		}
       
    59 	
       
    60 	}
       
    61 
       
    62 TInt CATSmsUtils::ConvertTypeOfNumber(RMobilePhone::TMobileTON aEnum) 
       
    63 /**
       
    64  * @param aEnum must be a n RMobile::TMobileTON value 
       
    65  * @return The equivalent ETSI Type-Of-Number value for aEnum
       
    66  */
       
    67 	{
       
    68 	switch(aEnum)
       
    69 		{
       
    70 		// The below 'magic numbers' come from the ETSI 03.40
       
    71 		// specification for Address Fields (section 9.1.2.5)
       
    72 	case RMobilePhone::EInternationalNumber:
       
    73 		return 1;
       
    74 	case RMobilePhone::ENationalNumber:
       
    75 		return 2;
       
    76 	case RMobilePhone::ENetworkSpecificNumber:
       
    77 		return 3;
       
    78 	case RMobilePhone::ESubscriberNumber:
       
    79 		return 4;
       
    80 	case RMobilePhone::EUnknownNumber:
       
    81 	case RMobilePhone::EAbbreviatedNumber:
       
    82 	default:
       
    83 		return 0;
       
    84 		}
       
    85 	}
       
    86 
       
    87 RMobilePhone::TMobileNPI CATSmsUtils::ConvertNumberingPlan(TInt aValue)
       
    88 /**
       
    89  * @param aValue should be an ETSI Numbering-Plan-Identification field
       
    90  * @return The equivalent RMobilePhone::TMobileNPI value for aValue
       
    91  */
       
    92 	{
       
    93 	switch(aValue)
       
    94 		{
       
    95 		// The below 'magic numbers' come from the ETSI 03.40
       
    96 		// specification for Address Fields (section 9.1.2.5)
       
    97 	case 1:
       
    98 		return RMobilePhone::EIsdnNumberPlan;
       
    99 	case 3:
       
   100 		return RMobilePhone::EDataNumberPlan;
       
   101 	case 4:
       
   102 		return RMobilePhone::ETelexNumberPlan;
       
   103 	case 8:
       
   104 		return RMobilePhone::ENationalNumberPlan;
       
   105 	case 9:
       
   106 		return RMobilePhone::EPrivateNumberPlan;
       
   107 	default:
       
   108 		return RMobilePhone::EUnknownNumberingPlan;
       
   109 		}
       
   110 	}
       
   111 
       
   112 
       
   113 TInt CATSmsUtils::ConvertNumberingPlan(RMobilePhone::TMobileNPI aEnum)  
       
   114 /**
       
   115  * @param aEnum must be a n RMobile::TMobileNPI value 
       
   116  * @return The equivalent ETSI Numbering-Plan-Identification value for aEnum
       
   117  */
       
   118 	{
       
   119 	switch(aEnum)
       
   120 		{
       
   121 		// The below 'magic numbers' come from the ETSI 03.40
       
   122 		// specification for Address Fields (section 9.1.2.5)
       
   123 	case RMobilePhone::EIsdnNumberPlan:
       
   124 		return 1;
       
   125 	case RMobilePhone::EDataNumberPlan:
       
   126 		return 3;
       
   127 	case RMobilePhone::ETelexNumberPlan:
       
   128 		return 4;
       
   129 	case RMobilePhone::ENationalNumberPlan:
       
   130 		return 8;
       
   131 	case RMobilePhone::EPrivateNumberPlan:
       
   132 		return 9;
       
   133 	case RMobilePhone::EUnknownNumberingPlan:
       
   134 	default:
       
   135 		return 0;
       
   136 		}
       
   137 	}
       
   138 
       
   139 
       
   140 
       
   141 TInt CATSmsUtils::AppendAddressToAscii(TDes8& aAscii,const RMobilePhone::TMobileAddress& aAddress,TBool aUse0340Format)
       
   142 /**
       
   143  * Default operation is to code Address-Length according to=
       
   144  * 04.11 spec (ie. Address-Length=number of digits in Address-Value).
       
   145  *
       
   146  * If aUse0340Format argument is ETrue then Address Length will be coded using 
       
   147  * 03.40 format (ie. Address-Length=number of octets used for Address-Type
       
   148  * and Address-Value). 03.40 is typically only used when prefixing an SCA to a PDU.
       
   149  *
       
   150  * @return Standard KErr... values
       
   151  */
       
   152 	{
       
   153 	// Duplicate tel number, removing all the weird chars
       
   154 	TBuf<RMobilePhone::KMaxMobileTelNumberSize> telNumber;
       
   155 	const TInt count(aAddress.iTelNumber.Length());
       
   156 	TInt i;
       
   157 	for(i=0;i<count;++i)
       
   158 		{
       
   159 		if(IsAddressChar(TChar(aAddress.iTelNumber[i])))
       
   160 			telNumber.Append(aAddress.iTelNumber[i]);
       
   161 		}
       
   162 
       
   163 	const TInt telNumberLength(telNumber.Length());
       
   164 
       
   165 	// Validate the size of the supplied SCA
       
   166 
       
   167 	// Calculate the number of ascii chars we'll need
       
   168 	// We need 4 chars to code the Address-Length and Address-Type fields.
       
   169 	// We need to add on an extra 'padding' char if the total number of chars is odd.
       
   170 	const TInt neededAsciiChars=(4+telNumberLength)+(telNumberLength%2);
       
   171 	if((aAscii.MaxLength()-aAscii.Length())<neededAsciiChars)	
       
   172 		return KErrOverflow;
       
   173 
       
   174 	// Code Address-Length
       
   175 	if(aUse0340Format)
       
   176 		AppendOctet(1+(telNumberLength/2)+(telNumberLength%2),aAscii);
       
   177 	else
       
   178 		AppendOctet(telNumberLength,aAscii);
       
   179 
       
   180 	// Code Type-Of-Address
       
   181 	TInt typeOfNumber=ConvertTypeOfNumber(aAddress.iTypeOfNumber);
       
   182 	TInt numberingPlan=ConvertNumberingPlan(aAddress.iNumberPlan);
       
   183 	AppendOctet(0x80+(typeOfNumber<<4)+(numberingPlan),aAscii);
       
   184 
       
   185 	// Code Address-Value
       
   186 	TInt highSemiOctet;
       
   187 	TInt lowSemiOctet;
       
   188 	const TInt octets(telNumberLength/2);	// This division will be rounded down
       
   189 	for(i=0;i<octets;++i)
       
   190 		{
       
   191 		// See ETSI 03.40 section 9.1.2.3
       
   192 		// Address digits are coded into octets as pairs.
       
   193 		lowSemiOctet=ConvertAddressChar(TChar(telNumber[i*2]));
       
   194 		highSemiOctet=ConvertAddressChar(TChar(telNumber[(i*2)+1]));
       
   195 		AppendOctet((highSemiOctet<<4)+lowSemiOctet,aAscii);
       
   196 		}
       
   197 				
       
   198 	// If number of semi octects is odd then process the final octet
       
   199 	if(telNumberLength%2==1)		
       
   200 		{
       
   201 		lowSemiOctet=ConvertAddressChar(TChar(telNumber[telNumberLength-1]));
       
   202 		AppendOctet(0xf0+lowSemiOctet,aAscii);
       
   203 		}
       
   204 				
       
   205 	__ASSERT_DEBUG(aAscii.Length()%2==0,Panic(EATSmsUtilsOddNumberOfSemiOctets));
       
   206 	return KErrNone;
       
   207 	}
       
   208 
       
   209 
       
   210 void CATSmsUtils::AppendOctet(TInt aOctet,TDes8& aAscii)
       
   211 /**
       
   212  * Converts a TInt octet value into ASCII representation and then appends that
       
   213  * ASCII representation to the end of the given ASCII string.
       
   214  *
       
   215  * @param aOctet the octet value to append
       
   216  * @param aAscii the ASCII string to which aOctet value should be appended
       
   217  */
       
   218 	{
       
   219 	// Ensure client has only passed us a octet (ie. low 8 bits only)
       
   220 	aOctet=aOctet&0xff;
       
   221 
       
   222 	// Append octet 
       
   223 	// (prefix '0' if the octets value only uses one digit as final octet coding must use two digits)
       
   224 	if(aOctet<=0x0f)
       
   225 		aAscii.Append(TChar('0'));
       
   226 	aAscii.AppendNum(aOctet,EHex);
       
   227 	}
       
   228 
       
   229 
       
   230 TInt CATSmsUtils::ConvertAddressChar(TChar aChar)
       
   231 /**
       
   232  * Returns the equivalent numeric value for a given ASCII address character.
       
   233  *
       
   234  * @param aChar the address character to be converted
       
   235  * @return The numeric value equivalent of the given address character.
       
   236  */
       
   237  	{
       
   238 	aChar.LowerCase();
       
   239 	if(aChar-TChar('0')<=9)  
       
   240 		return aChar-TChar('0');		// Assumes digit characters are one after each other
       
   241 	else if(aChar==TChar('*'))
       
   242 		return 10;
       
   243 	else if(aChar==TChar('#'))
       
   244 		return 11;
       
   245 	else if(aChar==TChar('a'))
       
   246 		return 12;
       
   247 	else if(aChar==TChar('b'))
       
   248 		return 13;
       
   249 	else if(aChar==TChar('c'))
       
   250 		return 14;
       
   251 	return 15;
       
   252 	}
       
   253 			
       
   254 TChar CATSmsUtils::ConvertAddressChar(TInt aBinary)
       
   255 /**
       
   256  * Returns the equivalent ASCII address character for a given address value.
       
   257  *
       
   258  * @param aBinary the numerix value of the address character to be returned
       
   259  * @return The ASCII charcater which represents the given address numeric value.
       
   260  */
       
   261 	{
       
   262 	if(aBinary>=0 && aBinary<=9)
       
   263 		return TChar(aBinary)+TChar('0');  	// Assumes digit characters are one after each other
       
   264 	else if(aBinary==10)
       
   265 		return TChar('*');
       
   266 	else if(aBinary==11)
       
   267 		return TChar('#');
       
   268 	else if(aBinary==12)
       
   269 		return TChar('a');
       
   270 	else if(aBinary==13)
       
   271 		return TChar('b');
       
   272 	else if(aBinary==14)
       
   273 		return TChar('c');
       
   274 	return TChar(0);		// This is the cloest I can find to a NULL char 
       
   275 	}
       
   276 
       
   277 
       
   278 
       
   279 TBool CATSmsUtils::IsAddressChar(TChar aChar)
       
   280 /**
       
   281  * Returns ETrue if, and only if, the given ASCII charcater is valid as an ASCII address character.
       
   282  */
       
   283  	{
       
   284 	if(aChar.IsDigit())
       
   285 		return ETrue;
       
   286 	if(aChar==TChar('*') ||
       
   287 	   aChar==TChar('#') ||
       
   288 	   aChar==TChar('a') ||
       
   289 	   aChar==TChar('b') ||
       
   290 	   aChar==TChar('c'))
       
   291 		return ETrue;
       
   292 	return EFalse;
       
   293 	}
       
   294 
       
   295 
       
   296 void CATSmsUtils::AppendDataToAscii(TDes8& aAscii,const TDesC8& aData)
       
   297 /**
       
   298  * Appends the binary data (aData) onto the end of an ASCII string (aAscii) in ASCII format.
       
   299  */
       
   300  	{
       
   301 	const TInt count(aData.Length());
       
   302 	__ASSERT_DEBUG((aAscii.MaxLength()-aAscii.MaxLength())<=(count*2),Panic(EATSmsUtilsDescriptorOverflow));
       
   303 
       
   304 	for(TInt i=0;i<count;++i)
       
   305 		AppendOctet(aData[i],aAscii);
       
   306 
       
   307 	__ASSERT_DEBUG(aAscii.Length()%2==0,Panic(EATSmsUtilsOddNumberOfSemiOctets));
       
   308 	}
       
   309 
       
   310 
       
   311 
       
   312 TInt CATSmsUtils::ConvertAsciiToBinary(const TDesC8& aAscii,TDes8& aData)
       
   313 /**
       
   314  * Converts aAscii ASCII chars to Semi Octets in aData.
       
   315  * One ASCII char (8bits in aAscii) is translated to one Semi-Octet (4bits in aData).
       
   316  * @return Standard KErr... values 
       
   317  */
       
   318 	{
       
   319 	__ASSERT_DEBUG(aAscii.Length()%2==0,Panic(EATSmsUtilsOddNumberOfSemiOctets));
       
   320 	__ASSERT_DEBUG(aData.MaxLength()>=(aAscii.Length()/2),Panic(EATSmsUtilsDescriptorOverflow));
       
   321 
       
   322 	aData.Zero();
       
   323 	TLex8 lex;
       
   324 	TUint8 val;
       
   325 	TInt ret;
       
   326 	const TInt count(aAscii.Length());
       
   327 	for(TInt i=0;i<count;i=i+2)
       
   328 		{
       
   329 		lex=aAscii.Mid(i,2);
       
   330 		ret=lex.Val(val,EHex);
       
   331 		if(ret!=KErrNone)
       
   332 			return ret;
       
   333 
       
   334 		aData.Append(val);
       
   335 		}
       
   336 		
       
   337 	return KErrNone;
       
   338 	}
       
   339 
       
   340 
       
   341 TInt CATSmsUtils::ReadAddressFromAscii(const TDesC8& aAscii,RMobilePhone::TMobileAddress& aAddress,TBool aPduUses0340Format)
       
   342 /**
       
   343  * Default operation assumes has prefixed SCA which uses 04.11 format
       
   344  * (ie. Address-Length=number of digits in Address-Value).
       
   345  *
       
   346  * If aUse0340Format argument is ETrue then Address Length will be coded using 
       
   347  * 03.40 format (ie. Address-Length=number of octets used for Address-Type
       
   348  * and Address-Value). 03.40 is typically only used when prefixing an SCA to a PDU.
       
   349  *
       
   350  * @return Standard KErr... values
       
   351  */
       
   352 	{
       
   353 	TLex8 lex;
       
   354 	TInt ret;
       
   355 	TUint8 val;
       
   356 
       
   357 	// Address-length
       
   358 	lex=aAscii.Mid(0,2);
       
   359 	ret=lex.Val(val,EHex);
       
   360 	if(ret!=KErrNone)
       
   361 		return ret;
       
   362 	
       
   363 	TInt addrLen;	// Will hold number of octets used to code Address-Value
       
   364 	if(aPduUses0340Format)
       
   365 		addrLen=val-1;
       
   366 	else
       
   367 		addrLen=(val/2)+(val%2);
       
   368 
       
   369 	// Type-Of-Number
       
   370 	lex=aAscii.Mid(2,1);
       
   371 	ret=lex.Val(val,EHex);
       
   372 	if(ret!=KErrNone)
       
   373 		return ret;
       
   374 	aAddress.iTypeOfNumber=ConvertTypeOfNumber(val&0x07);	// Highest bit is not part of Type-Of-Number
       
   375 
       
   376 	// Number-Plan
       
   377 	lex=aAscii.Mid(3,1);
       
   378 	ret=lex.Val(val,EHex);
       
   379 	if(ret!=KErrNone)
       
   380 		return ret;
       
   381 	aAddress.iNumberPlan=ConvertNumberingPlan(val);
       
   382 	
       
   383 	// Address (loop for each octet ie. two hex chars from aAscii)
       
   384 	aAddress.iTelNumber.Zero();
       
   385 	for(TInt i=0;i<addrLen;++i)		
       
   386 		{
       
   387 		// Process semi-octet
       
   388 		lex=aAscii.Mid((i*2)+5,1);
       
   389 		ret=lex.Val(val,EHex);
       
   390 		if(ret!=KErrNone)
       
   391 			return ret;
       
   392 		if(val<=14)
       
   393 			aAddress.iTelNumber.Append(ConvertAddressChar(val));
       
   394 
       
   395 		// Process semi-octet
       
   396 		lex=aAscii.Mid((i*2)+4,1);
       
   397 		ret=lex.Val(val,EHex);
       
   398 		if(ret!=KErrNone)
       
   399 			return ret;
       
   400 		if(val<=14)
       
   401 			aAddress.iTelNumber.Append(ConvertAddressChar(val));
       
   402 		}
       
   403 
       
   404 	return KErrNone;
       
   405 	}
       
   406 	
       
   407 
       
   408 TInt CATSmsUtils::ReadAndRemoveAddressFromAscii(TDes8& aAscii,RMobilePhone::TMobileAddress& aAddress,TBool aPduUses0340Format)
       
   409 /**
       
   410  * Reads an address from the front of the ASCII string (aAscii) and fills up Address structure (aAddress).
       
   411  * The address read from the ASCII string is removed from the ASCII string.
       
   412  */
       
   413 	{
       
   414 	__ASSERT_DEBUG(aAscii.Length()%2==0,Panic(EATSmsUtilsOddNumberOfSemiOctets));
       
   415 	TInt ret(KErrNone);
       
   416 
       
   417 	ret=ReadAddressFromAscii(aAscii,aAddress,aPduUses0340Format);
       
   418 	if(ret==KErrNone)
       
   419 		{
       
   420 		// Delete address from aAscii (using Address-length at start of string)
       
   421 		TLex8 lex(aAscii.Mid(0,2));
       
   422 		TUint val;
       
   423 		ret=lex.Val(val,EHex);
       
   424 		if(ret==KErrNone)
       
   425 			{
       
   426 			if(aPduUses0340Format)
       
   427 				{
       
   428 				// +1 to include Address-Length octect
       
   429 				val=val+1;		
       
   430 				
       
   431 				// double value to change from 'octets used' to 'ASCII chars used'
       
   432 				val=val*2;
       
   433 				}
       
   434 			else	
       
   435 				{
       
   436 				// Allow for the case where the last digit is actually a dummy digit
       
   437 				if(val%2!=0)
       
   438 					++val;
       
   439 				// +4 to include the Address-Length and Address-Type octets
       
   440 				val=val+4; 
       
   441 				}
       
   442 
       
   443 			aAscii.Delete(0,val);		
       
   444 			__ASSERT_DEBUG(aAscii.Length()%2==0,Panic(EATSmsUtilsOddNumberOfSemiOctets));
       
   445 			}
       
   446 		}
       
   447 			
       
   448 	return ret;
       
   449 	}
       
   450 
       
   451 
       
   452 TInt CATSmsUtils::CopyAddressStringToAddressStruct(const TDesC8& aAddressValueString,const TDesC8& aAddressTypeString,RMobilePhone::TMobileAddress& aAddress)
       
   453 /**
       
   454  * Analyse rx results for a CSCA response and attempt to parse into provided tel
       
   455  * number object
       
   456  * An example CSCA response would be '+CSCA: "00447785016005",129'.
       
   457  */
       
   458 	{
       
   459 	// Process Address-Type
       
   460 	TLex8 lex(aAddressTypeString);
       
   461 	TUint8 val;
       
   462 	TInt ret=lex.Val(val,EDecimal);
       
   463 	if(ret!=KErrNone)
       
   464 		return ret;
       
   465 	
       
   466 	aAddress.iTypeOfNumber=ConvertTypeOfNumber((TInt)((val&0x70)>>4));
       
   467 	aAddress.iNumberPlan=ConvertNumberingPlan((TInt)(val&0x0f));
       
   468 	
       
   469 	// Process Address-Value, filtering out non telephone chars
       
   470 	aAddress.iTelNumber.Zero();
       
   471 	const TInt len=aAddressValueString.Length();
       
   472 	TChar c;
       
   473 	for(TInt i=0;i<len;++i)
       
   474 		{
       
   475 		c=aAddressValueString[i];
       
   476 		if(IsAddressChar(c))
       
   477 			aAddress.iTelNumber.Append(c);
       
   478 		}
       
   479 			
       
   480 	return KErrNone;
       
   481 	}
       
   482 
       
   483 
       
   484 void CATSmsUtils::GetTypeOfAddressInDecimal(const RMobilePhone::TMobileAddress& aAddress, TUint& aVal)
       
   485 /**
       
   486  * Reads the type-of-number and numbering-plan contents of the address structure (aAddress) and
       
   487  * saves the equivalent decimal value in aVal.
       
   488  *
       
   489  * For example...
       
   490  *  if type-of-number is 'international' and numbering-plan is 'telephone' then aVal will be 145.
       
   491  *  if type-of-number is 'unknown' and numbering-plan is 'telephone' then aVal will be 129.
       
   492  */
       
   493  	{
       
   494 	const TInt typeOfNumber=ConvertTypeOfNumber(aAddress.iTypeOfNumber);
       
   495 	const TInt numberingPlan=ConvertNumberingPlan(aAddress.iNumberPlan);
       
   496 	aVal=0x80+(typeOfNumber<<4)+numberingPlan;
       
   497 	}
       
   498 
       
   499 
       
   500 void CATSmsUtils::SetTypeOfAddressFromDecimal(RMobilePhone::TMobileAddress& aAddress,const TUint& aVal)
       
   501 /**
       
   502  * Uses the aVal decimal value and set the type-of-number and numbering-plan fields
       
   503  * of aAddress accordingly.
       
   504  * This is the opposite functionality to ::GetTypeOfAddressInDecimal
       
   505  */
       
   506 	{
       
   507 	aAddress.iTypeOfNumber=ConvertTypeOfNumber((aVal&0x70)>>4);
       
   508 	aAddress.iNumberPlan=ConvertNumberingPlan(aVal&0x0f);
       
   509 	}
       
   510 
       
   511 
       
   512 
       
   513 void CATSmsUtils::ConvertStoreNameToPhoneVersion(const TDesC& aEtelMMVersion,TDes8& aPhoneVersion)
       
   514 /**
       
   515  * Convert from Etel MultiMode API SMS store names to ETSI GSM store names
       
   516  */
       
   517  	{
       
   518 	if(aEtelMMVersion.Compare(KETelMeSmsStore)==0)
       
   519 		{
       
   520 		aPhoneVersion.Copy(KMEStorage);
       
   521 		return;
       
   522 		}
       
   523 	if(aEtelMMVersion.Compare(KETelIccSmsStore)==0)
       
   524 		{
       
   525 		aPhoneVersion.Copy(KSMStorage);
       
   526 		return;
       
   527 		}
       
   528 	if(aEtelMMVersion.Compare(KETelCombinedSmsStore)==0)
       
   529 		{
       
   530 		aPhoneVersion.Copy(KMTStorage);
       
   531 		return;
       
   532 		}
       
   533 
       
   534 	// Panic if we are in debug build
       
   535 	__ASSERT_DEBUG(EFalse,Panic(EATSmsUtilsUnknownStoreName));
       
   536 
       
   537 	// Return the combined store if we are in release build
       
   538 	aPhoneVersion.Copy(KMTStorage);
       
   539 	}
       
   540 
       
   541 
       
   542 void CATSmsUtils::ConvertStoreNameToEtelMMVersion(TDes& aEtelMMVersion,const TDesC8& aPhoneVersion)
       
   543 /**
       
   544  * Convert from ETSI GSM store names to Etel MultiMode API SMS store names
       
   545  */
       
   546 	{
       
   547 	if(aPhoneVersion.Compare(KMEStorage)==0)
       
   548 		{
       
   549 		aEtelMMVersion.Copy(KETelMeSmsStore);
       
   550 		return;
       
   551 		}
       
   552 	if(aPhoneVersion.Compare(KSMStorage)==0)
       
   553 		{
       
   554 		aEtelMMVersion.Copy(KETelIccSmsStore);
       
   555 		return;
       
   556 		}
       
   557 	if(aPhoneVersion.Compare(KMTStorage)==0)
       
   558 		{
       
   559 		aEtelMMVersion.Copy(KETelCombinedSmsStore);
       
   560 		return;
       
   561 		}
       
   562 
       
   563 	// Panic if we are in debug build
       
   564 	__ASSERT_DEBUG(EFalse,Panic(EATSmsUtilsUnknownStoreName));
       
   565 
       
   566 	// Return the combined store if we are in release build
       
   567 	aEtelMMVersion.Copy(KETelCombinedSmsStore);
       
   568 	}
       
   569