No lo he podido probar, y aún así las funcionalidades están un poco limitadas. Pero se puede usar Skype mediante PHP, aunque necesitaremos:
Un ejemplo sería el siguiente:
<?php
// Event sink:
class _ISkypeEvents {
function AttachmentStatus($status) {
echo ">Attachment status $status\n";
}
function CallStatus($call, $status) {
echo ">Call $call->id status $status\n";
}
}
// Create a Skype4COM object:
$skype = new COM("Skype4COM.Skype");
// Create a sink object:
$sink =& new _ISkypeEvents ();
$sink->convert = $skype->convert();
// Connect to the sink:
com_event_sink($skype, $sink, "_ISkypeEvents");
// Create a conversion object:
$convert = $skype->convert;
$convert->language = "en";
// Start the Skype client, minimized and with no splash screen:
if (!$skype->client()->isRunning()) {
$skype->client()->start(true, true);
}
// If the user status is not "online", change user status to "online":
if ($skype->currentUserStatus() == $convert->textToUserStatus("OFFLINE")) {
$skype->changeUserStatus($convert->textToUserStatus("ONLINE"));
}
// Create a user object
$user = $skype->user("echo123");
echo "User " . $user->handle . " online status is " . $convert->onlineStatusToText($user->onlineStatus) . "\n";
// Place a call
$call = $skype->PlaceCall($user->handle);
// Wait for the call to be "in progress" and report an error if:
while ($call->status <> $convert->textToCallStatus("INPROGRESS")) {
if ($call->status == $convert->textToCallStatus("FAILED") ||
$call->status == $convert->textToCallStatus("REFUSED") ||
$call->status == $convert->textToCallStatus("CANCELLED") ||
$call->status == $convert->textToCallStatus("FINISHED") ||
$call->status == $convert->textToCallStatus("BUSY"))
die ("Call status " . $convert->callStatusToText($call->status));
else
com_message_pump (500);
}
// Send dtmf tones:
com_message_pump (10000);
if ($call->status == $convert->textToCallStatus("INPROGRESS")) $call->dtmf = "0";
com_message_pump (500);
if ($call->status == $convert->textToCallStatus("INPROGRESS")) $call->dtmf = "1";
com_message_pump (500);
if ($call->status == $convert->textToCallStatus("INPROGRESS")) $call->dtmf = "2";
com_message_pump (500);
if ($call->status == $convert->textToCallStatus("INPROGRESS")) $call->dtmf = "3";
com_message_pump (500);
if ($call->status == $convert->textToCallStatus("INPROGRESS")) $call->dtmf = "4";
com_message_pump (500);
if ($call->status == $convert->textToCallStatus("INPROGRESS")) $call->dtmf = "5";
com_message_pump (500);
if ($call->status == $convert->textToCallStatus("INPROGRESS")) $call->dtmf = "6";
com_message_pump (500);
if ($call->status == $convert->textToCallStatus("INPROGRESS")) $call->dtmf = "7";
com_message_pump (500);
if ($call->status == $convert->textToCallStatus("INPROGRESS")) $call->dtmf = "8";
com_message_pump (500);
if ($call->status == $convert->textToCallStatus("INPROGRESS")) $call->dtmf = "9";
com_message_pump (500);
if ($call->status == $convert->textToCallStatus("INPROGRESS")) $call->dtmf = "#";
com_message_pump (500);
if ($call->status == $convert->textToCallStatus("INPROGRESS")) $call->dtmf = "*";
// Finish the call:
if ($call->status <> $convert->textToCallStatus("FINISHED")) $call->finish();
//Sleep:
com_message_pump (1000);
?>
Example Call.php
interesante, aunque hay otros fw, quizás, mejores que ci. ejemplo: yii o zend.
salU
A mi personalmente no me gusta Zend, pero para gustos los colores 🙂
Hay muchos frameworks y algunos muy interesantes, como por ejemplo Kohana, basado en CI
Saludos
Yo trabajo con Ci y me parece un buen framework y hasta el momento no he tenido la necesidad de probar o utilizar otro framework.
El hack que mas me interesa es el de prevenir la colisión de nombres entre controladores y modelos.
Cierto, Psycho, lo más interesante para mà también es el hack de las colisiones.
Saludos
interesante, y por cierto no habia notado que sentido web cambio de luck cosa que le sentó de maravilla
Hola khafra.
Si, año nuevo imagen nueva, me alegro de que te haya gustado, total sólo he tardado año y pico en hacerlo jejeje y ya por desesperación lo dejé asÃ, lo de diseñar no es lo mÃo.
Saludos