smsgateway/json_sms.php

40 lines
710 B
PHP
Raw Normal View History

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();
try
{
2011-09-30 11:42:45 +00:00
$dbBackend = new postgresGatewayBackend('localhost', 'sms_gateway', 'quaiy8Zu', 'sms_gateway');
}
catch (PDOException $e)
{
2011-09-29 16:55:48 +00:00
header('Status: 500 Internal Server Error (DB)');
exit;
}
try
{
2011-09-30 11:42:45 +00:00
$smsBackend = new gnokiiSMSBackend();
}
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:55:48 +00:00
jsonRPCServer::handle($smsSender);