Skip to content

Instantly share code, notes, and snippets.

@amachang
Created November 12, 2012 01:54
Show Gist options
  • Save amachang/4057103 to your computer and use it in GitHub Desktop.
Save amachang/4057103 to your computer and use it in GitHub Desktop.
Send SMS through Skype with php-dbus; pecl library.
<?php
$phoneNumber = '+818012345678';
$dbus = new DBus();
$n = $dbus->createProxy('com.Skype.API', '/com/Skype', 'com.Skype.API');
if ($n->Invoke('NAME test') !== 'OK') die();
if ($n->Invoke('PROTOCOL 7') !== 'PROTOCOL 7') die();
$res = $n->Invoke("CREATE SMS OUTGOING $phoneNumber");
list($type, $id) = preg_split('/\s+/u', $res);
if ($type !== 'SMS') die();
$res = $n->Invoke("SET SMS $id BODY \"done is better than perfect\"");
list($type, $id) = preg_split('/\s+/u', $res);
if ($type !== 'SMS') die();
$res = $n->Invoke("ALTER SMS $id SEND");
list($op, $type, $id) = preg_split('/\s+/u', $res);
if ($op !== 'ALTER' || $type !== 'SMS') die();
$res = $n->Invoke("DELETE SMS $id");
@tessoudali
Copy link

plesae help me i want code php foward incoming sms to skype users

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment