astercrm提供了全部开源的web部分代码 如果需要二次开发可以对这些代码进行改动,或者编写独立的界面。当使用进程模式时,名为astercc的后台进程将把系统呼叫时间存储到一个叫做curcdr的内存表中,通过对这个表进行查询 就可以知道当前系统的通话状况了。
例如当没有任何通话时curcdr表为空
当通过SIP中继呼入到ringgroup 1000(201,202,203同时振铃), curcdr表中数据如下
select * from curcdr;
+—–+——+——+———+———————-+——————+———–+———————+———————+———————+—————-+—————-+——-+————-+——–+———+———–+————+——–+—————-+—————-+————-+————-+————+————+———–+——+————-+———-+———–+
| id | src | dst | srcname | srcchan | dstchan | didnumber | starttime | answertime | calldate | srcuid | dstuid | queue | disposition | userid | groupid | accountid | resellerid | credit | callshopcredit | resellercredit | creditlimit | destination | dialstring | dialstatus | agentchan | memo | accountcode | pushcall | monitored |
+—–+——+——+———+———————-+——————+———–+———————+———————+———————+—————-+—————-+——-+————-+——–+———+———–+————+——–+—————-+—————-+————-+————-+————+————+———–+——+————-+———-+———–+
| 333 | 2002 | 1000 | hehe | sip/sipto45-0000019d | sip/203-000001a0 | 30900 | 2011-07-11 18:38:23 | 0000-00-00 00:00:00 | 0000-00-00 00:00:00 | 1310380702.781 | 1310380703.784 | | RINGING | 0 | 0 | 0 | 0 | 0.0000 | 0.0000 | 0.0000 | 0.0000 | | 203 | | | | | no | 0 |
| 331 | 2002 | 1000 | hehe | sip/sipto45-0000019d | sip/201-0000019e | 30900 | 2011-07-11 18:38:22 | 0000-00-00 00:00:00 | 0000-00-00 00:00:00 | 1310380702.781 | 1310380703.782 | | RINGING | 0 | 0 | 0 | 0 | 0.0000 | 0.0000 | 0.0000 | 0.0000 | | | | | | | no | 0 |
| 332 | 2002 | 1000 | hehe | sip/sipto45-0000019d | sip/202-0000019f | 30900 | 2011-07-11 18:38:23 | 0000-00-00 00:00:00 | 0000-00-00 00:00:00 | 1310380702.781 | 1310380703.783 | | RINGING | 0 | 0 | 0 | 0 | 0.0000 | 0.0000 | 0.0000 | 0.0000 | | 202 | | | | | no | 0 |
+—–+——+——+———+———————-+——————+———–+———————+———————+———————+—————-+—————-+——-+————-+——–+———+———–+————+——–+—————-+—————-+————-+————-+————+————+———–+——+————-+———-+———–+
3 rows in set (0.00 sec)
+—–+——+——+———+———————-+——————+———–+———————+———————+———————+—————-+—————-+——-+————-+——–+———+———–+————+——–+—————-+—————-+————-+————-+————+————+———–+——+————-+———-+———–+
| id | src | dst | srcname | srcchan | dstchan | didnumber | starttime | answertime | calldate | srcuid | dstuid | queue | disposition | userid | groupid | accountid | resellerid | credit | callshopcredit | resellercredit | creditlimit | destination | dialstring | dialstatus | agentchan | memo | accountcode | pushcall | monitored |
+—–+——+——+———+———————-+——————+———–+———————+———————+———————+—————-+—————-+——-+————-+——–+———+———–+————+——–+—————-+—————-+————-+————-+————+————+———–+——+————-+———-+———–+
| 333 | 2002 | 1000 | hehe | sip/sipto45-0000019d | sip/203-000001a0 | 30900 | 2011-07-11 18:38:23 | 0000-00-00 00:00:00 | 0000-00-00 00:00:00 | 1310380702.781 | 1310380703.784 | | RINGING | 0 | 0 | 0 | 0 | 0.0000 | 0.0000 | 0.0000 | 0.0000 | | 203 | | | | | no | 0 |
| 331 | 2002 | 1000 | hehe | sip/sipto45-0000019d | sip/201-0000019e | 30900 | 2011-07-11 18:38:22 | 0000-00-00 00:00:00 | 0000-00-00 00:00:00 | 1310380702.781 | 1310380703.782 | | RINGING | 0 | 0 | 0 | 0 | 0.0000 | 0.0000 | 0.0000 | 0.0000 | | | | | | | no | 0 |
| 332 | 2002 | 1000 | hehe | sip/sipto45-0000019d | sip/202-0000019f | 30900 | 2011-07-11 18:38:23 | 0000-00-00 00:00:00 | 0000-00-00 00:00:00 | 1310380702.781 | 1310380703.783 | | RINGING | 0 | 0 | 0 | 0 | 0.0000 | 0.0000 | 0.0000 | 0.0000 | | 202 | | | | | no | 0 |
+—–+——+——+———+———————-+——————+———–+———————+———————+———————+—————-+—————-+——-+————-+——–+———+———–+————+——–+—————-+—————-+————-+————-+————+————+———–+——+————-+———-+———–+
3 rows in set (0.00 sec)
当通话结束时 curcdr表中想一个数据被删除 同时通话记录被转移到一个叫做mycdr的表里
最简单的方法可以通过ajax不断查询该表 而在页面上进行相应的弹屏操作,当需要强插监听强拆时 也可以通过AMI接口向asterisk发出相应的命令,由于curcdr表中提供了具体的通道名称,这种操作变得相对简单 并且不需要对asterisk的dialplan进行特殊的修改,结合freepbx的使用 可以很容易开发出来新的业务系统。具体使用案例可以参见astercrm中自带的php源码。
值得注意的是默认的astercc仅提供了5个通道的免费并发许可,也就是当curcdr中数据最多只会有5条,需要更多并发的用户可以联系sales@astercc.org咨询价格。
