-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.php
38 lines (25 loc) · 814 Bytes
/
index.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
<?php
require_once 'process.php';
require_once 'services/slack.php';
require_once 'services/hipchat.php';
require_once 'constants.php';
$h = new Hipchat($token, $room, $from);
$s = new Slack($weebhook_url, $channel);
$call = isset($_POST['event_type']) ? $_POST['event_type'] : false;
$caller = isset($_POST['caller']) ? $_POST['caller'] : false;
$callee = isset($_POST['callee']) ? $_POST['callee'] : false;
$direction = isset($_POST['direction']) ? $_POST['direction'] : false;
switch($call){
case 'call_init':
$p = new Process($s, $call);
$p->setDirection($direction);
$p->setCaller($caller);
$p->setCalee($callee);
break;
case 'call_hangup':
$p = new Process($s, $call);
break;
default:
echo 'Forbitten';
break;
}