Although Skype was originally intended for voice, video and textual communication between two or more players, quick-witted people, there was not enough. Up to the same skype launched COM module, through which it can also be from other applications that it sadarīt Skype.
As I tell the title of the story is about how the external application (which this time will be written in PHP) can take action with Skype. Operation range is quite impressive and can be seen here https: / / developer.skype.com/Docs/Skype4COMLib . On the whole, this rich array of chat rooms will use the procedure – message sending and message.
Pictures 1. Platform.
Now abstrahēsimies of the technical details (and options:)) And let us think of where and how such arrangements could be used.
- All correspondence will automatically maintained web site (blog, Twitter, etc..)
- Only by special command is added to the report web page. For example, Add: Current articles on skype4com.
- URL Correction. For example: document.doc is an amended to the / / server / user / document.doc, as a result of this link will become real and relevant.
- Google Mini. For example: google: skype4com and as a result they were originally dispatched the first 3 tracks. Or pagerank, or keyword search engine position, rank or Alexa, or dajebkas else.
- Verķītis itself from time to time a particular conference (eg, work) is sent out a brief information – payment of invoice No. 123 today, or I have heard about John Smith and the birthday is celebrated Liena Berzins.
- Dictionary. Writing, for example: en: Lullaby reply is received – en: lullaby
- Info Service. For example:? The disk space on the server. Answer 1Gb.
- Čatbots.As much good will come … If the mind enough to make a coherent MI-based could prove to be good-natured conversational partner:)
- Well and of course the pile with a variety of other teams.
Where to start?
First of all need the same Skype to Skype network of registered users. Given that the Skype protocol is closed (that is not publicly viewable), all in the distant steps will be possible if the skype client is running (dabūnams both for Windows and Linux, and Mac). We consider that Skype client is the only GUI version …
Second. Skype4COM component. In principle, it is a dll file that you can register with regsrv32 team. Did not work: (. With the second option. When you install choose Options (in the very first window) and note the “Install Skype Extras Manager”. With this, Skype4Com pieinstalēsies. But it has all the magic ends.
Third. Except in cases where PHP will run on the command line (ie php-f skype.php), to understand one thing – initializing the connection through the COM object will run another Skype instance (if Skype is not yet active) and asked to enter authentication data. In their experiments did it:
- – Skype and let ielogojos;
- – In Administrative Tools> Services> Apache> Properties> Log On and put the hook on
- – When you run PHP and allow Skype connection.
If PHP did not show some kind of mystical COM error or Skype4COM Unable to Attach (Wait Timeout) then everything works and more activity in already by PHP!
NBWhen writing PHP code, keep in mind two things: 1st Time must be allowed to run the team. For example, using com_message_pump (4000); 2nd If you want to “wait” to a Skype event such as an incoming message, then somewhere at the beginning set_time_limit (0), and at the end – endless cycle of waiting:
My PHP code that sends the response message to any incoming message .
Some good ideas and a real Skype bot: http://www.voidstar.com/void.bot/source/skypebot.txt
Useful links: Skype. Skype4COM reference – https://developer.skype.com/Docs/Skype4COM Skype bots: http://www.voidstar.com/void.bot/ Linux skype wrappers – http://labs.gree.jp/Top/OpenSource/Skype-en.html