How to use backup.sh to backup your databases and directorys

By | asterBilling, asterCRM | No Comments

There is a backup script in astercc scripts directory, you can use it to make a sechduled backup mission for your databases and directorys.

First you should make a directory for backup , I make it to /home/backup.

Copy the bakcup.sh and backup.conf  to /home/backup

cp astercc/scripts/backup.sh astercc/scripts/backup.conf  /home/backup

Then, configure the backup.conf:

[local] #this name of server,just for mark; default is the hostname of this server
hostname=

#local path of save the backup file, default is back script running path
localpath=

#how many latest days backup file will be saved in local server
savelocal=3

#when run bakcup shell,it will sent a mail to notify if set the mailto
#the backup notify mail to
mailto=

#the backup notify mail from
mailfrom=

if you want to send the backup file to a remote server by ftp,  just configure the [ftp] segment
[ftp] #if set, will try to sent the backup file to the host by ftp
ftphost=
ftpuser=
ftppasswd=

#directory name to save the database backup file in ftp home
ftpdbpath=

#directory name to save the dir backup file in ftp home
ftpdirpath=

[dblist] #which database would be backup you want; format: databasename:user:password
#for astercc database
astercc:astercc:asterccsecret

[dirlist] #which directory would be backup you want, the absolute path of directory and the basename of directory: /etc/asterisk:asterisk

#for asterisk etc
/etc/asterisk:asterisk

then we execute the ./backup.sh to test, after execute the backup.sh, execut “find” in /home/backup, could get likes following content:

.
./backup.conf
./dir_backup
./dir_backup/localsave
./dir_backup/localsave/asterisk.2010-11-09-05.tar.gz
./backup.sh
./db_backup
./db_backup/localsave
./db_backup/localsave/astercc.2010-11-09-05.tar.gz
./db_backup/dbbk.log

If everything is ok ,  we should set a schedule backup mission with crontab.

execute “crontab -e” and add the following line :

0 0 * * * /home/backup/backup.sh >/dev/null 2>&1

it’s means that the /home/backup/backup.sh will execute  at 00:00:00 every days, you can adjust the execute time for fit your request.

astercc data report

By | asterBilling, asterCRM | No Comments

test in :

asterisk1.6.2.9

freepbx 2.8.0.3

astercc daemon 0.20-101005

asterCRM 0.07 in asterCC0.2

agent: 8000

customer :8001

the third part:5000

=======sip incoming call=======
(ringing)
select * from curcdr;
+—-+——+——+———+——————-+——————-+———–+———————+———————+—————–+—————–+————-+——–+———+———–+————+——–+—————-+—————-+————-+————-+————+——+————-+———–+———————+——-+
| id | src  | dst  | srcname | srcchan           | dstchan           | didnumber | starttime           | answertime          | srcuid          | dstuid          | disposition | userid | groupid | accountid | resellerid | credit | callshopcredit | resellercredit | creditlimit | destination | dialstring | memo | accountcode | monitored | calldate            | queue |
+—-+——+——+———+——————-+——————-+———–+———————+———————+—————–+—————–+————-+——–+———+———–+————+——–+—————-+—————-+————-+————-+————+——+————-+———–+———————+——-+
|  9 | 8001 | 8000 | dev8001 | sip/8001-0000022f | sip/8000-00000230 | 8000      | 2010-09-28 05:55:41 | 0000-00-00 00:00:00 | 1285624541.1273 | 1285624541.1274 | RINGING     |      0 |       0 |         0 |          0 | 0.0000 |         0.0000 |         0.0000 |      0.0000 |             |            |      |             |         0 | 0000-00-00 00:00:00 |       |
+—-+——+——+———+——————-+——————-+———–+———————+———————+—————–+—————–+————-+——–+———+———–+————+——–+—————-+—————-+————-+————-+————+——+————-+———–+———————+——-+
1 row in set (0.00 sec)

(answered)
select * from curcdr;
+—-+——+——+———+——————-+——————-+———–+———————+———————+—————–+—————–+————-+——–+———+———–+————+——–+—————-+—————-+————-+————-+————+——+————-+———–+———————+——-+
| id | src  | dst  | srcname | srcchan           | dstchan           | didnumber | starttime           | answertime          | srcuid          | dstuid          | disposition | userid | groupid | accountid | resellerid | credit | callshopcredit | resellercredit | creditlimit | destination | dialstring | memo | accountcode | monitored | calldate            | queue |
+—-+——+——+———+——————-+——————-+———–+———————+———————+—————–+—————–+————-+——–+———+———–+————+——–+—————-+—————-+————-+————-+————+——+————-+———–+———————+——-+
|  9 | 8001 | 8000 | dev8001 | sip/8001-0000022f | sip/8000-00000230 | 8000      | 2010-09-28 05:55:41 | 2010-09-28 05:55:55 | 1285624541.1273 | 1285624541.1274 | LINK        |      0 |       0 |         0 |          0 | 0.0000 |         0.0000 |         0.0000 |      0.0000 |             |            |      |             |         1 | 0000-00-00 00:00:00 |       |
+—-+——+——+———+——————-+——————-+———–+———————+———————+—————–+—————–+————-+——–+———+———–+————+——–+—————-+—————-+————-+————-+————+——+————-+———–+———————+——-+
1 row in set (0.00 sec)

(third part ringing)
select * from curcdr;
+—-+——+——+———+——————-+——————-+———–+———————+———————+—————–+—————–+————-+——–+———+———–+————+——–+—————-+—————-+————-+————-+————+——+————-+———–+———————+——-+
| id | src  | dst  | srcname | srcchan           | dstchan           | didnumber | starttime           | answertime          | srcuid          | dstuid          | disposition | userid | groupid | accountid | resellerid | credit | callshopcredit | resellercredit | creditlimit | destination | dialstring | memo | accountcode | monitored | calldate            | queue |
+—-+——+——+———+——————-+——————-+———–+———————+———————+—————–+—————–+————-+——–+———+———–+————+——–+—————-+—————-+————-+————-+————+——+————-+———–+———————+——-+
| 10 | 8000 | 5000 | dev8000 | sip/8000-00000230 | sip/5000-00000231 |           | 2010-09-28 05:56:21 | 0000-00-00 00:00:00 | 1285624581.1275 | 1285624581.1276 | RINGING     |      0 |       0 |         0 |          0 | 0.0000 |         0.0000 |         0.0000 |      0.0000 |             | 5000       |      |             |         0 | 0000-00-00 00:00:00 |       |
+—-+——+——+———+——————-+——————-+———–+———————+———————+—————–+—————–+————-+——–+———+———–+————+——–+—————-+—————-+————-+————-+————+——+————-+———–+———————+——-+
1 row in set (0.00 sec)

(third part answered)
select * from curcdr;
+—-+——+——+———+——————-+——————-+———–+———————+———————+—————–+—————–+————-+——–+———+———–+————+——–+—————-+—————-+————-+————-+————+——+————-+———–+———————+——-+
| id | src  | dst  | srcname | srcchan           | dstchan           | didnumber | starttime           | answertime          | srcuid          | dstuid          | disposition | userid | groupid | accountid | resellerid | credit | callshopcredit | resellercredit | creditlimit | destination | dialstring | memo | accountcode | monitored | calldate            | queue |
+—-+——+——+———+——————-+——————-+———–+———————+———————+—————–+—————–+————-+——–+———+———–+————+——–+—————-+—————-+————-+————-+————+——+————-+———–+———————+——-+
| 10 | 8000 | 5000 | dev8000 | sip/8000-00000230 | sip/5000-00000231 |           | 2010-09-28 05:56:21 | 2010-09-28 05:56:23 | 1285624581.1275 | 1285624581.1276 | LINK        |      0 |       0 |         0 |          0 | 0.0000 |         0.0000 |         0.0000 |      0.0000 |             | 5000       |      |             |         2 | 0000-00-00 00:00:00 |       |
+—-+——+——+———+——————-+——————-+———–+———————+———————+—————–+—————–+————-+——–+———+———–+————+——–+—————-+—————-+————-+————-+————+——+————-+———–+———————+——-+
1 row in set (0.00 sec)

(trun back)
select * from curcdr;
+—-+——+——+———+——————-+——————-+———–+———————+———————+—————–+—————–+————-+——–+———+———–+————+——–+—————-+—————-+————-+————-+————+——+————-+———–+———————+——-+
| id | src  | dst  | srcname | srcchan           | dstchan           | didnumber | starttime           | answertime          | srcuid          | dstuid          | disposition | userid | groupid | accountid | resellerid | credit | callshopcredit | resellercredit | creditlimit | destination | dialstring | memo | accountcode | monitored | calldate            | queue |
+—-+——+——+———+——————-+——————-+———–+———————+———————+—————–+—————–+————-+——–+———+———–+————+——–+—————-+—————-+————-+————-+————+——+————-+———–+———————+——-+
| 11 | 8001 | 8000 | device  | sip/8001-0000022f | sip/8000-00000230 | 8000      | 2010-09-28 05:56:46 | 2010-09-28 05:56:46 | 1285624541.1273 | 1285624606.1277 | LINK        |      0 |       0 |         0 |          0 | 0.0000 |         0.0000 |         0.0000 |      0.0000 |             |            |      |             |         3 | 0000-00-00 00:00:00 |       |
+—-+——+——+———+——————-+——————-+———–+———————+———————+—————–+—————–+————-+——–+———+———–+————+——–+—————-+—————-+————-+————-+————+——+————-+———–+———————+——-+
1 row in set (0.01 sec)

(transfered)
select * from curcdr;
+—-+——+——+———+——————-+——————-+———–+———————+———————+—————–+—————–+————-+——–+———+———–+————+——–+—————-+—————-+————-+————-+————+——+————-+———–+———————+——-+
| id | src  | dst  | srcname | srcchan           | dstchan           | didnumber | starttime           | answertime          | srcuid          | dstuid          | disposition | userid | groupid | accountid | resellerid | credit | callshopcredit | resellercredit | creditlimit | destination | dialstring | memo | accountcode | monitored | calldate            | queue |
+—-+——+——+———+——————-+——————-+———–+———————+———————+—————–+—————–+————-+——–+———+———–+————+——–+—————-+—————-+————-+————-+————+——+————-+———–+———————+——-+
| 13 | 8001 | 5000 | device  | sip/8001-0000022f | sip/5000-00000232 | 8000      | 2010-09-28 05:57:13 | 2010-09-28 05:57:13 | 1285624541.1273 | 1285624633.1280 | LINK        |      0 |       0 |         0 |          0 | 0.0000 |         0.0000 |         0.0000 |      0.0000 |             |            |      |             |         5 | 0000-00-00 00:00:00 |       |
+—-+——+——+———+——————-+——————-+———–+———————+———————+—————–+—————–+————-+——–+———+———–+————+——–+—————-+—————-+————-+————-+————+——+————-+———–+———————+——-+
1 row in set (0.00 sec)

mycdr
select * from mycdr;
+—-+———————+——+——+———+——————-+——————-+———–+———-+———+—————+————-+————-+———–+—————–+—————–+———-+——–+—————-+—————-+———+————+——–+———–+————-+——+————+———–+———-+———+————+—————-+———–+———-+———+——+————-+———–+——————+——-+
| id | calldate            | src  | dst  | srcname | channel           | dstchannel        | didnumber | duration | billsec | billsec_leg_a | disposition | accountcode | userfield | srcuid          | dstuid          | calltype | credit | callshopcredit | resellercredit | groupid | resellerid | userid | accountid | destination | memo | dialstring | processed | children | ischild | customerid | crm_customerid | contactid | discount | payment | note | setfreecall | monitored | astercrm_groupid | queue |
+—-+———————+——+——+———+——————-+——————-+———–+———-+———+—————+————-+————-+———–+—————–+—————–+———-+——–+—————-+—————-+———+————+——–+———–+————-+——+————+———–+———-+———+————+—————-+———–+———-+———+——+————-+———–+——————+——-+
|  1 | 2010-09-28 05:55:41 | 8001 | 8000 | dev8001 | sip/8001-0000022f | sip/8000-00000230 | 8000      |       40 |      26 |             0 | ANSWERED    |             | UNBILLED  | 1285624541.1273 | 1285624541.1274 |          | 0.0000 |         0.0000 |         0.0000 |       0 |          0 |      0 |         0 |             |      |            |         0 |          | no      |          0 |              0 |         0 |   0.0000 |         | NULL | no          |         1 |                0 |       |
|  2 | 2010-09-28 05:56:21 | 8000 | 5000 | dev8000 | sip/8000-00000230 | sip/5000-00000231 |           |       25 |      23 |             0 | ANSWERED    |             | UNBILLED  | 1285624581.1275 | 1285624581.1276 |          | 0.0000 |         0.0000 |         0.0000 |       0 |          0 |      0 |         0 |             |      |            |         0 |          | no      |          0 |              0 |         0 |   0.0000 |         | NULL | no          |         2 |                0 |       |
|  3 | 2010-09-28 05:56:46 | 8001 | 8000 | device  | sip/8001-0000022f | sip/8000-00000230 | 8000      |       20 |      20 |             0 | ANSWERED    |             | UNBILLED  | 1285624541.1273 | 1285624606.1277 |          | 0.0000 |         0.0000 |         0.0000 |       0 |          0 |      0 |         0 |             |      |            |         0 |          | no      |          0 |              0 |         0 |   0.0000 |         | NULL | no          |         3 |                0 |       |
|  4 | 2010-09-28 05:57:06 | 8000 | 5000 | dev8000 | sip/8000-00000230 | sip/5000-00000232 |           |        7 |       5 |             0 | ANSWERED    |             | UNBILLED  | 1285624626.1278 | 1285624626.1279 |          | 0.0000 |         0.0000 |         0.0000 |       0 |          0 |      0 |         0 |             |      |            |         0 |          | no      |          0 |              0 |         0 |   0.0000 |         | NULL | no          |         4 |                0 |       |
|  5 | 2010-09-28 05:57:13 | 8001 | 5000 | device  | sip/8001-0000022f | sip/5000-00000232 | 8000      |       18 |      18 |             0 | ANSWERED    |             | UNBILLED  | 1285624541.1273 | 1285624633.1280 |          | 0.0000 |         0.0000 |         0.0000 |       0 |          0 |      0 |         0 |             |      |            |         0 |          | no      |          0 |              0 |         0 |   0.0000 |         | NULL | no          |         5 |                0 |       |
+—-+———————+——+——+———+——————-+——————-+———–+———-+———+—————+————-+————-+———–+—————–+—————–+———-+——–+—————-+—————-+———+————+——–+———–+————-+——+————+———–+———-+———+————+—————-+———–+———-+———+——+————-+———–+——————+——-+
5 rows in set (0.00 sec)

monitorrecord
select * from monitorrecord;
+—-+———-+—————————————————————-+————+———–+———+———–+———–+—————–+———-+———+———————+
| id | callerid | filename                                                       | fileformat | processed | groupid | accountid | extension | uniqueid        | mycdr_id | creby   | cretime             |
+—-+———-+—————————————————————-+————+———–+———+———–+———–+—————–+———-+———+———————+
|  1 | 8001     | /var/spool/asterisk/monitor/2010/09/28/05/8001-8000.1285624555 | wav        | no        |       0 |         0 | 8000      | 1285624541.1273 |        0 | astercc | 2010-09-28 05:55:55 |
|  2 | 8000     | /var/spool/asterisk/monitor/2010/09/28/05/8000-5000.1285624583 | wav        | no        |       0 |         0 | 5000      | 1285624581.1275 |        0 | astercc | 2010-09-28 05:56:23 |
|  3 | 8001     | /var/spool/asterisk/monitor/2010/09/28/05/8001-8000.1285624606 | wav        | no        |       0 |         0 | 8000      | 1285624541.1273 |        0 | astercc | 2010-09-28 05:56:46 |
|  4 | 8000     | /var/spool/asterisk/monitor/2010/09/28/05/8000-5000.1285624628 | wav        | no        |       0 |         0 | 5000      | 1285624626.1278 |        0 | astercc | 2010-09-28 05:57:08 |
|  5 | 8001     | /var/spool/asterisk/monitor/2010/09/28/05/8001-5000.1285624633 | wav        | no        |       0 |         0 | 5000      | 1285624541.1273 |        0 | astercc | 2010-09-28 05:57:13 |
+—-+———-+—————————————————————-+————+———–+———+———–+———–+—————–+———-+———+———————+
5 rows in set (0.15 sec)

monitorrecord files
ll /var/spool/asterisk/monitor/2010/09/28/05/
total 4092
-rw-r–r– 1 asterisk asterisk  361324 Sep 28 05:56 8000-5000.1285624583-in.wav
-rw-r–r– 1 asterisk asterisk  360684 Sep 28 05:56 8000-5000.1285624583-out.wav
-rw-r–r– 1 asterisk asterisk  481644 Sep 28 05:57 8001-5000.1285624633-in.wav
-rw-r–r– 1 asterisk asterisk  481644 Sep 28 05:57 8001-5000.1285624633-out.wav
-rw-r–r– 1 asterisk asterisk 1249964 Sep 28 05:57 8001-8000.1285624606-in.wav
-rw-r–r– 1 asterisk asterisk 1249324 Sep 28 05:57 8001-8000.1285624606-out.wav

=======sip dial out=======
(ringing)
select * from curcdr;
+—-+——+——+———+——————-+——————-+———–+———————+———————+—————–+—————–+————-+——–+———+———–+————+——–+—————-+—————-+————-+————-+————+——+————-+———–+———————+——-+
| id | src  | dst  | srcname | srcchan           | dstchan           | didnumber | starttime           | answertime          | srcuid          | dstuid          | disposition | userid | groupid | accountid | resellerid | credit | callshopcredit | resellercredit | creditlimit | destination | dialstring | memo | accountcode | monitored | calldate            | queue |
+—-+——+——+———+——————-+——————-+———–+———————+———————+—————–+—————–+————-+——–+———+———–+————+——–+—————-+—————-+————-+————-+————+——+————-+———–+———————+——-+
| 14 | 8000 | 8001 | dev8000 | sip/8000-00000233 | sip/8001-00000234 | 8001      | 2010-09-28 06:00:50 | 0000-00-00 00:00:00 | 1285624850.1281 | 1285624850.1282 | RINGING     |      0 |       0 |         0 |          0 | 0.0000 |         0.0000 |         0.0000 |      0.0000 |             |            |      |             |         0 | 0000-00-00 00:00:00 |       |
+—-+——+——+———+——————-+——————-+———–+———————+———————+—————–+—————–+————-+——–+———+———–+————+——–+—————-+—————-+————-+————-+————+——+————-+———–+———————+——-+
1 row in set (0.00 sec)

(answered)
select * from curcdr;
+—-+——+——+———+——————-+——————-+———–+———————+———————+—————–+—————–+————-+——–+———+———–+————+——–+—————-+—————-+————-+————-+————+——+————-+———–+———————+——-+
| id | src  | dst  | srcname | srcchan           | dstchan           | didnumber | starttime           | answertime          | srcuid          | dstuid          | disposition | userid | groupid | accountid | resellerid | credit | callshopcredit | resellercredit | creditlimit | destination | dialstring | memo | accountcode | monitored | calldate            | queue |
+—-+——+——+———+——————-+——————-+———–+———————+———————+—————–+—————–+————-+——–+———+———–+————+——–+—————-+—————-+————-+————-+————+——+————-+———–+———————+——-+
| 14 | 8000 | 8001 | dev8000 | sip/8000-00000233 | sip/8001-00000234 | 8001      | 2010-09-28 06:00:50 | 2010-09-28 06:00:56 | 1285624850.1281 | 1285624850.1282 | LINK        |      0 |       0 |         0 |          0 | 0.0000 |         0.0000 |         0.0000 |      0.0000 |             |            |      |             |         1 | 0000-00-00 00:00:00 |       |
+—-+——+——+———+——————-+——————-+———–+———————+———————+—————–+—————–+————-+——–+———+———–+————+——–+—————-+—————-+————-+————-+————+——+————-+———–+———————+——-+
1 row in set (0.00 sec)

(third part ringing)
select * from curcdr;
+—-+——+——+———+——————-+——————-+———–+———————+———————+—————–+—————–+————-+——–+———+———–+————+——–+—————-+—————-+————-+————-+————+——+————-+———–+———————+——-+
| id | src  | dst  | srcname | srcchan           | dstchan           | didnumber | starttime           | answertime          | srcuid          | dstuid          | disposition | userid | groupid | accountid | resellerid | credit | callshopcredit | resellercredit | creditlimit | destination | dialstring | memo | accountcode | monitored | calldate            | queue |
+—-+——+——+———+——————-+——————-+———–+———————+———————+—————–+—————–+————-+——–+———+———–+————+——–+—————-+—————-+————-+————-+————+——+————-+———–+———————+——-+
| 15 | 8000 | 5000 | dev8000 | sip/8000-00000233 | sip/5000-00000235 | 8001      | 2010-09-28 06:01:29 | 0000-00-00 00:00:00 | 1285624850.1281 | 1285624889.1284 | RINGING     |      0 |       0 |         0 |          0 | 0.0000 |         0.0000 |         0.0000 |      0.0000 |             | 5000       |      |             |         0 | 0000-00-00 00:00:00 |       |
+—-+——+——+———+——————-+——————-+———–+———————+———————+—————–+—————–+————-+——–+———+———–+————+——–+—————-+—————-+————-+————-+————+——+————-+———–+———————+——-+
1 row in set (0.00 sec)

(third part answered)
select * from curcdr;
+—-+——+——+———+——————-+——————-+———–+———————+———————+—————–+—————–+————-+——–+———+———–+————+——–+—————-+—————-+————-+————-+————+——+————-+———–+———————+——-+
| id | src  | dst  | srcname | srcchan           | dstchan           | didnumber | starttime           | answertime          | srcuid          | dstuid          | disposition | userid | groupid | accountid | resellerid | credit | callshopcredit | resellercredit | creditlimit | destination | dialstring | memo | accountcode | monitored | calldate            | queue |
+—-+——+——+———+——————-+——————-+———–+———————+———————+—————–+—————–+————-+——–+———+———–+————+——–+—————-+—————-+————-+————-+————+——+————-+———–+———————+——-+
| 15 | 8000 | 5000 | dev8000 | sip/8000-00000233 | sip/5000-00000235 | 8001      | 2010-09-28 06:01:29 | 2010-09-28 06:01:31 | 1285624850.1281 | 1285624889.1284 | LINK        |      0 |       0 |         0 |          0 | 0.0000 |         0.0000 |         0.0000 |      0.0000 |             | 5000       |      |             |         2 | 0000-00-00 00:00:00 |       |
+—-+——+——+———+——————-+——————-+———–+———————+———————+—————–+—————–+————-+——–+———+———–+————+——–+—————-+—————-+————-+————-+————+——+————-+———–+———————+——-+
1 row in set (0.00 sec)

(turn back)
select * from curcdr;
+—-+——+——+———+——————-+——————-+———–+———————+———————+—————–+—————–+————-+——–+———+———–+————+——–+—————-+—————-+————-+————-+————+——+————-+———–+———————+——-+
| id | src  | dst  | srcname | srcchan           | dstchan           | didnumber | starttime           | answertime          | srcuid          | dstuid          | disposition | userid | groupid | accountid | resellerid | credit | callshopcredit | resellercredit | creditlimit | destination | dialstring | memo | accountcode | monitored | calldate            | queue |
+—-+——+——+———+——————-+——————-+———–+———————+———————+—————–+—————–+————-+——–+———+———–+————+——–+—————-+—————-+————-+————-+————+——+————-+———–+———————+——-+
| 16 | 8000 | 8001 | device  | sip/8000-00000233 | sip/8001-00000234 | 8001      | 2010-09-28 06:01:53 | 2010-09-28 06:01:53 | 1285624850.1281 | 1285624913.1285 | LINK        |      0 |       0 |         0 |          0 | 0.0000 |         0.0000 |         0.0000 |      0.0000 |             |            |      |             |         3 | 0000-00-00 00:00:00 |       |
+—-+——+——+———+——————-+——————-+———–+———————+———————+—————–+—————–+————-+——–+———+———–+————+——–+—————-+—————-+————-+————-+————+——+————-+———–+———————+——-+
1 row in set (0.00 sec)

(transfered)
select * from curcdr;
+—-+——+——+———+——————-+——————-+———–+———————+———————+—————–+—————–+————-+——–+———+———–+————+——–+—————-+—————-+————-+————-+————+——+————-+———–+———————+——-+
| id | src  | dst  | srcname | srcchan           | dstchan           | didnumber | starttime           | answertime          | srcuid          | dstuid          | disposition | userid | groupid | accountid | resellerid | credit | callshopcredit | resellercredit | creditlimit | destination | dialstring | memo | accountcode | monitored | calldate            | queue |
+—-+——+——+———+——————-+——————-+———–+———————+———————+—————–+—————–+————-+——–+———+———–+————+——–+—————-+—————-+————-+————-+————+——+————-+———–+———————+——-+
| 18 | 8001 | 5000 |         | sip/8001-00000234 | sip/5000-00000236 |           | 2010-09-28 06:02:23 | 2010-09-28 06:02:23 | 1285624937.1286 | 1285624942.1288 | LINK        |      0 |       0 |         0 |          0 | 0.0000 |         0.0000 |         0.0000 |      0.0000 |             |            |      |             |         5 | 0000-00-00 00:00:00 |       |
+—-+——+——+———+——————-+——————-+———–+———————+———————+—————–+—————–+————-+——–+———+———–+————+——–+—————-+—————-+————-+————-+————+——+————-+———–+———————+——-+
1 row in set (0.00 sec)

