Help - Search - Members - Calendar
Full Version: problem with SendSms in c++
Skype Community > English > Development, Betas and Skype Garage > Skype Public API
barbalanza
Hi everybody,


1) I want to send a SMS message with the following code but it returns me an error on the Sendsms function.
what am i doing wrong?
I simply tried to use Sendsms like the (here commented) placeCall which perfectly works.

2) another problem : when I try to track the status of my calls with CallStatustoText i receive the error "identifier not found" ....where's the problem? Has anybody an example of how CallStatustoText should be used??

thanks in advance






#include "stdafx.h"
#import "Skype4COM.dll"

using namespace SKYPE4COMLib;

int main(void)
{

// Initialize COM
CoInitialize(NULL);

// Create object
ISkypePtr pSkype(__uuidof(Skype));

// Connect to API
pSkype->Attach(6,VARIANT_TRUE);

// Friends collection
IUserCollectionPtr pFriends = pSkype->GetFriends();


// ICallPtr pCall = pSkype->PlaceCall("+393xxxxxxx", "", "", "");

ISmsMessagePtr pSms = pSkype->SendSms("+39xxxxxx","msg text","+39xxxx");




// Cleanup
pFriends = NULL;
pSkype = NULL;

// Deinitialize COM
CoUninitialize();


system("PAUSE");

return 0;
}
andreskaasik
1. To be able to send SMS you need Skype credit.

2. The last parameter of the SendSMS method is "Reply to Number" that must be configured from Skype options before it can be used with SendSMS.

CODE

// IDL definition
HRESULT SendSms([in] BSTR TargetNumbers, [in] BSTR MessageText, [in, defaultvalue("")] BSTR ReplyToNumber, [out, retval] ISmsMessage** pMessage);

barbalanza
thanks for your reply but....

1) Ok I've got skype credit, that's not the problem.

2) If I implement the code above in c# language, I am able to send SMS from the same skype account from which in c++ it failed.
Using c# and using the option "identify the sender with the skype name" , I can send SMS with the only limitation that receivers can not answer (obviously).
Is it impossible to do the same with c++? Could you please post an example of working code sending SMS?


3)...have you got any any idea why the CallStatustoText fails? could you please post working code using this function?
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here.