get realtime CDR to your mysql from asterisk

Many a time we want to know who is calling and how long it lasts, but asterisk only provide our the cdr when the call is finished, we have to use some agi script or special dialplan to get the real time data, but now we could use "astercc" to get the data in real time no matter what's the dialplan in your system, which means we can get CDR in real time from any asterisk based system.

astercc works as a daemon in linux, it get events from asterisk AMI and store the CDR to two mysql table.
the first table is "curcdr" which will store all simultaneous calls, when call starts there would be a new record in the table, and when it stops, the record would be removed to another table "mycdr"

the record could be:

mysql> select * from curcdr;
+------+------+----------+---------------+-----------------+---------------------+---------------------+-----------------+-----------------+-------------+---------+--------+--------+----------------+----------------+-------------+
| id | src | dst | srcchan | dstchan | starttime | answertime | srcuid | dstuid | disposition | groupid | userid | credit | callshopcredit | resellercredit | creditlimit |
+------+------+----------+---------------+-----------------+---------------------+---------------------+-----------------+-----------------+-------------+---------+--------+--------+----------------+----------------+-------------+
| 3880 | 8807 | 8806 | SIP/8807-6fc2 | SIP/8806-d962 | 2008-02-28 12:26:01 | 2008-02-28 12:26:10 | 1204172801.3813 | 1204172801.3814 | link | 0 | 0 | 0.0000 | 0.0000 | 0.0000 | 0.0000 |
| 3881 | 8000 | 84350822 | SIP/8000-1684 | SIP/trunk1-a73d | 2008-02-28 12:26:13 | 0000-00-00 00:00:00 | 1204172812.3815 | 1204172813.3816 | dial | 0 | 0 | 0.0000 | 0.0000 | 0.0000 | 0.0000 |
+------+------+----------+---------------+-----------------+---------------------+---------------------+-----------------+-----------------+-------------+---------+--------+--------+----------------+----------------+-------------+


and the record in mycdr could be

mysql> select * from mycdr order by id desc limit 0,2;
+------+---------------------+------+----------+---------------+-----------------+----------+---------+-------------+-------------+-----------+-----------------+-----------------+----------+--------+----------------+----------------+---------+--------+
| id | calldate | src | dst | channel | dstchannel | duration | billsec | disposition | accountcode | userfield | srcuid | dstuid | calltype | credit | callshopcredit | resellercredit | groupid | userid |
+------+---------------------+------+----------+---------------+-----------------+----------+---------+-------------+-------------+-----------+-----------------+-----------------+----------+--------+----------------+----------------+---------+--------+
| 3682 | 2008-02-28 12:26:13 | 8000 | 84350822 | SIP/8000-1684 | SIP/trunk1-a73d | 5 | 0 | NO ANSWER | | UNBILLED | 1204172812.3815 | 1204172813.3816 | | 0.0000 | 0.0000 | 0.0000 | 0 | 0 |
| 3681 | 2008-02-28 12:24:40 | 8806 | 8807 | SIP/8806-c36f | SIP/8807-0139 | 8 | 6 | ANSWERED | | UNBILLED | 1204172719.3811 | 1204172720.3812 | | 0.0000 | 0.0000 | 0.0000 | 0 | 0 |
+------+---------------------+------+----------+---------------+-----------------+----------+---------+-------------+-------------+-----------+-----------------+-----------------+----------+--------+----------------+----------------+---------+--------+
2 rows in set (0.00 sec)


so if you want to get real time cdr datas from your asterisk for your application, you can try astercc, it provide 5 free channels, means it could catch 5 simultaneous calls in your asterisk, it has been tested that astercc could catch as much as 240 simultaneous calls.

astercc daemon could be download from http://sourceforge.net/project/showfile ... _id=202441, if you only want to get the calls information, you just need astercc and astercc.conf in directory daemon in the package
Posted by solo at 20:10:03 | Permanent Link | Comments (0) |

how to use asterisk as a predictive dialer

Predictive dialers, systems that automatically place outbound calls and deliver answered calls to agents; they are the key to using your sales force time as efficiently as possible in your outbound call center.

Here we use asterisk and astercrm to build a predictive dialer.

1. we need to install asterisk, for beginner you could use trixbox.
2. install astercrm, it could be on same server with asterisk or on a different one. the newest version is 0.046,  installation guide could be found here.
3. there's a bug in 0.046, if you have not used a previous version, you need fix the bug, execute these two line in your mysql:

        alter table diallist add creby VARCHAR(20);
        alter table diallist add cretime datetime NOT NULL default '0000-00-00 00:00:00';

4. login as admin/admin, go to "Manager" -> "preference", we need to set which context to use when make outbound call


the outcontext could be

[from-sipuser]
exten => _X.,1,Dial(SIP/TRUNK1/${EXTEN})

when a outbound campaign start, predictive dialer would first drop the phone number to this context, so this context should be your outbound context.

5. then we go  "Manager" -> "Extension" -> "Group Manage", click "Add" button to add a new group.


here we need to notice thw parameters: pdcontext and pdextensions, this mean how to handle the call when it's answered. Here, the context in extensions.conf could be something like

