2011-09-29 16:09:59 +00:00
|
|
|
<?php
|
|
|
|
require_once 'jsonRPCServer.php';
|
|
|
|
require_once 'smsSender.php';
|
|
|
|
require_once 'postgresGatewayBackend.php';
|
2011-09-30 11:42:45 +00:00
|
|
|
require_once 'gnokiiSMSBackend.php';
|
2011-09-29 16:09:59 +00:00
|
|
|
|
|
|
|
session_start();
|
|
|
|
|
2011-09-29 16:47:53 +00:00
|
|
|
try
|
|
|
|
{
|
2011-09-30 11:42:45 +00:00
|
|
|
$dbBackend = new postgresGatewayBackend('localhost', 'sms_gateway', 'quaiy8Zu', 'sms_gateway');
|
2011-09-29 16:47:53 +00:00
|
|
|
}
|
|
|
|
catch (PDOException $e)
|
|
|
|
{
|
2011-09-29 16:55:48 +00:00
|
|
|
header('Status: 500 Internal Server Error (DB)');
|
2011-09-29 16:47:53 +00:00
|
|
|
exit;
|
|
|
|
}
|
|
|
|
|
|
|
|
try
|
|
|
|
{
|
2011-09-30 11:42:45 +00:00
|
|
|
$smsBackend = new gnokiiSMSBackend();
|
2011-09-29 16:47:53 +00:00
|
|
|
}
|
|
|
|
catch (Exception $e)
|
|
|
|
{
|
2011-09-30 11:42:45 +00:00
|
|
|
header('Status: 500 Internal Server Error (SMS)');
|
|
|
|
exit;
|
|
|
|
}
|
|
|
|
|
|
|
|
try
|
|
|
|
{
|
|
|
|
$smsSender = new smsSender($dbBackend, $smsBackend, session_id());
|
|
|
|
}
|
|
|
|
catch (Exception $e)
|
|
|
|
{
|
|
|
|
header('Status: 500 Internal Server Error');
|
2011-09-29 16:55:48 +00:00
|
|
|
exit;
|
2011-09-29 16:47:53 +00:00
|
|
|
}
|
|
|
|
|
2011-09-29 16:55:48 +00:00
|
|
|
jsonRPCServer::handle($smsSender);
|