-
Notifications
You must be signed in to change notification settings - Fork 1
/
call.php
78 lines (78 loc) · 1.64 KB
/
call.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
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
<?php
include 'func.php';
if (isset($_GET['a']) and isset($_GET['b']) and !isset($_GET['spy'])){
$a=$_GET['a'];
$b=$_GET['b'];
include('phpagi/phpagi.php');
$manager = new AGI_AsteriskManager();
$manager->connect();
//if(strlen($b)==6){
// $b='78452'.$b;
//}
$context=get_param($a);
$manager->Originate(
'SIP/'.$a,
$b,
$context,
'1',
'',
'',
'20000',
'SIP/'.$b,
'tTr',
'',
'Async',
''
);
$manager->disconnect();
}
if(isset($_GET['spy']) and isset($_GET['a']) and isset($_GET['b']) and isset($_GET['type']) ){
print_r ($_GET);
$a= $_GET['a'];
$b= $_GET['b'];
echo $type= $_GET['type'];
//$a= íîìåð ýêñòåíøíà
//$b= êàíàë êîòîðûé áóäåì ñëóøàòü
include('phpagi/phpagi.php');
$manager = new AGI_AsteriskManager();
$manager->connect();
//if(strlen($b)==6){
// $b='78452'.$b;
//}
//$context=get_param($a);
/*
$manager->Originate(
'SIP/'.$a,
'',
'',
'1',
'ChanSpy',
$b.',qx',
'',
'',
'',
'',
'Async',
''
);
*/
$r= $manager->Originate ('SIP/'.$a, $a, 'from-internal','1', 'ChanSpy', $b.','.$type, '', $b, '', '', 'Async','' );
echo $r['Response'].' mode='.$type;
$manager->disconnect();
//echo 'ok';
/*
'Êàíàë äëÿ âûçîâà, íàïðèìåð SIP/1001',
'Ýêñòåíøí äëÿ äèàëïëàíà',
'Êîíòåêñò äèàëïëàíà',
'Ïðèîðèòåò êîíòåêñòà äèàëïëàíà',
'Èëè ïðèëîæåíèå àñòåðèñêà äëÿ çàïóñêà, íàïðèìåð playback',
'ïàðàìåòðû ïðèëîæåíèÿ, íàïðèìåð ïóòü ê àóäèîôàéëó',
'òàéìàóò',
'Íîìåð àáîíåíòà îò êîòîðîãî èäåò âûçîâ èëè èìÿ',
'ïåðåìåííûå äëÿ äèàëïëàíà',
'account - íåçíàþ çà÷åì, íå èñïîëüçîâàë åùå',
'Ñèíõðîííûé èëè àñèíõðîííûé çàïðîñ (æäåò èëè íå æäåò îòâåòà î ñîñòîÿíèè çàïðîñà)',
'actionid - òîæå ïîêà íå èñïîëüçîâàë'
*/
}
?>