Category

asterBilling

billing with accountcode works on freepbx(asterisk) + aserbilling

By | asterBilling | No Comments

The asterbilling support billing with accoutcode since version 0.15 in asterCC 0.21 beta, the following content show how it works: We said you alread set the trunk and outbound rule in freepbx for dial out. Now, we should add a extension in freepbx as follwing image, and set the accountcode for this extension : Then we should configure astercc to billing with accountcode. first, set the parameter billingfield= accountcode in /opt/asterisk/scripts/astercc/astercc.conf and restart asterccd ( /etc/init.d/asterccd resstart ) Login to asterbilling and add the clid with accountcode Login as groupadmin or operator to test

How to restore astercc from backup

By | asterBilling, asterCRM | No Comments

If you bakcups the astercc database, code dirctoys and asterisk etc by backup.sh, you would get backup files as following:

./dir_backup ./dir_backup/localsave ./dir_backup/localsave/asterisk.2010-11-18-06.tar.gz ./dir_backup/localsave/astercc.2010-11-18-06.tar.gz ./backup.sh ./db_backup ./db_backup/localsave ./db_backup/localsave/astercc.2010-11-18-06.tar.gz ./db_backup/dbbk.log

All directory backup file is in dir_backup/localsave, such as above , the “./dir_backup/localsave/asterisk.2010-11-18-06.tar.gz” is backuped for asterisk etc and the “./dir_backup/localsave/astercc.2010-11-18-06.tar.gz” is backuped for astercc code. if you want restore directory, just untar .tar.gz file and move them to corresponding position. All database bakcup file is in db_backup/localsave, the “./db_backup/localsave/astercc.2010-11-18-06.tar.gz” is backup for database named astercc, if you untar the file,you would get a sql file such as astercc.2010-11-18-06.sql If you want restore database astercc, just run: mysql -uyourdbuser -pyourdbpassword astercc < astercc.2010-11-18-06.sql that’s all

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

why i cant see booth history when can see the calling call?

By | asterBilling | 2 Comments

some customers find that they can see live booth calls(screen 1) but when call is done, nothing appears in the booth box(screen 2).

live call in booth window

nothing in booth box

this happens coz the admin set sip account in “clid” when it should be “caller id” check table “mycdr” you will find that the “src” filed would be a number which doesnt match with “channel” field to fix this, just go to “clid” in asterbilling and change the clid to be the number in src field

how to upgrade astercc

