Created
November 12, 2012 01:54
-
-
Save amachang/4057103 to your computer and use it in GitHub Desktop.
Send SMS through Skype with php-dbus; pecl library.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?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"); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
plesae help me i want code php foward incoming sms to skype users