mycdr
select * from mycdr;
+—-+———————+——+——+———+——————-+——————-+———–+———-+———+—————+————-+————-+———–+—————–+—————–+———-+——–+—————-+—————-+———+————+——–+———–+————-+——+————+———–+———-+———+————+—————-+———–+———-+———+——+————-+———–+——————+——-+
| id | calldate            | src  | dst  | srcname | channel           | dstchannel        | didnumber | duration | billsec | billsec_leg_a | disposition | accountcode | userfield | srcuid          | dstuid          | calltype | credit | callshopcredit | resellercredit | groupid | resellerid | userid | accountid | destination | memo | dialstring | processed | children | ischild | customerid | crm_customerid | contactid | discount | payment | note | setfreecall | monitored | astercrm_groupid | queue |
+—-+———————+——+——+———+——————-+——————-+———–+———-+———+—————+————-+————-+———–+—————–+—————–+———-+——–+—————-+—————-+———+————+——–+———–+————-+——+————+———–+———-+———+————+—————-+———–+———-+———+——+————-+———–+——————+——-+
|  1 | 2010-09-28 06:00:50 | 8000 | 8001 | dev8000 | sip/8000-00000233 | sip/8001-00000234 | 8001      |       39 |      33 |             0 | ANSWERED    |             | UNBILLED  | 1285624850.1281 | 1285624850.1282 |          | 0.0000 |         0.0000 |         0.0000 |       0 |          0 |      0 |         0 |             |      |            |         0 |          | no      |          0 |              0 |         0 |   0.0000 |         | NULL | no          |         1 |                0 |       |
|  2 | 2010-09-28 06:01:29 | 8000 | 5000 | dev8000 | sip/8000-00000233 | sip/5000-00000235 | 8001      |       24 |      22 |             0 | ANSWERED    |             | UNBILLED  | 1285624850.1281 | 1285624889.1284 |          | 0.0000 |         0.0000 |         0.0000 |       0 |          0 |      0 |         0 |             |      |            |         0 |          | no      |          0 |              0 |         0 |   0.0000 |         | NULL | no          |         2 |                0 |       |
|  3 | 2010-09-28 06:01:53 | 8000 | 8001 | device  | sip/8000-00000233 | sip/8001-00000234 | 8001      |       24 |      24 |             0 | ANSWERED    |             | UNBILLED  | 1285624850.1281 | 1285624913.1285 |          | 0.0000 |         0.0000 |         0.0000 |       0 |          0 |      0 |         0 |             |      |            |         0 |          | no      |          0 |              0 |         0 |   0.0000 |         | NULL | no          |         3 |                0 |       |
|  4 | 2010-09-28 06:02:17 | 8000 | 5000 | dev8000 | sip/8000-00000233 | sip/5000-00000236 | 8001      |        6 |       5 |             0 | ANSWERED    |             | UNBILLED  | 1285624850.1281 | 1285624937.1287 |          | 0.0000 |         0.0000 |         0.0000 |       0 |          0 |      0 |         0 |             |      |            |         0 |          | no      |          0 |              0 |         0 |   0.0000 |         | NULL | no          |         4 |                0 |       |
|  5 | 2010-09-28 06:02:23 | 8001 | 5000 |         | sip/8001-00000234 | sip/5000-00000236 |           |       22 |      22 |             0 | ANSWERED    |             | UNBILLED  | 1285624937.1286 | 1285624942.1288 |          | 0.0000 |         0.0000 |         0.0000 |       0 |          0 |      0 |         0 |             |      |            |         0 |          | no      |          0 |              0 |         0 |   0.0000 |         | NULL | no          |         5 |                0 |       |
+—-+———————+——+——+———+——————-+——————-+———–+———-+———+—————+————-+————-+———–+—————–+—————–+———-+——–+—————-+—————-+———+————+——–+———–+————-+——+————+———–+———-+———+————+—————-+———–+———-+———+——+————-+———–+——————+——-+
5 rows in set (0.00 sec)

monitorrecord
select * from monitorrecord;
+—-+———-+—————————————————————-+————+———–+———+———–+———–+—————–+———-+———+———————+
| id | callerid | filename                                                       | fileformat | processed | groupid | accountid | extension | uniqueid        | mycdr_id | creby   | cretime             |
+—-+———-+—————————————————————-+————+———–+———+———–+———–+—————–+———-+———+———————+
|  1 | 8000     | /var/spool/asterisk/monitor/2010/09/28/06/8000-8001.1285624856 | wav        | no        |       0 |         0 | 8001      | 1285624850.1281 |        0 | astercc | 2010-09-28 06:00:56 |
|  2 | 8000     | /var/spool/asterisk/monitor/2010/09/28/06/8000-5000.1285624891 | wav        | no        |       0 |         0 | 5000      | 1285624850.1281 |        0 | astercc | 2010-09-28 06:01:32 |
|  3 | 8000     | /var/spool/asterisk/monitor/2010/09/28/06/8000-8001.1285624913 | wav        | no        |       0 |         0 | 8001      | 1285624850.1281 |        0 | astercc | 2010-09-28 06:01:53 |
|  4 | 8000     | /var/spool/asterisk/monitor/2010/09/28/06/8000-5000.1285624938 | wav        | no        |       0 |         0 | 5000      | 1285624850.1281 |        0 | astercc | 2010-09-28 06:02:18 |
|  5 | 8001     | /var/spool/asterisk/monitor/2010/09/28/06/8001-5000.1285624943 | wav        | no        |       0 |         0 | 5000      | 1285624937.1286 |        0 | astercc | 2010-09-28 06:02:23 |
+—-+———-+—————————————————————-+————+———–+———+———–+———–+—————–+———-+———+———————+
5 rows in set (0.00 sec)

monitorrecord files
ll /var/spool/asterisk/monitor/2010/09/28/06/
total 5116
-rw-r–r– 1 asterisk asterisk  337644 Sep 28 06:01 8000-5000.1285624891-in.wav
-rw-r–r– 1 asterisk asterisk  338284 Sep 28 06:01 8000-5000.1285624891-out.wav
-rw-r–r– 1 asterisk asterisk 1740204 Sep 28 06:02 8000-8001.1285624913-in.wav
-rw-r–r– 1 asterisk asterisk 1740844 Sep 28 06:02 8000-8001.1285624913-out.wav
-rw-r–r– 1 asterisk asterisk  537324 Sep 28 06:02 8001-5000.1285624943-in.wav
-rw-r–r– 1 asterisk asterisk  537964 Sep 28 06:02 8001-5000.1285624943-out.wav

=======incoming by quueu(dial 1000 to queue 1000, static agent: local/8000@from-internal/n)=======
(ringing)
select * from curcdr;
+—-+——+——+———+——————-+——————-+———–+———————+———————+—————–+—————–+————-+——–+———+———–+————+——–+—————-+—————-+————-+————-+————+——+————-+———–+———————+——-+
| id | src  | dst  | srcname | srcchan           | dstchan           | didnumber | starttime           | answertime          | srcuid          | dstuid          | disposition | userid | groupid | accountid | resellerid | credit | callshopcredit | resellercredit | creditlimit | destination | dialstring | memo | accountcode | monitored | calldate            | queue |
+—-+——+——+———+——————-+——————-+———–+———————+———————+—————–+—————–+————-+——–+———+———–+————+——–+—————-+—————-+————-+————-+————+——+————-+———–+———————+——-+
| 33 | 8001 | 8000 | dev8001 | sip/8001-00000243 | sip/8000-00000244 | 1000      | 2010-09-28 06:11:47 | 0000-00-00 00:00:00 | 1285625507.1327 | 1285625507.1328 | RINGING     |      0 |       0 |         0 |          0 | 0.0000 |         0.0000 |         0.0000 |      0.0000 |             | 8000       |      |             |         0 | 0000-00-00 00:00:00 | 1000  |
| 32 | 8001 |      | dev8001 | sip/8001-00000243 |                   | 1000      | 2010-09-28 06:11:47 | 0000-00-00 00:00:00 | 1285625507.1325 |                 | RING        |      0 |       0 |         0 |          0 | 0.0000 |         0.0000 |         0.0000 |      0.0000 |             |            |      |             |         0 | 0000-00-00 00:00:00 | 1000  |
+—-+——+——+———+——————-+——————-+———–+———————+———————+—————–+—————–+————-+——–+———+———–+————+——–+—————-+—————-+————-+————-+————+——+————-+———–+———————+——-+
2 rows in set (0.03 sec)

(answered)
select * from curcdr;
+—-+——+——+———+——————-+——————-+———–+———————+———————+—————–+—————–+————-+——–+———+———–+————+——–+—————-+—————-+————-+————-+————+——+————-+———–+———————+——-+
| id | src  | dst  | srcname | srcchan           | dstchan           | didnumber | starttime           | answertime          | srcuid          | dstuid          | disposition | userid | groupid | accountid | resellerid | credit | callshopcredit | resellercredit | creditlimit | destination | dialstring | memo | accountcode | monitored | calldate            | queue |
+—-+——+——+———+——————-+——————-+———–+———————+———————+—————–+—————–+————-+——–+———+———–+————+——–+—————-+—————-+————-+————-+————+——+————-+———–+———————+——-+
| 33 | 8001 | 8000 | dev8001 | sip/8001-00000243 | sip/8000-00000244 | 1000      | 2010-09-28 06:11:47 | 2010-09-28 06:12:00 | 1285625507.1327 | 1285625507.1328 | LINK        |      0 |       0 |         0 |          0 | 0.0000 |         0.0000 |         0.0000 |      0.0000 |             | 8000       |      |             |         1 | 0000-00-00 00:00:00 | 1000  |
+—-+——+——+———+——————-+——————-+———–+———————+———————+—————–+—————–+————-+——–+———+———–+————+——–+—————-+—————-+————-+————-+————+——+————-+———–+———————+——-+
1 row in set (0.09 sec)

(the third part ringing)
select * from curcdr;
+—-+——+——+———+——————-+——————-+———–+———————+———————+—————–+—————–+————-+——–+———+———–+————+——–+—————-+—————-+————-+————-+————+——+————-+———–+———————+——-+
| id | src  | dst  | srcname | srcchan           | dstchan           | didnumber | starttime           | answertime          | srcuid          | dstuid          | disposition | userid | groupid | accountid | resellerid | credit | callshopcredit | resellercredit | creditlimit | destination | dialstring | memo | accountcode | monitored | calldate            | queue |
+—-+——+——+———+——————-+——————-+———–+———————+———————+—————–+—————–+————-+——–+———+———–+————+——–+—————-+—————-+————-+————-+————+——+————-+———–+———————+——-+
| 36 | 8000 | 5000 | dev8000 | sip/8000-00000244 | sip/5000-00000246 |           | 2010-09-28 06:12:40 | 0000-00-00 00:00:00 | 1285625560.1332 | 1285625560.1333 | RINGING     |      0 |       0 |         0 |          0 | 0.0000 |         0.0000 |         0.0000 |      0.0000 |             | 5000       |      |             |         0 | 0000-00-00 00:00:00 |       |
+—-+——+——+———+——————-+——————-+———–+———————+———————+—————–+—————–+————-+——–+———+———–+————+——–+—————-+—————-+————-+————-+————+——+————-+———–+———————+——-+
1 row in set (0.00 sec)

(the third part answered)
select * from curcdr;
+—-+——+——+———+——————-+——————-+———–+———————+———————+—————–+—————–+————-+——–+———+———–+————+——–+—————-+—————-+————-+————-+————+——+————-+———–+———————+——-+
| id | src  | dst  | srcname | srcchan           | dstchan           | didnumber | starttime           | answertime          | srcuid          | dstuid          | disposition | userid | groupid | accountid | resellerid | credit | callshopcredit | resellercredit | creditlimit | destination | dialstring | memo | accountcode | monitored | calldate            | queue |
+—-+——+——+———+——————-+——————-+———–+———————+———————+—————–+—————–+————-+——–+———+———–+————+——–+—————-+—————-+————-+————-+————+——+————-+———–+———————+——-+
| 36 | 8000 | 5000 | dev8000 | sip/8000-00000244 | sip/5000-00000246 |           | 2010-09-28 06:12:40 | 2010-09-28 06:12:41 | 1285625560.1332 | 1285625560.1333 | LINK        |      0 |       0 |         0 |          0 | 0.0000 |         0.0000 |         0.0000 |      0.0000 |             | 5000       |      |             |         4 | 0000-00-00 00:00:00 |       |
+—-+——+——+———+——————-+——————-+———–+———————+———————+—————–+—————–+————-+——–+———+———–+————+——–+—————-+—————-+————-+————-+————+——+————-+———–+———————+——-+
1 row in set (0.00 sec)

(turn back)
select * from curcdr;
+—-+——+——+———+——————-+——————-+———–+———————+———————+—————–+—————–+————-+——–+———+———–+————+——–+—————-+—————-+————-+————-+————+——+————-+———–+———————+——-+
| id | src  | dst  | srcname | srcchan           | dstchan           | didnumber | starttime           | answertime          | srcuid          | dstuid          | disposition | userid | groupid | accountid | resellerid | credit | callshopcredit | resellercredit | creditlimit | destination | dialstring | memo | accountcode | monitored | calldate            | queue |
+—-+——+——+———+——————-+——————-+———–+———————+———————+—————–+—————–+————-+——–+———+———–+————+——–+—————-+—————-+————-+————-+————+——+————-+———–+———————+——-+
| 37 | 8001 | 8000 | device  | sip/8001-00000243 | sip/8000-00000244 | 1000      | 2010-09-28 06:13:02 | 2010-09-28 06:13:02 | 1285625507.1325 | 1285625582.1334 | LINK        |      0 |       0 |         0 |          0 | 0.0000 |         0.0000 |         0.0000 |      0.0000 |             |            |      |             |         5 | 0000-00-00 00:00:00 |       |
+—-+——+——+———+——————-+——————-+———–+———————+———————+—————–+—————–+————-+——–+———+———–+————+——–+—————-+—————-+————-+————-+————+——+————-+———–+———————+——-+
1 row in set (0.01 sec)

(transfered)
select * from curcdr;
+—-+——+——+———+——————-+——————-+———–+———————+———————+—————–+—————–+————-+——–+———+———–+————+——–+—————-+—————-+————-+————-+————+——+————-+———–+———————+——-+
| id | src  | dst  | srcname | srcchan           | dstchan           | didnumber | starttime           | answertime          | srcuid          | dstuid          | disposition | userid | groupid | accountid | resellerid | credit | callshopcredit | resellercredit | creditlimit | destination | dialstring | memo | accountcode | monitored | calldate            | queue |
+—-+——+——+———+——————-+——————-+———–+———————+———————+—————–+—————–+————-+——–+———+———–+————+——–+—————-+—————-+————-+————-+————+——+————-+———–+———————+——-+
| 39 | 8001 | 5000 | device  | sip/8001-00000243 | sip/5000-00000247 | 1000      | 2010-09-28 06:13:30 | 2010-09-28 06:13:30 | 1285625507.1325 | 1285625610.1337 | LINK        |      0 |       0 |         0 |          0 | 0.0000 |         0.0000 |         0.0000 |      0.0000 |             |            |      |             |         7 | 0000-00-00 00:00:00 |       |
+—-+——+——+———+——————-+——————-+———–+———————+———————+—————–+—————–+————-+——–+———+———–+————+——–+—————-+—————-+————-+————-+————+——+————-+———–+———————+——-+
1 row in set (0.00 sec)

mycdr
select * from mycdr;
+—-+———————+——+——+———+——————-+——————-+———–+———-+———+—————+————-+————-+———–+—————–+—————–+———-+——–+—————-+—————-+———+————+——–+———–+————-+——+————+———–+———-+———+————+—————-+———–+———-+———+——+————-+———–+——————+——-+
| id | calldate            | src  | dst  | srcname | channel           | dstchannel        | didnumber | duration | billsec | billsec_leg_a | disposition | accountcode | userfield | srcuid          | dstuid          | calltype | credit | callshopcredit | resellercredit | groupid | resellerid | userid | accountid | destination | memo | dialstring | processed | children | ischild | customerid | crm_customerid | contactid | discount | payment | note | setfreecall | monitored | astercrm_groupid | queue |
+—-+———————+——+——+———+——————-+——————-+———–+———-+———+—————+————-+————-+———–+—————–+—————–+———-+——–+—————-+—————-+———+————+——–+———–+————-+——+————+———–+———-+———+————+—————-+———–+———-+———+——+————-+———–+——————+——-+
|  1 | 2010-09-28 06:11:47 | 8001 | 8000 | dev8001 | sip/8001-00000243 | sip/8000-00000244 | 1000      |       37 |      24 |             0 | ANSWERED    |             | UNBILLED  | 1285625507.1327 | 1285625507.1328 |          | 0.0000 |         0.0000 |         0.0000 |       0 |          0 |      0 |         0 |             |      |            |         0 |          | no      |          0 |              0 |         0 |   0.0000 |         | NULL | no          |         1 |                0 | 1000  |
|  2 | 2010-09-28 06:12:40 | 8000 | 5000 | dev8000 | sip/8000-00000244 | sip/5000-00000246 |           |       22 |      21 |             0 | ANSWERED    |             | UNBILLED  | 1285625560.1332 | 1285625560.1333 |          | 0.0000 |         0.0000 |         0.0000 |       0 |          0 |      0 |         0 |             |      |            |         0 |          | no      |          0 |              0 |         0 |   0.0000 |         | NULL | no          |         4 |                0 |       |
|  3 | 2010-09-28 06:13:02 | 8001 | 8000 | device  | sip/8001-00000243 | sip/8000-00000244 | 1000      |       21 |      21 |             0 | ANSWERED    |             | UNBILLED  | 1285625507.1325 | 1285625582.1334 |          | 0.0000 |         0.0000 |         0.0000 |       0 |          0 |      0 |         0 |             |      |            |         0 |          | no      |          0 |              0 |         0 |   0.0000 |         | NULL | no          |         5 |                0 |       |
|  4 | 2010-09-28 06:13:24 | 8000 | 5000 | dev8000 | sip/8000-00000244 | sip/5000-00000247 |           |        7 |       5 |             0 | ANSWERED    |             | UNBILLED  | 1285625603.1335 | 1285625603.1336 |          | 0.0000 |         0.0000 |         0.0000 |       0 |          0 |      0 |         0 |             |      |            |         0 |          | no      |          0 |              0 |         0 |   0.0000 |         | NULL | no          |         6 |                0 |       |
|  5 | 2010-09-28 06:13:30 | 8001 | 5000 | device  | sip/8001-00000243 | sip/5000-00000247 | 1000      |       20 |      20 |             0 | ANSWERED    |             | UNBILLED  | 1285625507.1325 | 1285625610.1337 |          | 0.0000 |         0.0000 |         0.0000 |       0 |          0 |      0 |         0 |             |      |            |         0 |          | no      |          0 |              0 |         0 |   0.0000 |         | NULL | no          |         7 |                0 |       |
+—-+———————+——+——+———+——————-+——————-+———–+———-+———+—————+————-+————-+———–+—————–+—————–+———-+——–+—————-+—————-+———+————+——–+———–+————-+——+————+———–+———-+———+————+—————-+———–+———-+———+——+————-+———–+——————+——-+
7 rows in set (0.00 sec)

monitorrecord
select * from monitorrecord;
+—-+———-+—————————————————————-+————+———–+———+———–+———–+—————–+———-+———+———————+
| id | callerid | filename                                                       | fileformat | processed | groupid | accountid | extension | uniqueid        | mycdr_id | creby   | cretime             |
+—-+———-+—————————————————————-+————+———–+———+———–+———–+—————–+———-+———+———————+
|  1 | 8001     | /var/spool/asterisk/monitor/2010/09/28/06/8001-8000.1285625520 | wav        | no        |       0 |         0 | 8000      | 1285625507.1327 |        0 | astercc | 2010-09-28 06:12:00 |
|  2 | 8000     | /var/spool/asterisk/monitor/2010/09/28/06/8000-5000.1285625561 | wav        | no        |       0 |         0 | 5000      | 1285625560.1332 |        0 | astercc | 2010-09-28 06:12:42 |
|  3 | 8001     | /var/spool/asterisk/monitor/2010/09/28/06/8001-8000.1285625582 | wav        | no        |       0 |         0 | 8000      | 1285625507.1325 |        0 | astercc | 2010-09-28 06:13:02 |
|  4 | 8000     | /var/spool/asterisk/monitor/2010/09/28/06/8000-5000.1285625606 | wav        | no        |       0 |         0 | 5000      | 1285625603.1335 |        0 | astercc | 2010-09-28 06:13:26 |
|  5 | 8001     | /var/spool/asterisk/monitor/2010/09/28/06/8001-5000.1285625610 | wav        | no        |       0 |         0 | 5000      | 1285625507.1325 |        0 | astercc | 2010-09-28 06:13:31 |
+—-+———-+—————————————————————-+————+———–+———+———–+———–+—————–+———-+———+———————+
7 rows in set (0.00 sec)

monitorrecord files
ll /var/spool/asterisk/monitor/2010/09/28/06/
total 4468
-rw-r–r– 1 asterisk asterisk  326444 Sep 28 06:13 8000-5000.1285625561-in.wav
-rw-r–r– 1 asterisk asterisk  326124 Sep 28 06:13 8000-5000.1285625561-out.wav
-rw-r–r– 1 asterisk asterisk  383084 Sep 28 06:13 8001-5000.1285625610-in.wav
-rw-r–r– 1 asterisk asterisk  385324 Sep 28 06:13 8001-5000.1285625610-out.wav
-rw-r–r– 1 asterisk asterisk 1451884 Sep 28 06:13 8001-8000.1285625582-in.wav
-rw-r–r– 1 asterisk asterisk 1450284 Sep 28 06:13 8001-8000.1285625582-out.wav

=======incoming by queue(dial 1000 to queue 1000, agent: Agent/1000)=======
agent login
select * from curcdr;
+—-+——+—–+———+——————-+———+———–+———————+———————+—————–+——–+————-+——–+———+———–+————+——–+—————-+—————-+————-+————-+————+——+————-+———–+———————+——-+
| id | src  | dst | srcname | srcchan           | dstchan | didnumber | starttime           | answertime          | srcuid          | dstuid | disposition | userid | groupid | accountid | resellerid | credit | callshopcredit | resellercredit | creditlimit | destination | dialstring | memo | accountcode | monitored | calldate            | queue |
+—-+——+—–+———+——————-+———+———–+———————+———————+—————–+——–+————-+——–+———+———–+————+——–+—————-+—————-+————-+————-+————+——+————-+———–+———————+——-+
|  9 | 8000 |     | device  | sip/8000-00000250 |         | *789      | 2010-09-28 06:35:31 | 0000-00-00 00:00:00 | 1285626931.1352 |        | RING        |      0 |       0 |         0 |          0 | 0.0000 |         0.0000 |         0.0000 |      0.0000 |             |            |      |             |         0 | 0000-00-00 00:00:00 |       |
+—-+——+—–+———+——————-+———+———–+———————+———————+—————–+——–+————-+——–+———+———–+————+——–+—————-+—————-+————-+————-+————+——+————-+———–+———————+——-+
1 row in set (0.00 sec)

(answered)
select * from curcdr;
+—-+——+——+———+——————-+————+———–+———————+———————+—————–+—————–+————-+——–+———+———–+————+——–+—————-+—————-+————-+————-+————+——+————-+———–+———————+——-+
| id | src  | dst  | srcname | srcchan           | dstchan    | didnumber | starttime           | answertime          | srcuid          | dstuid          | disposition | userid | groupid | accountid | resellerid | credit | callshopcredit | resellercredit | creditlimit | destination | dialstring | memo | accountcode | monitored | calldate            | queue |
+—-+——+——+———+——————-+————+———–+———————+———————+—————–+—————–+————-+——–+———+———–+————+——–+—————-+—————-+————-+————-+————+——+————-+———–+———————+——-+
| 11 | 8001 | 8001 | device  | sip/8001-00000251 | agent/1000 | 1000      | 2010-09-28 06:35:54 | 2010-09-28 06:35:54 | 1285626953.1353 | 1285626953.1354 | LINK        |      0 |       0 |         0 |          0 | 0.0000 |         0.0000 |         0.0000 |      0.0000 |             |            |      |             |         1 | 0000-00-00 00:00:00 | 1000  |
|  9 | 8000 |      | device  | sip/8000-00000250 |            | *789      | 2010-09-28 06:35:31 | 0000-00-00 00:00:00 | 1285626931.1352 |                 | RING        |      0 |       0 |         0 |          0 | 0.0000 |         0.0000 |         0.0000 |      0.0000 |             |            |      |             |         0 | 0000-00-00 00:00:00 |       |
+—-+——+——+———+——————-+————+———–+———————+———————+—————–+—————–+————-+——–+———+———–+————+——–+—————-+—————-+————-+————-+————+——+————-+———–+———————+——-+
2 rows in set (0.00 sec)

(the third part ringing)
select * from curcdr;
select * from curcdr;
+—-+——+——+———+——————-+——————-+———–+———————+———————+—————–+—————–+————-+——–+———+———–+————+——–+—————-+—————-+————-+————-+————+——+————-+———–+———————+——-+
| id | src  | dst  | srcname | srcchan           | dstchan           | didnumber | starttime           | answertime          | srcuid          | dstuid          | disposition | userid | groupid | accountid | resellerid | credit | callshopcredit | resellercredit | creditlimit | destination | dialstring | memo | accountcode | monitored | calldate            | queue |
+—-+——+——+———+——————-+——————-+———–+———————+———————+—————–+—————–+————-+——–+———+———–+————+——–+—————-+—————-+————-+————-+————+——+————-+———–+———————+——-+
| 12 | 8001 | 5000 | dev8001 | sip/8001-00000251 | sip/5000-00000252 | 1000      | 2010-09-28 06:36:17 | 0000-00-00 00:00:00 | 1285626953.1353 | 1285626977.1355 | RINGING     |      0 |       0 |         0 |          0 | 0.0000 |         0.0000 |         0.0000 |      0.0000 |             | 5000       |      |             |         0 | 0000-00-00 00:00:00 |       |
|  9 | 8000 |      | device  | sip/8000-00000250 |                   | *789      | 2010-09-28 06:35:31 | 0000-00-00 00:00:00 | 1285626931.1352 |                 | RING        |      0 |       0 |         0 |          0 | 0.0000 |         0.0000 |         0.0000 |      0.0000 |             |            |      |             |         0 | 0000-00-00 00:00:00 |       |
+—-+——+——+———+——————-+——————-+———–+———————+———————+—————–+—————–+————-+——–+———+———–+————+——–+—————-+—————-+————-+————-+————+——+————-+———–+———————+——-+
2 rows in set (0.00 sec)

(the third part answered)
select * from curcdr;
+—-+——+——+———+——————-+——————-+———–+———————+———————+—————–+—————–+————-+——–+———+———–+————+——–+—————-+—————-+————-+————-+————+——+————-+———–+———————+——-+
| id | src  | dst  | srcname | srcchan           | dstchan           | didnumber | starttime           | answertime          | srcuid          | dstuid          | disposition | userid | groupid | accountid | resellerid | credit | callshopcredit | resellercredit | creditlimit | destination | dialstring | memo | accountcode | monitored | calldate            | queue |
+—-+——+——+———+——————-+——————-+———–+———————+———————+—————–+—————–+————-+——–+———+———–+————+——–+—————-+—————-+————-+————-+————+——+————-+———–+———————+——-+
| 12 | 8001 | 5000 | dev8001 | sip/8001-00000251 | sip/5000-00000252 | 1000      | 2010-09-28 06:36:17 | 2010-09-28 06:36:19 | 1285626953.1353 | 1285626977.1355 | LINK        |      0 |       0 |         0 |          0 | 0.0000 |         0.0000 |         0.0000 |      0.0000 |             | 5000       |      |             |         2 | 0000-00-00 00:00:00 |       |
|  9 | 8000 |      | device  | sip/8000-00000250 |                   | *789      | 2010-09-28 06:35:31 | 0000-00-00 00:00:00 | 1285626931.1352 |                 | RING        |      0 |       0 |         0 |          0 | 0.0000 |         0.0000 |         0.0000 |      0.0000 |             |            |      |             |         0 | 0000-00-00 00:00:00 |       |
+—-+——+——+———+——————-+——————-+———–+———————+———————+—————–+—————–+————-+——–+———+———–+————+——–+—————-+—————-+————-+————-+————+——+————-+———–+———————+——-+
2 rows in set (0.00 sec)

mycdr
select * from mycdr;
+—-+———————+——+——+———+——————-+——————-+———–+———-+———+—————+————-+————-+———–+—————–+—————–+———-+——–+—————-+—————-+———+————+——–+———–+————-+——+————+———–+———-+———+————+—————-+———–+———-+———+——+————-+———–+——————+——-+
| id | calldate            | src  | dst  | srcname | channel           | dstchannel        | didnumber | duration | billsec | billsec_leg_a | disposition | accountcode | userfield | srcuid          | dstuid          | calltype | credit | callshopcredit | resellercredit | groupid | resellerid | userid | accountid | destination | memo | dialstring | processed | children | ischild | customerid | crm_customerid | contactid | discount | payment | note | setfreecall | monitored | astercrm_groupid | queue |
+—-+———————+——+——+———+——————-+——————-+———–+———-+———+—————+————-+————-+———–+—————–+—————–+———-+——–+—————-+—————-+———+————+——–+———–+————-+——+————+———–+———-+———+————+—————-+———–+———-+———+——+————-+———–+——————+——-+
|  1 | 2010-09-28 06:35:54 | 8001 | 8001 | device  | sip/8001-00000251 | agent/1000        | 1000      |       23 |      23 |             0 | ANSWERED    |             | UNBILLED  | 1285626953.1353 | 1285626953.1354 |          | 0.0000 |         0.0000 |         0.0000 |       0 |          0 |      0 |         0 |             |      |            |         0 |          | no      |          0 |              0 |         0 |   0.0000 |         | NULL | no          |         1 |                0 | 1000  |
|  2 | 2010-09-28 06:36:17 | 8001 | 5000 | dev8001 | sip/8001-00000251 | sip/5000-00000252 | 1000      |       27 |      25 |             0 | ANSWERED    |             | UNBILLED  | 1285626953.1353 | 1285626977.1355 |          | 0.0000 |         0.0000 |         0.0000 |       0 |          0 |      0 |         0 |             |      |            |         0 |          | no      |          0 |              0 |         0 |   0.0000 |         | NULL | no          |         2 |                0 |       |
+—-+———————+——+——+———+——————-+——————-+———–+———-+———+—————+————-+————-+———–+—————–+—————–+———-+——–+—————-+—————-+———+————+——–+———–+————-+——+————+———–+———-+———+————+—————-+———–+———-+———+——+————-+———–+——————+——-+
2 rows in set (0.00 sec)

monitorrecord
select * from monitorrecord;
+—-+———-+—————————————————————-+————+———–+———+———–+———–+—————–+———-+———+———————+
| id | callerid | filename                                                       | fileformat | processed | groupid | accountid | extension | uniqueid        | mycdr_id | creby   | cretime             |
+—-+———-+—————————————————————-+————+———–+———+———–+———–+—————–+———-+———+———————+
|  1 | 8001     | /var/spool/asterisk/monitor/2010/09/28/06/8001-8001.1285626954 | wav        | no        |       0 |         0 | 8001      | 1285626953.1353 |        0 | astercc | 2010-09-28 06:35:54 |
|  2 | 8001     | /var/spool/asterisk/monitor/2010/09/28/06/8001-5000.1285626979 | wav        | no        |       0 |         0 | 5000      | 1285626953.1353 |        0 | astercc | 2010-09-28 06:36:19 |
+—-+———-+—————————————————————-+————+———–+———+———–+———–+—————–+———-+———+———————+
2 rows in set (0.00 sec)

monitorrecord files
ll /var/spool/asterisk/monitor/2010/09/28/06/
total 1540
-rw-r–r– 1 asterisk asterisk 401644 Sep 28 06:36 8001-5000.1285626979-in.wav
-rw-r–r– 1 asterisk asterisk 400364 Sep 28 06:36 8001-5000.1285626979-out.wav
-rw-r–r– 1 asterisk asterisk 376364 Sep 28 06:36 8001-8001.1285626954-in.wav
-rw-r–r– 1 asterisk asterisk 376044 Sep 28 06:36 8001-8001.1285626954-out.wav

=======click to dial in portal page(agent ring first)=======
(agent ringing)
select * from curcdr;
+—-+——+——+———–+———————————+——————-+———–+———————+———————+—————–+—————–+————-+——–+———+———–+————+——–+—————-+—————-+————-+————-+————+——+————-+———–+———————+——-+
| id | src  | dst  | srcname   | srcchan                         | dstchan           | didnumber | starttime           | answertime          | srcuid          | dstuid          | disposition | userid | groupid | accountid | resellerid | credit | callshopcredit | resellercredit | creditlimit | destination | dialstring | memo | accountcode | monitored | calldate            | queue |
+—-+——+——+———–+———————————+——————-+———–+———————+———————+—————–+—————–+————-+——–+———+———–+————+——–+—————-+—————-+————-+————-+————+——+————-+———–+———————+——-+
| 13 | 8001 | 8000 | <unknown> | local/8000@from-internal-8cb4;2 | sip/8000-00000253 |           | 2010-09-28 06:40:11 | 0000-00-00 00:00:00 | 1285627211.1357 | 1285627211.1358 | RINGING     |      0 |       0 |         0 |          0 | 0.0000 |         0.0000 |         0.0000 |      0.0000 |             | 8000       |      |             |         0 | 0000-00-00 00:00:00 |       |
+—-+——+——+———–+———————————+——————-+———–+———————+———————+—————–+—————–+————-+——–+———+———–+————+——–+—————-+—————-+————-+————-+————+——+————-+———–+———————+——-+
1 row in set (0.00 sec)

(agent answered/callee ringing)
select * from curcdr;
+—-+——+——+———+——————-+——————-+———–+———————+———————+—————–+—————–+————-+——–+———+———–+————+——–+—————-+—————-+————-+————-+————+——+————-+———–+———————+——-+
| id | src  | dst  | srcname | srcchan           | dstchan           | didnumber | starttime           | answertime          | srcuid          | dstuid          | disposition | userid | groupid | accountid | resellerid | credit | callshopcredit | resellercredit | creditlimit | destination | dialstring | memo | accountcode | monitored | calldate            | queue |
+—-+——+——+———+——————-+——————-+———–+———————+———————+—————–+—————–+————-+——–+———+———–+————+——–+—————-+—————-+————-+————-+————+——+————-+———–+———————+——-+
| 13 | 8001 | 8000 |         | sip/8001-00000254 | sip/8000-00000253 |           | 2010-09-28 06:40:11 | 0000-00-00 00:00:00 | 1285627211.1357 | 1285627211.1358 | BRIDGELINK  |      0 |       0 |         0 |          0 | 0.0000 |         0.0000 |         0.0000 |      0.0000 |             | 8000       |      |             |         0 | 2010-09-28 06:40:17 |       |
+—-+——+——+———+——————-+——————-+———–+———————+———————+—————–+—————–+————-+——–+———+———–+————+——–+—————-+—————-+————-+————-+————+——+————-+———–+———————+——-+
1 row in set (0.00 sec)

(answered)
select * from curcdr;
+—-+——+——+———+——————-+——————-+———–+———————+———————+—————–+—————–+————-+——–+———+———–+————+——–+—————-+—————-+————-+————-+————+——+————-+———–+———————+——-+
| id | src  | dst  | srcname | srcchan           | dstchan           | didnumber | starttime           | answertime          | srcuid          | dstuid          | disposition | userid | groupid | accountid | resellerid | credit | callshopcredit | resellercredit | creditlimit | destination | dialstring | memo | accountcode | monitored | calldate            | queue |
+—-+——+——+———+——————-+——————-+———–+———————+———————+—————–+—————–+————-+——–+———+———–+————+——–+—————-+—————-+————-+————-+————+——+————-+———–+———————+——-+
| 13 | 8001 | 8000 |         | sip/8001-00000254 | sip/8000-00000253 |           | 2010-09-28 06:40:11 | 2010-09-28 06:40:38 | 1285627211.1357 | 1285627211.1358 | LINK        |      0 |       0 |         0 |          0 | 0.0000 |         0.0000 |         0.0000 |      0.0000 |             | 8000       |      |             |         1 | 2010-09-28 06:40:17 |       |
+—-+——+——+———+——————-+——————-+———–+———————+———————+—————–+—————–+————-+——–+———+———–+————+——–+—————-+—————-+————-+————-+————+——+————-+———–+———————+——-+
1 row in set (0.00 sec)

(the third part ringing)
select * from curcdr;
+—-+——+——+———+——————-+——————-+———–+———————+———————+—————–+—————–+————-+——–+———+———–+————+——–+—————-+—————-+————-+————-+————+——+————-+———–+———————+——-+
| id | src  | dst  | srcname | srcchan           | dstchan           | didnumber | starttime           | answertime          | srcuid          | dstuid          | disposition | userid | groupid | accountid | resellerid | credit | callshopcredit | resellercredit | creditlimit | destination | dialstring | memo | accountcode | monitored | calldate            | queue |
+—-+——+——+———+——————-+——————-+———–+———————+———————+—————–+—————–+————-+——–+———+———–+————+——–+—————-+—————-+————-+————-+————+——+————-+———–+———————+——-+
| 14 | 8000 | 5000 | dev8000 | sip/8000-00000253 | sip/5000-00000255 |           | 2010-09-28 06:41:13 | 0000-00-00 00:00:00 | 1285627273.1361 | 1285627273.1362 | RINGING     |      0 |       0 |         0 |          0 | 0.0000 |         0.0000 |         0.0000 |      0.0000 |             | 5000       |      |             |         0 | 0000-00-00 00:00:00 |       |
+—-+——+——+———+——————-+——————-+———–+———————+———————+—————–+—————–+————-+——–+———+———–+————+——–+—————-+—————-+————-+————-+————+——+————-+———–+———————+——-+
1 row in set (0.00 sec)

(the third part answered)
select * from curcdr;
+—-+——+——+———+——————-+——————-+———–+———————+———————+—————–+—————–+————-+——–+———+———–+————+——–+—————-+—————-+————-+————-+————+——+————-+———–+———————+——-+
| id | src  | dst  | srcname | srcchan           | dstchan           | didnumber | starttime           | answertime          | srcuid          | dstuid          | disposition | userid | groupid | accountid | resellerid | credit | callshopcredit | resellercredit | creditlimit | destination | dialstring | memo | accountcode | monitored | calldate            | queue |
+—-+——+——+———+——————-+——————-+———–+———————+———————+—————–+—————–+————-+——–+———+———–+————+——–+—————-+—————-+————-+————-+————+——+————-+———–+———————+——-+
| 14 | 8000 | 5000 | dev8000 | sip/8000-00000253 | sip/5000-00000255 |           | 2010-09-28 06:41:13 | 2010-09-28 06:41:15 | 1285627273.1361 | 1285627273.1362 | LINK        |      0 |       0 |         0 |          0 | 0.0000 |         0.0000 |         0.0000 |      0.0000 |             | 5000       |      |             |         2 | 0000-00-00 00:00:00 |       |
+—-+——+——+———+——————-+——————-+———–+———————+———————+—————–+—————–+————-+——–+———+———–+————+——–+—————-+—————-+————-+————-+————+——+————-+———–+———————+——-+
1 row in set (0.00 sec)

(turn back)
select * from curcdr;
+—-+——+——+———+——————-+——————-+———–+———————+———————+—————–+—————–+————-+——–+———+———–+————+——–+—————-+—————-+————-+————-+————+——+————-+———–+———————+——-+
| id | src  | dst  | srcname | srcchan           | dstchan           | didnumber | starttime           | answertime          | srcuid          | dstuid          | disposition | userid | groupid | accountid | resellerid | credit | callshopcredit | resellercredit | creditlimit | destination | dialstring | memo | accountcode | monitored | calldate            | queue |
+—-+——+——+———+——————-+——————-+———–+———————+———————+—————–+—————–+————-+——–+———+———–+————+——–+—————-+—————-+————-+————-+————+——+————-+———–+———————+——-+
| 15 | 8001 | 8000 |         | sip/8001-00000254 | sip/8000-00000253 |           | 2010-09-28 06:41:51 | 2010-09-28 06:41:51 | 1285627273.1360 | 1285627311.1363 | LINK        |      0 |       0 |         0 |          0 | 0.0000 |         0.0000 |         0.0000 |      0.0000 |             |            |      |             |         3 | 0000-00-00 00:00:00 |       |
+—-+——+——+———+——————-+——————-+———–+———————+———————+—————–+—————–+————-+——–+———+———–+————+——–+—————-+—————-+————-+————-+————+——+————-+———–+———————+——-+
1 row in set (0.00 sec)

(transfered)
select * from curcdr;
+—-+——+——+———+——————-+——————-+———–+———————+———————+—————–+—————–+————-+——–+———+———–+————+——–+—————-+—————-+————-+————-+————+——+————-+———–+———————+——-+
| id | src  | dst  | srcname | srcchan           | dstchan           | didnumber | starttime           | answertime          | srcuid          | dstuid          | disposition | userid | groupid | accountid | resellerid | credit | callshopcredit | resellercredit | creditlimit | destination | dialstring | memo | accountcode | monitored | calldate            | queue |
+—-+——+——+———+——————-+——————-+———–+———————+———————+—————–+—————–+————-+——–+———+———–+————+——–+—————-+—————-+————-+————-+————+——+————-+———–+———————+——-+
| 17 | 8001 | 5000 |         | sip/8001-00000254 | sip/5000-00000256 |           | 2010-09-28 06:43:01 | 2010-09-28 06:43:01 | 1285627273.1360 | 1285627381.1366 | LINK        |      0 |       0 |         0 |          0 | 0.0000 |         0.0000 |         0.0000 |      0.0000 |             |            |      |             |         5 | 0000-00-00 00:00:00 |       |
+—-+——+——+———+——————-+——————-+———–+———————+———————+—————–+—————–+————-+——–+———+———–+————+——–+—————-+—————-+————-+————-+————+——+————-+———–+———————+——-+
1 row in set (0.00 sec)

mycdr
select * from mycdr;
+—-+———————+——+——+———+——————-+——————-+———–+———-+———+—————+————-+————-+———–+—————–+—————–+———-+——–+—————-+—————-+———+————+——–+———–+————-+——+————+———–+———-+———+————+—————-+———–+———-+———+——+————-+———–+——————+——-+
| id | calldate            | src  | dst  | srcname | channel           | dstchannel        | didnumber | duration | billsec | billsec_leg_a | disposition | accountcode | userfield | srcuid          | dstuid          | calltype | credit | callshopcredit | resellercredit | groupid | resellerid | userid | accountid | destination | memo | dialstring | processed | children | ischild | customerid | crm_customerid | contactid | discount | payment | note | setfreecall | monitored | astercrm_groupid | queue |
+—-+———————+——+——+———+——————-+——————-+———–+———-+———+—————+————-+————-+———–+—————–+—————–+———-+——–+—————-+—————-+———+————+——–+———–+————-+——+————+———–+———-+———+————+—————-+———–+———-+———+——+————-+———–+——————+——-+
|  1 | 2010-09-28 06:40:11 | 8001 | 8000 |         | sip/8001-00000254 | sip/8000-00000253 |           |       62 |      35 |            56 | ANSWERED    |             | UNBILLED  | 1285627211.1357 | 1285627211.1358 |          | 0.0000 |         0.0000 |         0.0000 |       0 |          0 |      0 |         0 |             |      |            |         0 |          | no      |          0 |              0 |         0 |   0.0000 |         | NULL | no          |         1 |                0 |       |
|  2 | 2010-09-28 06:41:13 | 8000 | 5000 | dev8000 | sip/8000-00000253 | sip/5000-00000255 |           |       38 |      36 |             0 | ANSWERED    |             | UNBILLED  | 1285627273.1361 | 1285627273.1362 |          | 0.0000 |         0.0000 |         0.0000 |       0 |          0 |      0 |         0 |             |      |            |         0 |          | no      |          0 |              0 |         0 |   0.0000 |         | NULL | no          |         2 |                0 |       |
|  3 | 2010-09-28 06:41:51 | 8001 | 8000 |         | sip/8001-00000254 | sip/8000-00000253 |           |       64 |      64 |             0 | ANSWERED    |             | UNBILLED  | 1285627273.1360 | 1285627311.1363 |          | 0.0000 |         0.0000 |         0.0000 |       0 |          0 |      0 |         0 |             |      |            |         0 |          | no      |          0 |              0 |         0 |   0.0000 |         | NULL | no          |         3 |                0 |       |
|  4 | 2010-09-28 06:42:55 | 8000 | 5000 | dev8000 | sip/8000-00000253 | sip/5000-00000256 |           |        6 |       4 |             0 | ANSWERED    |             | UNBILLED  | 1285627375.1364 | 1285627375.1365 |          | 0.0000 |         0.0000 |         0.0000 |       0 |          0 |      0 |         0 |             |      |            |         0 |          | no      |          0 |              0 |         0 |   0.0000 |         | NULL | no          |         4 |                0 |       |
|  5 | 2010-09-28 06:43:01 | 8001 | 5000 |         | sip/8001-00000254 | sip/5000-00000256 |           |       16 |      16 |             0 | ANSWERED    |             | UNBILLED  | 1285627273.1360 | 1285627381.1366 |          | 0.0000 |         0.0000 |         0.0000 |       0 |          0 |      0 |         0 |             |      |            |         0 |          | no      |          0 |              0 |         0 |   0.0000 |         | NULL | no          |         5 |                0 |       |
+—-+———————+——+——+———+——————-+——————-+———–+———-+———+—————+————-+————-+———–+—————–+—————–+———-+——–+—————-+—————-+———+————+——–+———–+————-+——+————+———–+———-+———+————+—————-+———–+———-+———+——+————-+———–+——————+——-+
5 rows in set (0.00 sec)

monitorrecord
select * from monitorrecord;
+—-+———-+—————————————————————-+————+———–+———+———–+———–+—————–+———-+———+———————+
| id | callerid | filename                                                       | fileformat | processed | groupid | accountid | extension | uniqueid        | mycdr_id | creby   | cretime             |
+—-+———-+—————————————————————-+————+———–+———+———–+———–+—————–+———-+———+———————+
|  1 | 8001     | /var/spool/asterisk/monitor/2010/09/28/06/8001-8000.1285627238 | wav        | no        |       0 |         0 | 8000      | 1285627211.1357 |        0 | astercc | 2010-09-28 06:40:38 |
|  2 | 8000     | /var/spool/asterisk/monitor/2010/09/28/06/8000-5000.1285627275 | wav        | no        |       0 |         0 | 5000      | 1285627273.1361 |        0 | astercc | 2010-09-28 06:41:15 |
|  3 | 8001     | /var/spool/asterisk/monitor/2010/09/28/06/8001-8000.1285627311 | wav        | no        |       0 |         0 | 8000      | 1285627273.1360 |        0 | astercc | 2010-09-28 06:41:51 |
|  4 | 8000     | /var/spool/asterisk/monitor/2010/09/28/06/8000-5000.1285627377 | wav        | no        |       0 |         0 | 5000      | 1285627375.1364 |        0 | astercc | 2010-09-28 06:42:58 |
|  5 | 8001     | /var/spool/asterisk/monitor/2010/09/28/06/8001-5000.1285627381 | wav        | no        |       0 |         0 | 5000      | 1285627273.1360 |        0 | astercc | 2010-09-28 06:43:01 |
+—-+———-+—————————————————————-+————+———–+———+———–+———–+—————–+———-+———+———————+
5 rows in set (0.00 sec)

monitorrecord files
ll /var/spool/asterisk/monitor/2010/09/28/06/
total 6400
-rw-r–r– 1 asterisk asterisk  577004 Sep 28 06:41 8000-5000.1285627275-in.wav
-rw-r–r– 1 asterisk asterisk  576684 Sep 28 06:41 8000-5000.1285627275-out.wav
-rw-r–r– 1 asterisk asterisk  415724 Sep 28 06:43 8001-5000.1285627381-in.wav
-rw-r–r– 1 asterisk asterisk  416044 Sep 28 06:43 8001-5000.1285627381-out.wav
-rw-r–r– 1 asterisk asterisk 2283884 Sep 28 06:43 8001-8000.1285627311-in.wav
-rw-r–r– 1 asterisk asterisk 2283884 Sep 28 06:43 8001-8000.1285627311-out.wav

=======click to dial in portal page(agent ring first,use from-internal-mask as outcontext)=======
(agent ringing)
select * from curcdr;
+—-+——+——+———–+———————————+——————-+———–+———————+———————+—————–+—————–+————-+——–+———+———–+————+——–+—————-+—————-+————-+————-+————+——+————-+———–+———————+——-+
| id | src  | dst  | srcname   | srcchan                         | dstchan           | didnumber | starttime           | answertime          | srcuid          | dstuid          | disposition | userid | groupid | accountid | resellerid | credit | callshopcredit | resellercredit | creditlimit | destination | dialstring | memo | accountcode | monitored | calldate            | queue |
+—-+——+——+———–+———————————+——————-+———–+———————+———————+—————–+—————–+————-+——–+———+———–+————+——–+—————-+—————-+————-+————-+————+——+————-+———–+———————+——-+
| 18 | 8001 | 8000 | <unknown> | local/8000@from-internal-97e1;2 | sip/8000-00000257 |           | 2010-09-28 06:45:25 | 0000-00-00 00:00:00 | 1285627525.1368 | 1285627525.1369 | RINGING     |      0 |       0 |         0 |          0 | 0.0000 |         0.0000 |         0.0000 |      0.0000 |             | 8000       |      |             |         0 | 0000-00-00 00:00:00 |       |
+—-+——+——+———–+———————————+——————-+———–+———————+———————+—————–+—————–+————-+——–+———+———–+————+——–+—————-+—————-+————-+————-+————+——+————-+———–+———————+——-+
1 row in set (0.00 sec)

(agent answered/callee ringing)
select * from curcdr;
+—-+——+——+———+——————-+——————-+———–+———————+———————+—————–+—————–+————-+——–+———+———–+————+——–+—————-+—————-+————-+————-+————+——+————-+———–+———————+——-+
| id | src  | dst  | srcname | srcchan           | dstchan           | didnumber | starttime           | answertime          | srcuid          | dstuid          | disposition | userid | groupid | accountid | resellerid | credit | callshopcredit | resellercredit | creditlimit | destination | dialstring | memo | accountcode | monitored | calldate            | queue |
+—-+——+——+———+——————-+——————-+———–+———————+———————+—————–+—————–+————-+——–+———+———–+————+——–+—————-+—————-+————-+————-+————+——+————-+———–+———————+——-+
| 18 | 8001 | 8000 |         | sip/8001-00000258 | sip/8000-00000257 |           | 2010-09-28 06:45:25 | 0000-00-00 00:00:00 | 1285627525.1368 | 1285627525.1369 | BRIDGELINK  |      0 |       0 |         0 |          0 | 0.0000 |         0.0000 |         0.0000 |      0.0000 |             | 8000       |      |             |         0 | 2010-09-28 06:45:33 |       |
+—-+——+——+———+——————-+——————-+———–+———————+———————+—————–+—————–+————-+——–+———+———–+————+——–+—————-+—————-+————-+————-+————+——+————-+———–+———————+——-+
1 row in set (0.00 sec)

(answered)
select * from curcdr;
+—-+——+——+———+——————-+——————-+———–+———————+———————+—————–+—————–+————-+——–+———+———–+————+——–+—————-+—————-+————-+————-+————+——+————-+———–+———————+——-+
| id | src  | dst  | srcname | srcchan           | dstchan           | didnumber | starttime           | answertime          | srcuid          | dstuid          | disposition | userid | groupid | accountid | resellerid | credit | callshopcredit | resellercredit | creditlimit | destination | dialstring | memo | accountcode | monitored | calldate            | queue |
+—-+——+——+———+——————-+——————-+———–+———————+———————+—————–+—————–+————-+——–+———+———–+————+——–+—————-+—————-+————-+————-+————+——+————-+———–+———————+——-+
| 18 | 8001 | 8000 |         | sip/8001-00000258 | sip/8000-00000257 |           | 2010-09-28 06:45:25 | 2010-09-28 06:45:52 | 1285627525.1368 | 1285627525.1369 | LINK        |      0 |       0 |         0 |          0 | 0.0000 |         0.0000 |         0.0000 |      0.0000 |             | 8000       |      |             |         1 | 2010-09-28 06:45:33 |       |
+—-+——+——+———+——————-+——————-+———–+———————+———————+—————–+—————–+————-+——–+———+———–+————+——–+—————-+—————-+————-+————-+————+——+————-+———–+———————+——-+
1 row in set (0.00 sec)

(the third part ringing)
select * from curcdr;
+—-+——+——+———+——————-+——————-+———–+———————+———————+—————–+—————–+————-+——–+———+———–+————+——–+—————-+—————-+————-+————-+————+——+————-+———–+———————+——-+
| id | src  | dst  | srcname | srcchan           | dstchan           | didnumber | starttime           | answertime          | srcuid          | dstuid          | disposition | userid | groupid | accountid | resellerid | credit | callshopcredit | resellercredit | creditlimit | destination | dialstring | memo | accountcode | monitored | calldate            | queue |
+—-+——+——+———+——————-+——————-+———–+———————+———————+—————–+—————–+————-+——–+———+———–+————+——–+—————-+—————-+————-+————-+————+——+————-+———–+———————+——-+
| 19 | 8000 | 5000 | dev8000 | sip/8000-00000257 | sip/5000-00000259 |           | 2010-09-28 06:46:12 | 0000-00-00 00:00:00 | 1285627572.1372 | 1285627572.1373 | RINGING     |      0 |       0 |         0 |          0 | 0.0000 |         0.0000 |         0.0000 |      0.0000 |             | 5000       |      |             |         0 | 0000-00-00 00:00:00 |       |
+—-+——+——+———+——————-+——————-+———–+———————+———————+—————–+—————–+————-+——–+———+———–+————+——–+—————-+—————-+————-+————-+————+——+————-+———–+———————+——-+
1 row in set (0.00 sec)

