Public Types | Public Member Functions

Sms Class Reference

Wrapper class that includes SMS-specific properties and methods, such as P_BODY and GetTargetPrice. Instantiate SMS instances using Skype::CreateOutgoingSms; post SMS messages to a Conversation using Conversation::PostSMS. More...

#include <skype-embedded_2.h>

List of all members.

Public Types

enum  { MODULE_ID = 12 }
enum  PROPERTY {
  P_TYPE = 190,
  P_STATUS,
  P_FAILUREREASON,
  P_IS_FAILED_UNSEEN = 48,
  P_TIMESTAMP = 198,
  P_PRICE = 193,
  P_PRICE_PRECISION = 49,
  P_PRICE_CURRENCY = 194,
  P_REPLY_TO_NUMBER = 199,
  P_TARGET_NUMBERS = 195,
  P_TARGET_STATUSES,
  P_BODY,
  P_CHATMSG_ID = 840
}
enum  TYPE {
  OUTGOING = 2,
  CONFIRMATION_CODE_REQUEST,
  CONFIRMATION_CODE_SUBMIT
}
enum  STATUS {
  COMPOSING = 3,
  SENDING_TO_SERVER,
  SENT_TO_SERVER,
  DELIVERED,
  SOME_TARGETS_FAILED,
  FAILED
}
enum  FAILUREREASON {
  MISC_ERROR = 1,
  SERVER_CONNECT_FAILED,
  NO_SMS_CAPABILITY,
  INSUFFICIENT_FUNDS,
  INVALID_CONFIRMATION_CODE,
  USER_BLOCKED,
  IP_BLOCKED,
  NODE_BLOCKED,
  NO_SENDERID_CAPABILITY
}
enum  TARGETSTATUS {
  TARGET_ANALYZING = 1,
  TARGET_UNDEFINED,
  TARGET_ACCEPTABLE,
  TARGET_NOT_ROUTABLE,
  TARGET_DELIVERY_PENDING,
  TARGET_DELIVERY_SUCCESSFUL,
  TARGET_DELIVERY_FAILED
}
enum  SETBODYRESULT {
  BODY_INVALID = 0,
  BODY_TRUNCATED,
  BODY_OK,
  BODY_LASTCHAR_IGNORED
}
enum  CONFIRM_TYPE {
  ID_SMS = 1,
  ID_MOBILE,
  ID_SKYPEIN
}
typedef SmsRef Ref
typedef SmsRefs Refs

Public Member Functions

virtual ~Sms ()
SmsRef ref ()
bool GetTargetStatus (const Sid::String &target, TARGETSTATUS &status)
bool GetTargetPrice (const Sid::String &target, uint &price)
bool SetTargets (const Sid::List_String &numbers, bool &success)
bool SetBody (const Sid::String &text, SETBODYRESULT &result, Sid::List_String &chunks, uint &charsUntilNextChunk)
bool GetBodyChunks (Sid::List_String &textChunks, uint &charsUntilNextChunk)
bool GetPropType (TYPE &type)
bool GetPropStatus (STATUS &status)
bool GetPropFailurereason (FAILUREREASON &failurereason)
bool GetPropIsFailedUnseen (bool &is_failed_unseen)
bool GetPropTimestamp (uint &timestamp)
bool GetPropPrice (uint &price)
bool GetPropPricePrecision (uint &price_precision)
bool GetPropPriceCurrency (Sid::String &price_currency)
bool GetPropReplyToNumber (Sid::String &reply_to_number)
bool GetPropTargetNumbers (Sid::String &target_numbers)
bool GetPropTargetStatuses (Sid::Binary &target_statuses)
bool GetPropBody (Sid::String &body)
bool GetPropChatmsgId (MessageRef &chatmsg_id)

Detailed Description

Wrapper class that includes SMS-specific properties and methods, such as P_BODY and GetTargetPrice. Instantiate SMS instances using Skype::CreateOutgoingSms; post SMS messages to a Conversation using Conversation::PostSMS.



Each SMS can have multiple targets (normalized phone numbers). Note that in a Conversation context, every SMS instance has a corresponding Message instance. Once you've posted an SMS, you can retrieve its corresponding Message instance using Sms::GetPropChatmsgId. That Message instance's P_BODY_XML property contains the SMS message data, such as price, target phone number(s), failure codes, and so forth, which you can parsed out and display in the UI. To put it another way, the object chain goes like this:

 @n Conversation->Message->SMS  @n 



Note that SkypeKit SDK supports outgoing SMS messages only. SkypeKit clients, even when logged in with accounts that have SkypeIn numbers, cannot receive SMS messages.

Examples:

tutorial_13.cpp.

Definition at line 2225 of file skype-embedded_2.h.


Member Typedef Documentation

typedef SmsRef Sms::Ref

Definition at line 2234 of file skype-embedded_2.h.

typedef SmsRefs Sms::Refs

Definition at line 2235 of file skype-embedded_2.h.


Member Enumeration Documentation

anonymous enum
Enumerator:
MODULE_ID 

Definition at line 2236 of file skype-embedded_2.h.

Enumerator:
ID_SMS 

Confirm mobile number as SMS sender number

ID_MOBILE 

Confirm mobile number as CLI for SkypeOut calls

ID_SKYPEIN 

unused currently

Definition at line 2342 of file skype-embedded_2.h.

Enumerator:
MISC_ERROR 
SERVER_CONNECT_FAILED 
NO_SMS_CAPABILITY 
INSUFFICIENT_FUNDS 
INVALID_CONFIRMATION_CODE 
USER_BLOCKED 
IP_BLOCKED 
NODE_BLOCKED 
NO_SENDERID_CAPABILITY 

Definition at line 2281 of file skype-embedded_2.h.

Properties of the Sms class

Enumerator:
P_TYPE 

type: TYPE

P_STATUS 

type: STATUS

P_FAILUREREASON 

Set asynchronously and meaningful only after invoking Conversation::PostSMS and detecting Sms::STATUS of SOME_TARGETS_FAILED or FAILED.
, type: FAILUREREASON

P_IS_FAILED_UNSEEN 

set to 1 when status goes to FAILED. use MarkSeen() to clear, type: bool

P_TIMESTAMP 

unix timestamp of message submission, type: uint

P_PRICE 

The total price of sending this SMS message (sum of the individual prices to send to each recipient). Defaults to -1 on instantiation and incremented by the price for each recipient once that recipient's status reflects TARGET_ACCEPTABLE. Use Sms::GetTargetPrice to retrieve individual target prices.

A value of MAX_UINT indicates that SkypeKit is actively querying and/or updating the value. Note that P_PRICE is an integer value. Calculate the actual price (in units specified by P_PRICE_CURRENCY) using P_PRICE_PRECISION as:

 @n actualPrice = price / 10^pricePrecision;  @n 


, type: uint

P_PRICE_PRECISION 

The decimal precision of the SMS price values, both individual and total. For example, a value of 2 indicates that you should divide the price (represented as an integer) by 100 (10^2) to obtain the actual price.
, type: uint

P_PRICE_CURRENCY 

should be same as account currency at the time of composing/sending, type: Sid::String

P_REPLY_TO_NUMBER 

number that should receive the replies, type: Sid::String

P_TARGET_NUMBERS 

space-separated normalised pstn numbers, type: Sid::String

P_TARGET_STATUSES 

binary blob. track with OnPropertyChange(), access with GetTargetStatus(target), type: Sid::Binary

P_BODY 

actual payload, type: Sid::String

P_CHATMSG_ID 

reference to Message, type: MessageRef

Definition at line 2250 of file skype-embedded_2.h.

Enumerator:
BODY_INVALID 

body not set. message status wrong or invalid, or body not valid utf8 string

BODY_TRUNCATED 

body too long. set, but truncated. charsUntilNextChunk contains maxChunks value

BODY_OK 

body was set OK

BODY_LASTCHAR_IGNORED 

last unicode char was ignored, as some of the text would be deleted due to conversion

Definition at line 2315 of file skype-embedded_2.h.

Enumerator:
COMPOSING 
SENDING_TO_SERVER 
SENT_TO_SERVER 
DELIVERED 
SOME_TARGETS_FAILED 
FAILED 

Definition at line 2272 of file skype-embedded_2.h.

Enumerator:
TARGET_ANALYZING 
TARGET_UNDEFINED 
TARGET_ACCEPTABLE 
TARGET_NOT_ROUTABLE 
TARGET_DELIVERY_PENDING 
TARGET_DELIVERY_SUCCESSFUL 
TARGET_DELIVERY_FAILED 

Definition at line 2293 of file skype-embedded_2.h.

enum Sms::TYPE
Enumerator:
OUTGOING 

a normal outgoing SMS message

CONFIRMATION_CODE_REQUEST 

a message requesting a SMS confirmation code be sent to the number provided

CONFIRMATION_CODE_SUBMIT 

a message returning the SMS confirmation code received as a result of a CONFIRMATION_CODE_REQUEST to authorize it

Definition at line 2266 of file skype-embedded_2.h.


Constructor & Destructor Documentation

Sms::~Sms (  )  [virtual]

Definition at line 1116 of file skype-embedded_2.cpp.


Member Function Documentation

