Skip to content

Instantly share code, notes, and snippets.

@aaronpk
Created June 23, 2011 19:03
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save aaronpk/1043323 to your computer and use it in GitHub Desktop.
Save aaronpk/1043323 to your computer and use it in GitHub Desktop.
SMS to IRC Gateway
<?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