(the third part answered)
select * from curcdr;
+—-+——+——+———+——————-+——————-+———–+———————+———————+—————–+—————–+————-+——–+———+———–+————+——–+—————-+—————-+————-+————-+————+——+————-+———–+———————+——-+
| id | src  | dst  | srcname | srcchan           | dstchan           | didnumber | starttime           | answertime          | srcuid          | dstuid          | disposition | userid | groupid | accountid | resellerid | credit | callshopcredit | resellercredit | creditlimit | destination | dialstring | memo | accountcode | monitored | calldate            | queue |
+—-+——+——+———+——————-+——————-+———–+———————+———————+—————–+—————–+————-+——–+———+———–+————+——–+—————-+—————-+————-+————-+————+——+————-+———–+———————+——-+
| 19 | 8000 | 5000 | dev8000 | sip/8000-00000257 | sip/5000-00000259 |           | 2010-09-28 06:46:12 | 2010-09-28 06:46:15 | 1285627572.1372 | 1285627572.1373 | LINK        |      0 |       0 |         0 |          0 | 0.0000 |         0.0000 |         0.0000 |      0.0000 |             | 5000       |      |             |         2 | 0000-00-00 00:00:00 |       |
+—-+——+——+———+——————-+——————-+———–+———————+———————+—————–+—————–+————-+——–+———+———–+————+——–+—————-+—————-+————-+————-+————+——+————-+———–+———————+——-+
1 row in set (0.01 sec)

(turn back)
select * from curcdr;
+—-+——+——+———+——————-+——————-+———–+———————+———————+—————–+—————–+————-+——–+———+———–+————+——–+—————-+—————-+————-+————-+————+——+————-+———–+———————+——-+
| id | src  | dst  | srcname | srcchan           | dstchan           | didnumber | starttime           | answertime          | srcuid          | dstuid          | disposition | userid | groupid | accountid | resellerid | credit | callshopcredit | resellercredit | creditlimit | destination | dialstring | memo | accountcode | monitored | calldate            | queue |
+—-+——+——+———+——————-+——————-+———–+———————+———————+—————–+—————–+————-+——–+———+———–+————+——–+—————-+—————-+————-+————-+————+——+————-+———–+———————+——-+
| 20 | 8001 | 8000 |         | sip/8001-00000258 | sip/8000-00000257 |           | 2010-09-28 06:46:35 | 2010-09-28 06:46:35 | 1285627572.1371 | 1285627595.1374 | LINK        |      0 |       0 |         0 |          0 | 0.0000 |         0.0000 |         0.0000 |      0.0000 |             |            |      |             |         3 | 0000-00-00 00:00:00 |       |
+—-+——+——+———+——————-+——————-+———–+———————+———————+—————–+—————–+————-+——–+———+———–+————+——–+—————-+—————-+————-+————-+————+——+————-+———–+———————+——-+
1 row in set (0.00 sec)

(transfered)
select * from curcdr;
+—-+——+——+———+——————-+——————-+———–+———————+———————+—————–+—————–+————-+——–+———+———–+————+——–+—————-+—————-+————-+————-+————+——+————-+———–+———————+——-+
| id | src  | dst  | srcname | srcchan           | dstchan           | didnumber | starttime           | answertime          | srcuid          | dstuid          | disposition | userid | groupid | accountid | resellerid | credit | callshopcredit | resellercredit | creditlimit | destination | dialstring | memo | accountcode | monitored | calldate            | queue |
+—-+——+——+———+——————-+——————-+———–+———————+———————+—————–+—————–+————-+——–+———+———–+————+——–+—————-+—————-+————-+————-+————+——+————-+———–+———————+——-+
| 22 | 8001 | 5000 |         | sip/8001-00000258 | sip/5000-0000025a |           | 2010-09-28 06:46:56 | 2010-09-28 06:46:56 | 1285627572.1371 | 1285627616.1377 | LINK        |      0 |       0 |         0 |          0 | 0.0000 |         0.0000 |         0.0000 |      0.0000 |             |            |      |             |         5 | 0000-00-00 00:00:00 |       |
+—-+——+——+———+——————-+——————-+———–+———————+———————+—————–+—————–+————-+——–+———+———–+————+——–+—————-+—————-+————-+————-+————+——+————-+———–+———————+——-+
1 row in set (0.00 sec)

mycdr
select * from mycdr;
+—-+———————+——+——+———+——————-+——————-+———–+———-+———+—————+————-+————-+———–+—————–+—————–+———-+——–+—————-+—————-+———+————+——–+———–+————-+——+————+———–+———-+———+————+—————-+———–+———-+———+——+————-+———–+——————+——-+
| id | calldate            | src  | dst  | srcname | channel           | dstchannel        | didnumber | duration | billsec | billsec_leg_a | disposition | accountcode | userfield | srcuid          | dstuid          | calltype | credit | callshopcredit | resellercredit | groupid | resellerid | userid | accountid | destination | memo | dialstring | processed | children | ischild | customerid | crm_customerid | contactid | discount | payment | note | setfreecall | monitored | astercrm_groupid | queue |
+—-+———————+——+——+———+——————-+——————-+———–+———-+———+—————+————-+————-+———–+—————–+—————–+———-+——–+—————-+—————-+———+————+——–+———–+————-+——+————+———–+———-+———+————+—————-+———–+———-+———+——+————-+———–+——————+——-+
|  1 | 2010-09-28 06:45:25 | 8001 | 8000 |         | sip/8001-00000258 | sip/8000-00000257 |           |       47 |      20 |            39 | ANSWERED    |             | UNBILLED  | 1285627525.1368 | 1285627525.1369 |          | 0.0000 |         0.0000 |         0.0000 |       0 |          0 |      0 |         0 |             |      |            |         0 |          | no      |          0 |              0 |         0 |   0.0000 |         | NULL | no          |         1 |                0 |       |
|  2 | 2010-09-28 06:46:12 | 8000 | 5000 | dev8000 | sip/8000-00000257 | sip/5000-00000259 |           |       23 |      20 |             0 | ANSWERED    |             | UNBILLED  | 1285627572.1372 | 1285627572.1373 |          | 0.0000 |         0.0000 |         0.0000 |       0 |          0 |      0 |         0 |             |      |            |         0 |          | no      |          0 |              0 |         0 |   0.0000 |         | NULL | no          |         2 |                0 |       |
|  3 | 2010-09-28 06:46:35 | 8001 | 8000 |         | sip/8001-00000258 | sip/8000-00000257 |           |       14 |      14 |             0 | ANSWERED    |             | UNBILLED  | 1285627572.1371 | 1285627595.1374 |          | 0.0000 |         0.0000 |         0.0000 |       0 |          0 |      0 |         0 |             |      |            |         0 |          | no      |          0 |              0 |         0 |   0.0000 |         | NULL | no          |         3 |                0 |       |
|  4 | 2010-09-28 06:46:50 | 8000 | 5000 | dev8000 | sip/8000-00000257 | sip/5000-0000025a |           |        7 |       4 |             0 | ANSWERED    |             | UNBILLED  | 1285627609.1375 | 1285627610.1376 |          | 0.0000 |         0.0000 |         0.0000 |       0 |          0 |      0 |         0 |             |      |            |         0 |          | no      |          0 |              0 |         0 |   0.0000 |         | NULL | no          |         4 |                0 |       |
|  5 | 2010-09-28 06:46:56 | 8001 | 5000 |         | sip/8001-00000258 | sip/5000-0000025a |           |       18 |      18 |             0 | ANSWERED    |             | UNBILLED  | 1285627572.1371 | 1285627616.1377 |          | 0.0000 |         0.0000 |         0.0000 |       0 |          0 |      0 |         0 |             |      |            |         0 |          | no      |          0 |              0 |         0 |   0.0000 |         | NULL | no          |         5 |                0 |       |
+—-+———————+——+——+———+——————-+——————-+———–+———-+———+—————+————-+————-+———–+—————–+—————–+———-+——–+—————-+—————-+———+————+——–+———–+————-+——+————+———–+———-+———+————+—————-+———–+———-+———+——+————-+———–+——————+——-+
5 rows in set (0.00 sec)

monitorrecord
select * from monitorrecord;
+—-+———-+—————————————————————-+————+———–+———+———–+———–+—————–+———-+———+———————+
| id | callerid | filename                                                       | fileformat | processed | groupid | accountid | extension | uniqueid        | mycdr_id | creby   | cretime             |
+—-+———-+—————————————————————-+————+———–+———+———–+———–+—————–+———-+———+———————+
|  1 | 8001     | /var/spool/asterisk/monitor/2010/09/28/06/8001-8000.1285627552 | wav        | no        |       0 |         0 | 8000      | 1285627525.1368 |        0 | astercc | 2010-09-28 06:45:52 |
|  2 | 8000     | /var/spool/asterisk/monitor/2010/09/28/06/8000-5000.1285627575 | wav        | no        |       0 |         0 | 5000      | 1285627572.1372 |        0 | astercc | 2010-09-28 06:46:16 |
|  3 | 8001     | /var/spool/asterisk/monitor/2010/09/28/06/8001-8000.1285627595 | wav        | no        |       0 |         0 | 8000      | 1285627572.1371 |        0 | astercc | 2010-09-28 06:46:35 |
|  4 | 8000     | /var/spool/asterisk/monitor/2010/09/28/06/8000-5000.1285627613 | wav        | no        |       0 |         0 | 5000      | 1285627609.1375 |        0 | astercc | 2010-09-28 06:46:53 |
|  5 | 8001     | /var/spool/asterisk/monitor/2010/09/28/06/8001-5000.1285627616 | wav        | no        |       0 |         0 | 5000      | 1285627572.1371 |        0 | astercc | 2010-09-28 06:46:57 |
+—-+———-+—————————————————————-+————+———–+———+———–+———–+—————–+———-+———+———————+
5 rows in set (0.00 sec)

monitorrecord files
ll /var/spool/asterisk/monitor/2010/09/28/06/
total 3488
-rw-r–r– 1 asterisk asterisk  307244 Sep 28 06:46 8000-5000.1285627575-in.wav
-rw-r–r– 1 asterisk asterisk  307884 Sep 28 06:46 8000-5000.1285627575-out.wav
-rw-r–r– 1 asterisk asterisk  444844 Sep 28 06:47 8001-5000.1285627616-in.wav
-rw-r–r– 1 asterisk asterisk  445484 Sep 28 06:47 8001-5000.1285627616-out.wav
-rw-r–r– 1 asterisk asterisk 1031404 Sep 28 06:46 8001-8000.1285627595-in.wav
-rw-r–r– 1 asterisk asterisk 1030764 Sep 28 06:46 8001-8000.1285627595-out.wav

=======click to dial in partal page(callee ring first)=======
(callee ringing)
select * from curcdr;
+—-+——+——+———–+———————————+——————-+———–+———————+———————+—————–+—————–+————-+——–+———+———–+————+——–+—————-+—————-+————-+————-+————+——+————-+———–+———————+——-+
| id | src  | dst  | srcname   | srcchan                         | dstchan           | didnumber | starttime           | answertime          | srcuid          | dstuid          | disposition | userid | groupid | accountid | resellerid | credit | callshopcredit | resellercredit | creditlimit | destination | dialstring | memo | accountcode | monitored | calldate            | queue |
+—-+——+——+———–+———————————+——————-+———–+———————+———————+—————–+—————–+————-+——–+———+———–+————+——–+—————-+—————-+————-+————-+————+——+————-+———–+———————+——-+
| 23 | 8001 | 8001 | <unknown> | local/8001@from-internal-9858;2 | sip/8001-0000025b |           | 2010-09-28 06:48:50 | 0000-00-00 00:00:00 | 1285627730.1379 | 1285627730.1380 | RINGING     |      0 |       0 |         0 |          0 | 0.0000 |         0.0000 |         0.0000 |      0.0000 |             | 8001       |      |             |         0 | 0000-00-00 00:00:00 |       |
+—-+——+——+———–+———————————+——————-+———–+———————+———————+—————–+—————–+————-+——–+———+———–+————+——–+—————-+—————-+————-+————-+————+——+————-+———–+———————+——-+
1 row in set (0.01 sec)

(callee answered/agent ringing)
select * from curcdr;
+—-+——+——+———+——————-+——————-+———–+———————+———————+—————–+—————–+————-+——–+———+———–+————+——–+—————-+—————-+————-+————-+————+——+————-+———–+———————+——-+
| id | src  | dst  | srcname | srcchan           | dstchan           | didnumber | starttime           | answertime          | srcuid          | dstuid          | disposition | userid | groupid | accountid | resellerid | credit | callshopcredit | resellercredit | creditlimit | destination | dialstring | memo | accountcode | monitored | calldate            | queue |
+—-+——+——+———+——————-+——————-+———–+———————+———————+—————–+—————–+————-+——–+———+———–+————+——–+—————-+—————-+————-+————-+————+——+————-+———–+———————+——-+
| 23 | 8000 | 8001 |         | sip/8000-0000025c | sip/8001-0000025b |           | 2010-09-28 06:48:50 | 0000-00-00 00:00:00 | 1285627730.1379 | 1285627730.1380 | BRIDGELINK  |      0 |       0 |         0 |          0 | 0.0000 |         0.0000 |         0.0000 |      0.0000 |             | 8001       |      |             |         0 | 2010-09-28 06:48:58 |       |
+—-+——+——+———+——————-+——————-+———–+———————+———————+—————–+—————–+————-+——–+———+———–+————+——–+—————-+—————-+————-+————-+————+——+————-+———–+———————+——-+
1 row in set (0.00 sec)

(answered)
select * from curcdr;
+—-+——+——+———+——————-+——————-+———–+———————+———————+—————–+—————–+————-+——–+———+———–+————+——–+—————-+—————-+————-+————-+————+——+————-+———–+———————+——-+
| id | src  | dst  | srcname | srcchan           | dstchan           | didnumber | starttime           | answertime          | srcuid          | dstuid          | disposition | userid | groupid | accountid | resellerid | credit | callshopcredit | resellercredit | creditlimit | destination | dialstring | memo | accountcode | monitored | calldate            | queue |
+—-+——+——+———+——————-+——————-+———–+———————+———————+—————–+—————–+————-+——–+———+———–+————+——–+—————-+—————-+————-+————-+————+——+————-+———–+———————+——-+
| 23 | 8000 | 8001 |         | sip/8000-0000025c | sip/8001-0000025b |           | 2010-09-28 06:48:50 | 2010-09-28 06:49:17 | 1285627730.1379 | 1285627730.1380 | LINK        |      0 |       0 |         0 |          0 | 0.0000 |         0.0000 |         0.0000 |      0.0000 |             | 8001       |      |             |         1 | 2010-09-28 06:48:58 |       |
+—-+——+——+———+——————-+——————-+———–+———————+———————+—————–+—————–+————-+——–+———+———–+————+——–+—————-+—————-+————-+————-+————+——+————-+———–+———————+——-+
1 row in set (0.00 sec)

(the third part ringing)
select * from curcdr;
+—-+——+——+———+——————-+——————-+———–+———————+———————+—————–+—————–+————-+——–+———+———–+————+——–+—————-+—————-+————-+————-+————+——+————-+———–+———————+——-+
| id | src  | dst  | srcname | srcchan           | dstchan           | didnumber | starttime           | answertime          | srcuid          | dstuid          | disposition | userid | groupid | accountid | resellerid | credit | callshopcredit | resellercredit | creditlimit | destination | dialstring | memo | accountcode | monitored | calldate            | queue |
+—-+——+——+———+——————-+——————-+———–+———————+———————+—————–+—————–+————-+——–+———+———–+————+——–+—————-+—————-+————-+————-+————+——+————-+———–+———————+——-+
| 24 | 8000 | 5000 | dev8000 | sip/8000-0000025c | sip/5000-0000025d |           | 2010-09-28 06:49:36 | 0000-00-00 00:00:00 | 1285627775.1384 | 1285627776.1385 | RINGING     |      0 |       0 |         0 |          0 | 0.0000 |         0.0000 |         0.0000 |      0.0000 |             | 5000       |      |             |         0 | 0000-00-00 00:00:00 |       |
+—-+——+——+———+——————-+——————-+———–+———————+———————+—————–+—————–+————-+——–+———+———–+————+——–+—————-+—————-+————-+————-+————+——+————-+———–+———————+——-+
1 row in set (0.00 sec)

(the third part answered)
select * from curcdr;
+—-+——+——+———+——————-+——————-+———–+———————+———————+—————–+—————–+————-+——–+———+———–+————+——–+—————-+—————-+————-+————-+————+——+————-+———–+———————+——-+
| id | src  | dst  | srcname | srcchan           | dstchan           | didnumber | starttime           | answertime          | srcuid          | dstuid          | disposition | userid | groupid | accountid | resellerid | credit | callshopcredit | resellercredit | creditlimit | destination | dialstring | memo | accountcode | monitored | calldate            | queue |
+—-+——+——+———+——————-+——————-+———–+———————+———————+—————–+—————–+————-+——–+———+———–+————+——–+—————-+—————-+————-+————-+————+——+————-+———–+———————+——-+
| 24 | 8000 | 5000 | dev8000 | sip/8000-0000025c | sip/5000-0000025d |           | 2010-09-28 06:49:36 | 2010-09-28 06:49:37 | 1285627775.1384 | 1285627776.1385 | LINK        |      0 |       0 |         0 |          0 | 0.0000 |         0.0000 |         0.0000 |      0.0000 |             | 5000       |      |             |         2 | 0000-00-00 00:00:00 |       |
+—-+——+——+———+——————-+——————-+———–+———————+———————+—————–+—————–+————-+——–+———+———–+————+——–+—————-+—————-+————-+————-+————+——+————-+———–+———————+——-+
1 row in set (0.00 sec)

(turn back)
select * from curcdr;
+—-+——+——+———+——————-+——————-+———–+———————+———————+—————–+—————–+————-+——–+———+———–+————+——–+—————-+—————-+————-+————-+————+——+————-+———–+———————+——-+
| id | src  | dst  | srcname | srcchan           | dstchan           | didnumber | starttime           | answertime          | srcuid          | dstuid          | disposition | userid | groupid | accountid | resellerid | credit | callshopcredit | resellercredit | creditlimit | destination | dialstring | memo | accountcode | monitored | calldate            | queue |
+—-+——+——+———+——————-+——————-+———–+———————+———————+—————–+—————–+————-+——–+———+———–+————+——–+—————-+—————-+————-+————-+————+——+————-+———–+———————+——-+
| 25 | 8000 | 8001 |         | sip/8000-0000025c | sip/8001-0000025b |           | 2010-09-28 06:50:02 | 2010-09-28 06:50:02 | 1285627775.1384 | 1285627802.1386 | LINK        |      0 |       0 |         0 |          0 | 0.0000 |         0.0000 |         0.0000 |      0.0000 |             |            |      |             |         3 | 0000-00-00 00:00:00 |       |
+—-+——+——+———+——————-+——————-+———–+———————+———————+—————–+—————–+————-+——–+———+———–+————+——–+—————-+—————-+————-+————-+————+——+————-+———–+———————+——-+
1 row in set (0.00 sec)

(transfered)
select * from curcdr;
+—-+——+——+———+——————-+——————-+———–+———————+———————+—————–+—————–+————-+——–+———+———–+————+——–+—————-+—————-+————-+————-+————+——+————-+———–+———————+——-+
| id | src  | dst  | srcname | srcchan           | dstchan           | didnumber | starttime           | answertime          | srcuid          | dstuid          | disposition | userid | groupid | accountid | resellerid | credit | callshopcredit | resellercredit | creditlimit | destination | dialstring | memo | accountcode | monitored | calldate            | queue |
+—-+——+——+———+——————-+——————-+———–+———————+———————+—————–+—————–+————-+——–+———+———–+————+——–+—————-+—————-+————-+————-+————+——+————-+———–+———————+——-+
| 27 | 8001 | 5000 |         | sip/8001-0000025b | sip/5000-0000025e |           | 2010-09-28 06:50:23 | 2010-09-28 06:50:23 | 1285627818.1387 | 1285627823.1389 | LINK        |      0 |       0 |         0 |          0 | 0.0000 |         0.0000 |         0.0000 |      0.0000 |             |            |      |             |         5 | 0000-00-00 00:00:00 |       |
+—-+——+——+———+——————-+——————-+———–+———————+———————+—————–+—————–+————-+——–+———+———–+————+——–+—————-+—————-+————-+————-+————+——+————-+———–+———————+——-+
1 row in set (0.00 sec)

mycdr
select * from mycdr;
+—-+———————+——+——+———+——————-+——————-+———–+———-+———+—————+————-+————-+———–+—————–+—————–+———-+——–+—————-+—————-+———+————+——–+———–+————-+——+————+———–+———-+———+————+—————-+———–+———-+———+——+————-+———–+——————+——-+
| id | calldate            | src  | dst  | srcname | channel           | dstchannel        | didnumber | duration | billsec | billsec_leg_a | disposition | accountcode | userfield | srcuid          | dstuid          | calltype | credit | callshopcredit | resellercredit | groupid | resellerid | userid | accountid | destination | memo | dialstring | processed | children | ischild | customerid | crm_customerid | contactid | discount | payment | note | setfreecall | monitored | astercrm_groupid | queue |
+—-+———————+——+——+———+——————-+——————-+———–+———-+———+—————+————-+————-+———–+—————–+—————–+———-+——–+—————-+—————-+———+————+——–+———–+————-+——+————+———–+———-+———+————+—————-+———–+———-+———+——+————-+———–+——————+——-+
|  1 | 2010-09-28 06:48:50 | 8000 | 8001 |         | sip/8000-0000025c | sip/8001-0000025b |           |       46 |      19 |            38 | ANSWERED    |             | UNBILLED  | 1285627730.1379 | 1285627730.1380 |          | 0.0000 |         0.0000 |         0.0000 |       0 |          0 |      0 |         0 |             |      |            |         0 |          | no      |          0 |              0 |         0 |   0.0000 |         | NULL | no          |         1 |                0 |       |
|  2 | 2010-09-28 06:49:36 | 8000 | 5000 | dev8000 | sip/8000-0000025c | sip/5000-0000025d |           |       26 |      25 |             0 | ANSWERED    |             | UNBILLED  | 1285627775.1384 | 1285627776.1385 |          | 0.0000 |         0.0000 |         0.0000 |       0 |          0 |      0 |         0 |             |      |            |         0 |          | no      |          0 |              0 |         0 |   0.0000 |         | NULL | no          |         2 |                0 |       |
|  3 | 2010-09-28 06:50:02 | 8000 | 8001 |         | sip/8000-0000025c | sip/8001-0000025b |           |       16 |      16 |             0 | ANSWERED    |             | UNBILLED  | 1285627775.1384 | 1285627802.1386 |          | 0.0000 |         0.0000 |         0.0000 |       0 |          0 |      0 |         0 |             |      |            |         0 |          | no      |          0 |              0 |         0 |   0.0000 |         | NULL | no          |         3 |                0 |       |
|  4 | 2010-09-28 06:50:19 | 8000 | 5000 | dev8000 | sip/8000-0000025c | sip/5000-0000025e |           |        4 |       2 |             0 | ANSWERED    |             | UNBILLED  | 1285627775.1384 | 1285627819.1388 |          | 0.0000 |         0.0000 |         0.0000 |       0 |          0 |      0 |         0 |             |      |            |         0 |          | no      |          0 |              0 |         0 |   0.0000 |         | NULL | no          |         4 |                0 |       |
|  5 | 2010-09-28 06:50:23 | 8001 | 5000 |         | sip/8001-0000025b | sip/5000-0000025e |           |       20 |      20 |             0 | ANSWERED    |             | UNBILLED  | 1285627818.1387 | 1285627823.1389 |          | 0.0000 |         0.0000 |         0.0000 |       0 |          0 |      0 |         0 |             |      |            |         0 |          | no      |          0 |              0 |         0 |   0.0000 |         | NULL | no          |         5 |                0 |       |
+—-+———————+——+——+———+——————-+——————-+———–+———-+———+—————+————-+————-+———–+—————–+—————–+———-+——–+—————-+—————-+———+————+——–+———–+————-+——+————+———–+———-+———+————+—————-+———–+———-+———+——+————-+———–+——————+——-+
5 rows in set (0.00 sec)

monitorrecord
select * from monitorrecord;
+—-+———-+—————————————————————-+————+———–+———+———–+———–+—————–+———-+———+———————+
| id | callerid | filename                                                       | fileformat | processed | groupid | accountid | extension | uniqueid        | mycdr_id | creby   | cretime             |
+—-+———-+—————————————————————-+————+———–+———+———–+———–+—————–+———-+———+———————+
|  1 | 8000     | /var/spool/asterisk/monitor/2010/09/28/06/8000-8001.1285627757 | wav        | no        |       0 |         0 | 8001      | 1285627730.1379 |        0 | astercc | 2010-09-28 06:49:17 |
|  2 | 8000     | /var/spool/asterisk/monitor/2010/09/28/06/8000-5000.1285627777 | wav        | no        |       0 |         0 | 5000      | 1285627775.1384 |        0 | astercc | 2010-09-28 06:49:37 |
|  3 | 8000     | /var/spool/asterisk/monitor/2010/09/28/06/8000-8001.1285627802 | wav        | no        |       0 |         0 | 8001      | 1285627775.1384 |        0 | astercc | 2010-09-28 06:50:02 |
|  4 | 8000     | /var/spool/asterisk/monitor/2010/09/28/06/8000-5000.1285627821 | wav        | no        |       0 |         0 | 5000      | 1285627775.1384 |        0 | astercc | 2010-09-28 06:50:21 |
|  5 | 8001     | /var/spool/asterisk/monitor/2010/09/28/06/8001-5000.1285627823 | wav        | no        |       0 |         0 | 5000      | 1285627818.1387 |        0 | astercc | 2010-09-28 06:50:23 |
+—-+———-+—————————————————————-+————+———–+———+———–+———–+—————–+———-+———+———————+
5 rows in set (0.00 sec)

monitorrecord files
ll /var/spool/asterisk/monitor/2010/09/28/06/
total 4368
-rw-r–r– 1 asterisk asterisk  395884 Sep 28 06:50 8000-5000.1285627777-in.wav
-rw-r–r– 1 asterisk asterisk  395884 Sep 28 06:50 8000-5000.1285627777-out.wav
-rw-r–r– 1 asterisk asterisk 1380204 Sep 28 06:50 8000-8001.1285627802-in.wav
-rw-r–r– 1 asterisk asterisk 1381164 Sep 28 06:50 8000-8001.1285627802-out.wav
-rw-r–r– 1 asterisk asterisk  461804 Sep 28 06:50 8001-5000.1285627823-in.wav
-rw-r–r– 1 asterisk asterisk  462124 Sep 28 06:50 8001-5000.1285627823-out.wav

=======click to dial in partal page(callee ring first,use from-internal-mask as outcontext)=======
(callee ringing)
select * from curcdr;
+—-+——+——+———–+————————————–+——————-+———–+———————+———————+—————–+—————–+————-+——–+———+———–+————+——–+—————-+—————-+————-+————-+————+——+————-+———–+———————+——-+
| id | src  | dst  | srcname   | srcchan                              | dstchan           | didnumber | starttime           | answertime          | srcuid          | dstuid          | disposition | userid | groupid | accountid | resellerid | credit | callshopcredit | resellercredit | creditlimit | destination | dialstring | memo | accountcode | monitored | calldate            | queue |
+—-+——+——+———–+————————————–+——————-+———–+———————+———————+—————–+—————–+————-+——–+———+———–+————+——–+—————-+—————-+————-+————-+————+——+————-+———–+———————+——-+
| 28 | 8000 | 8001 | <unknown> | local/8001@from-internal-mask-4e44;2 | sip/8001-0000025f |           | 2010-09-28 06:52:02 | 0000-00-00 00:00:00 | 1285627922.1391 | 1285627922.1392 | RINGING     |      0 |       0 |         0 |          0 | 0.0000 |         0.0000 |         0.0000 |      0.0000 |             | 8001       |      |             |         0 | 0000-00-00 00:00:00 |       |
+—-+——+——+———–+————————————–+——————-+———–+———————+———————+—————–+—————–+————-+——–+———+———–+————+——–+—————-+—————-+————-+————-+————+——+————-+———–+———————+——-+
1 row in set (0.00 sec)

(callee answered/agent ringing)
select * from curcdr;
+—-+——+——+———+——————-+——————-+———–+———————+———————+—————–+—————–+————-+——–+———+———–+————+——–+—————-+—————-+————-+————-+————+——+————-+———–+———————+——-+
| id | src  | dst  | srcname | srcchan           | dstchan           | didnumber | starttime           | answertime          | srcuid          | dstuid          | disposition | userid | groupid | accountid | resellerid | credit | callshopcredit | resellercredit | creditlimit | destination | dialstring | memo | accountcode | monitored | calldate            | queue |
+—-+——+——+———+——————-+——————-+———–+———————+———————+—————–+—————–+————-+——–+———+———–+————+——–+—————-+—————-+————-+————-+————+——+————-+———–+———————+——-+
| 28 | 8000 | 8001 |         | sip/8000-00000260 | sip/8001-0000025f |           | 2010-09-28 06:52:02 | 0000-00-00 00:00:00 | 1285627922.1391 | 1285627922.1392 | BRIDGELINK  |      0 |       0 |         0 |          0 | 0.0000 |         0.0000 |         0.0000 |      0.0000 |             | 8001       |      |             |         0 | 2010-09-28 06:52:13 |       |
+—-+——+——+———+——————-+——————-+———–+———————+———————+—————–+—————–+————-+——–+———+———–+————+——–+—————-+—————-+————-+————-+————+——+————-+———–+———————+——-+
1 row in set (0.00 sec)

(answered)
select * from curcdr;
+—-+——+——+———+——————-+——————-+———–+———————+———————+—————–+—————–+————-+——–+———+———–+————+——–+—————-+—————-+————-+————-+————+——+————-+———–+———————+——-+
| id | src  | dst  | srcname | srcchan           | dstchan           | didnumber | starttime           | answertime          | srcuid          | dstuid          | disposition | userid | groupid | accountid | resellerid | credit | callshopcredit | resellercredit | creditlimit | destination | dialstring | memo | accountcode | monitored | calldate            | queue |
+—-+——+——+———+——————-+——————-+———–+———————+———————+—————–+—————–+————-+——–+———+———–+————+——–+—————-+—————-+————-+————-+————+——+————-+———–+———————+——-+
| 28 | 8000 | 8001 |         | sip/8000-00000260 | sip/8001-0000025f |           | 2010-09-28 06:52:02 | 2010-09-28 06:52:31 | 1285627922.1391 | 1285627922.1392 | LINK        |      0 |       0 |         0 |          0 | 0.0000 |         0.0000 |         0.0000 |      0.0000 |             | 8001       |      |             |         1 | 2010-09-28 06:52:13 |       |
+—-+——+——+———+——————-+——————-+———–+———————+———————+—————–+—————–+————-+——–+———+———–+————+——–+—————-+—————-+————-+————-+————+——+————-+———–+———————+——-+
1 row in set (0.00 sec)

(the third part ringing)
select * from curcdr;
+—-+——+——+———+——————-+——————-+———–+———————+———————+—————–+—————–+————-+——–+———+———–+————+——–+—————-+—————-+————-+————-+————+——+————-+———–+———————+——-+
| id | src  | dst  | srcname | srcchan           | dstchan           | didnumber | starttime           | answertime          | srcuid          | dstuid          | disposition | userid | groupid | accountid | resellerid | credit | callshopcredit | resellercredit | creditlimit | destination | dialstring | memo | accountcode | monitored | calldate            | queue |
+—-+——+——+———+——————-+——————-+———–+———————+———————+—————–+—————–+————-+——–+———+———–+————+——–+—————-+—————-+————-+————-+————+——+————-+———–+———————+——-+
| 29 | 8000 | 5000 | dev8000 | sip/8000-00000260 | sip/5000-00000261 |           | 2010-09-28 06:52:54 | 0000-00-00 00:00:00 | 1285627974.1395 | 1285627974.1396 | RINGING     |      0 |       0 |         0 |          0 | 0.0000 |         0.0000 |         0.0000 |      0.0000 |             | 5000       |      |             |         0 | 0000-00-00 00:00:00 |       |
+—-+——+——+———+——————-+——————-+———–+———————+———————+—————–+—————–+————-+——–+———+———–+————+——–+—————-+—————-+————-+————-+————+——+————-+———–+———————+——-+
1 row in set (0.00 sec)

(the third part answered)
select * from curcdr;
+—-+——+——+———+——————-+——————-+———–+———————+———————+—————–+—————–+————-+——–+———+———–+————+——–+—————-+—————-+————-+————-+————+——+————-+———–+———————+——-+
| id | src  | dst  | srcname | srcchan           | dstchan           | didnumber | starttime           | answertime          | srcuid          | dstuid          | disposition | userid | groupid | accountid | resellerid | credit | callshopcredit | resellercredit | creditlimit | destination | dialstring | memo | accountcode | monitored | calldate            | queue |
+—-+——+——+———+——————-+——————-+———–+———————+———————+—————–+—————–+————-+——–+———+———–+————+——–+—————-+—————-+————-+————-+————+——+————-+———–+———————+——-+
| 29 | 8000 | 5000 | dev8000 | sip/8000-00000260 | sip/5000-00000261 |           | 2010-09-28 06:52:54 | 2010-09-28 06:52:56 | 1285627974.1395 | 1285627974.1396 | LINK        |      0 |       0 |         0 |          0 | 0.0000 |         0.0000 |         0.0000 |      0.0000 |             | 5000       |      |             |         2 | 0000-00-00 00:00:00 |       |
+—-+——+——+———+——————-+——————-+———–+———————+———————+—————–+—————–+————-+——–+———+———–+————+——–+—————-+—————-+————-+————-+————+——+————-+———–+———————+——-+
1 row in set (0.00 sec)

(turn back)
select * from curcdr;
+—-+——+——+———+——————-+——————-+———–+———————+———————+—————–+—————–+————-+——–+———+———–+————+——–+—————-+—————-+————-+————-+————+——+————-+———–+———————+——-+
| id | src  | dst  | srcname | srcchan           | dstchan           | didnumber | starttime           | answertime          | srcuid          | dstuid          | disposition | userid | groupid | accountid | resellerid | credit | callshopcredit | resellercredit | creditlimit | destination | dialstring | memo | accountcode | monitored | calldate            | queue |
+—-+——+——+———+——————-+——————-+———–+———————+———————+—————–+—————–+————-+——–+———+———–+————+——–+—————-+—————-+————-+————-+————+——+————-+———–+———————+——-+
| 30 | 8000 | 8001 |         | sip/8000-00000260 | sip/8001-0000025f |           | 2010-09-28 06:53:23 | 2010-09-28 06:53:23 | 1285627974.1395 | 1285628002.1397 | LINK        |      0 |       0 |         0 |          0 | 0.0000 |         0.0000 |         0.0000 |      0.0000 |             |            |      |             |         3 | 0000-00-00 00:00:00 |       |
+—-+——+——+———+——————-+——————-+———–+———————+———————+—————–+—————–+————-+——–+———+———–+————+——–+—————-+—————-+————-+————-+————+——+————-+———–+———————+——-+
1 row in set (0.00 sec)

(transfered)
select * from curcdr;
+—-+——+——+———+——————-+——————-+———–+———————+———————+—————–+—————–+————-+——–+———+———–+————+——–+—————-+—————-+————-+————-+————+——+————-+———–+———————+——-+
| id | src  | dst  | srcname | srcchan           | dstchan           | didnumber | starttime           | answertime          | srcuid          | dstuid          | disposition | userid | groupid | accountid | resellerid | credit | callshopcredit | resellercredit | creditlimit | destination | dialstring | memo | accountcode | monitored | calldate            | queue |
+—-+——+——+———+——————-+——————-+———–+———————+———————+—————–+—————–+————-+——–+———+———–+————+——–+—————-+—————-+————-+————-+————+——+————-+———–+———————+——-+
| 32 | 8001 | 5000 |         | sip/8001-0000025f | sip/5000-00000262 |           | 2010-09-28 06:53:46 | 2010-09-28 06:53:46 | 1285628020.1398 | 1285628026.1400 | LINK        |      0 |       0 |         0 |          0 | 0.0000 |         0.0000 |         0.0000 |      0.0000 |             |            |      |             |         5 | 0000-00-00 00:00:00 |       |
+—-+——+——+———+——————-+——————-+———–+———————+———————+—————–+—————–+————-+——–+———+———–+————+——–+—————-+—————-+————-+————-+————+——+————-+———–+———————+——-+
1 row in set (0.00 sec)

mycdr
select * from mycdr;
+—-+———————+——+——+———+——————-+——————-+———–+———-+———+—————+————-+————-+———–+—————–+—————–+———-+——–+—————-+—————-+———+————+——–+———–+————-+——+————+———–+———-+———+————+—————-+———–+———-+———+——+————-+———–+——————+——-+
| id | calldate            | src  | dst  | srcname | channel           | dstchannel        | didnumber | duration | billsec | billsec_leg_a | disposition | accountcode | userfield | srcuid          | dstuid          | calltype | credit | callshopcredit | resellercredit | groupid | resellerid | userid | accountid | destination | memo | dialstring | processed | children | ischild | customerid | crm_customerid | contactid | discount | payment | note | setfreecall | monitored | astercrm_groupid | queue |
+—-+———————+——+——+———+——————-+——————-+———–+———-+———+—————+————-+————-+———–+—————–+—————–+———-+——–+—————-+—————-+———+————+——–+———–+————-+——+————+———–+———-+———+————+—————-+———–+———-+———+——+————-+———–+——————+——-+
|  1 | 2010-09-28 06:52:02 | 8000 | 8001 | dev8000 | sip/8000-00000260 | sip/8001-0000025f |           |       52 |      23 |            41 | ANSWERED    |             | UNBILLED  | 1285627922.1391 | 1285627922.1392 |          | 0.0000 |         0.0000 |         0.0000 |       0 |          0 |      0 |         0 |             |      |            |         0 |          | no      |          0 |              0 |         0 |   0.0000 |         | NULL | no          |         1 |                0 |       |
|  2 | 2010-09-28 06:52:54 | 8000 | 5000 | dev8000 | sip/8000-00000260 | sip/5000-00000261 |           |       28 |      26 |             0 | ANSWERED    |             | UNBILLED  | 1285627974.1395 | 1285627974.1396 |          | 0.0000 |         0.0000 |         0.0000 |       0 |          0 |      0 |         0 |             |      |            |         0 |          | no      |          0 |              0 |         0 |   0.0000 |         | NULL | no          |         2 |                0 |       |
|  3 | 2010-09-28 06:53:23 | 8000 | 8001 |         | sip/8000-00000260 | sip/8001-0000025f |           |       17 |      17 |             0 | ANSWERED    |             | UNBILLED  | 1285627974.1395 | 1285628002.1397 |          | 0.0000 |         0.0000 |         0.0000 |       0 |          0 |      0 |         0 |             |      |            |         0 |          | no      |          0 |              0 |         0 |   0.0000 |         | NULL | no          |         3 |                0 |       |
|  4 | 2010-09-28 06:53:40 | 8000 | 5000 | dev8000 | sip/8000-00000260 | sip/5000-00000262 |           |        6 |       3 |             0 | ANSWERED    |             | UNBILLED  | 1285627974.1395 | 1285628020.1399 |          | 0.0000 |         0.0000 |         0.0000 |       0 |          0 |      0 |         0 |             |      |            |         0 |          | no      |          0 |              0 |         0 |   0.0000 |         | NULL | no          |         4 |                0 |       |
|  5 | 2010-09-28 06:53:46 | 8001 | 5000 |         | sip/8001-0000025f | sip/5000-00000262 |           |       19 |      19 |             0 | ANSWERED    |             | UNBILLED  | 1285628020.1398 | 1285628026.1400 |          | 0.0000 |         0.0000 |         0.0000 |       0 |          0 |      0 |         0 |             |      |            |         0 |          | no      |          0 |              0 |         0 |   0.0000 |         | NULL | no          |         5 |                0 |       |
+—-+———————+——+——+———+——————-+——————-+———–+———-+———+—————+————-+————-+———–+—————–+—————–+———-+——–+—————-+—————-+———+————+——–+———–+————-+——+————+———–+———-+———+————+—————-+———–+———-+———+——+————-+———–+——————+——-+
5 rows in set (0.00 sec)

monitorrecord
select * from monitorrecord;
+—-+———-+—————————————————————-+————+———–+———+———–+———–+—————–+———-+———+———————+
| id | callerid | filename                                                       | fileformat | processed | groupid | accountid | extension | uniqueid        | mycdr_id | creby   | cretime             |
+—-+———-+—————————————————————-+————+———–+———+———–+———–+—————–+———-+———+———————+
|  1 | 8000     | /var/spool/asterisk/monitor/2010/09/28/06/8000-8001.1285627951 | wav        | no        |       0 |         0 | 8001      | 1285627922.1391 |        0 | astercc | 2010-09-28 06:52:31 |
|  2 | 8000     | /var/spool/asterisk/monitor/2010/09/28/06/8000-5000.1285627976 | wav        | no        |       0 |         0 | 5000      | 1285627974.1395 |        0 | astercc | 2010-09-28 06:52:56 |
|  3 | 8000     | /var/spool/asterisk/monitor/2010/09/28/06/8000-8001.1285628003 | wav        | no        |       0 |         0 | 8001      | 1285627974.1395 |        0 | astercc | 2010-09-28 06:53:23 |
|  4 | 8000     | /var/spool/asterisk/monitor/2010/09/28/06/8000-5000.1285628023 | wav        | no        |       0 |         0 | 5000      | 1285627974.1395 |        0 | astercc | 2010-09-28 06:53:43 |
|  5 | 8001     | /var/spool/asterisk/monitor/2010/09/28/06/8001-5000.1285628026 | wav        | no        |       0 |         0 | 5000      | 1285628020.1398 |        0 | astercc | 2010-09-28 06:53:46 |
+—-+———-+—————————————————————-+————+———–+———+———–+———–+—————–+———-+———+———————+
5 rows in set (0.00 sec)

monitorrecord files
ll /var/spool/asterisk/monitor/2010/09/28/06/
total 9020
-rw-r–r– 1 asterisk asterisk  428204 Sep 28 06:53 8000-5000.1285627976-in.wav
-rw-r–r– 1 asterisk asterisk  428524 Sep 28 06:53 8000-5000.1285627976-out.wav
-rw-r–r– 1 asterisk asterisk 1494124 Sep 28 06:54 8000-8001.1285628003-in.wav
-rw-r–r– 1 asterisk asterisk 1496044 Sep 28 06:54 8000-8001.1285628003-out.wav
-rw-r–r– 1 asterisk asterisk  457324 Sep 28 06:54 8001-5000.1285628026-in.wav
-rw-r–r– 1 asterisk asterisk  458284 Sep 28 06:54 8001-5000.1285628026-out.wav

=======click dial button in partal page(callee ring first)=======
被叫振铃(callee ringing)
select * from curcdr;
+—-+——+——+———–+———————————+——————-+———–+———————+———————+—————–+—————–+————-+——–+———+———–+————+——–+—————-+—————-+————-+————-+————+——+————-+———–+———————+——-+
| id | src  | dst  | srcname   | srcchan                         | dstchan           | didnumber | starttime           | answertime          | srcuid          | dstuid          | disposition | userid | groupid | accountid | resellerid | credit | callshopcredit | resellercredit | creditlimit | destination | dialstring | memo | accountcode | monitored | calldate            | queue |
+—-+——+——+———–+———————————+——————-+———–+———————+———————+—————–+—————–+————-+——–+———+———–+————+——–+—————-+—————-+————-+————-+————+——+————-+———–+———————+——-+
| 33 | 8001 | 8001 | <unknown> | local/8001@from-internal-c7e6;2 | sip/8001-00000263 |           | 2010-09-28 06:57:15 | 0000-00-00 00:00:00 | 1285628235.1402 | 1285628235.1403 | RINGING     |      0 |       0 |         0 |          0 | 0.0000 |         0.0000 |         0.0000 |      0.0000 |             | 8001       |      |             |         0 | 0000-00-00 00:00:00 |       |
+—-+——+——+———–+———————————+——————-+———–+———————+———————+—————–+—————–+————-+——–+———+———–+————+——–+—————-+—————-+————-+————-+————+——+————-+———–+———————+——-+
1 row in set (0.00 sec)

(callee answered/agent ringing)
select * from curcdr;
+—-+——+——+———+——————-+——————-+———–+———————+———————+—————–+—————–+————-+——–+———+———–+————+——–+—————-+—————-+————-+————-+————+——+————-+———–+———————+——-+
| id | src  | dst  | srcname | srcchan           | dstchan           | didnumber | starttime           | answertime          | srcuid          | dstuid          | disposition | userid | groupid | accountid | resellerid | credit | callshopcredit | resellercredit | creditlimit | destination | dialstring | memo | accountcode | monitored | calldate            | queue |
+—-+——+——+———+——————-+——————-+———–+———————+———————+—————–+—————–+————-+——–+———+———–+————+——–+—————-+—————-+————-+————-+————+——+————-+———–+———————+——-+
| 33 | 8000 | 8001 |         | sip/8000-00000264 | sip/8001-00000263 |           | 2010-09-28 06:57:15 | 0000-00-00 00:00:00 | 1285628235.1402 | 1285628235.1403 | BRIDGELINK  |      0 |       0 |         0 |          0 | 0.0000 |         0.0000 |         0.0000 |      0.0000 |             | 8001       |      |             |         0 | 2010-09-28 06:57:27 |       |
+—-+——+——+———+——————-+——————-+———–+———————+———————+—————–+—————–+————-+——–+———+———–+————+——–+—————-+—————-+————-+————-+————+——+————-+———–+———————+——-+
1 row in set (0.00 sec)

(answered)
select * from curcdr;
+—-+——+——+———+——————-+——————-+———–+———————+———————+—————–+—————–+————-+——–+———+———–+————+——–+—————-+—————-+————-+————-+————+——+————-+———–+———————+——-+
| id | src  | dst  | srcname | srcchan           | dstchan           | didnumber | starttime           | answertime          | srcuid          | dstuid          | disposition | userid | groupid | accountid | resellerid | credit | callshopcredit | resellercredit | creditlimit | destination | dialstring | memo | accountcode | monitored | calldate            | queue |
+—-+——+——+———+——————-+——————-+———–+———————+———————+—————–+—————–+————-+——–+———+———–+————+——–+—————-+—————-+————-+————-+————+——+————-+———–+———————+——-+
| 33 | 8000 | 8001 |         | sip/8000-00000264 | sip/8001-00000263 |           | 2010-09-28 06:57:15 | 2010-09-28 06:57:42 | 1285628235.1402 | 1285628235.1403 | LINK        |      0 |       0 |         0 |          0 | 0.0000 |         0.0000 |         0.0000 |      0.0000 |             | 8001       |      |             |         1 | 2010-09-28 06:57:27 |       |
+—-+——+——+———+——————-+——————-+———–+———————+———————+—————–+—————–+————-+——–+———+———–+————+——–+—————-+—————-+————-+————-+————+——+————-+———–+———————+——-+
1 row in set (0.00 sec)

(the third part ringing)
select * from curcdr;
+—-+——+——+———+——————-+——————-+———–+———————+———————+—————–+—————–+————-+——–+———+———–+————+——–+—————-+—————-+————-+————-+————+——+————-+———–+———————+——-+
| id | src  | dst  | srcname | srcchan           | dstchan           | didnumber | starttime           | answertime          | srcuid          | dstuid          | disposition | userid | groupid | accountid | resellerid | credit | callshopcredit | resellercredit | creditlimit | destination | dialstring | memo | accountcode | monitored | calldate            | queue |
+—-+——+——+———+——————-+——————-+———–+———————+———————+—————–+—————–+————-+——–+———+———–+————+——–+—————-+—————-+————-+————-+————+——+————-+———–+———————+——-+
| 34 | 8000 | 5000 | dev8000 | sip/8000-00000264 | sip/5000-00000265 |           | 2010-09-28 06:58:05 | 0000-00-00 00:00:00 | 1285628285.1407 | 1285628285.1408 | RINGING     |      0 |       0 |         0 |          0 | 0.0000 |         0.0000 |         0.0000 |      0.0000 |             | 5000       |      |             |         0 | 0000-00-00 00:00:00 |       |
+—-+——+——+———+——————-+——————-+———–+———————+———————+—————–+—————–+————-+——–+———+———–+————+——–+—————-+—————-+————-+————-+————+——+————-+———–+———————+——-+
1 row in set (0.00 sec)

(the third part answered)
select * from curcdr;
+—-+——+——+———+——————-+——————-+———–+———————+———————+—————–+—————–+————-+——–+———+———–+————+——–+—————-+—————-+————-+————-+————+——+————-+———–+———————+——-+
| id | src  | dst  | srcname | srcchan           | dstchan           | didnumber | starttime           | answertime          | srcuid          | dstuid          | disposition | userid | groupid | accountid | resellerid | credit | callshopcredit | resellercredit | creditlimit | destination | dialstring | memo | accountcode | monitored | calldate            | queue |
+—-+——+——+———+——————-+——————-+———–+———————+———————+—————–+—————–+————-+——–+———+———–+————+——–+—————-+—————-+————-+————-+————+——+————-+———–+———————+——-+
| 34 | 8000 | 5000 | dev8000 | sip/8000-00000264 | sip/5000-00000265 |           | 2010-09-28 06:58:05 | 2010-09-28 06:58:06 | 1285628285.1407 | 1285628285.1408 | LINK        |      0 |       0 |         0 |          0 | 0.0000 |         0.0000 |         0.0000 |      0.0000 |             | 5000       |      |             |         2 | 0000-00-00 00:00:00 |       |
+—-+——+——+———+——————-+——————-+———–+———————+———————+—————–+—————–+————-+——–+———+———–+————+——–+—————-+—————-+————-+————-+————+——+————-+———–+———————+——-+
1 row in set (0.00 sec)

(turn back)
select * from curcdr;
+—-+——+——+———+——————-+——————-+———–+———————+———————+—————–+—————–+————-+——–+———+———–+————+——–+—————-+—————-+————-+————-+————+——+————-+———–+———————+——-+
| id | src  | dst  | srcname | srcchan           | dstchan           | didnumber | starttime           | answertime          | srcuid          | dstuid          | disposition | userid | groupid | accountid | resellerid | credit | callshopcredit | resellercredit | creditlimit | destination | dialstring | memo | accountcode | monitored | calldate            | queue |
+—-+——+——+———+——————-+——————-+———–+———————+———————+—————–+—————–+————-+——–+———+———–+————+——–+—————-+—————-+————-+————-+————+——+————-+———–+———————+——-+
| 35 | 8000 | 8001 |         | sip/8000-00000264 | sip/8001-00000263 |           | 2010-09-28 06:58:31 | 2010-09-28 06:58:31 | 1285628285.1407 | 1285628311.1409 | LINK        |      0 |       0 |         0 |          0 | 0.0000 |         0.0000 |         0.0000 |      0.0000 |             |            |      |             |         3 | 0000-00-00 00:00:00 |       |
+—-+——+——+———+——————-+——————-+———–+———————+———————+—————–+—————–+————-+——–+———+———–+————+——–+—————-+—————-+————-+————-+————+——+————-+———–+———————+——-+
1 row in set (0.00 sec)

(transfered)
select * from curcdr;
+—-+——+——+———+——————-+——————-+———–+———————+———————+—————–+—————–+————-+——–+———+———–+————+——–+—————-+—————-+————-+————-+————+——+————-+———–+———————+——-+
| id | src  | dst  | srcname | srcchan           | dstchan           | didnumber | starttime           | answertime          | srcuid          | dstuid          | disposition | userid | groupid | accountid | resellerid | credit | callshopcredit | resellercredit | creditlimit | destination | dialstring | memo | accountcode | monitored | calldate            | queue |
+—-+——+——+———+——————-+——————-+———–+———————+———————+—————–+—————–+————-+——–+———+———–+————+——–+—————-+—————-+————-+————-+————+——+————-+———–+———————+——-+
| 37 | 8001 | 5000 |         | sip/8001-00000263 | sip/5000-00000266 |           | 2010-09-28 06:58:51 | 2010-09-28 06:58:51 | 1285628328.1410 | 1285628331.1412 | LINK        |      0 |       0 |         0 |          0 | 0.0000 |         0.0000 |         0.0000 |      0.0000 |             |            |      |             |         5 | 0000-00-00 00:00:00 |       |
+—-+——+——+———+——————-+——————-+———–+———————+———————+—————–+—————–+————-+——–+———+———–+————+——–+—————-+—————-+————-+————-+————+——+————-+———–+———————+——-+
1 row in set (0.00 sec)

