Send an SMS via Skype with PHP

2020-07-30 02:56发布

问题:

Does anyone have any experience using PHP to send an sms via skype

I want the user off the website to use one the forms and give them a choice if they want to send an SMS to do a request. First it will have to check for the availabillity of Skype on the clients computer, if so it should send an SMS. I already have the users mobile number in the database when he logs to the website.

Maybe, I have to use a combination off Javascript and PHP?

I see that Skype has a call.php script, but I can't seem to understand how it is supposed to be used. And also how to ajust it to send sms messages.

If anyone can give me some pointers, that would be helpfull.

If Skype is to closed off then does anyone know a good sms service to implement on the website that would allow me to achieve the same goal?

回答1:

If you're running PHP on Windows, you can use the COM wrapper for PHP to interface with Skype4COM. I haven't tested it, but following the examples from the Skype4COM documentation, this should work:

$skype = new COM("Skype4COM.Skype");
$skype->sendSms("+1234567890", "SMS text goes here");

However, this would use the instance of Skype running on your server. It is certainly impossible to interface with the instance of Skype running on your client's machine using client-side JavaScript. Some basic interfacing can be done with MSIE and VBScript, but I think that this way the functionality would be very limited as well, because it would be very insecure if it wasn't limited.



回答2:

no, php is a server side scripting language, you cannot access your clients’ pcs with it. and i doubt it is possible to call skype from javascript …



回答3:

TRUE..However, this would use the instance of Skype running on your server.

NOT TRUE..It is certainly impossible to interface with the instance of Skype running on your client's machine using client-side JavaScript

^ The client side javascript CAN make server calls via javascript ajax, hell you can even make server side calls WITHOUT using javascript by embedding the call in an image tag!

ie. img src="myskype_server.com/announcestatus.php?session=23eedwrwe23323&status=viewing mortgage documents"

announcestatus.php // connect to server actually running skype //do a series of security checks // connect to the actual windows pc running skype (It's host name can be fixed by using a service like www.dyndns.com) //

If anybody is particularly interested, I can package up the wobbly code I used to implement this and post it.