bool Sms::GetBodyChunks ( Sid::List_String &  textChunks,
uint &  charsUntilNextChunk 
)

Retrieves string list of SMS text chunks in first argument, while the second argument contains the number of available characters until creation of the next chunk becomes necessary.

Parameters:
textChunks List of text chunk strings
charsUntilNextChunk Number of available characters until creation of the next chunk becomes necessary.
bool Sms::GetPropBody ( Sid::String &  body  ) 

Sms::P_BODY property get accessor

bool Sms::GetPropChatmsgId ( MessageRef chatmsg_id  ) 

Sms::P_CHATMSG_ID property get accessor

bool Sms::GetPropFailurereason ( FAILUREREASON failurereason  ) 

Sms::P_FAILUREREASON property get accessor

bool Sms::GetPropIsFailedUnseen ( bool &  is_failed_unseen  ) 

Sms::P_IS_FAILED_UNSEEN property get accessor

bool Sms::GetPropPrice ( uint &  price  ) 

Sms::P_PRICE property get accessor

bool Sms::GetPropPriceCurrency ( Sid::String &  price_currency  ) 

Sms::P_PRICE_CURRENCY property get accessor

bool Sms::GetPropPricePrecision ( uint &  price_precision  ) 

Sms::P_PRICE_PRECISION property get accessor

bool Sms::GetPropReplyToNumber ( Sid::String &  reply_to_number  ) 

Sms::P_REPLY_TO_NUMBER property get accessor

bool Sms::GetPropStatus ( STATUS status  ) 

Sms::P_STATUS property get accessor

bool Sms::GetPropTargetNumbers ( Sid::String &  target_numbers  ) 

Sms::P_TARGET_NUMBERS property get accessor

bool Sms::GetPropTargetStatuses ( Sid::Binary &  target_statuses  ) 

Sms::P_TARGET_STATUSES property get accessor

bool Sms::GetPropTimestamp ( uint &  timestamp  ) 

Sms::P_TIMESTAMP property get accessor

bool Sms::GetPropType ( TYPE type  ) 

Sms::P_TYPE property get accessor

bool Sms::GetTargetPrice ( const Sid::String &  target,
uint &  price 
)

Retrieves the amount of Skype credit necessary to send the SMS to a particular recipient. Defaults to -1 on instantiation and set only when that recipient's status reflects TARGET_ACCEPTABLE. Use Sms::GetPropPrice to retrieve the total cost of this SMS.

Note that the target price is an integer value. Calculate the actual price (in units specified by P_PRICE_CURRENCY) using P_PRICE_PRECISION as:

 @n actualTargetPrice = targetPrice / 10^pricePrecision;  @n 


Parameters:
target The normalized phone number of the target recipient.
price The price of sending this SMS message to the target recipient.
bool Sms::GetTargetStatus ( const Sid::String &  target,
TARGETSTATUS status 
)

Retrieves the send status of this SMS to a particular recipient (P_TARGET_STATUSES) either prior to or after invoking Conversation::PostSMS.

Parameters:
target The normalized phone number of the target recipient.
status The send status of the target recipient, for example, TARGET_ANALYZING, TARGET_DELIVERY_PENDING, TARGET_DELIVERY_SUCCESSFUL, TARGET_DELIVERY_FAILED, and so forth. TARGET_UNDEFINED implies that the specified target is not a recipient of this SMS.
SmsRef Sms::ref (  )  [inline]

Definition at line 2237 of file skype-embedded_2.h.

bool Sms::SetBody ( const Sid::String &  text,
SETBODYRESULT result,
Sid::List_String &  chunks,
uint &  charsUntilNextChunk 
)

-The- method for setting the body text of this SMS. While Conversation::PostSMS does have a body argument, that argument is currently unused.

Parameters:
text Message body text.
result Whether the Message body was successfully set and if not, why not.
chunks The Message body as a list of individual chunks.
charsUntilNextChunk Number of available characters until creation of the next chunk becomes necessary.
bool Sms::SetTargets ( const Sid::List_String &  numbers,
bool &  success 
)

Sets the recipient(s) of this SMS. Note that each invocation replaces the target list and re-calculates all prices - they are not additive!

Parameters:
numbers Normalized phone number(s) of the intended recipient(s).
success Set to true if the target list appears to contain valid, normalized telephone numbers. Note that this check is not very reliable. Actual target validity checking occurs asynchronously in the background, and manifests itself as a series of Sms::P_TARGET_STATUSES property change events.

The documentation for this class was generated from the following files:
 All Classes Files Functions Variables Typedefs Enumerations Enumerator Friends Defines

(c) Skype Technologies S.A. Confidential/Proprietary

Last updated: Fri Jan 27 2012