Skype activex

Skype activex

Postby Marco Turco » Thu Nov 18, 2010 9:10 am

Hi all,
I'm having problems to send sms via Skype using xHarbour+FWH,
is there someone that can share a running sample code that show the way to send an SMS through Skype ?

Thanks in advance
Best Regards,

Marco Turco
SOFTWARE XP LLP
User avatar
Marco Turco
 
Posts: 858
Joined: Fri Oct 07, 2005 12:00 pm
Location: London

Re: Skype activex

Postby Silvio » Thu Nov 18, 2010 9:23 am

function dial_skype(t_phone)
local objskype
if empty(t_phone)
return .t.
endif
objSkype = CreateObject("SKYPEAPI.Access", "objSkype_")
objSkype:Connect()
do while objSkype:APIAttachmentStatus <> 0
enddo
inkey(.5)
oCall = objskype:PlaceCall(t_phone)
objskype = Nil
return .t.



but I never try it because I not found dll on skype site
Best Regards, Saludos

Falconi Silvio
User avatar
Silvio
 
Posts: 3107
Joined: Fri Oct 07, 2005 6:28 pm
Location: Teramo,Italy

Re: Skype activex

Postby Marco Turco » Thu Nov 18, 2010 10:47 am

Thanks for your sample,
anyway I am looking for an SMS sample, not a Skype call sample.
I have Skype already installad so I think no external dll is required.
Best Regards,

Marco Turco
SOFTWARE XP LLP
User avatar
Marco Turco
 
Posts: 858
Joined: Fri Oct 07, 2005 12:00 pm
Location: London

Re: Skype activex

Postby Silvio » Thu Nov 18, 2010 5:41 pm

scusa ho capito ma credo che se avessimo la dll forse potremmo sapere qualche funzione all'interno..per inviare sms.. oopps ho parlato italiano
Best Regards, Saludos

Falconi Silvio
User avatar
Silvio
 
Posts: 3107
Joined: Fri Oct 07, 2005 6:28 pm
Location: Teramo,Italy

Re: Skype activex

Postby Colin Haig » Fri Nov 19, 2010 10:23 pm

Marco

I have an example using a dll - Skype4com.dll

I am not sure where I got this sample from but I did get it working.

Regards

Colin

Code: Select all  Expand view

function smsskype(t_sms,t_mess)
// send an SMS (if enough credit on skype account)
// return 1 : SMS delivered, 0 : SMS failed
// Skype Version 3 installation required on local machine (2.5 ?) or Skype4com DLL

// t_sms : mobile number format +(country code)(mobilenumber)  e.g. '+32691348192' no spaces or other caracters allowed
Local oSkype,oSMS,nRet := 1,i := 0,lRunning := TRUE
Try
   oSkype := CreateObject("SKYPE4COM.Skype", "Skype_")
Catch
   MsgInfo("No Skype4Com installed")
   nRet := 0
End
If empty(t_sms)
   nRet := 0  // empty phone number
endif
If ! oSkype:Client:IsRunning()
   oSkype:Client:Start()
   lRunning := FALSE
else

Endif

if lRunning
   //if MsgYesNo('Send Message')
      Try
        oSMS := oSkype:SendSms(t_sms, t_mess)  // generic
      Catch
         MsgInfo('fail')
         nRet := 0
       End

       //? oSms:Id() // actual ID of SMS

       For i := 1 to 30  // try for max. 30 seconds for sending 1 SMS and waiting for answer from operator

          //  MsgWait(,oSkype:Convert:SmsMessageStatusToText(oSms:Status),2)
   
          If oSms:Status()=2  // delivered
             Exit
          Endif

          inkey(1)

       next
    //endif

   If oSms:Status()<>2  // not delivered
      MsgAlert('SMS probably failed !')
      nRet := 0  // erreur SMS
   Else
      //MsgAlert("Message delivered successfully !",,,3)
   Endif
endif

// => List all SMS
// For Each oSms In oSkype:Smss()
// ? oSms:Id() //Sms Id
// ? oSms:Timestamp() // time (date)
// ? oSms:Type() // type
// ? oSkype:Convert:SmsMessageTypeToText(oSms:Type) // p. ex. originated
//  ? oSms:Status() //status
// ? oSkype:Convert:SmsMessageStatusToText(oSms:Status)  // p.ex. delivered
// ? oSms:FailureReason()  //failure reason
// ? oSms:IsFailedUnseen() //failed unseen
// ? oSms:Price() //price
// ? oSms:PricePrecision()  //price precision
// ? oSms:PriceCurrency() //price currency
// ? oSms:ReplyToNumber() //reply to number
//Next

//inkey(0)

oSkype := Nil
return(nRet)
 
Colin Haig
 
Posts: 310
Joined: Mon Oct 10, 2005 5:10 am

Re: Skype activex

Postby Marco Turco » Sun Nov 21, 2010 2:20 pm

Hi,
nothing to do.
It runs well on Skype 4 but with Skype 5 is not possibile to send SMS.

Is there anyone that succesfull sent SMS with Skype 5 ?
Best Regards,

Marco Turco
SOFTWARE XP LLP
User avatar
Marco Turco
 
Posts: 858
Joined: Fri Oct 07, 2005 12:00 pm
Location: London


Return to FiveWin for Harbour/xHarbour

Who is online

Users browsing this forum: nageswaragunupudi, RSalazarU and 85 guests