By | asterBilling, asterCRM | 2 Comments
  • upgrade database unzip the package u could see folder “sql” where we put all database files, in asterCC 0.X it would looks like: astercc0.1b-0.1.sql astercc0.1-0.11.sql astercc0.11-0.12b.sql astercc0.12b.-0.12sql astercc0.13-0.14b.sql astercc….0.X.sql astercc.sql say you are using 0.1b now, so you have to execute astercc0.1b-0.1.sql, astercc0.1-0.11.sql, astercc0.11-0.12b.sql, astercc0.12b.-0.12sql until astercc…0.X.sql, then u get database of v0.X the command line for this is like mysql -uroot -p astercc < astercc….0.X.sql
  • stop astercc daemons /opt/asterisk/scripts/astercc/asterccd stop
  • cp the new html & daemon files, please notice that you may want to backup astercrm.conf.php, astercc.conf and asterbilling.conf.php first example: cp astercrm /var/www/html -rf cp asterbilling /var/www/html -rf cp scripts/* /opt/asterisk/scripts/astercc * from astercc-0.21, the package includes both 32bit and 64bit scrips, you will copy the scripts out of 32/ or 64/ to your daemon folder (usually /opt/asterisk/scripts/astercc)
  • config conf files check your astercc.conf, asterbilling.conf.php, astercrm.conf.php, make sure you have the correct config
  • start astercc daemons /opt/asterisk/scripts/astercc/asterccd start
  • check crontab we provides some cron script to deal with recording files and CDRs, so open README, make sure you have the scripts configed in your crontab
  • login web and check if any errors

new feature in asterbilling

By | asterBilling | No Comments

we provide a new feature in asterbilling, you can read your buy rate when add a sell rate manually.

say admin set three rates for reseller:
default     0.2        for all resellers
0086        0.25     for reseller1
00852     0.3        for all resellers

new_feature_rate_hint_1

then reseller1 logged in and want to add sell rate for his callshop

1. we add rate for North Americe, which prefix is 001, it will give the buy rate for 001 after input box (we didnt set prefix 001 in rate to reseller, so it will use default rate)

new_feature_rate_hint_2

2. we add rate for China, which prefix is 0086, it will give the buy rate for 0086 after input box

new_feature_rate_hint_3

3. we add rate for HK, which prefix is 00852, it will give the buy rate for 00852after input box

new_feature_rate_hint_4

also, when groupadmin add customer sell rate, he can also see his buy rate from reseller
new_feature_rate_hint_4

add callshop & realtime billing feature to your a2billing

By | asterBilling | 2 Comments

If you have a a2billing working already, you may want to add some more features, like make it work as a hosted callshop, here we’ll introduce how to add callshop feature using asterbilling.

  • add a new conf in your a2billing add a new conf like [agi-conf2] in a2billing.conf, make sure you have the changed the following options: ; Manage the answer on the call answer_call = NO play_audio = NO use_dnid = YES number_try = 1 say_balance_after_auth = NO say_balance_after_call = NO say_rateinitial = NO say_timetocall = NO cid_enable = NO cid_auto_assign_card_to_cid = NO anyway, disable all prompt & announcement
  • add new dialplan in asterisk extensions by default, sip peer generated by a2billing will use context a2billing, so we add [a2billing] ; for asterbilling booth exten => _X.,1,DeadAGI,a2billing.php|2
  • sc-2
  • add costomer in a2billing then we add a customer in a2billing, make sure you enabled sip or iax account, then click the “generate” button and click “reload” link also u may want to set this customer as “postpay” and a big number for the limit coz you would not charge customer in a2billing, just make sure this customer could make calls with no problem
  • set your ip phone go to “List Sip-friend” or “List iax-friend” get the username/secret for your phone, then try make a call, if everything goes well, u should make a call successfully
  • sc-4
  • add clid in asterbilling go to asterbilling and create clid using the username(if there’s callerid defined for this customers, use callerid instead) in sip-friends
  • sc-1
  • login as groupadmin/operator and enjoy 🙂
  • sc-3

why cant import when the file is big?

By | asterBilling, asterCRM | 2 Comments

some customers find that they get a problem when import, it just gives a XML error, that’s because there’s too much data and no enough memory for php. find the php.ini for your apache line: memory_limit it could be like 16M or 20M, try change it bigger, say 64M so it looks like memory_limit = 64M save and exit, remember restart your apache before give the try.

Why I cant see some records in CDR page in my asterBilling?

By | asterBilling | 3 Comments

sometimes when you go CDR page to check CDRs for resellers, groups or some clid in your system, but nothing there or some records missed, and then u go database and checked, find there’s data in cdr table “mycdr”, so why it’s missed in asterBilling interface? Reason 1: historyCdr issue check your asterbilling.conf.php in asterbilling web scripts folder sc1 by default the option is “useHistoryCdr = 1”, and asterbilling CDR page will go table “historycdr” to fetch data, but astercc daemon only put data to table “mycdr” untill someone “checkout” the records, the data will be moved to table “historycdr”, so if u cant find all data in web interface, change this option to “0” or “checkout” the records. click Clear to checkout Reason 2: clid issue Even though the astercc daemon will put all CDR it get to database, but not all records will be billed, only after you set the “clid” in asterbilling. So if u see the value of fields “resellerid” and “groupid” in “mycdr” is -1, please check if u set the “clid” correctly, the “src” field should be matched with clid. sc3