Is there any way to send / receive SMS using FWH

Is there any way to send / receive SMS using FWH

Postby RAMESHBABU » Mon May 21, 2007 1:59 pm

Hi friends

Has anybody tried sending/receiving SMS using FWH ?

Regards

- Ramesh Babu P
User avatar
RAMESHBABU
 
Posts: 624
Joined: Fri Oct 21, 2005 5:54 am
Location: Secunderabad (T.S), India

SMS

Postby Colin Haig » Mon May 21, 2007 11:47 pm

Hi RAMESHBABU

You can use skype to send SMS's - you have to set up an account and purchase some credit -


smsskype(cPhone,cNotes)
MsgWait('Sending Message ' + str(i,3),'Sending SMS',2)
//-------------------------------------------------------------------------//
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)

//-----------------------------------------------------------------------------//

Hope this helps

Colin
Colin Haig
 
Posts: 310
Joined: Mon Oct 10, 2005 5:10 am

Postby RAMESHBABU » Tue May 22, 2007 9:41 am

Mr.Colin

Thanks for your reply. I will try Skype.
Do you have any idea whether we can send bulk SMS with Skype ?

regards

- Ramesh Babu P
User avatar
RAMESHBABU
 
Posts: 624
Joined: Fri Oct 21, 2005 5:54 am
Location: Secunderabad (T.S), India


Return to FiveWin for Harbour/xHarbour

Who is online

Users browsing this forum: Google [Bot] and 76 guests