Asterisk Telegram -

, Asterisk - CDR (Call Detail Record). , , .

Asterisk asteriskcdrdb, cdr. .

[root@asterisk]# mysql  //   MySQL 

, asteriskcdrdb:

mysql> use asteriskcdrdb;
Reading table information for completion of table and column names
You can turn off this feature to get a quicker startup with -A
Database changed

, cdr. , :

mysql> show tables;
+-------------------------+
| Tables_in_asteriskcdrdb |
+-------------------------+
| cdr                     |
| cel                     |
+-------------------------+
2 rows in set (0.00 sec)

, asteriskcdrdb, cdr. ( 18 2016 ), 12:00 12:10, . 10 :

SELECT  `dst` ,  `src` ,  `duration` ,   `calldate` ,  `recordingfile` 
FROM  `cdr` WHERE `calldate` >= '2016-03-18 12:00:00' AND `calldate` <= '2016-03-18 12:10:00' AND LENGTH(  `src` ) >3;
+-----+-------------+----------+---------------------+----------------------------------------------------------------+
| dst | src         | duration | calldate            | recordingfile                                                  |
+-----+-------------+----------+---------------------+----------------------------------------------------------------+
| 113 | 84991111111 |      140 | 2016-03-18 12:00:36 | external-113-84991111111-20160318-115933-1458291573.157155.wav |
| 104 | 89162222222 |       81 | 2016-03-18 12:01:33 | external-104-89162222222-20160318-120133-1458291693.157169.wav |
+-----+-------------+----------+---------------------+----------------------------------------------------------------+
2 rows in set (0.00 sec)

, SQL LENGTH( `src` ) >3. src (source - ). , , . , , . , . cdr asteriskcdrdb:

calldate 2016-03-18 12:00:36
clid "Oleg Ivanov" <84991111111> CallerID (CLID, CID), . .
src 84991111111 CallerID (CNUM). .
dst 113 . .
dcontext CustomContext1 . .
channel SIP/0002B2356854-a34bh3ef ,
dstchannel SIP/0004F6675969-97836bb0 ,
lastapp Dial, Busy, Congestion , cdr
lastdata SIP/0004F6675969,30,tT , , (lastapp)
duration 75 ( start) ( end)
billsec 67 ( answer) ( end). duration, , .
disposition ANSWERED, BUSY, NO ANSWER, FAILED
amaflags OMIT, BILLING, DOCUMENTATION, Unknown Automatic Message Accounting (AMA) .
accountcode 23232 . , .
uniqueid 1458291693.157169
userfield . , .
did 4996491913 DID (Direct Inward Dialing). DID Asterisk ( ).
recordingfile external-113-84991111111-20160318-115933-1458291573.157155.wav , . .
cnum 84991111111 CallerID.
cnam Oleg Ivanov CallerID.

, , . , . php cron.


?