mycdr
select * from mycdr;
+—-+———————+——+——+———+——————-+——————-+———–+———-+———+—————+————-+————-+———–+—————–+—————–+———-+——–+—————-+—————-+———+————+——–+———–+————-+——+————+———–+———-+———+————+—————-+———–+———-+———+——+————-+———–+——————+——-+
| id | calldate            | src  | dst  | srcname | channel           | dstchannel        | didnumber | duration | billsec | billsec_leg_a | disposition | accountcode | userfield | srcuid          | dstuid          | calltype | credit | callshopcredit | resellercredit | groupid | resellerid | userid | accountid | destination | memo | dialstring | processed | children | ischild | customerid | crm_customerid | contactid | discount | payment | note | setfreecall | monitored | astercrm_groupid | queue |
+—-+———————+——+——+———+——————-+——————-+———–+———-+———+—————+————-+————-+———–+—————–+—————–+———-+——–+—————-+—————-+———+————+——–+———–+————-+——+————+———–+———-+———+————+—————-+———–+———-+———+——+————-+———–+——————+——-+
|  1 | 2010-09-28 06:57:15 | 8000 | 8001 | dev8000 | sip/8000-00000264 | sip/8001-00000263 |           |       50 |      23 |            38 | ANSWERED    |             | UNBILLED  | 1285628235.1402 | 1285628235.1403 |          | 0.0000 |         0.0000 |         0.0000 |       0 |          0 |      0 |         0 |             |      |            |         0 |          | no      |          0 |              0 |         0 |   0.0000 |         | NULL | no          |         1 |                0 |       |
|  2 | 2010-09-28 06:58:05 | 8000 | 5000 | dev8000 | sip/8000-00000264 | sip/5000-00000265 |           |       26 |      25 |             0 | ANSWERED    |             | UNBILLED  | 1285628285.1407 | 1285628285.1408 |          | 0.0000 |         0.0000 |         0.0000 |       0 |          0 |      0 |         0 |             |      |            |         0 |          | no      |          0 |              0 |         0 |   0.0000 |         | NULL | no          |         2 |                0 |       |
|  3 | 2010-09-28 06:58:31 | 8000 | 8001 |         | sip/8000-00000264 | sip/8001-00000263 |           |       17 |      17 |             0 | ANSWERED    |             | UNBILLED  | 1285628285.1407 | 1285628311.1409 |          | 0.0000 |         0.0000 |         0.0000 |       0 |          0 |      0 |         0 |             |      |            |         0 |          | no      |          0 |              0 |         0 |   0.0000 |         | NULL | no          |         3 |                0 |       |
|  4 | 2010-09-28 06:58:48 | 8000 | 5000 | dev8000 | sip/8000-00000264 | sip/5000-00000266 |           |        4 |       3 |             0 | ANSWERED    |             | UNBILLED  | 1285628285.1407 | 1285628328.1411 |          | 0.0000 |         0.0000 |         0.0000 |       0 |          0 |      0 |         0 |             |      |            |         0 |          | no      |          0 |              0 |         0 |   0.0000 |         | NULL | no          |         4 |                0 |       |
|  5 | 2010-09-28 06:58:51 | 8001 | 5000 |         | sip/8001-00000263 | sip/5000-00000266 |           |       23 |      23 |             0 | ANSWERED    |             | UNBILLED  | 1285628328.1410 | 1285628331.1412 |          | 0.0000 |         0.0000 |         0.0000 |       0 |          0 |      0 |         0 |             |      |            |         0 |          | no      |          0 |              0 |         0 |   0.0000 |         | NULL | no          |         5 |                0 |       |
+—-+———————+——+——+———+——————-+——————-+———–+———-+———+—————+————-+————-+———–+—————–+—————–+———-+——–+—————-+—————-+———+————+——–+———–+————-+——+————+———–+———-+———+————+—————-+———–+———-+———+——+————-+———–+——————+——-+
5 rows in set (0.00 sec)

monitorrecord
select * from monitorrecord;
+—-+———-+—————————————————————-+————+———–+———+———–+———–+—————–+———-+———+———————+
| id | callerid | filename                                                       | fileformat | processed | groupid | accountid | extension | uniqueid        | mycdr_id | creby   | cretime             |
+—-+———-+—————————————————————-+————+———–+———+———–+———–+—————–+———-+———+———————+
|  1 | 8000     | /var/spool/asterisk/monitor/2010/09/28/06/8000-8001.1285628262 | wav        | no        |       0 |         0 | 8001      | 1285628235.1402 |        0 | astercc | 2010-09-28 06:57:42 |
|  2 | 8000     | /var/spool/asterisk/monitor/2010/09/28/06/8000-5000.1285628286 | wav        | no        |       0 |         0 | 5000      | 1285628285.1407 |        0 | astercc | 2010-09-28 06:58:07 |
|  3 | 8000     | /var/spool/asterisk/monitor/2010/09/28/06/8000-8001.1285628311 | wav        | no        |       0 |         0 | 8001      | 1285628285.1407 |        0 | astercc | 2010-09-28 06:58:31 |
|  4 | 8000     | /var/spool/asterisk/monitor/2010/09/28/06/8000-5000.1285628329 | wav        | no        |       0 |         0 | 5000      | 1285628285.1407 |        0 | astercc | 2010-09-28 06:58:50 |
|  5 | 8001     | /var/spool/asterisk/monitor/2010/09/28/06/8001-5000.1285628331 | wav        | no        |       0 |         0 | 5000      | 1285628328.1410 |        0 | astercc | 2010-09-28 06:58:52 |
+—-+———-+—————————————————————-+————+———–+———+———–+———–+—————–+———-+———+———————+
5 rows in set (0.00 sec)

monitorrecord files
ll /var/spool/asterisk/monitor/2010/09/28/06/
total 4600
-rw-r–r– 1 asterisk asterisk  390124 Sep 28 06:58 8000-5000.1285628286-in.wav
-rw-r–r– 1 asterisk asterisk  390444 Sep 28 06:58 8000-5000.1285628286-out.wav
-rw-r–r– 1 asterisk asterisk 1469164 Sep 28 06:59 8000-8001.1285628311-in.wav
-rw-r–r– 1 asterisk asterisk 1469484 Sep 28 06:59 8000-8001.1285628311-out.wav
-rw-r–r– 1 asterisk asterisk  494124 Sep 28 06:59 8001-5000.1285628331-in.wav
-rw-r–r– 1 asterisk asterisk  494444 Sep 28 06:59 8001-5000.1285628331-out.wav

=======predictivedialer(direct to queue 1000, set campaign callerid:9999)=======
(callee ringing)
select * from curcdr;
+—-+——+——+———–+———————————+——————-+———–+———————+———————+—————–+—————–+————-+——–+———+———–+————+——–+—————-+—————-+————-+————-+————+——+————-+———–+———————+——-+
| id | src  | dst  | srcname   | srcchan                         | dstchan           | didnumber | starttime           | answertime          | srcuid          | dstuid          | disposition | userid | groupid | accountid | resellerid | credit | callshopcredit | resellercredit | creditlimit | destination | dialstring | memo | accountcode | monitored | calldate            | queue |
+—-+——+——+———–+———————————+——————-+———–+———————+———————+—————–+—————–+————-+——–+———+———–+————+——–+—————-+—————-+————-+————-+————+——+————-+———–+———————+——-+
| 41 | 9999 | 8001 | <unknown> | local/8001@from-internal-1e9e;2 | sip/8001-0000026a |           | 2010-09-28 07:05:10 | 0000-00-00 00:00:00 | 1285628710.1423 | 1285628710.1424 | RINGING     |      0 |       0 |         0 |          0 | 0.0000 |         0.0000 |         0.0000 |      0.0000 |             | 8001       |      |             |         0 | 0000-00-00 00:00:00 |       |
+—-+——+——+———–+———————————+——————-+———–+———————+———————+—————–+—————–+————-+——–+———+———–+————+——–+—————-+—————-+————-+————-+————+——+————-+———–+———————+——-+
1 row in set (0.00 sec)

(callee answered/agent ringing)
select * from curcdr;
+—-+——+——+———–+———————————+——————-+———–+———————+———————+—————–+—————–+————-+——–+———+———–+————+——–+—————-+—————-+————-+————-+————+——+————-+———–+———————+——-+
| id | src  | dst  | srcname   | srcchan                         | dstchan           | didnumber | starttime           | answertime          | srcuid          | dstuid          | disposition | userid | groupid | accountid | resellerid | credit | callshopcredit | resellercredit | creditlimit | destination | dialstring | memo | accountcode | monitored | calldate            | queue |
+—-+——+——+———–+———————————+——————-+———–+———————+———————+—————–+—————–+————-+——–+———+———–+————+——–+—————-+—————-+————-+————-+————+——+————-+———–+———————+——-+
| 41 | 9999 | 8001 | <unknown> | local/8001@from-internal-1e9e;2 | sip/8001-0000026a |           | 2010-09-28 07:05:10 | 0000-00-00 00:00:00 | 1285628710.1423 | 1285628710.1424 | BRIDGELINK  |      0 |       0 |         0 |          0 | 0.0000 |         0.0000 |         0.0000 |      0.0000 |             | 8001       |      |             |         0 | 2010-09-28 07:05:24 | 1000  |
| 42 | 8001 | 8000 | <unknown> | local/8000@from-queue-da3a;2    | sip/8000-0000026b | 9999      | 2010-09-28 07:05:24 | 0000-00-00 00:00:00 | 1285628724.1426 | 1285628724.1427 | RINGING     |      0 |       0 |         0 |          0 | 0.0000 |         0.0000 |         0.0000 |      0.0000 |             | 8000       |      |             |         0 | 0000-00-00 00:00:00 | 1000  |
+—-+——+——+———–+———————————+——————-+———–+———————+———————+—————–+—————–+————-+——–+———+———–+————+——–+—————-+—————-+————-+————-+————+——+————-+———–+———————+——-+
2 rows in set (0.08 sec)

(answered)
select * from curcdr;
+—-+——+——+———–+——————-+——————-+———–+———————+———————+—————–+—————–+————-+——–+———+———–+————+——–+—————-+—————-+————-+————-+————+——+————-+———–+———————+——-+
| id | src  | dst  | srcname   | srcchan           | dstchan           | didnumber | starttime           | answertime          | srcuid          | dstuid          | disposition | userid | groupid | accountid | resellerid | credit | callshopcredit | resellercredit | creditlimit | destination | dialstring | memo | accountcode | monitored | calldate            | queue |
+—-+——+——+———–+——————-+——————-+———–+———————+———————+—————–+—————–+————-+——–+———+———–+————+——–+—————-+—————-+————-+————-+————+——+————-+———–+———————+——-+
| 42 | 8001 | 8000 | <unknown> | sip/8001-0000026a | sip/8000-0000026b | 9999      | 2010-09-28 07:05:10 | 2010-09-28 07:05:33 | 1285628710.1424 | 1285628724.1427 | LINK        |      0 |       0 |         0 |          0 | 0.0000 |         0.0000 |         0.0000 |      0.0000 |             | 8000       |      |             |         1 | 2010-09-28 07:05:24 | 1000  |
+—-+——+——+———–+——————-+——————-+———–+———————+———————+—————–+—————–+————-+——–+———+———–+————+——–+—————-+—————-+————-+————-+————+——+————-+———–+———————+——-+
1 row in set (0.00 sec)

(the third part ringing)
select * from curcdr;
+—-+——+——+———+——————-+——————-+———–+———————+———————+—————–+—————–+————-+——–+———+———–+————+——–+—————-+—————-+————-+————-+————+——+————-+———–+———————+——-+
| id | src  | dst  | srcname | srcchan           | dstchan           | didnumber | starttime           | answertime          | srcuid          | dstuid          | disposition | userid | groupid | accountid | resellerid | credit | callshopcredit | resellercredit | creditlimit | destination | dialstring | memo | accountcode | monitored | calldate            | queue |
+—-+——+——+———+——————-+——————-+———–+———————+———————+—————–+—————–+————-+——–+———+———–+————+——–+—————-+—————-+————-+————-+————+——+————-+———–+———————+——-+
| 43 | 8000 | 5000 | dev8000 | sip/8000-0000026b | sip/5000-0000026c |           | 2010-09-28 07:06:16 | 0000-00-00 00:00:00 | 1285628776.1429 | 1285628776.1430 | RINGING     |      0 |       0 |         0 |          0 | 0.0000 |         0.0000 |         0.0000 |      0.0000 |             | 5000       |      |             |         0 | 0000-00-00 00:00:00 |       |
+—-+——+——+———+——————-+——————-+———–+———————+———————+—————–+—————–+————-+——–+———+———–+————+——–+—————-+—————-+————-+————-+————+——+————-+———–+———————+——-+
1 row in set (0.00 sec)

(the third part answered)
select * from curcdr;
+—-+——+——+———+——————-+——————-+———–+———————+———————+—————–+—————–+————-+——–+———+———–+————+——–+—————-+—————-+————-+————-+————+——+————-+———–+———————+——-+
| id | src  | dst  | srcname | srcchan           | dstchan           | didnumber | starttime           | answertime          | srcuid          | dstuid          | disposition | userid | groupid | accountid | resellerid | credit | callshopcredit | resellercredit | creditlimit | destination | dialstring | memo | accountcode | monitored | calldate            | queue |
+—-+——+——+———+——————-+——————-+———–+———————+———————+—————–+—————–+————-+——–+———+———–+————+——–+—————-+—————-+————-+————-+————+——+————-+———–+———————+——-+
| 43 | 8000 | 5000 | dev8000 | sip/8000-0000026b | sip/5000-0000026c |           | 2010-09-28 07:06:16 | 2010-09-28 07:06:18 | 1285628776.1429 | 1285628776.1430 | LINK        |      0 |       0 |         0 |          0 | 0.0000 |         0.0000 |         0.0000 |      0.0000 |             | 5000       |      |             |         2 | 0000-00-00 00:00:00 |       |
+—-+——+——+———+——————-+——————-+———–+———————+———————+—————–+—————–+————-+——–+———+———–+————+——–+—————-+—————-+————-+————-+————+——+————-+———–+———————+——-+
1 row in set (0.00 sec)

(turn back)
select * from curcdr;
+—-+——+——+———+——————-+——————-+———–+———————+———————+—————–+—————–+————-+——–+———+———–+————+——–+—————-+—————-+————-+————-+————+——+————-+———–+———————+——-+
| id | src  | dst  | srcname | srcchan           | dstchan           | didnumber | starttime           | answertime          | srcuid          | dstuid          | disposition | userid | groupid | accountid | resellerid | credit | callshopcredit | resellercredit | creditlimit | destination | dialstring | memo | accountcode | monitored | calldate            | queue |
+—-+——+——+———+——————-+——————-+———–+———————+———————+—————–+—————–+————-+——–+———+———–+————+——–+—————-+—————-+————-+————-+————+——+————-+———–+———————+——-+
| 44 | 8001 | 8000 |         | sip/8001-0000026a | sip/8000-0000026b |           | 2010-09-28 07:06:45 | 2010-09-28 07:06:45 | 1285628776.1428 | 1285628805.1431 | LINK        |      0 |       0 |         0 |          0 | 0.0000 |         0.0000 |         0.0000 |      0.0000 |             |            |      |             |         3 | 0000-00-00 00:00:00 |       |
+—-+——+——+———+——————-+——————-+———–+———————+———————+—————–+—————–+————-+——–+———+———–+————+——–+—————-+—————-+————-+————-+————+——+————-+———–+———————+——-+
1 row in set (0.00 sec)

(transfered)
select * from curcdr;
+—-+——+——+———+——————-+——————-+———–+———————+———————+—————–+—————–+————-+——–+———+———–+————+——–+—————-+—————-+————-+————-+————+——+————-+———–+———————+——-+
| id | src  | dst  | srcname | srcchan           | dstchan           | didnumber | starttime           | answertime          | srcuid          | dstuid          | disposition | userid | groupid | accountid | resellerid | credit | callshopcredit | resellercredit | creditlimit | destination | dialstring | memo | accountcode | monitored | calldate            | queue |
+—-+——+——+———+——————-+——————-+———–+———————+———————+—————–+—————–+————-+——–+———+———–+————+——–+—————-+—————-+————-+————-+————+——+————-+———–+———————+——-+
| 46 | 8001 | 5000 |         | sip/8001-0000026a | sip/5000-0000026d |           | 2010-09-28 07:07:22 | 2010-09-28 07:07:22 | 1285628776.1428 | 1285628842.1434 | LINK        |      0 |       0 |         0 |          0 | 0.0000 |         0.0000 |         0.0000 |      0.0000 |             |            |      |             |         5 | 0000-00-00 00:00:00 |       |
+—-+——+——+———+——————-+——————-+———–+———————+———————+—————–+—————–+————-+——–+———+———–+————+——–+—————-+—————-+————-+————-+————+——+————-+———–+———————+——-+
1 row in set (0.00 sec)

mycdr
select * from mycdr;
+—-+———————+——+——+———+——————-+——————-+———–+———-+———+—————+————-+————-+———–+—————–+—————–+———-+——–+—————-+—————-+———+————+——–+———–+————-+——+————+———–+———-+———+————+—————-+———–+———-+———+——+————-+———–+——————+——-+
| id | calldate            | src  | dst  | srcname | channel           | dstchannel        | didnumber | duration | billsec | billsec_leg_a | disposition | accountcode | userfield | srcuid          | dstuid          | calltype | credit | callshopcredit | resellercredit | groupid | resellerid | userid | accountid | destination | memo | dialstring | processed | children | ischild | customerid | crm_customerid | contactid | discount | payment | note | setfreecall | monitored | astercrm_groupid | queue |
+—-+———————+——+——+———+——————-+——————-+———–+———-+———+—————+————-+————-+———–+—————–+—————–+———-+——–+—————-+—————-+———+————+——–+———–+————-+——+————+———–+———-+———+————+—————-+———–+———-+———+——+————-+———–+——————+——-+
|  1 | 2010-09-28 07:05:10 | 8001 | 8000 |         | sip/8001-0000026a | sip/8000-0000026b | 9999      |       66 |      43 |            52 | ANSWERED    |             | UNBILLED  | 1285628710.1424 | 1285628724.1427 |          | 0.0000 |         0.0000 |         0.0000 |       0 |          0 |      0 |         0 |             |      |            |         0 |          | no      |          0 |              0 |         0 |   0.0000 |         | NULL | no          |         1 |                0 | 1000  |
|  2 | 2010-09-28 07:06:16 | 8000 | 5000 | dev8000 | sip/8000-0000026b | sip/5000-0000026c |           |       29 |      27 |             0 | ANSWERED    |             | UNBILLED  | 1285628776.1429 | 1285628776.1430 |          | 0.0000 |         0.0000 |         0.0000 |       0 |          0 |      0 |         0 |             |      |            |         0 |          | no      |          0 |              0 |         0 |   0.0000 |         | NULL | no          |         2 |                0 |       |
|  3 | 2010-09-28 07:06:45 | 8001 | 8000 |         | sip/8001-0000026a | sip/8000-0000026b |           |       17 |      17 |             0 | ANSWERED    |             | UNBILLED  | 1285628776.1428 | 1285628805.1431 |          | 0.0000 |         0.0000 |         0.0000 |       0 |          0 |      0 |         0 |             |      |            |         0 |          | no      |          0 |              0 |         0 |   0.0000 |         | NULL | no          |         3 |                0 |       |
|  4 | 2010-09-28 07:07:02 | 8000 | 5000 | dev8000 | sip/8000-0000026b | sip/5000-0000026d |           |       20 |       3 |             0 | ANSWERED    |             | UNBILLED  | 1285628822.1432 | 1285628822.1433 |          | 0.0000 |         0.0000 |         0.0000 |       0 |          0 |      0 |         0 |             |      |            |         0 |          | no      |          0 |              0 |         0 |   0.0000 |         | NULL | no          |         4 |                0 |       |
|  5 | 2010-09-28 07:07:22 | 8001 | 5000 |         | sip/8001-0000026a | sip/5000-0000026d |           |       15 |      15 |             0 | ANSWERED    |             | UNBILLED  | 1285628776.1428 | 1285628842.1434 |          | 0.0000 |         0.0000 |         0.0000 |       0 |          0 |      0 |         0 |             |      |            |         0 |          | no      |          0 |              0 |         0 |   0.0000 |         | NULL | no          |         5 |                0 |       |
+—-+———————+——+——+———+——————-+——————-+———–+———-+———+—————+————-+————-+———–+—————–+—————–+———-+——–+—————-+—————-+———+————+——–+———–+————-+——+————+———–+———-+———+————+—————-+———–+———-+———+——+————-+———–+——————+——-+
5 rows in set (0.00 sec)

monitorrecord
select * from monitorrecord;
+—-+———-+—————————————————————-+————+———–+———+———–+———–+—————–+———-+———+———————+
| id | callerid | filename                                                       | fileformat | processed | groupid | accountid | extension | uniqueid        | mycdr_id | creby   | cretime             |
+—-+———-+—————————————————————-+————+———–+———+———–+———–+—————–+———-+———+———————+
|  1 | 8001     | /var/spool/asterisk/monitor/2010/09/28/07/8001-8000.1285628733 | wav        | no        |       0 |         0 | 8000      | 1285628710.1424 |        0 | astercc | 2010-09-28 07:05:34 |
|  2 | 8000     | /var/spool/asterisk/monitor/2010/09/28/07/8000-5000.1285628778 | wav        | no        |       0 |         0 | 5000      | 1285628776.1429 |        0 | astercc | 2010-09-28 07:06:18 |
|  3 | 8001     | /var/spool/asterisk/monitor/2010/09/28/07/8001-8000.1285628805 | wav        | no        |       0 |         0 | 8000      | 1285628776.1428 |        0 | astercc | 2010-09-28 07:06:45 |
|  4 | 8000     | /var/spool/asterisk/monitor/2010/09/28/07/8000-5000.1285628839 | wav        | no        |       0 |         0 | 5000      | 1285628822.1432 |        0 | astercc | 2010-09-28 07:07:19 |
|  5 | 8001     | /var/spool/asterisk/monitor/2010/09/28/07/8001-5000.1285628842 | wav        | no        |       0 |         0 | 5000      | 1285628776.1428 |        0 | astercc | 2010-09-28 07:07:22 |
+—-+———-+—————————————————————-+————+———–+———+———–+———–+—————–+———-+———+———————+
5 rows in set (0.01 sec)

monitorrecord files
ll /var/spool/asterisk/monitor/2010/09/28/07
total 4908
-rw-r–r– 1 asterisk asterisk  434284 Sep 28 07:06 8000-5000.1285628778-in.wav
-rw-r–r– 1 asterisk asterisk  434284 Sep 28 07:06 8000-5000.1285628778-out.wav
-rw-r–r– 1 asterisk asterisk  366124 Sep 28 07:07 8001-5000.1285628842-in.wav
-rw-r–r– 1 asterisk asterisk  283884 Sep 28 07:07 8001-5000.1285628842-out.wav
-rw-r–r– 1 asterisk asterisk 1732844 Sep 28 07:07 8001-8000.1285628805-in.wav
-rw-r–r– 1 asterisk asterisk 1731884 Sep 28 07:07 8001-8000.1285628805-out.wav

=======predictivedialer(direct to queue 1000, no callerid set to campaign)=======
select * from curcdr;
+—-+——+——+———–+———————————+——————-+———–+———————+———————+—————–+—————–+————-+——–+———+———–+————+——–+—————-+—————-+————-+————-+————+——+————-+———–+———————+——-+
| id | src  | dst  | srcname   | srcchan                         | dstchan           | didnumber | starttime           | answertime          | srcuid          | dstuid          | disposition | userid | groupid | accountid | resellerid | credit | callshopcredit | resellercredit | creditlimit | destination | dialstring | memo | accountcode | monitored | calldate            | queue |
+—-+——+——+———–+———————————+——————-+———–+———————+———————+—————–+—————–+————-+——–+———+———–+————+——–+—————-+—————-+————-+————-+————+——+————-+———–+———————+——-+
| 48 | 8001 | 8001 | <unknown> | local/8001@from-internal-3fe4;2 | sip/8001-0000026f |           | 2010-09-28 07:09:57 | 0000-00-00 00:00:00 | 1285628996.1439 | 1285628997.1440 | RINGING     |      0 |       0 |         0 |          0 | 0.0000 |         0.0000 |         0.0000 |      0.0000 |             | 8001       |      |             |         0 | 0000-00-00 00:00:00 |       |
+—-+——+——+———–+———————————+——————-+———–+———————+———————+—————–+—————–+————-+——–+———+———–+————+——–+—————-+—————-+————-+————-+————+——+————-+———–+———————+——-+
1 row in set (0.00 sec)

(callee answered/agent ringing)
select * from curcdr;
+—-+——+——+———–+———————————+——————-+———–+———————+———————+—————–+—————–+————-+——–+———+———–+————+——–+—————-+—————-+————-+————-+————+——+————-+———–+———————+——-+
| id | src  | dst  | srcname   | srcchan                         | dstchan           | didnumber | starttime           | answertime          | srcuid          | dstuid          | disposition | userid | groupid | accountid | resellerid | credit | callshopcredit | resellercredit | creditlimit | destination | dialstring | memo | accountcode | monitored | calldate            | queue |
+—-+——+——+———–+———————————+——————-+———–+———————+———————+—————–+—————–+————-+——–+———+———–+————+——–+—————-+—————-+————-+————-+————+——+————-+———–+———————+——-+
| 48 | 8001 | 8001 | <unknown> | local/8001@from-internal-3fe4;2 | sip/8001-0000026f |           | 2010-09-28 07:09:57 | 0000-00-00 00:00:00 | 1285628996.1439 | 1285628997.1440 | BRIDGELINK  |      0 |       0 |         0 |          0 | 0.0000 |         0.0000 |         0.0000 |      0.0000 |             | 8001       |      |             |         0 | 2010-09-28 07:10:10 | 1000  |
| 49 | 8001 | 8000 | <unknown> | local/8000@from-queue-b731;2    | sip/8000-00000270 | 8001      | 2010-09-28 07:10:10 | 0000-00-00 00:00:00 | 1285629010.1442 | 1285629010.1443 | RINGING     |      0 |       0 |         0 |          0 | 0.0000 |         0.0000 |         0.0000 |      0.0000 |             | 8000       |      |             |         0 | 0000-00-00 00:00:00 | 1000  |
+—-+——+——+———–+———————————+——————-+———–+———————+———————+—————–+—————–+————-+——–+———+———–+————+——–+—————-+—————-+————-+————-+————+——+————-+———–+———————+——-+
2 rows in set (0.00 sec)

(answered)
select * from curcdr;
+—-+——+——+———–+——————-+——————-+———–+———————+———————+—————–+—————–+————-+——–+———+———–+————+——–+—————-+—————-+————-+————-+————+——+————-+———–+———————+——-+
| id | src  | dst  | srcname   | srcchan           | dstchan           | didnumber | starttime           | answertime          | srcuid          | dstuid          | disposition | userid | groupid | accountid | resellerid | credit | callshopcredit | resellercredit | creditlimit | destination | dialstring | memo | accountcode | monitored | calldate            | queue |
+—-+——+——+———–+——————-+——————-+———–+———————+———————+—————–+—————–+————-+——–+———+———–+————+——–+—————-+—————-+————-+————-+————+——+————-+———–+———————+——-+
| 49 | 8001 | 8000 | <unknown> | sip/8001-0000026f | sip/8000-00000270 | 8001      | 2010-09-28 07:09:57 | 2010-09-28 07:10:14 | 1285628997.1440 | 1285629010.1443 | LINK        |      0 |       0 |         0 |          0 | 0.0000 |         0.0000 |         0.0000 |      0.0000 |             | 8000       |      |             |         1 | 2010-09-28 07:10:10 | 1000  |
+—-+——+——+———–+——————-+——————-+———–+———————+———————+—————–+—————–+————-+——–+———+———–+————+——–+—————-+—————-+————-+————-+————+——+————-+———–+———————+——-+
1 row in set (0.00 sec)

