Sunday, December 30, 2012

How to send Skype IM programmatically

SKYPE

In this tutorial, we 'll see how to send a IM to your Skype friends. For this, you need to access Skype API. There 's an Skype ActiveX component which allows to access their API. This is an object oriented layer which wraps the API functinality.

First you need to download the Skype4COM
component. Then You need to create an instance of type COM by specifying the path to above dll.

[sourcecode language="php"]
<?php
ini_set('display_errors', 'On');
error_reporting(E_ALL | E_STRICT);

$skype = new COM('Skype4COM.Skype');

if (!$skype->client()->isRunning()) {
$skype->client()->start(true, true);
}
$skype->attach(5,false);

$members = new COM('Skype4COM.UserCollection');
$members->Add($skype->User('echo123'));

$chat = $skype->CreateChatMultiple($members);
$chat->OpenWindow();
$chat->SendMessage("Hi friend");
?>
[/sourcecode]

No comments:

Post a Comment

How to enable CORS in Laravel 5

https://www.youtube.com/watch?v=PozYTvmgcVE 1. Add middleware php artisan make:middleware Cors return $next($request) ->header('Acces...