[from-trunk-customer]
exten => queue1, 1, Answer()
exten => queue1, n, Queue(tech-queue) 

when the call is connected, it could be redirect to queue "tech-queue" and answered by agent in this queue.

6. add a account as groupadmin, go "Extension" and click "Add", add a account, group is AstercrmGroup3, usertype is groupadmin



7. next, we should prepare a diallist, we could use "Import" function to import diallist from a excel or cvs file. The operation could be done using the groupadmin account we just added. Logout and then login as the groupadmin, go to "Import", select the local file, and then click "Upload"


"import" function could help us import phone numbers to diallist, we check the two check box on the buttom, the 0 in the select box, means the 0 column. click "Import" to continue, when finished, it will tell you "diallist : XXX records insert success", then we could to "Diallist" and check if it imported:


8. now every thing is ready, we could go "Dialer" to start, coz only a admin could start a predictive dialer, so we logout and login as admin again


we could click "Dial" button to start, the number in input box is the maximum channels number, dialer would stop once the concurrent channels reach this number, it could be modified as you like.

Posted by solo at 20:15:37 | Permanent Link | Comments (3) |

two new features in astercc

1. two level billing, administrator -> callshop -> customer
2. profit report
Posted by solo at 10:07:08 | Permanent Link | Comments (0) |

Why doesnt my astercrm popup

here're two reasons most possibly:

1. astercrm cant get asterisk evens, it's always empty in table events.

please check if eventsdaemon.pl starts, ensure database & asterisk parameters be correct in the script.

for astercrm 0.0456 or above, could try start eventsdaemon in debug mode, execute:

 eventsdaemon.pl

and check the output message.

2. Popup is disabled in astercrm configuration

in astercrm configuration file: astercrm.conf.php, the fellowing parameters are related to popup:

[system]

it wouldnot  popup unless the length of the callerid is greater than this number

phone_number_length = 6

it wouldnot popup unless the value is 1 when dial out

pop_up_when_dial_out = 1

it wouldnot popup unless the value is 1 when dial in

pop_up_when_dial_in = 1

Posted by solo at 11:59:23 | Permanent Link | Comments (0) |

asterCRM announce 0.0456beta

new features:

  • invite dial
  • google map support
  • multi condition search & export
  • config system parameters in browser
  • monitor/spy channel in real time
  • prefixs remove
  • switch in customer mode and customer->contact mode
  • read callerid of other extensions when they are talking
Posted by solo at 18:49:37 | Permanent Link | Comments (0) |

asterisk real time billing solution

I just developed an open souce billing solution for asterisk.
It could be used in hosted callshop solution or office ip pbx billing.

features:

  • real time billing
  • support multi-user
  • every user could have a rate for its ip phone
  • work with all asterisk based system, and no need to edit the original system
  • support callback
  • display all ip phone status in real time
  • lock phone
  • credit limit
  • originate or terminate calls
  • all web scripts  is open source
Posted by solo at 14:53:54 | Permanent Link | Comments (1) |

asterCRM 0.045 released

use perl script: eventsdaemon to replace the python script: ProxyMan

customer and contact could be related or irrespective

import/export datas online, include customer, contact, dial list

add survey module, administrator could add difference survey

survey result statistics

add monitor control in agent interface

all pop-up form is movable

browser title blinking and maximize when dial events happened

enter phone number and dial in agent interface

could trim zero in the callerid

multi-skin support

Posted by solo at 09:01:49 | Permanent Link | Comments (0) |

asterCRM 0.0443 released

this release mainly imporved crm features and fixed some bugs in dialer.

 

Posted by solo at 12:13:51 | Permanent Link | Comments (0) |

asterCRM 0.0441 released

asterCRM  0.0441 released:

1. improve management system

2. add extension status panel in user page and administrator page

3. improve compatibility with different astersion version

Posted by solo at 16:31:55 | Permanent Link | Comments (1) |

about asterCRM

asterCRM is a web-based open source call center software for asterisk, and it has some simple CRM features. First, a python deamon called ProxyMan.py will listen on manager port of asterisk, and save all asterisk events to a database, at the same time, the user client (browser) analysis the data, get all the action of asterisk, such as ring, dial , link, hangup,  ... When the user want asterisk to do something, such as click-to-call, transfer, hangup, just click the mouse, asterCRM will tell asterisk what to do in asterisk manager port.

Benifits: 

1. asterisk can work with all asterisk-based system, such as Trixbox, Magiclink IP PBX
2. asterisk, database, web can be distributed, that's flexible, capable
3. web 2.0 technoloy make asterCRM easy to use
4. open source, can be customize development by the user.
5. No need client software, just  browser.

Features:

1.   Pop-up when dial in
2.   PoP-up when dial out
3.   Auto-complete
4.   Click-to-dial
5.   Transfer
6.   Exension manager

Coming soon:

1.  Extsnsion status
2.  Dial out phone list
3.  Queue status
4.  Phone pick up
5.  Hangup
6.  Parking calls

Download:

http://sourceforge.net/projects/asterisk-crm/

Author:

solo.fu@gmail.com

Sponsor

大连盛唐通信技术有限公司 (www.magiclink.cn)

Posted by solo at 16:40:15 | Permanent Link | Comments (0) |