(the third part ringing)
select * from curcdr;
+—-+——+——+———+——————-+——————-+———–+———————+———————+—————–+—————–+————-+——–+———+———–+————+——–+—————-+—————-+————-+————-+————+——+————-+———–+———————+——-+
| id | src  | dst  | srcname | srcchan           | dstchan           | didnumber | starttime           | answertime          | srcuid          | dstuid          | disposition | userid | groupid | accountid | resellerid | credit | callshopcredit | resellercredit | creditlimit | destination | dialstring | memo | accountcode | monitored | calldate            | queue |
+—-+——+——+———+——————-+——————-+———–+———————+———————+—————–+—————–+————-+——–+———+———–+————+——–+—————-+—————-+————-+————-+————+——+————-+———–+———————+——-+
| 50 | 8000 | 5000 | dev8000 | sip/8000-00000270 | sip/5000-00000271 |           | 2010-09-28 07:10:46 | 0000-00-00 00:00:00 | 1285629046.1445 | 1285629046.1446 | RINGING     |      0 |       0 |         0 |          0 | 0.0000 |         0.0000 |         0.0000 |      0.0000 |             | 5000       |      |             |         0 | 0000-00-00 00:00:00 |       |
+—-+——+——+———+——————-+——————-+———–+———————+———————+—————–+—————–+————-+——–+———+———–+————+——–+—————-+—————-+————-+————-+————+——+————-+———–+———————+——-+
1 row in set (0.00 sec)

(the third part answered)
select * from curcdr;
+—-+——+——+———+——————-+——————-+———–+———————+———————+—————–+—————–+————-+——–+———+———–+————+——–+—————-+—————-+————-+————-+————+——+————-+———–+———————+——-+
| id | src  | dst  | srcname | srcchan           | dstchan           | didnumber | starttime           | answertime          | srcuid          | dstuid          | disposition | userid | groupid | accountid | resellerid | credit | callshopcredit | resellercredit | creditlimit | destination | dialstring | memo | accountcode | monitored | calldate            | queue |
+—-+——+——+———+——————-+——————-+———–+———————+———————+—————–+—————–+————-+——–+———+———–+————+——–+—————-+—————-+————-+————-+————+——+————-+———–+———————+——-+
| 50 | 8000 | 5000 | dev8000 | sip/8000-00000270 | sip/5000-00000271 |           | 2010-09-28 07:10:46 | 2010-09-28 07:10:48 | 1285629046.1445 | 1285629046.1446 | LINK        |      0 |       0 |         0 |          0 | 0.0000 |         0.0000 |         0.0000 |      0.0000 |             | 5000       |      |             |         2 | 0000-00-00 00:00:00 |       |
+—-+——+——+———+——————-+——————-+———–+———————+———————+—————–+—————–+————-+——–+———+———–+————+——–+—————-+—————-+————-+————-+————+——+————-+———–+———————+——-+
1 row in set (0.00 sec)

(turn back)
select * from curcdr;
+—-+——+——+———+——————-+——————-+———–+———————+———————+—————–+—————–+————-+——–+———+———–+————+——–+—————-+—————-+————-+————-+————+——+————-+———–+———————+——-+
| id | src  | dst  | srcname | srcchan           | dstchan           | didnumber | starttime           | answertime          | srcuid          | dstuid          | disposition | userid | groupid | accountid | resellerid | credit | callshopcredit | resellercredit | creditlimit | destination | dialstring | memo | accountcode | monitored | calldate            | queue |
+—-+——+——+———+——————-+——————-+———–+———————+———————+—————–+—————–+————-+——–+———+———–+————+——–+—————-+—————-+————-+————-+————+——+————-+———–+———————+——-+
| 51 | 8001 | 8000 |         | sip/8001-0000026f | sip/8000-00000270 |           | 2010-09-28 07:11:23 | 2010-09-28 07:11:23 | 1285629046.1444 | 1285629082.1447 | LINK        |      0 |       0 |         0 |          0 | 0.0000 |         0.0000 |         0.0000 |      0.0000 |             |            |      |             |         3 | 0000-00-00 00:00:00 |       |
+—-+——+——+———+——————-+——————-+———–+———————+———————+—————–+—————–+————-+——–+———+———–+————+——–+—————-+—————-+————-+————-+————+——+————-+———–+———————+——-+
1 row in set (0.00 sec)

(transfered)
select * from curcdr;
+—-+——+——+———+——————-+——————-+———–+———————+———————+—————–+—————–+————-+——–+———+———–+————+——–+—————-+—————-+————-+————-+————+——+————-+———–+———————+——-+
| id | src  | dst  | srcname | srcchan           | dstchan           | didnumber | starttime           | answertime          | srcuid          | dstuid          | disposition | userid | groupid | accountid | resellerid | credit | callshopcredit | resellercredit | creditlimit | destination | dialstring | memo | accountcode | monitored | calldate            | queue |
+—-+——+——+———+——————-+——————-+———–+———————+———————+—————–+—————–+————-+——–+———+———–+————+——–+—————-+—————-+————-+————-+————+——+————-+———–+———————+——-+
| 53 | 8001 | 5000 |         | sip/8001-0000026f | sip/5000-00000272 |           | 2010-09-28 07:11:46 | 2010-09-28 07:11:46 | 1285629046.1444 | 1285629106.1450 | LINK        |      0 |       0 |         0 |          0 | 0.0000 |         0.0000 |         0.0000 |      0.0000 |             |            |      |             |         5 | 0000-00-00 00:00:00 |       |
+—-+——+——+———+——————-+——————-+———–+———————+———————+—————–+—————–+————-+——–+———+———–+————+——–+—————-+—————-+————-+————-+————+——+————-+———–+———————+——-+
1 row in set (0.00 sec)

mycdr
select * from mycdr;
+—-+———————+——+——+———+——————-+——————-+———–+———-+———+—————+————-+————-+———–+—————–+—————–+———-+——–+—————-+—————-+———+————+——–+———–+————-+——+————+———–+———-+———+————+—————-+———–+———-+———+——+————-+———–+——————+——-+
| id | calldate            | src  | dst  | srcname | channel           | dstchannel        | didnumber | duration | billsec | billsec_leg_a | disposition | accountcode | userfield | srcuid          | dstuid          | calltype | credit | callshopcredit | resellercredit | groupid | resellerid | userid | accountid | destination | memo | dialstring | processed | children | ischild | customerid | crm_customerid | contactid | discount | payment | note | setfreecall | monitored | astercrm_groupid | queue |
+—-+———————+——+——+———+——————-+——————-+———–+———-+———+—————+————-+————-+———–+—————–+—————–+———-+——–+—————-+—————-+———+————+——–+———–+————-+——+————+———–+———-+———+————+—————-+———–+———-+———+——+————-+———–+——————+——-+
|  1 | 2010-09-28 07:09:57 | 8001 | 8000 |         | sip/8001-0000026f | sip/8000-00000270 | 8001      |       49 |      32 |            36 | ANSWERED    |             | UNBILLED  | 1285628997.1440 | 1285629010.1443 |          | 0.0000 |         0.0000 |         0.0000 |       0 |          0 |      0 |         0 |             |      |            |         0 |          | no      |          0 |              0 |         0 |   0.0000 |         | NULL | no          |         1 |                0 | 1000  |
|  2 | 2010-09-28 07:10:46 | 8000 | 5000 | dev8000 | sip/8000-00000270 | sip/5000-00000271 |           |       37 |      35 |             0 | ANSWERED    |             | UNBILLED  | 1285629046.1445 | 1285629046.1446 |          | 0.0000 |         0.0000 |         0.0000 |       0 |          0 |      0 |         0 |             |      |            |         0 |          | no      |          0 |              0 |         0 |   0.0000 |         | NULL | no          |         2 |                0 |       |
|  3 | 2010-09-28 07:11:23 | 8001 | 8000 |         | sip/8001-0000026f | sip/8000-00000270 |           |       16 |      16 |             0 | ANSWERED    |             | UNBILLED  | 1285629046.1444 | 1285629082.1447 |          | 0.0000 |         0.0000 |         0.0000 |       0 |          0 |      0 |         0 |             |      |            |         0 |          | no      |          0 |              0 |         0 |   0.0000 |         | NULL | no          |         3 |                0 |       |
|  4 | 2010-09-28 07:11:39 | 8000 | 5000 | dev8000 | sip/8000-00000270 | sip/5000-00000272 |           |        8 |       6 |             0 | ANSWERED    |             | UNBILLED  | 1285629099.1448 | 1285629099.1449 |          | 0.0000 |         0.0000 |         0.0000 |       0 |          0 |      0 |         0 |             |      |            |         0 |          | no      |          0 |              0 |         0 |   0.0000 |         | NULL | no          |         4 |                0 |       |
|  5 | 2010-09-28 07:11:46 | 8001 | 5000 |         | sip/8001-0000026f | sip/5000-00000272 |           |       24 |      24 |             0 | ANSWERED    |             | UNBILLED  | 1285629046.1444 | 1285629106.1450 |          | 0.0000 |         0.0000 |         0.0000 |       0 |          0 |      0 |         0 |             |      |            |         0 |          | no      |          0 |              0 |         0 |   0.0000 |         | NULL | no          |         5 |                0 |       |
+—-+———————+——+——+———+——————-+——————-+———–+———-+———+—————+————-+————-+———–+—————–+—————–+———-+——–+—————-+—————-+———+————+——–+———–+————-+——+————+———–+———-+———+————+—————-+———–+———-+———+——+————-+———–+——————+——-+
5 rows in set (0.00 sec)

monitorrecord
select * from monitorrecord;
+—-+———-+—————————————————————-+————+———–+———+———–+———–+—————–+———-+———+———————+
| id | callerid | filename                                                       | fileformat | processed | groupid | accountid | extension | uniqueid        | mycdr_id | creby   | cretime             |
+—-+———-+—————————————————————-+————+———–+———+———–+———–+—————–+———-+———+———————+
|  1 | 8001     | /var/spool/asterisk/monitor/2010/09/28/07/8001-8000.1285629014 | wav        | no        |       0 |         0 | 8000      | 1285628997.1440 |        0 | astercc | 2010-09-28 07:10:14 |
|  2 | 8000     | /var/spool/asterisk/monitor/2010/09/28/07/8000-5000.1285629048 | wav        | no        |       0 |         0 | 5000      | 1285629046.1445 |        0 | astercc | 2010-09-28 07:10:48 |
|  3 | 8001     | /var/spool/asterisk/monitor/2010/09/28/07/8001-8000.1285629083 | wav        | no        |       0 |         0 | 8000      | 1285629046.1444 |        0 | astercc | 2010-09-28 07:11:23 |
|  4 | 8000     | /var/spool/asterisk/monitor/2010/09/28/07/8000-5000.1285629101 | wav        | no        |       0 |         0 | 5000      | 1285629099.1448 |        0 | astercc | 2010-09-28 07:11:42 |
|  5 | 8001     | /var/spool/asterisk/monitor/2010/09/28/07/8001-5000.1285629106 | wav        | no        |       0 |         0 | 5000      | 1285629046.1444 |        0 | astercc | 2010-09-28 07:11:47 |
+—-+———-+—————————————————————-+————+———–+———+———–+———–+—————–+———-+———+———————+
5 rows in set (0.00 sec)

monitorrecord files
ll /var/spool/asterisk/monitor/2010/09/28/07
total 4984
-rw-r–r– 1 asterisk asterisk  557164 Sep 28 07:11 8000-5000.1285629048-in.wav
-rw-r–r– 1 asterisk asterisk  556844 Sep 28 07:11 8000-5000.1285629048-out.wav
-rw-r–r– 1 asterisk asterisk  536684 Sep 28 07:12 8001-5000.1285629106-in.wav
-rw-r–r– 1 asterisk asterisk  454444 Sep 28 07:12 8001-5000.1285629106-out.wav
-rw-r–r– 1 asterisk asterisk 1481324 Sep 28 07:11 8001-8000.1285629083-in.wav
-rw-r–r– 1 asterisk asterisk 1481004 Sep 28 07:11 8001-8000.1285629083-out.wav

=======predictivedialer(to queue 1000 by context, set campaign callerid:9999)=======
(callee ringing)
select * from curcdr;
+—-+——+——+———–+———————————+——————-+———–+———————+———————+—————–+—————–+————-+——–+———+———–+————+——–+—————-+—————-+————-+————-+————+——+————-+———–+———————+——-+
| id | src  | dst  | srcname   | srcchan                         | dstchan           | didnumber | starttime           | answertime          | srcuid          | dstuid          | disposition | userid | groupid | accountid | resellerid | credit | callshopcredit | resellercredit | creditlimit | destination | dialstring | memo | accountcode | monitored | calldate            | queue |
+—-+——+——+———–+———————————+——————-+———–+———————+———————+—————–+—————–+————-+——–+———+———–+————+——–+—————-+—————-+————-+————-+————+——+————-+———–+———————+——-+
| 54 | 9999 | 8001 | <unknown> | local/8001@from-internal-8c9e;2 | sip/8001-00000273 |           | 2010-09-28 07:14:14 | 0000-00-00 00:00:00 | 1285629254.1452 | 1285629254.1453 | RINGING     |      0 |       0 |         0 |          0 | 0.0000 |         0.0000 |         0.0000 |      0.0000 |             | 8001       |      |             |         0 | 0000-00-00 00:00:00 |       |
+—-+——+——+———–+———————————+——————-+———–+———————+———————+—————–+—————–+————-+——–+———+———–+————+——–+—————-+—————-+————-+————-+————+——+————-+———–+———————+——-+
1 row in set (0.03 sec)

(callee answered/agent ringing)
select * from curcdr;
+—-+——+——+———–+———————————+——————-+———–+———————+———————+—————–+—————–+————-+——–+———+———–+————+——–+—————-+—————-+————-+————-+————+——+————-+———–+———————+——-+
| id | src  | dst  | srcname   | srcchan                         | dstchan           | didnumber | starttime           | answertime          | srcuid          | dstuid          | disposition | userid | groupid | accountid | resellerid | credit | callshopcredit | resellercredit | creditlimit | destination | dialstring | memo | accountcode | monitored | calldate            | queue |
+—-+——+——+———–+———————————+——————-+———–+———————+———————+—————–+—————–+————-+——–+———+———–+————+——–+—————-+—————-+————-+————-+————+——+————-+———–+———————+——-+
| 54 | 9999 | 8001 | <unknown> | local/8001@from-internal-8c9e;2 | sip/8001-00000273 |           | 2010-09-28 07:14:14 | 0000-00-00 00:00:00 | 1285629254.1452 | 1285629254.1453 | BRIDGELINK  |      0 |       0 |         0 |          0 | 0.0000 |         0.0000 |         0.0000 |      0.0000 |             | 8001       |      |             |         0 | 2010-09-28 07:14:26 | 1000  |
| 55 | 8001 | 8000 | <unknown> | local/8000@from-queue-86a7;2    | sip/8000-00000274 | 9999      | 2010-09-28 07:14:26 | 0000-00-00 00:00:00 | 1285629266.1455 | 1285629266.1456 | RINGING     |      0 |       0 |         0 |          0 | 0.0000 |         0.0000 |         0.0000 |      0.0000 |             | 8000       |      |             |         0 | 0000-00-00 00:00:00 | 1000  |
+—-+——+——+———–+———————————+——————-+———–+———————+———————+—————–+—————–+————-+——–+———+———–+————+——–+—————-+—————-+————-+————-+————+——+————-+———–+———————+——-+
2 rows in set (0.00 sec)

(answered)
select * from curcdr;
+—-+——+——+———–+——————-+——————-+———–+———————+———————+—————–+—————–+————-+——–+———+———–+————+——–+—————-+—————-+————-+————-+————+——+————-+———–+———————+——-+
| id | src  | dst  | srcname   | srcchan           | dstchan           | didnumber | starttime           | answertime          | srcuid          | dstuid          | disposition | userid | groupid | accountid | resellerid | credit | callshopcredit | resellercredit | creditlimit | destination | dialstring | memo | accountcode | monitored | calldate            | queue |
+—-+——+——+———–+——————-+——————-+———–+———————+———————+—————–+—————–+————-+——–+———+———–+————+——–+—————-+—————-+————-+————-+————+——+————-+———–+———————+——-+
| 55 | 8001 | 8000 | <unknown> | sip/8001-00000273 | sip/8000-00000274 | 9999      | 2010-09-28 07:14:14 | 2010-09-28 07:14:29 | 1285629254.1453 | 1285629266.1456 | LINK        |      0 |       0 |         0 |          0 | 0.0000 |         0.0000 |         0.0000 |      0.0000 |             | 8000       |      |             |         1 | 2010-09-28 07:14:26 | 1000  |
+—-+——+——+———–+——————-+——————-+———–+———————+———————+—————–+—————–+————-+——–+———+———–+————+——–+—————-+—————-+————-+————-+————+——+————-+———–+———————+——-+
1 row in set (0.00 sec)

(the third part ringing)
select * from curcdr;
+—-+——+——+———+——————-+——————-+———–+———————+———————+—————–+—————–+————-+——–+———+———–+————+——–+—————-+—————-+————-+————-+————+——+————-+———–+———————+——-+
| id | src  | dst  | srcname | srcchan           | dstchan           | didnumber | starttime           | answertime          | srcuid          | dstuid          | disposition | userid | groupid | accountid | resellerid | credit | callshopcredit | resellercredit | creditlimit | destination | dialstring | memo | accountcode | monitored | calldate            | queue |
+—-+——+——+———+——————-+——————-+———–+———————+———————+—————–+—————–+————-+——–+———+———–+————+——–+—————-+—————-+————-+————-+————+——+————-+———–+———————+——-+
| 56 | 8000 | 5000 | dev8000 | sip/8000-00000274 | sip/5000-00000275 |           | 2010-09-28 07:15:31 | 0000-00-00 00:00:00 | 1285629331.1458 | 1285629331.1459 | RINGING     |      0 |       0 |         0 |          0 | 0.0000 |         0.0000 |         0.0000 |      0.0000 |             | 5000       |      |             |         0 | 0000-00-00 00:00:00 |       |
+—-+——+——+———+——————-+——————-+———–+———————+———————+—————–+—————–+————-+——–+———+———–+————+——–+—————-+—————-+————-+————-+————+——+————-+———–+———————+——-+
1 row in set (0.00 sec)

(the third part answered)
select * from curcdr;
+—-+——+——+———+——————-+——————-+———–+———————+———————+—————–+—————–+————-+——–+———+———–+————+——–+—————-+—————-+————-+————-+————+——+————-+———–+———————+——-+
| id | src  | dst  | srcname | srcchan           | dstchan           | didnumber | starttime           | answertime          | srcuid          | dstuid          | disposition | userid | groupid | accountid | resellerid | credit | callshopcredit | resellercredit | creditlimit | destination | dialstring | memo | accountcode | monitored | calldate            | queue |
+—-+——+——+———+——————-+——————-+———–+———————+———————+—————–+—————–+————-+——–+———+———–+————+——–+—————-+—————-+————-+————-+————+——+————-+———–+———————+——-+
| 56 | 8000 | 5000 | dev8000 | sip/8000-00000274 | sip/5000-00000275 |           | 2010-09-28 07:15:31 | 2010-09-28 07:15:32 | 1285629331.1458 | 1285629331.1459 | LINK        |      0 |       0 |         0 |          0 | 0.0000 |         0.0000 |         0.0000 |      0.0000 |             | 5000       |      |             |         2 | 0000-00-00 00:00:00 |       |
+—-+——+——+———+——————-+——————-+———–+———————+———————+—————–+—————–+————-+——–+———+———–+————+——–+—————-+—————-+————-+————-+————+——+————-+———–+———————+——-+
1 row in set (0.00 sec)

(turn back)
select * from curcdr;
+—-+——+——+———+——————-+——————-+———–+———————+———————+—————–+—————–+————-+——–+———+———–+————+——–+—————-+—————-+————-+————-+————+——+————-+———–+———————+——-+
| id | src  | dst  | srcname | srcchan           | dstchan           | didnumber | starttime           | answertime          | srcuid          | dstuid          | disposition | userid | groupid | accountid | resellerid | credit | callshopcredit | resellercredit | creditlimit | destination | dialstring | memo | accountcode | monitored | calldate            | queue |
+—-+——+——+———+——————-+——————-+———–+———————+———————+—————–+—————–+————-+——–+———+———–+————+——–+—————-+—————-+————-+————-+————+——+————-+———–+———————+——-+
| 57 | 8001 | 8000 |         | sip/8001-00000273 | sip/8000-00000274 |           | 2010-09-28 07:16:00 | 2010-09-28 07:16:00 | 1285629331.1457 | 1285629360.1460 | LINK        |      0 |       0 |         0 |          0 | 0.0000 |         0.0000 |         0.0000 |      0.0000 |             |            |      |             |         3 | 0000-00-00 00:00:00 |       |
+—-+——+——+———+——————-+——————-+———–+———————+———————+—————–+—————–+————-+——–+———+———–+————+——–+—————-+—————-+————-+————-+————+——+————-+———–+———————+——-+
1 row in set (0.00 sec)

(transfered)
select * from curcdr;
+—-+——+——+———+——————-+——————-+———–+———————+———————+—————–+—————–+————-+——–+———+———–+————+——–+—————-+—————-+————-+————-+————+——+————-+———–+———————+——-+
| id | src  | dst  | srcname | srcchan           | dstchan           | didnumber | starttime           | answertime          | srcuid          | dstuid          | disposition | userid | groupid | accountid | resellerid | credit | callshopcredit | resellercredit | creditlimit | destination | dialstring | memo | accountcode | monitored | calldate            | queue |
+—-+——+——+———+——————-+——————-+———–+———————+———————+—————–+—————–+————-+——–+———+———–+————+——–+—————-+—————-+————-+————-+————+——+————-+———–+———————+——-+
| 59 | 8001 | 5000 |         | sip/8001-00000273 | sip/5000-00000276 |           | 2010-09-28 07:16:53 | 2010-09-28 07:16:53 | 1285629331.1457 | 1285629413.1463 | LINK        |      0 |       0 |         0 |          0 | 0.0000 |         0.0000 |         0.0000 |      0.0000 |             |            |      |             |         5 | 0000-00-00 00:00:00 |       |
+—-+——+——+———+——————-+——————-+———–+———————+———————+—————–+—————–+————-+——–+———+———–+————+——–+—————-+—————-+————-+————-+————+——+————-+———–+———————+——-+
1 row in set (0.00 sec)

mycdr
select * from mycdr;
+—-+———————+——+——+———+——————-+——————-+———–+———-+———+—————+————-+————-+———–+—————–+—————–+———-+——–+—————-+—————-+———+————+——–+———–+————-+——+————+———–+———-+———+————+—————-+———–+———-+———+——+————-+———–+——————+——-+
| id | calldate            | src  | dst  | srcname | channel           | dstchannel        | didnumber | duration | billsec | billsec_leg_a | disposition | accountcode | userfield | srcuid          | dstuid          | calltype | credit | callshopcredit | resellercredit | groupid | resellerid | userid | accountid | destination | memo | dialstring | processed | children | ischild | customerid | crm_customerid | contactid | discount | payment | note | setfreecall | monitored | astercrm_groupid | queue |
+—-+———————+——+——+———+——————-+——————-+———–+———-+———+—————+————-+————-+———–+—————–+—————–+———-+——–+—————-+—————-+———+————+——–+———–+————-+——+————+———–+———-+———+————+—————-+———–+———-+———+——+————-+———–+——————+——-+
|  1 | 2010-09-28 07:14:14 | 8001 | 8000 |         | sip/8001-00000273 | sip/8000-00000274 | 9999      |       77 |      62 |            65 | ANSWERED    |             | UNBILLED  | 1285629254.1453 | 1285629266.1456 |          | 0.0000 |         0.0000 |         0.0000 |       0 |          0 |      0 |         0 |             |      |            |         0 |          | no      |          0 |              0 |         0 |   0.0000 |         | NULL | no          |         1 |                0 | 1000  |
|  2 | 2010-09-28 07:15:31 | 8000 | 5000 | dev8000 | sip/8000-00000274 | sip/5000-00000275 |           |       29 |      28 |             0 | ANSWERED    |             | UNBILLED  | 1285629331.1458 | 1285629331.1459 |          | 0.0000 |         0.0000 |         0.0000 |       0 |          0 |      0 |         0 |             |      |            |         0 |          | no      |          0 |              0 |         0 |   0.0000 |         | NULL | no          |         2 |                0 |       |
|  3 | 2010-09-28 07:16:00 | 8001 | 8000 |         | sip/8001-00000273 | sip/8000-00000274 |           |       44 |      44 |             0 | ANSWERED    |             | UNBILLED  | 1285629331.1457 | 1285629360.1460 |          | 0.0000 |         0.0000 |         0.0000 |       0 |          0 |      0 |         0 |             |      |            |         0 |          | no      |          0 |              0 |         0 |   0.0000 |         | NULL | no          |         3 |                0 |       |
|  4 | 2010-09-28 07:16:45 | 8000 | 5000 | dev8000 | sip/8000-00000274 | sip/5000-00000276 |           |        8 |       6 |             0 | ANSWERED    |             | UNBILLED  | 1285629404.1461 | 1285629405.1462 |          | 0.0000 |         0.0000 |         0.0000 |       0 |          0 |      0 |         0 |             |      |            |         0 |          | no      |          0 |              0 |         0 |   0.0000 |         | NULL | no          |         4 |                0 |       |
|  5 | 2010-09-28 07:16:53 | 8001 | 5000 |         | sip/8001-00000273 | sip/5000-00000276 |           |       14 |      14 |             0 | ANSWERED    |             | UNBILLED  | 1285629331.1457 | 1285629413.1463 |          | 0.0000 |         0.0000 |         0.0000 |       0 |          0 |      0 |         0 |             |      |            |         0 |          | no      |          0 |              0 |         0 |   0.0000 |         | NULL | no          |         5 |                0 |       |
+—-+———————+——+——+———+——————-+——————-+———–+———-+———+—————+————-+————-+———–+—————–+—————–+———-+——–+—————-+—————-+———+————+——–+———–+————-+——+————+———–+———-+———+————+—————-+———–+———-+———+——+————-+———–+——————+——-+
5 rows in set (0.00 sec)

