Created
June 23, 2011 19:03
-
-
Save aaronpk/1043323 to your computer and use it in GitHub Desktop.
SMS to IRC Gateway
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 | |
require('tropo-webapi-php/tropo.class.php'); | |
define('IRC_SERVER', 'example.com'); | |
define('IRC_UDP_PORT', 51000); | |
$session = new Session(); | |
// Read text from incoming SMS | |
$text = $session->getInitialText(); | |
// Send text to the IRC bot | |
$sock = socket_create(AF_INET, SOCK_DGRAM, SOL_UDP); | |
socket_sendto($sock, $text, strlen($text), 0, IRC_SERVER, IRC_UDP_PORT); | |
?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment