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