monitorrecord
select * from monitorrecord;
+—-+———-+—————————————————————-+————+———–+———+———–+———–+—————–+———-+———+———————+
| id | callerid | filename                                                       | fileformat | processed | groupid | accountid | extension | uniqueid        | mycdr_id | creby   | cretime             |
+—-+———-+—————————————————————-+————+———–+———+———–+———–+—————–+———-+———+———————+
|  1 | 8001     | /var/spool/asterisk/monitor/2010/09/28/07/8001-8000.1285629269 | wav        | no        |       0 |         0 | 8000      | 1285629254.1453 |        0 | astercc | 2010-09-28 07:14:29 |
|  2 | 8000     | /var/spool/asterisk/monitor/2010/09/28/07/8000-5000.1285629332 | wav        | no        |       0 |         0 | 5000      | 1285629331.1458 |        0 | astercc | 2010-09-28 07:15:33 |
|  3 | 8001     | /var/spool/asterisk/monitor/2010/09/28/07/8001-8000.1285629360 | wav        | no        |       0 |         0 | 8000      | 1285629331.1457 |        0 | astercc | 2010-09-28 07:16:00 |
|  4 | 8000     | /var/spool/asterisk/monitor/2010/09/28/07/8000-5000.1285629407 | wav        | no        |       0 |         0 | 5000      | 1285629404.1461 |        0 | astercc | 2010-09-28 07:16:47 |
|  5 | 8001     | /var/spool/asterisk/monitor/2010/09/28/07/8001-5000.1285629413 | wav        | no        |       0 |         0 | 5000      | 1285629331.1457 |        0 | astercc | 2010-09-28 07:16:53 |
+—-+———-+—————————————————————-+————+———–+———+———–+———–+—————–+———-+———+———————+
5 rows in set (0.00 sec)

monitorrecord files
ll /var/spool/asterisk/monitor/2010/09/28/07
total 6088
-rw-r–r– 1 asterisk asterisk  441964 Sep 28 07:16 8000-5000.1285629332-in.wav
-rw-r–r– 1 asterisk asterisk  441964 Sep 28 07:16 8000-5000.1285629332-out.wav
-rw-r–r– 1 asterisk asterisk  405484 Sep 28 07:17 8001-5000.1285629413-in.wav
-rw-r–r– 1 asterisk asterisk  321644 Sep 28 07:17 8001-5000.1285629413-out.wav
-rw-r–r– 1 asterisk asterisk 2296684 Sep 28 07:16 8001-8000.1285629360-in.wav
-rw-r–r– 1 asterisk asterisk 2295724 Sep 28 07:16 8001-8000.1285629360-out.wav

=======predictivedialer(to queue 1000 by context, no callerid set to campaign)=======
(callee ringing)
select * from curcdr;
+—-+——+——+———–+———————————+——————-+———–+———————+———————+—————–+—————–+————-+——–+———+———–+————+——–+—————-+—————-+————-+————-+————+——+————-+———–+———————+——-+
| id | src  | dst  | srcname   | srcchan                         | dstchan           | didnumber | starttime           | answertime          | srcuid          | dstuid          | disposition | userid | groupid | accountid | resellerid | credit | callshopcredit | resellercredit | creditlimit | destination | dialstring | memo | accountcode | monitored | calldate            | queue |
+—-+——+——+———–+———————————+——————-+———–+———————+———————+—————–+—————–+————-+——–+———+———–+————+——–+—————-+—————-+————-+————-+————+——+————-+———–+———————+——-+
| 60 | 8001 | 8001 | <unknown> | local/8001@from-internal-bcd4;2 | sip/8001-00000277 |           | 2010-09-28 07:19:07 | 0000-00-00 00:00:00 | 1285629547.1465 | 1285629547.1466 | RINGING     |      0 |       0 |         0 |          0 | 0.0000 |         0.0000 |         0.0000 |      0.0000 |             | 8001       |      |             |         0 | 0000-00-00 00:00:00 |       |
+—-+——+——+———–+———————————+——————-+———–+———————+———————+—————–+—————–+————-+——–+———+———–+————+——–+—————-+—————-+————-+————-+————+——+————-+———–+———————+——-+
1 row in set (0.00 sec)

(callee answered/agent ringing)
select * from curcdr;
+—-+——+——+———–+———————————+——————-+———–+———————+———————+—————–+—————–+————-+——–+———+———–+————+——–+—————-+—————-+————-+————-+————+——+————-+———–+———————+——-+
| id | src  | dst  | srcname   | srcchan                         | dstchan           | didnumber | starttime           | answertime          | srcuid          | dstuid          | disposition | userid | groupid | accountid | resellerid | credit | callshopcredit | resellercredit | creditlimit | destination | dialstring | memo | accountcode | monitored | calldate            | queue |
+—-+——+——+———–+———————————+——————-+———–+———————+———————+—————–+—————–+————-+——–+———+———–+————+——–+—————-+—————-+————-+————-+————+——+————-+———–+———————+——-+
| 60 | 8001 | 8001 | <unknown> | local/8001@from-internal-bcd4;2 | sip/8001-00000277 |           | 2010-09-28 07:19:07 | 0000-00-00 00:00:00 | 1285629547.1465 | 1285629547.1466 | BRIDGELINK  |      0 |       0 |         0 |          0 | 0.0000 |         0.0000 |         0.0000 |      0.0000 |             | 8001       |      |             |         0 | 2010-09-28 07:19:18 | 1000  |
| 61 | 8001 | 8000 | <unknown> | local/8000@from-queue-170d;2    | sip/8000-00000278 | 8001      | 2010-09-28 07:19:18 | 0000-00-00 00:00:00 | 1285629558.1468 | 1285629558.1469 | RINGING     |      0 |       0 |         0 |          0 | 0.0000 |         0.0000 |         0.0000 |      0.0000 |             | 8000       |      |             |         0 | 0000-00-00 00:00:00 | 1000  |
+—-+——+——+———–+———————————+——————-+———–+———————+———————+—————–+—————–+————-+——–+———+———–+————+——–+—————-+—————-+————-+————-+————+——+————-+———–+———————+——-+
2 rows in set (0.00 sec)

(answered)
select * from curcdr;
+—-+——+——+———–+——————-+——————-+———–+———————+———————+—————–+—————–+————-+——–+———+———–+————+——–+—————-+—————-+————-+————-+————+——+————-+———–+———————+——-+
| id | src  | dst  | srcname   | srcchan           | dstchan           | didnumber | starttime           | answertime          | srcuid          | dstuid          | disposition | userid | groupid | accountid | resellerid | credit | callshopcredit | resellercredit | creditlimit | destination | dialstring | memo | accountcode | monitored | calldate            | queue |
+—-+——+——+———–+——————-+——————-+———–+———————+———————+—————–+—————–+————-+——–+———+———–+————+——–+—————-+—————-+————-+————-+————+——+————-+———–+———————+——-+
| 61 | 8001 | 8000 | <unknown> | sip/8001-00000277 | sip/8000-00000278 | 8001      | 2010-09-28 07:19:07 | 2010-09-28 07:19:21 | 1285629547.1466 | 1285629558.1469 | LINK        |      0 |       0 |         0 |          0 | 0.0000 |         0.0000 |         0.0000 |      0.0000 |             | 8000       |      |             |         1 | 2010-09-28 07:19:18 | 1000  |
+—-+——+——+———–+——————-+——————-+———–+———————+———————+—————–+—————–+————-+——–+———+———–+————+——–+—————-+—————-+————-+————-+————+——+————-+———–+———————+——-+
1 row in set (0.00 sec)

(the third part ringing)
select * from curcdr;
+—-+——+——+———+——————-+——————-+———–+———————+———————+—————–+—————–+————-+——–+———+———–+————+——–+—————-+—————-+————-+————-+————+——+————-+———–+———————+——-+
| id | src  | dst  | srcname | srcchan           | dstchan           | didnumber | starttime           | answertime          | srcuid          | dstuid          | disposition | userid | groupid | accountid | resellerid | credit | callshopcredit | resellercredit | creditlimit | destination | dialstring | memo | accountcode | monitored | calldate            | queue |
+—-+——+——+———+——————-+——————-+———–+———————+———————+—————–+—————–+————-+——–+———+———–+————+——–+—————-+—————-+————-+————-+————+——+————-+———–+———————+——-+
| 62 | 8000 | 5000 | dev8000 | sip/8000-00000278 | sip/5000-00000279 |           | 2010-09-28 07:20:03 | 0000-00-00 00:00:00 | 1285629603.1471 | 1285629603.1472 | RINGING     |      0 |       0 |         0 |          0 | 0.0000 |         0.0000 |         0.0000 |      0.0000 |             | 5000       |      |             |         0 | 0000-00-00 00:00:00 |       |
+—-+——+——+———+——————-+——————-+———–+———————+———————+—————–+—————–+————-+——–+———+———–+————+——–+—————-+—————-+————-+————-+————+——+————-+———–+———————+——-+
1 row in set (0.00 sec)

(the third part answered)
select * from curcdr;
+—-+——+——+———+——————-+——————-+———–+———————+———————+—————–+—————–+————-+——–+———+———–+————+——–+—————-+—————-+————-+————-+————+——+————-+———–+———————+——-+
| id | src  | dst  | srcname | srcchan           | dstchan           | didnumber | starttime           | answertime          | srcuid          | dstuid          | disposition | userid | groupid | accountid | resellerid | credit | callshopcredit | resellercredit | creditlimit | destination | dialstring | memo | accountcode | monitored | calldate            | queue |
+—-+——+——+———+——————-+——————-+———–+———————+———————+—————–+—————–+————-+——–+———+———–+————+——–+—————-+—————-+————-+————-+————+——+————-+———–+———————+——-+
| 62 | 8000 | 5000 | dev8000 | sip/8000-00000278 | sip/5000-00000279 |           | 2010-09-28 07:20:03 | 2010-09-28 07:20:04 | 1285629603.1471 | 1285629603.1472 | LINK        |      0 |       0 |         0 |          0 | 0.0000 |         0.0000 |         0.0000 |      0.0000 |             | 5000       |      |             |         2 | 0000-00-00 00:00:00 |       |
+—-+——+——+———+——————-+——————-+———–+———————+———————+—————–+—————–+————-+——–+———+———–+————+——–+—————-+—————-+————-+————-+————+——+————-+———–+———————+——-+
1 row in set (0.01 sec)

(turn back)
select * from curcdr;
+—-+——+——+———+——————-+——————-+———–+———————+———————+—————–+—————–+————-+——–+———+———–+————+——–+—————-+—————-+————-+————-+————+——+————-+———–+———————+——-+
| id | src  | dst  | srcname | srcchan           | dstchan           | didnumber | starttime           | answertime          | srcuid          | dstuid          | disposition | userid | groupid | accountid | resellerid | credit | callshopcredit | resellercredit | creditlimit | destination | dialstring | memo | accountcode | monitored | calldate            | queue |
+—-+——+——+———+——————-+——————-+———–+———————+———————+—————–+—————–+————-+——–+———+———–+————+——–+—————-+—————-+————-+————-+————+——+————-+———–+———————+——-+
| 63 | 8001 | 8000 |         | sip/8001-00000277 | sip/8000-00000278 |           | 2010-09-28 07:20:29 | 2010-09-28 07:20:29 | 1285629603.1470 | 1285629628.1473 | LINK        |      0 |       0 |         0 |          0 | 0.0000 |         0.0000 |         0.0000 |      0.0000 |             |            |      |             |         3 | 0000-00-00 00:00:00 |       |
+—-+——+——+———+——————-+——————-+———–+———————+———————+—————–+—————–+————-+——–+———+———–+————+——–+—————-+—————-+————-+————-+————+——+————-+———–+———————+——-+
1 row in set (0.00 sec)

(transfered)
select * from curcdr;
+—-+——+——+———+——————-+——————-+———–+———————+———————+—————–+—————–+————-+——–+———+———–+————+——–+—————-+—————-+————-+————-+————+——+————-+———–+———————+——-+
| id | src  | dst  | srcname | srcchan           | dstchan           | didnumber | starttime           | answertime          | srcuid          | dstuid          | disposition | userid | groupid | accountid | resellerid | credit | callshopcredit | resellercredit | creditlimit | destination | dialstring | memo | accountcode | monitored | calldate            | queue |
+—-+——+——+———+——————-+——————-+———–+———————+———————+—————–+—————–+————-+——–+———+———–+————+——–+—————-+—————-+————-+————-+————+——+————-+———–+———————+——-+
| 65 | 8001 | 5000 |         | sip/8001-00000277 | sip/5000-0000027a |           | 2010-09-28 07:20:52 | 2010-09-28 07:20:52 | 1285629603.1470 | 1285629652.1476 | LINK        |      0 |       0 |         0 |          0 | 0.0000 |         0.0000 |         0.0000 |      0.0000 |             |            |      |             |         5 | 0000-00-00 00:00:00 |       |
+—-+——+——+———+——————-+——————-+———–+———————+———————+—————–+—————–+————-+——–+———+———–+————+——–+—————-+—————-+————-+————-+————+——+————-+———–+———————+——-+
1 row in set (0.00 sec)

mycdr
select * from mycdr;
+—-+———————+——+——+———+——————-+——————-+———–+———-+———+—————+————-+————-+———–+—————–+—————–+———-+——–+—————-+—————-+———+————+——–+———–+————-+——+————+———–+———-+———+————+—————-+———–+———-+———+——+————-+———–+——————+——-+
| id | calldate            | src  | dst  | srcname | channel           | dstchannel        | didnumber | duration | billsec | billsec_leg_a | disposition | accountcode | userfield | srcuid          | dstuid          | calltype | credit | callshopcredit | resellercredit | groupid | resellerid | userid | accountid | destination | memo | dialstring | processed | children | ischild | customerid | crm_customerid | contactid | discount | payment | note | setfreecall | monitored | astercrm_groupid | queue |
+—-+———————+——+——+———+——————-+——————-+———–+———-+———+—————+————-+————-+———–+—————–+—————–+———-+——–+—————-+—————-+———+————+——–+———–+————-+——+————+———–+———-+———+————+—————-+———–+———-+———+——+————-+———–+——————+——-+
|  1 | 2010-09-28 07:19:07 | 8001 | 8000 |         | sip/8001-00000277 | sip/8000-00000278 | 8001      |       56 |      42 |            45 | ANSWERED    |             | UNBILLED  | 1285629547.1466 | 1285629558.1469 |          | 0.0000 |         0.0000 |         0.0000 |       0 |          0 |      0 |         0 |             |      |            |         0 |          | no      |          0 |              0 |         0 |   0.0000 |         | NULL | no          |         1 |                0 | 1000  |
|  2 | 2010-09-28 07:20:03 | 8000 | 5000 | dev8000 | sip/8000-00000278 | sip/5000-00000279 |           |       26 |      25 |             0 | ANSWERED    |             | UNBILLED  | 1285629603.1471 | 1285629603.1472 |          | 0.0000 |         0.0000 |         0.0000 |       0 |          0 |      0 |         0 |             |      |            |         0 |          | no      |          0 |              0 |         0 |   0.0000 |         | NULL | no          |         2 |                0 |       |
|  3 | 2010-09-28 07:20:29 | 8001 | 8000 |         | sip/8001-00000277 | sip/8000-00000278 |           |       15 |      15 |             0 | ANSWERED    |             | UNBILLED  | 1285629603.1470 | 1285629628.1473 |          | 0.0000 |         0.0000 |         0.0000 |       0 |          0 |      0 |         0 |             |      |            |         0 |          | no      |          0 |              0 |         0 |   0.0000 |         | NULL | no          |         3 |                0 |       |
|  4 | 2010-09-28 07:20:44 | 8000 | 5000 | dev8000 | sip/8000-00000278 | sip/5000-0000027a |           |        8 |       5 |             0 | ANSWERED    |             | UNBILLED  | 1285629644.1474 | 1285629644.1475 |          | 0.0000 |         0.0000 |         0.0000 |       0 |          0 |      0 |         0 |             |      |            |         0 |          | no      |          0 |              0 |         0 |   0.0000 |         | NULL | no          |         4 |                0 |       |
+—-+———————+——+——+———+——————-+——————-+———–+———-+———+—————+————-+————-+———–+—————–+—————–+———-+——–+—————-+—————-+———+————+——–+———–+————-+——+————+———–+———-+———+————+—————-+———–+———-+———+——+————-+———–+——————+——-+
4 rows in set (0.01 sec)

monitorrecord
select * from monitorrecord;
+—-+———-+—————————————————————-+————+———–+———+———–+———–+—————–+———-+———+———————+
| id | callerid | filename                                                       | fileformat | processed | groupid | accountid | extension | uniqueid        | mycdr_id | creby   | cretime             |
+—-+———-+—————————————————————-+————+———–+———+———–+———–+—————–+———-+———+———————+
|  1 | 8001     | /var/spool/asterisk/monitor/2010/09/28/07/8001-8000.1285629561 | wav        | no        |       0 |         0 | 8000      | 1285629547.1466 |        0 | astercc | 2010-09-28 07:19:22 |
|  2 | 8000     | /var/spool/asterisk/monitor/2010/09/28/07/8000-5000.1285629604 | wav        | no        |       0 |         0 | 5000      | 1285629603.1471 |        0 | astercc | 2010-09-28 07:20:05 |
|  3 | 8001     | /var/spool/asterisk/monitor/2010/09/28/07/8001-8000.1285629629 | wav        | no        |       0 |         0 | 8000      | 1285629603.1470 |        0 | astercc | 2010-09-28 07:20:29 |
|  4 | 8000     | /var/spool/asterisk/monitor/2010/09/28/07/8000-5000.1285629647 | wav        | no        |       0 |         0 | 5000      | 1285629644.1474 |        0 | astercc | 2010-09-28 07:20:47 |
|  5 | 8001     | /var/spool/asterisk/monitor/2010/09/28/07/8001-5000.1285629652 | wav        | no        |       0 |         0 | 5000      | 1285629603.1470 |        0 | astercc | 2010-09-28 07:20:52 |
+—-+———-+—————————————————————-+————+———–+———+———–+———–+—————–+———-+———+———————+
5 rows in set (0.01 sec)

monitorrecord files
ll /var/spool/asterisk/monitor/2010/09/28/07
total 5136
-rw-r–r– 1 asterisk asterisk  379564 Sep 28 07:20 8000-5000.1285629604-in.wav
-rw-r–r– 1 asterisk asterisk  380524 Sep 28 07:20 8000-5000.1285629604-out.wav
-rw-r–r– 1 asterisk asterisk  786604 Sep 28 07:21 8000-5000.1285629647-in.wav
-rw-r–r– 1 asterisk asterisk  786476 Sep 28 07:21 8000-5000.1285629647-out.wav
-rw-r–r– 1 asterisk asterisk 1443884 Sep 28 07:20 8001-8000.1285629629-in.wav
-rw-r–r– 1 asterisk asterisk 1443564 Sep 28 07:20 8001-8000.1285629629-out.wav

astercc 0.2 beta released

By | Latest News | 2 Comments
[download#22#size]

astercc 0.2 has great improvement than astercc 0.1x, the new features are

  • compatible with asterisk 1.6 and 1.4
    • we have done a lot of testing for both asterisk 1.6 and 1.4, and 0.2 will work for both version, in fact in this new version, we suggest customer use asterisk 1.6
  • more powerful queue realtime function

  • blind transfer attend transfer and get call back
    • when agent talk with customer, they can consult a 3rd-party and choose transfer the call or restore the original conversation
    • only asterisk 1.6 support this feature

  • same calls, less channels
    • astercc 0.X user may know that when you use click 2 dial or predictive dialer or queue, it may have more than 1 channel each call, sometime one call even take 3 channels, in astercc 0.2 we improved this, so usually one call only have one channel, this means you get more simultaneous calls for same license.
  • improvement of CDR and recording
    • now one conversation will have a main CDR and sub CDR(if it has attend transfer ), you can choose the listen the full recording or just listen part of it.
  • campaign dialedlist statistic

  • queue panel
    • agent can check in/check out/pause the queue, and when calls come from a queue, it will also give hint in queue panel

  • user ticket
  • scheduler call for agent
    • agent can make sheduler calls, when it’s the time, it will ring agent first, if agent answer, it will call the customer.
  • easy for customer development
    • in astercc 0.2, the CDR is more clear than 0.1X, it has no local channels so you can easily do customer developent or develop your GUI based astercc daemons

please notice that if you are using 0.1X now and want to upgrade to 0.2, your data would not lose but you may miss some data from web GUI, coz in 0.2 the CDR table changed.

asterCRM 0.07:

  • improved error debug with executed sql
  • added auto clear popup after call hangup
  • could add the number to dnc list in agent portal page
  • could set if add ‘/n’ when dial in campaign page
  • added disabed dial button when agent in call
  • added attend tranfer(with asterisk 1.6.x) in portal page
  • added check current asterisk version
  • fixed bug of import diallist
  • added memo in diallist
  • improved use post methed to popup external crm page
  • added my tickets
  • fixed bug of deleted in dnc list
  • improved processcdr.pl
  • improved processmonitors.pl
  • added billsec_leg_a ang queue number in cdr
  • added statistic in dialedlist page
  • merged the cdr and monitorrecord page
  • added loigin/logoff as dynamic agent to queue(the queue in campaign)
  • improved import page
  • improved astercrm.agi
  • added the memory table dialedlist
  • improved the predictivedialer daemon
  • improved the astercc daemon
  • added initTables(if we clear all temp data when restart astercc) in astercc.conf
  • added removeIncompleteCDR(change this to 1 if you dont want to keep cdr without dstchan) in
  • astercc.conf
  • improved queuestatus page
  • added check duplicates in diallist page

asterBilling 0.13:

  • fixed bug of update all reseller epayment information in profile page
  • added the parameter ‘callshop_pay_fee’ in asterbilling.conf and reseller profile to control if callshop pays the fee by paypal.
  • improved removePrefix in astercc.conf, supports like “removePrefix = 00,011”

set the special dialplan work with campaign callerid

By | asterCRM | No Comments

when you set a callerid for a campaign in astercrm, maybe you could find that the campaign callerid is not only show in customer’s phone , but also in agent’s phone. Now let’s fix this poplem together with asterisk dialplan.

First,we set a new dialplan such as following lines(extensions_astercc.conf is include from-internal-mask above aserCC version 0.2 beta):

[from-internal-mask]

exten => _X.,1,NoOp(${CUSCID})
exten => _X.,n,GoToIf($[“${CUSCID}” = “NONE”]?dial)
exten => _X.,n,Set(CALLERID(num)=${CUSCID})
exten => _X.,n(dial),GoTo(from-internal,${EXTEN},1)

In above dialplan we said you are using from-internal for dialout, if not you should change “from-internal” to your dialplan at last line.

And then, we should edit the ‘Incontext’ of campaign to ‘from-internal-mask’

Now, try it if work well.

Note: if you set “send calls to this queue directly” on , then the call would not go to incontext, so the solutions could not works.

Also, the cotext from-internal-mask could resleved callerid issue when click to dial in portal
page, just need to set the outcontext to from-internal-mask in group management page:

asterCC-1.0-beta-rc1 released (commercial version)

By | Latest News | 2 Comments
    • [download#19#size]
    • [download#21#size]
    • [download#20#size]

      astercc1.0 is a contact center system, while providing a powerful CRM (customer relationship management) functions, including features we often use like inbound / outbound missile screen, call recording, interactive voice menu (IVR), call queues and so on. Basicly by using astercc, you can record every customer call, the time when the customer calls appear on the screen of the customer contact information and historical contact records, or the design of an interactive voice menu (IVR) to provide self-service inquiries. In addition, the use of reporting tools, so you can quickly call from thousands of the critical information. Finally, astercc also offers a variety of practical tools, such as the task of setting and reminders by telephone, SMS and EMAIL of enterprise information, check the map or use the google map paths.

      If you already have your own business system, you can come in its perfect integration1), for example, a customer calls you want your system to show customers information, used astercc the secondary development interface, you can quickly complete the work.

      For ISP, astercc is the best choice to carry out new business, whether functional or telephone call center switching (PBX), astercc support SAAS mode, simply building a system, we can provide services to multiple customers .

      asterCC 0.14-beta and asterCC BOX 0.14-beta-rc1 released

      By | Latest News | No Comments

      asterCC-BOX-0.14-beta-rc1 asterCRM 0.62: * added DNC(do not call list) for daillist

      dnc1

      dnc2

      * fixed worktimepackage bug with astercctools * fixed can not update callresult to dialedlist in astercrm.agi * added update groupid and accountid to mycdr(parameter “update_groupid” in astercc.conf) asterBilling 0.12: * updated astercc daemon to fixed the a billing issue, which may cause the billing sec is less than the real billing time * added playbalance.agi for listen the balance of callshop by a clid

      asterCC and asterCC-BOX released 0.14-beta

      By | Latest News | No Comments
      [download#16#size]

      asterCC-BOX-0.14-beta

      asterCRM 0.062:

      * added export in cdr page

      * added parameters(uniqueid/calldate) when ust extenal crm

      * not display diallist function when login as dynamic agent

      * added update groupid and accountid to mycdr(parameter “update_groupid” in astercc.conf)

      * improved processmonitors

      * improved export funciton, supoorts to export xls and cvs format

      * improved report page

      * astercc daemon support astersik 1.6.x

      * added script astercrm_update_cdr(update customer id to mycdr)

      * added astercrm.agi(update call result to dialedlist and Answering Machine Detect when using predictive dialer)

      * fixed worktime bug when use predictive dialer

      asterBilling 0.12:

      * improved profile page of resller and groupadmin(could view the own balance)

      * fixed the currency bug of recharge by paypal

      * added display callshop Balance in systemstatus

      * improve clid page (could control the clid if display in systemstatus as a booth)

      * improved systemstatus(could be open manager page in current page)

      * added set free call function in receipt page

      * improved receipt to close page when paid

      * improved cdr page to set special color for unbilled or free call

      * improved report(display memo and note)

      * added could set a special turnk for each resller dialout

      * astercc daemon support astersik 1.6.x

      * improved reselleroutbound.agi, support spare trunk

      * added account_log page(records the account login logs)

      Use astercrm.agi to answering machine detect and auto update call result of diledlist

      By | asterCRM | No Comments

      In astercrm 0.062,we call use astercrm.agi to answering machine detect and auto update call result of diledlist. How to: a) in your asterisk, add two context in your dialplan for reselleroutbound.agi, in directory scripts, we also provided a conf file named “extensions_astercc.conf”, [from-astercrm] and [from-astercrm-amd] is the context for astercrm.agi, if you have installed astercc via the shell script install.sh, this conf file will be copy to your asterisk etc folder, and add a new line in your extensions.conf “#include extensions_astercc.conf”, now you can use [from-astercrm] and [from-astercrm-amd] as the context for astercrm.agi, if you are using asterCC-Box, it’s configed already. If you installed astercc manually, you would like to copy extensions_astercc.conf to asterisk etc folder(usually it’s /etc/asterisk ), and add the include line in your extensions.conf (#include extensions_astercc.conf, if it’s a system based freepbx, please add this line to /etc/asterisk/extensions_custom.conf).

      extensions_astercc.conf

      b) configure campaign

      crd_amd_en

      select “Call Result Detect” and “Aswering Machine Detect”, and then fill the context for them c) try it we add some records in diallist for campaign

      dialist_en

       

       

       

       

      dialout use predictive dialer: this one , the callee refused, got the following data in dialedlist:

       

      dialist_en1

      dialist_en1

      and this one the callee is a fax machine, got ollowing data in dialedlist and surveyresult:

      dialist_en3dialist_en2
      A Sonicwell Product · Also: CXMind AI · WCC Contact Center